Merge pull request #696 from filecoin-project/fix/propagation-delay

fix propagation delay to be a sane number
This commit is contained in:
Łukasz Magiera 2019-12-03 13:35:25 +01:00 committed by GitHub
commit 8e09fd6ca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 4 deletions

View File

@ -7,6 +7,8 @@ import "os"
// Seconds
const BlockDelay = 6
const PropagationDelay = 3
// FallbackPoStDelay is the number of epochs the miner needs to wait after
// ElectionPeriodStart before starting fallback post computation
//

View File

@ -5,6 +5,8 @@ package build
// Seconds
const BlockDelay = 30
const PropagationDelay = 5
// FallbackPoStDelay is the number of epochs the miner needs to wait after
// ElectionPeriodStart before starting fallback post computation
//

View File

@ -290,7 +290,7 @@ func (cs *ChainStore) takeHeaviestTipSet(ctx context.Context, ts *types.TipSet)
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
if err := cs.writeHead(ts); err != nil {

View File

@ -71,7 +71,6 @@ func (sm *SyncManager) Stop() {
}
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()
defer sm.lk.Unlock()
sm.peerHeads[p] = ts
@ -336,7 +335,6 @@ func (sm *SyncManager) syncWorker(id int) {
log.Info("sync manager worker shutting down")
return
}
log.Info("sync worker go time!", ts.Height(), ts.Cids())
ctx := context.WithValue(context.TODO(), syncStateKey{}, ss)
err := sm.doSync(ctx, ts)

View File

@ -27,7 +27,7 @@ func NewMiner(api api.FullNode, epp gen.ElectionPoStProver) *Miner {
epp: epp,
waitFunc: func(ctx context.Context) error {
// 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
},
}