core, consensus, internal, eth, miner: construct block accessList#34957
Conversation
8b29595 to
ffb1180
Compare
a85e995 to
d01cd67
Compare
d01cd67 to
4eabe32
Compare
| // GetRules returns the chain rules used throughout the EVM execution. | ||
| func (evm *EVM) GetRules() params.Rules { | ||
| return evm.chainRules | ||
| } |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
| if local != remote { | ||
| return fmt.Errorf("access list hash mismatch, local: %x, remote: %x", local, remote) | ||
| } | ||
| if err := enc.ValidateSize(block.GasLimit()); err != nil { |
There was a problem hiding this comment.
It shouldn't be able to be hit in practice, but we should keep it just to be safe.
There was a problem hiding this comment.
Yeah, i guess this validation is recently added in the spec, the check is also very cheap, no down side to have it.
| } | ||
| // Verify Block-level accessList once Amsterdam is enabled | ||
| if v.config.IsAmsterdam(block.Number(), block.Time()) { | ||
| enc := res.Bal.ToEncodingObj() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
This PR finally lands EIP-7928, collecting the block accessList during the block execution and verifying against the block header.