diff --git a/consensus/errors.go b/consensus/errors.go index f9e633b05..ac5242fb5 100644 --- a/consensus/errors.go +++ b/consensus/errors.go @@ -31,10 +31,6 @@ var ( // to the current node. ErrFutureBlock = errors.New("block in the future") - // ErrFutureParentBlock is returned when a block's parent's timestamp is in the future - // according to the current node. - ErrFutureParentBlock = errors.New("parent block in the future") - // ErrInvalidNumber is returned if a block's number doesn't equal its parent's // plus one. ErrInvalidNumber = errors.New("invalid block number") diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index e2061cefa..3b45e4d55 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -327,26 +327,9 @@ func (p *Parlia) verifyHeader(chain consensus.ChainHeaderReader, header *types.H } number := header.Number.Uint64() - // According to BEP188, after Planck fork, an in-turn validator is allowed to broadcast - // a mined block earlier but not earlier than its parent's timestamp when the block is ready . + // Don't waste time checking blocks from the future if header.Time > uint64(time.Now().Unix()) { - if !chain.Config().IsPlanck(header.Number) || header.Difficulty.Cmp(diffInTurn) != 0 { - return consensus.ErrFutureBlock - } - var parent *types.Header - if len(parents) > 0 { - parent = parents[len(parents)-1] - } else { - parent = chain.GetHeader(header.ParentHash, number-1) - } - - if parent == nil || parent.Number.Uint64() != number-1 || parent.Hash() != header.ParentHash { - return consensus.ErrUnknownAncestor - } - - if parent.Time > uint64(time.Now().Unix()) { - return consensus.ErrFutureParentBlock - } + return consensus.ErrFutureBlock } // Check that the extra-data contains the vanity, validators and signature. if len(header.Extra) < extraVanity {