From e9aaf928d41790150ecfb8b730e34145e3c28270 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 19 Mar 2024 01:49:15 +0100 Subject: [PATCH] core/types: remove ils from block --- core/types/block.go | 51 +++++++++++++-------------------------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/core/types/block.go b/core/types/block.go index 176a247c4a..1a357baa3a 100644 --- a/core/types/block.go +++ b/core/types/block.go @@ -93,9 +93,6 @@ type Header struct { // ParentBeaconRoot was added by EIP-4788 and is ignored in legacy headers. ParentBeaconRoot *common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"` - - // InclusionListSummaryRoot was added by EIP-7547 and is ignored in legacy headers. - InclusionListSummaryRoot *common.Hash `json:"inclusionListSummaryRoot" rlp:"optional"` } // field type overrides for gencodec @@ -171,10 +168,9 @@ func (h *Header) EmptyReceipts() bool { // Body is a simple (mutable, non-safe) data container for storing and moving // a block's data contents (transactions and uncles) together. type Body struct { - Transactions []*Transaction - Uncles []*Header - Withdrawals []*Withdrawal `rlp:"optional"` - InclusionListSummary []common.Address + Transactions []*Transaction + Uncles []*Header + Withdrawals []*Withdrawal `rlp:"optional"` } // Block represents an Ethereum block. @@ -195,11 +191,10 @@ type Body struct { // - We do not copy body data on access because it does not affect the caches, and also // because it would be too expensive. type Block struct { - header *Header - uncles []*Header - transactions Transactions - withdrawals Withdrawals - inclusionListSummary []common.Address + header *Header + uncles []*Header + transactions Transactions + withdrawals Withdrawals // caches hash atomic.Value @@ -213,11 +208,10 @@ type Block struct { // "external" block encoding. used for eth protocol, etc. type extblock struct { - Header *Header - Txs []*Transaction - Uncles []*Header - Withdrawals []*Withdrawal `rlp:"optional"` - InclusionListSummary []common.Address + Header *Header + Txs []*Transaction + Uncles []*Header + Withdrawals []*Withdrawal `rlp:"optional"` } // NewBlock creates a new block. The input data is copied, changes to header and to the @@ -338,16 +332,15 @@ func (b *Block) EncodeRLP(w io.Writer) error { // Body returns the non-header content of the block. // Note the returned data is not an independent copy. func (b *Block) Body() *Body { - return &Body{b.transactions, b.uncles, b.withdrawals, b.inclusionListSummary} + return &Body{b.transactions, b.uncles, b.withdrawals} } // Accessors for body data. These do not return a copy because the content // of the body slices does not affect the cached hash/size in block. -func (b *Block) Uncles() []*Header { return b.uncles } -func (b *Block) Transactions() Transactions { return b.transactions } -func (b *Block) Withdrawals() Withdrawals { return b.withdrawals } -func (b *Block) InclusionListSummary() []common.Address { return b.inclusionListSummary } +func (b *Block) Uncles() []*Header { return b.uncles } +func (b *Block) Transactions() Transactions { return b.transactions } +func (b *Block) Withdrawals() Withdrawals { return b.withdrawals } func (b *Block) Transaction(hash common.Hash) *Transaction { for _, transaction := range b.transactions { @@ -489,20 +482,6 @@ func (b *Block) WithWithdrawals(withdrawals []*Withdrawal) *Block { return block } -// WithInclusionList returns a copy of the block containing the given inclusionList. -func (b *Block) WithInclusionList(addresses []common.Address) *Block { - block := &Block{ - header: b.header, - transactions: b.transactions, - uncles: b.uncles, - } - if addresses != nil { - block.inclusionListSummary = make([]common.Address, len(addresses)) - copy(block.inclusionListSummary, addresses) - } - return block -} - // Hash returns the keccak256 hash of b's header. // The hash is computed on the first call and cached thereafter. func (b *Block) Hash() common.Hash {