mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
chg: make consistent with erigon
This commit is contained in:
parent
95cee33038
commit
d0abdcb188
2 changed files with 9 additions and 15 deletions
|
|
@ -172,12 +172,6 @@ func encodeSigHeader(w io.Writer, header *types.Header, c *params.BorConfig) {
|
|||
}
|
||||
}
|
||||
|
||||
if header.WithdrawalsHash != nil {
|
||||
header.WithdrawalsHash = nil
|
||||
|
||||
log.Warn("Bor does not support withdrawals", "number", header.Number)
|
||||
}
|
||||
|
||||
if err := rlp.Encode(w, enc); err != nil {
|
||||
panic("can't encode: " + err.Error())
|
||||
}
|
||||
|
|
@ -387,11 +381,14 @@ func (c *Bor) verifyHeader(chain consensus.ChainHeaderReader, header *types.Head
|
|||
|
||||
// Verify that the gas limit is <= 2^63-1
|
||||
gasCap := uint64(0x7fffffffffffffff)
|
||||
|
||||
if header.GasLimit > gasCap {
|
||||
return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, gasCap)
|
||||
}
|
||||
|
||||
if header.WithdrawalsHash != nil {
|
||||
return consensus.ErrUnexpectedWithdrawals
|
||||
}
|
||||
|
||||
// All basic checks passed, verify cascading fields
|
||||
return c.verifyCascadingFields(chain, header, parents)
|
||||
}
|
||||
|
|
@ -823,10 +820,7 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
|
|||
headerNumber := header.Number.Uint64()
|
||||
|
||||
if withdrawals != nil || header.WithdrawalsHash != nil {
|
||||
// withdrawals = nil is not required because withdrawals are not used
|
||||
header.WithdrawalsHash = nil
|
||||
|
||||
log.Warn("Bor does not support withdrawals", "number", headerNumber)
|
||||
return
|
||||
}
|
||||
|
||||
if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
|
||||
|
|
@ -904,10 +898,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
|
|||
headerNumber := header.Number.Uint64()
|
||||
|
||||
if withdrawals != nil || header.WithdrawalsHash != nil {
|
||||
// withdrawals != nil not required because withdrawals are not used
|
||||
header.WithdrawalsHash = nil
|
||||
|
||||
log.Warn("Bor does not support withdrawals", "number", headerNumber)
|
||||
return nil, consensus.ErrUnexpectedWithdrawals
|
||||
}
|
||||
|
||||
stateSyncData := []*types.StateSyncData{}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,7 @@ var (
|
|||
// ErrInvalidTerminalBlock is returned if a block is invalid wrt. the terminal
|
||||
// total difficulty.
|
||||
ErrInvalidTerminalBlock = errors.New("invalid terminal block")
|
||||
|
||||
// ErrUnexpectedWithdrawals is returned if a pre-Shanghai block has withdrawals.
|
||||
ErrUnexpectedWithdrawals = errors.New("unexpected withdrawals")
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue