Tracking PR for projects/binary-trie (PBT)#3207
Draft
kevaundray wants to merge 24 commits into
Draft
Conversation
feat: Add initial PBT impl
…/binary-trie # Conflicts: # uv.lock
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3207 +/- ##
===================================================
- Coverage 93.39% 92.94% -0.45%
===================================================
Files 624 627 +3
Lines 37014 37215 +201
Branches 3386 3398 +12
===================================================
+ Hits 34568 34590 +22
- Misses 1672 1851 +179
Partials 774 774
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
feat(8297): Add key derivation layer
The State class and its helpers moved to ethereum.state_mpt, but two test files import the module itself rather than names from it, which the import rewrite missed: test_optimized_state.py aliases it for state_root calls (caught by mypy in CI) and load_vm_tests.py returns it as the fallback fork state module (hidden behind an Any return).
Contributor
Author
…rface Squash-merge of kevaundray:kw/state-interface (PR #3218) so the binary tree work can build on the new interface without waiting for the upstream merge into forks/amsterdam: - PreState.compute_state_root_and_trie_changes becomes compute_state_root and returns only the root: the trie-changes list was produced empty by the only implementation and discarded by every caller. - The MPT-backed State and its helpers move from ethereum/state.py to the new ethereum/state_mpt.py; state.py keeps the commitment-agnostic model and protocol. - compute_state_root gains a code_changes parameter so commitments over code contents (not just code hashes) are implementable behind the protocol.
Contributor
Author
The evm tools hardcoded the MPT-backed provider: alloc loading built ethereum.state_mpt.State directly, and t8n applied diffs, serialized allocs, and backed up state by reaching into MPT trie internals. Resolve the provider through the fork instead: every fork's fork module imports its State class, so ForkLoad.state_provider derives the provider module from it. Alloc loading, diff application, serialization, and backup/restore all go through that module. The provider gains the uniform helpers this needs: copy_state, restore_state, all_accounts, and account_storage. With this, a fork whose commitment is not the Merkle Patricia Trie works with the tooling by supplying a provider with the same module surface as ethereum.state_mpt.
The evm tools hardcoded the MPT-backed provider: alloc loading built ethereum.state_mpt.State directly, and t8n applied diffs, serialized allocs, and backed up state by reaching into MPT trie internals. Resolve the provider through the fork instead: every fork's fork module imports its State class, so ForkLoad.state_provider derives the provider module from it. Alloc loading, diff application, serialization, and backup/restore all go through that module. The provider gains the uniform helpers this needs: copy_state, restore_state, all_accounts, and account_storage. With this, a fork whose commitment is not the Merkle Patricia Trie works with the tooling by supplying a provider with the same module surface as ethereum.state_mpt.
…-interface # Conflicts: # src/ethereum_spec_tools/evm_tools/loaders/fork_loader.py # src/ethereum_spec_tools/evm_tools/t8n/__init__.py # src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py
# Conflicts: # src/ethereum/forks/amsterdam/fork.py # src/ethereum/forks/arrow_glacier/fork.py # src/ethereum/forks/berlin/fork.py # src/ethereum/forks/bpo1/fork.py # src/ethereum/forks/bpo2/fork.py # src/ethereum/forks/bpo3/fork.py # src/ethereum/forks/bpo4/fork.py # src/ethereum/forks/bpo5/fork.py # src/ethereum/forks/byzantium/fork.py # src/ethereum/forks/cancun/fork.py # src/ethereum/forks/constantinople/fork.py # src/ethereum/forks/dao_fork/fork.py # src/ethereum/forks/frontier/fork.py # src/ethereum/forks/gray_glacier/fork.py # src/ethereum/forks/homestead/fork.py # src/ethereum/forks/istanbul/fork.py # src/ethereum/forks/london/fork.py # src/ethereum/forks/muir_glacier/fork.py # src/ethereum/forks/osaka/fork.py # src/ethereum/forks/paris/fork.py # src/ethereum/forks/prague/fork.py # src/ethereum/forks/shanghai/fork.py # src/ethereum/forks/spurious_dragon/fork.py # src/ethereum/forks/tangerine_whistle/fork.py # src/ethereum/state.py # src/ethereum/state_mpt.py # src/ethereum_spec_tools/evm_tools/t8n/__init__.py # src/ethereum_spec_tools/evm_tools/t8n/t8n_types.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issues or PRs
N/A.
Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture