execution: eradicate block.SetBlockAccessList - #23060
Conversation
…ock_set_bals # Conflicts: # cmd/rpcdaemon/rpcdaemontest/block_access_list.go # execution/execmodule/exec_module_test.go # execution/tests/blockgen/chain_makers.go # execution/tests/testutil/block_test_util.go
There was a problem hiding this comment.
Pull request overview
This PR refactors block insertion and block construction to fully eliminate block.SetBlockAccessList, making the EIP-7928 Block Access List (BAL) a constructor-provided sidecar (similar to withdrawals/txs/header) and simplifying insertion APIs by removing separate BAL plumbing.
Changes:
- Switch
ExecutionModule.InsertBlocks(and callers) from[]*types.RawBlockto[]*types.Block, removing separate BAL arguments/feeds. - Update block constructors (
NewBlockFromNetwork,NewBlockFromStorage*,NewBlockForAsembling) to accept BAL bytes directly, and removeSetBlockAccessList/RawBlock.BlockAccessList. - Propagate the signature changes through Engine API, P2P downloader paths, Polygon sync, and tests/mocks.
Reviewed changes
Copilot reviewed 42 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
execution/types/block.go |
Removes SetBlockAccessList/RawBlock.BlockAccessList, renames the sidecar field to bal, and threads BAL into constructors. |
execution/execmodule/interface.go |
Updates the exec module interface to accept []*types.Block for insertion. |
execution/execmodule/inserters.go |
Adjusts insertion logic to persist BAL bytes sourced from the types.Block object. |
execution/execmodule/chainreader/chain_reader.go |
Simplifies chain reader insertion API to no longer accept separate BAL slices. |
execution/p2p/bbd*.go |
Removes BAL side-channel from downloader result feed and attaches BAL directly to blocks when available. |
execution/engineapi/* |
Updates Engine API insertion paths and related tests to match the new insertion/block-construction model. |
execution/builder/finish.go |
Encodes BAL bytes for Amsterdam+ and passes them via block assembly constructor. |
db/rawdb/accessors_chain.go |
Reconstructs blocks from DB while carrying BAL bytes as a block sidecar. |
polygon/*, cl/*, cmd/*, execution/tests/* |
Mechanical updates to constructor signatures and insertion APIs across integrations and tests. |
Files not reviewed (1)
- cl/phase1/execution_client/execution_engine_mock.go: Generated file
Suppressed comments (3)
execution/types/block.go:1176
balis stored by reference. To preserve the previous non-aliasing guarantee, clonebalwhen constructing the block.
execution/types/block.go:1195balis stored by reference. This can alias request/network buffers; cloning here matches the oldSetBlockAccessListbehavior and prevents post-construction mutation from affecting the block.
execution/types/block.go:1168balis stored by reference. To avoid callers mutating the provided slice after block construction (the oldSetBlockAccessListexplicitly cloned), store a clone in the block.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Reviewed the whole diff. Looks good — this is a real simplification, not just a signature shuffle. One point I would like you to consider before merge, plus two nits. Nothing blocking. What this fixes beyond the stated goalAttaching the BAL to the block removes two parallel-collection alignments that had to stay in sync by hand:
Both are now "the block carries its own BAL". That is strictly harder to get wrong. Main point: the
|
yes, the bytes.Clone was removed on purpose |
|
will address the other nits |
…23096) fixes a regression introduced in erigontech#23060 in exec we read block from read aheader first to avoid db lookup and get it from memory instead, then fall back to db if not there the read aheader was returning that block with bal=nil, causing an unnecessary db lookup for the BAL at tip this fixes that
block.SetBlockAccessListin favour of always passing it via block constructors as we do for withdrawals, transactions, header, etcbalfromexecModule.InsertBlocksbecause they are now attached to the block after execution: carry the block access list as a first-class block object #22894