rename build.AllowableClockDrift{=>Secs}.

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

View File

@ -21,8 +21,7 @@ const UnixfsLinksPerLevel = 1024
// ///// // /////
// Consensus / Network // Consensus / Network
// Seconds const AllowableClockDriftSecs = uint64(1)
const AllowableClockDrift = uint64(1)
// Epochs // Epochs
const ForkLengthThreshold = Finality const ForkLengthThreshold = Finality

View File

@ -27,7 +27,7 @@ var (
BlockDelaySecs = uint64(builtin.EpochDurationSeconds) BlockDelaySecs = uint64(builtin.EpochDurationSeconds)
PropagationDelay = uint64(6) PropagationDelay = uint64(6)
AllowableClockDrift = uint64(1) AllowableClockDriftSecs = uint64(1)
Finality = miner.ChainFinalityish Finality = miner.ChainFinalityish
ForkLengthThreshold = Finality ForkLengthThreshold = Finality

View File

@ -657,7 +657,7 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) (er
// fast checks first // fast checks first
now := uint64(time.Now().Unix()) now := uint64(time.Now().Unix())
if h.Timestamp > now+build.AllowableClockDrift { if h.Timestamp > now+build.AllowableClockDriftSecs {
return xerrors.Errorf("block was from the future (now=%d, blk=%d): %w", now, h.Timestamp, ErrTemporal) return xerrors.Errorf("block was from the future (now=%d, blk=%d): %w", now, h.Timestamp, ErrTemporal)
} }
if h.Timestamp > now { if h.Timestamp > now {

View File

@ -43,7 +43,7 @@ Assemble a `FullTipSet` populated with the single block received earlier.
This function contains most of the validation logic grouped in separate closures that run asynchronously, this list does not reflect validation order then. This function contains most of the validation logic grouped in separate closures that run asynchronously, this list does not reflect validation order then.
`V:` Block `Timestamp`: `V:` Block `Timestamp`:
* Is not bigger than current time plus `AllowableClockDrift`. * Is not bigger than current time plus `AllowableClockDriftSecs`.
* Is not smaller than previous block's `Timestamp` plus `BlockDelay` (including null blocks). * Is not smaller than previous block's `Timestamp` plus `BlockDelay` (including null blocks).
### Messages ### Messages