-
Notifications
You must be signed in to change notification settings - Fork 74
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
[WIP] feat(fw): verkle t8n post state verification #485
Closed
spencer-tb
wants to merge
4
commits into
ethereum:verkle/t8n-changes
from
spencer-tb:verkle/t8n-changes-post-verification
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
932f365
feat(fw): add verkle sub-command, boiler plate for post vkt verify.
spencer-tb d4943ae
feat(fw): add initial post vkt verification checks.
spencer-tb da929b2
feat(fw): create alloc to vkt func, add test for it.
spencer-tb 2023092
feat(fw): update vkt post state verifaction.
spencer-tb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
""" | ||
Test the verkle tree subcommand from the geth transition tool. | ||
""" | ||
|
||
import pytest | ||
|
||
from evm_transition_tool import GethTransitionTool | ||
|
||
|
||
# TODO: Update to use correct types. | ||
@pytest.mark.parametrize( | ||
"post_alloc, expected_vkt", | ||
[ | ||
( | ||
{ | ||
"0x0000000000000000000000000000000000000100": { | ||
"nonce": "0x01", | ||
"balance": "0x01", | ||
"code": "0x60203560003555", | ||
"storage": {"0x0a": "0x0b"}, | ||
}, | ||
}, | ||
{ | ||
"0x31b64bbd0b09c1d09afea606bebb70bce80a2909189e513c924a0871bbd36300": "0x0000000000000000000000000000000000000000000000000000000000000000", # noqa: E501 | ||
"0x31b64bbd0b09c1d09afea606bebb70bce80a2909189e513c924a0871bbd36301": "0x0100000000000000000000000000000000000000000000000000000000000000", # noqa: E501 | ||
"0x31b64bbd0b09c1d09afea606bebb70bce80a2909189e513c924a0871bbd36302": "0x0100000000000000000000000000000000000000000000000000000000000000", # noqa: E501 | ||
"0x31b64bbd0b09c1d09afea606bebb70bce80a2909189e513c924a0871bbd36303": "0x159c5cfa7fab15702c72a4141ef31b26c42827bd74ffc5671d95033227e662e7", # noqa: E501 | ||
"0x31b64bbd0b09c1d09afea606bebb70bce80a2909189e513c924a0871bbd3634a": "0x000000000000000000000000000000000000000000000000000000000000000b", # noqa: E501 | ||
}, | ||
), | ||
], | ||
) | ||
def test_post_alloc_to_vkt(post_alloc, expected_vkt): | ||
""" | ||
Verifies that the `post_alloc_to_vkt` method of the `GethTransitionTool` class. | ||
""" | ||
t8n = GethTransitionTool() | ||
result_vkt = t8n.post_alloc_to_vkt(post_alloc) | ||
|
||
assert set(result_vkt.keys()) == set( | ||
expected_vkt.keys() | ||
), "Keys in created verkle tree do not match the expected keys." | ||
|
||
for key, expected_value in expected_vkt.items(): | ||
assert key in result_vkt, f"Key {key} is missing in created verkle tree." | ||
assert result_vkt[key] == expected_value, ( | ||
f"Value for {key} in the created verkle tree does not match expected. " | ||
f"Expected {expected_value}, got {result_vkt[key]}." | ||
) |
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever option we choose to finalize with, we need to determine how we check for unexpected keys in the vkt. The previous solution involved using
Account.NON_EXISTENT
: https://github.com/ethereum/execution-spec-tests/blob/main/src/ethereum_test_tools/spec/base/base_test.py#L61-L63Can we do something similar here?