diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index d217afadc1b..e23af09b8b6 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -41,7 +41,6 @@ import ( "github.com/ledgerwatch/erigon/common/debug" "github.com/ledgerwatch/erigon/common/hexutil" "github.com/ledgerwatch/erigon/consensus" - "github.com/ledgerwatch/erigon/consensus/misc" "github.com/ledgerwatch/erigon/core/state" "github.com/ledgerwatch/erigon/core/types" "github.com/ledgerwatch/erigon/core/types/accounts" @@ -380,13 +379,6 @@ func (c *Clique) Finalize(config *chain.Config, header *types.Header, state *sta ) (types.Transactions, types.Receipts, error) { // No block rewards in PoA, so the state remains as is and uncles are dropped header.UncleHash = types.CalcUncleHash(nil) - if config.IsCancun(header.Time) { - if parent := chain.GetHeaderByHash(header.ParentHash); parent != nil { - header.SetExcessDataGas(misc.CalcExcessDataGas(parent.ExcessDataGas, misc.CountBlobs(txs))) - } else { - header.SetExcessDataGas(new(big.Int)) - } - } return txs, r, nil } diff --git a/consensus/clique/verifier.go b/consensus/clique/verifier.go index 702b18a6790..4ce939c4003 100644 --- a/consensus/clique/verifier.go +++ b/consensus/clique/verifier.go @@ -130,13 +130,8 @@ func (c *Clique) verifyCascadingFields(chain consensus.ChainHeaderReader, header // Verify the header's EIP-1559 attributes. return err } - if !chain.Config().IsCancun(header.Time) { - if header.ExcessDataGas != nil { - return fmt.Errorf("invalid excessDataGas before fork: have %v, expected 'nil'", header.ExcessDataGas) - } - } else if err := misc.VerifyEip4844Header(chain.Config(), parent, header); err != nil { - // Verify the header's EIP-4844 attributes. - return err + if header.ExcessDataGas != nil { + return fmt.Errorf("invalid excessDataGas before fork: have %v, expected 'nil'", header.ExcessDataGas) } // Retrieve the snapshot needed to verify this header and cache it diff --git a/consensus/ethash/consensus.go b/consensus/ethash/consensus.go index e2620f0095b..c7dfc46bc0b 100644 --- a/consensus/ethash/consensus.go +++ b/consensus/ethash/consensus.go @@ -239,13 +239,8 @@ func VerifyHeaderBasics(chain consensus.ChainHeaderReader, header, parent *types // Verify the header's EIP-1559 attributes. return err } - if !chain.Config().IsCancun(header.Time) { - if header.ExcessDataGas != nil { - return fmt.Errorf("invalid excessDataGas before fork: have %v, expected 'nil'", header.ExcessDataGas) - } - } else if err := misc.VerifyEip4844Header(chain.Config(), parent, header); err != nil { - // Verify the header's EIP-4844 attributes. - return err + if header.ExcessDataGas != nil { + return fmt.Errorf("invalid excessDataGas before fork: have %v, expected 'nil'", header.ExcessDataGas) } // Verify that the block number is parent's +1 @@ -569,13 +564,6 @@ func (ethash *Ethash) Finalize(config *chain.Config, header *types.Header, state ) (types.Transactions, types.Receipts, error) { // Accumulate any block and uncle rewards and commit the final state root accumulateRewards(config, state, header, uncles) - if config.IsCancun(header.Time) { - if parent := chain.GetHeaderByHash(header.ParentHash); parent != nil { - header.SetExcessDataGas(misc.CalcExcessDataGas(parent.ExcessDataGas, misc.CountBlobs(txs))) - } else { - header.SetExcessDataGas(new(big.Int)) - } - } return txs, r, nil }