From 1ef490feea5e35ae8eae03303f14ae40236470bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Tue, 30 Jun 2020 15:01:30 +0100 Subject: [PATCH] rename build.PropagationDelay{=>Secs}. --- build/params_2k.go | 2 +- build/params_testground.go | 10 +++++----- build/params_testnet.go | 2 +- miner/miner.go | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/params_2k.go b/build/params_2k.go index e5b2f062f..d22c6a6f8 100644 --- a/build/params_2k.go +++ b/build/params_2k.go @@ -22,7 +22,7 @@ func init() { const BlockDelaySecs = uint64(2) -const PropagationDelay = uint64(3) +const PropagationDelaySecs = uint64(3) // SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after // which the miner is slashed diff --git a/build/params_testground.go b/build/params_testground.go index df03124af..704503981 100644 --- a/build/params_testground.go +++ b/build/params_testground.go @@ -21,11 +21,11 @@ var ( UnixfsChunkSize = uint64(1 << 20) UnixfsLinksPerLevel = 1024 - BlocksPerEpoch = uint64(builtin.ExpectedLeadersPerEpoch) - BlockMessageLimit = 512 - BlockGasLimit = int64(100_000_000_000) - BlockDelaySecs = uint64(builtin.EpochDurationSeconds) - PropagationDelay = uint64(6) + BlocksPerEpoch = uint64(builtin.ExpectedLeadersPerEpoch) + BlockMessageLimit = 512 + BlockGasLimit = int64(100_000_000_000) + BlockDelaySecs = uint64(builtin.EpochDurationSeconds) + PropagationDelaySecs = uint64(6) AllowableClockDriftSecs = uint64(1) diff --git a/build/params_testnet.go b/build/params_testnet.go index 3da87c08b..e0e3fc3fa 100644 --- a/build/params_testnet.go +++ b/build/params_testnet.go @@ -22,4 +22,4 @@ func init() { const BlockDelaySecs = uint64(builtin.EpochDurationSeconds) -const PropagationDelay = uint64(6) +const PropagationDelaySecs = uint64(6) diff --git a/miner/miner.go b/miner/miner.go index 08a4645fd..6ee11d55c 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -42,7 +42,7 @@ func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address) address: addr, waitFunc: func(ctx context.Context, baseTime uint64) (func(bool), error) { // Wait around for half the block time in case other parents come in - deadline := baseTime + build.PropagationDelay + deadline := baseTime + build.PropagationDelaySecs time.Sleep(time.Until(time.Unix(int64(deadline), 0))) return func(bool) {}, nil @@ -194,7 +194,7 @@ func (m *Miner) mine(ctx context.Context) { // has enough time to form. // // See: https://github.com/filecoin-project/lotus/issues/1845 - nextRound := time.Unix(int64(base.TipSet.MinTimestamp()+build.BlockDelaySecs*uint64(base.NullRounds))+int64(build.PropagationDelay), 0) + nextRound := time.Unix(int64(base.TipSet.MinTimestamp()+build.BlockDelaySecs*uint64(base.NullRounds))+int64(build.PropagationDelaySecs), 0) select { case <-time.After(time.Until(nextRound)):