fix propagation delay to be a sane number
This commit is contained in:
parent
a1f676bf30
commit
1b8aa2c2b4
@ -7,6 +7,8 @@ import "os"
|
|||||||
// Seconds
|
// Seconds
|
||||||
const BlockDelay = 6
|
const BlockDelay = 6
|
||||||
|
|
||||||
|
const PropagationDelay = 3
|
||||||
|
|
||||||
// FallbackPoStDelay is the number of epochs the miner needs to wait after
|
// FallbackPoStDelay is the number of epochs the miner needs to wait after
|
||||||
// ElectionPeriodStart before starting fallback post computation
|
// ElectionPeriodStart before starting fallback post computation
|
||||||
//
|
//
|
||||||
|
@ -5,6 +5,8 @@ package build
|
|||||||
// Seconds
|
// Seconds
|
||||||
const BlockDelay = 30
|
const BlockDelay = 30
|
||||||
|
|
||||||
|
const PropagationDelay = 5
|
||||||
|
|
||||||
// FallbackPoStDelay is the number of epochs the miner needs to wait after
|
// FallbackPoStDelay is the number of epochs the miner needs to wait after
|
||||||
// ElectionPeriodStart before starting fallback post computation
|
// ElectionPeriodStart before starting fallback post computation
|
||||||
//
|
//
|
||||||
|
@ -290,7 +290,7 @@ func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet)
|
|||||||
|
|
||||||
span.AddAttributes(trace.BoolAttribute("newHead", true))
|
span.AddAttributes(trace.BoolAttribute("newHead", true))
|
||||||
|
|
||||||
log.Debugf("New heaviest tipset! %s", ts.Cids())
|
log.Infof("New heaviest tipset! %s (height=%d)", ts.Cids())
|
||||||
cs.heaviest = ts
|
cs.heaviest = ts
|
||||||
|
|
||||||
if err := cs.writeHead(ts); err != nil {
|
if err := cs.writeHead(ts); err != nil {
|
||||||
|
@ -71,7 +71,6 @@ func (sm *SyncManager) Stop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sm *SyncManager) SetPeerHead(ctx context.Context, p peer.ID, ts *types.TipSet) {
|
func (sm *SyncManager) SetPeerHead(ctx context.Context, p peer.ID, ts *types.TipSet) {
|
||||||
log.Info("set peer head!", ts.Height(), ts.Cids())
|
|
||||||
sm.lk.Lock()
|
sm.lk.Lock()
|
||||||
defer sm.lk.Unlock()
|
defer sm.lk.Unlock()
|
||||||
sm.peerHeads[p] = ts
|
sm.peerHeads[p] = ts
|
||||||
@ -336,7 +335,6 @@ func (sm *SyncManager) syncWorker(id int) {
|
|||||||
log.Info("sync manager worker shutting down")
|
log.Info("sync manager worker shutting down")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("sync worker go time!", ts.Height(), ts.Cids())
|
|
||||||
|
|
||||||
ctx := context.WithValue(context.TODO(), syncStateKey{}, ss)
|
ctx := context.WithValue(context.TODO(), syncStateKey{}, ss)
|
||||||
err := sm.doSync(ctx, ts)
|
err := sm.doSync(ctx, ts)
|
||||||
|
@ -27,7 +27,7 @@ func NewMiner(api api.FullNode, epp gen.ElectionPoStProver) *Miner {
|
|||||||
epp: epp,
|
epp: epp,
|
||||||
waitFunc: func(ctx context.Context) error {
|
waitFunc: func(ctx context.Context) error {
|
||||||
// Wait around for half the block time in case other parents come in
|
// Wait around for half the block time in case other parents come in
|
||||||
time.Sleep(build.BlockDelay * time.Second / 2)
|
time.Sleep(build.PropagationDelay * time.Second)
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user