rename build.AllowableClockDrift{=>Secs}.
This commit is contained in:
parent
d232299c77
commit
3b826e41f6
@ -21,8 +21,7 @@ const UnixfsLinksPerLevel = 1024
|
||||
// /////
|
||||
// Consensus / Network
|
||||
|
||||
// Seconds
|
||||
const AllowableClockDrift = uint64(1)
|
||||
const AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
// Epochs
|
||||
const ForkLengthThreshold = Finality
|
||||
|
@ -27,7 +27,7 @@ var (
|
||||
BlockDelaySecs = uint64(builtin.EpochDurationSeconds)
|
||||
PropagationDelay = uint64(6)
|
||||
|
||||
AllowableClockDrift = uint64(1)
|
||||
AllowableClockDriftSecs = uint64(1)
|
||||
|
||||
Finality = miner.ChainFinalityish
|
||||
ForkLengthThreshold = Finality
|
||||
|
@ -657,7 +657,7 @@ func (syncer *Syncer) ValidateBlock(ctx context.Context, b *types.FullBlock) (er
|
||||
// fast checks first
|
||||
|
||||
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)
|
||||
}
|
||||
if h.Timestamp > now {
|
||||
|
@ -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.
|
||||
|
||||
`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).
|
||||
|
||||
### Messages
|
||||
|
Loading…
Reference in New Issue
Block a user