Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BeaconBlockRootHandler #7604

Merged
merged 7 commits into from
Oct 20, 2024
Merged

Fix BeaconBlockRootHandler #7604

merged 7 commits into from
Oct 20, 2024

Conversation

yerke26
Copy link
Contributor

@yerke26 yerke26 commented Oct 14, 2024

Fixes #7594

Changes

  • add check for eip4788Account existence

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@yerke26 yerke26 requested a review from MarekM25 October 14, 2024 18:05
@LukaszRozmej
Copy link
Member

Can you explain why this is the issue? It is just AccessList creation, which shouldn't make a difference here if there is no contract?

@yerke26
Copy link
Contributor Author

yerke26 commented Oct 15, 2024

Can you explain why this is the issue? It is just AccessList creation, which shouldn't make a difference here if there is no contract?

I checked geth implementation:
Evm call is called here with BeaconRootsAddress, which fits this condition and does not create account with BeaconRootsAddress, which does not change state root. I think the issue that we create account with BeaconRootsAddress.

@LukaszRozmej
Copy link
Member

Can you explain why this is the issue? It is just AccessList creation, which shouldn't make a difference here if there is no contract?

I checked geth implementation: Evm call is called here with BeaconRootsAddress, which fits this condition and does not create account with BeaconRootsAddress, which does not change state root. I think the issue that we create account with BeaconRootsAddress.

Ok but Geth also uses access list but doesn't create the account? Something is off.

@yerke26
Copy link
Contributor Author

yerke26 commented Oct 15, 2024

Can you explain why this is the issue? It is just AccessList creation, which shouldn't make a difference here if there is no contract?

I checked geth implementation: Evm call is called here with BeaconRootsAddress, which fits this condition and does not create account with BeaconRootsAddress, which does not change state root. I think the issue that we create account with BeaconRootsAddress.

Ok but Geth also uses access list but doesn't create the account? Something is off.

Yes, here, before Evm call


namespace Nethermind.Blockchain.BeaconBlockRoot;
public class BeaconBlockRootHandler(ITransactionProcessor processor) : IBeaconBlockRootHandler
{
private const long GasLimit = 30_000_000L;

public (Address? toAddress, AccessList? accessList) BeaconRootsAccessList(Block block, IReleaseSpec spec, bool includeStorageCells = true)
public (Address? toAddress, AccessList? accessList) BeaconRootsAccessList(Block block, IReleaseSpec spec, IWorldState stateProvider, bool includeStorageCells = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

can you pass StateProvider in constructor?

@yerke26 yerke26 requested a review from MarekM25 October 20, 2024 16:28
@yerke26 yerke26 merged commit 70a4780 into master Oct 20, 2024
75 checks passed
@yerke26 yerke26 deleted the fix/7594 branch October 20, 2024 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid state root in Nethermind v1.29.0 during gas-benchmark
3 participants