rename build.PropagationDelay{=>Secs}.

This commit is contained in:
Raúl Kripalani 2020-06-30 15:01:30 +01:00
parent 3b826e41f6
commit 1ef490feea
4 changed files with 9 additions and 9 deletions

View File

@ -22,7 +22,7 @@ func init() {
const BlockDelaySecs = uint64(2) const BlockDelaySecs = uint64(2)
const PropagationDelay = uint64(3) const PropagationDelaySecs = uint64(3)
// SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after // SlashablePowerDelay is the number of epochs after ElectionPeriodStart, after
// which the miner is slashed // which the miner is slashed

View File

@ -25,7 +25,7 @@ var (
BlockMessageLimit = 512 BlockMessageLimit = 512
BlockGasLimit = int64(100_000_000_000) BlockGasLimit = int64(100_000_000_000)
BlockDelaySecs = uint64(builtin.EpochDurationSeconds) BlockDelaySecs = uint64(builtin.EpochDurationSeconds)
PropagationDelay = uint64(6) PropagationDelaySecs = uint64(6)
AllowableClockDriftSecs = uint64(1) AllowableClockDriftSecs = uint64(1)

View File

@ -22,4 +22,4 @@ func init() {
const BlockDelaySecs = uint64(builtin.EpochDurationSeconds) const BlockDelaySecs = uint64(builtin.EpochDurationSeconds)
const PropagationDelay = uint64(6) const PropagationDelaySecs = uint64(6)

View File

@ -42,7 +42,7 @@ func NewMiner(api api.FullNode, epp gen.WinningPoStProver, addr address.Address)
address: addr, address: addr,
waitFunc: func(ctx context.Context, baseTime uint64) (func(bool), error) { waitFunc: func(ctx context.Context, baseTime uint64) (func(bool), 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
deadline := baseTime + build.PropagationDelay deadline := baseTime + build.PropagationDelaySecs
time.Sleep(time.Until(time.Unix(int64(deadline), 0))) time.Sleep(time.Until(time.Unix(int64(deadline), 0)))
return func(bool) {}, nil return func(bool) {}, nil
@ -194,7 +194,7 @@ func (m *Miner) mine(ctx context.Context) {
// has enough time to form. // has enough time to form.
// //
// See: https://github.com/filecoin-project/lotus/issues/1845 // 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 { select {
case <-time.After(time.Until(nextRound)): case <-time.After(time.Until(nextRound)):