Skip to content

core, consensus, internal, eth, miner: construct block accessList#34957

Merged
rjl493456442 merged 10 commits into
ethereum:masterfrom
rjl493456442:aggregate-bal-2
May 19, 2026
Merged

core, consensus, internal, eth, miner: construct block accessList#34957
rjl493456442 merged 10 commits into
ethereum:masterfrom
rjl493456442:aggregate-bal-2

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

@rjl493456442 rjl493456442 commented May 13, 2026

This PR finally lands EIP-7928, collecting the block accessList during the block execution and verifying against the block header.

Comment thread core/vm/evm.go Outdated
Comment thread core/vm/evm.go
Comment on lines +717 to +720
// GetRules returns the chain rules used throughout the EVM execution.
func (evm *EVM) GetRules() params.Rules {
return evm.chainRules
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary? In all instances where we use this, we have the rules one layer up. Instead we could just pass the rules to ProcessBeaconBlockRoot and ProcessParentBlockHash

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that we can derive the chain rule in all invocations, but the issue is there are multiple invocations and duplicated code is expected.
It's easier to just use the one inside of EVM.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Comment thread core/vm/evm.go Outdated
Comment thread core/state_processor.go
Comment thread core/state_processor.go
Comment thread core/state_processor.go Outdated
Comment thread core/block_validator.go Outdated
if local != remote {
return fmt.Errorf("access list hash mismatch, local: %x, remote: %x", local, remote)
}
if err := enc.ValidateSize(block.GasLimit()); err != nil {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be able to be hit in practice, but we should keep it just to be safe.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i guess this validation is recently added in the spec, the check is also very cheap, no down side to have it.

Comment thread core/state_processor.go
Comment thread core/types/bal/bal_encoding.go Outdated
Comment thread beacon/engine/types.go Outdated
@rjl493456442 rjl493456442 added this to the 1.17.4 milestone May 18, 2026
Comment thread core/block_validator.go
}
// Verify Block-level accessList once Amsterdam is enabled
if v.config.IsAmsterdam(block.Number(), block.Time()) {
enc := res.Bal.ToEncodingObj()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might panic. It relies on the assumption that we call validateBody before we call validateState, but we dont do that in the stateless verification path iiuc

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stateless mode will be fixed #34087, in which the ValidateBody will also be invoked.

But before that let's check the nilness in the ValdiateState

@rjl493456442 rjl493456442 merged commit 1bdc4a6 into ethereum:master May 19, 2026
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants