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: use in memory state for state_by_block_number_or_tag #10152

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Aug 6, 2024

Previously this would only look at the database, when we may want to look in memory for state. For example, in eth_getStorageAt we use this method. The auto implementation is removed, and implemented directly on the old tree. The new tree now uses state_by_block_hash.

This fixes numerous cancun/ tests

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation A-db Related to the database A-blockchain-tree Related to sidechains, reorgs and pending blocks labels Aug 6, 2024
Comment on lines 986 to 991
let hash = self
.canonical_in_memory_state
.hash_by_number(num)
.ok_or_else(|| ProviderError::HeaderNotFound(num.into()))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this only looks at the tree but could also be an older block on disk

Copy link
Member Author

Choose a reason for hiding this comment

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

ah right

Copy link
Member Author

Choose a reason for hiding this comment

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

now uses block_hash

@Rjected Rjected enabled auto-merge August 6, 2024 20:22
@Rjected Rjected added this pull request to the merge queue Aug 6, 2024
Merged via the queue into main with commit 5ca4921 Aug 6, 2024
34 checks passed
@Rjected Rjected deleted the dan/fix-storage-at branch August 6, 2024 21:09
martinezjorge pushed a commit to martinezjorge/reth that referenced this pull request Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks A-db Related to the database A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants