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
feat(fw): verkle pydantic rebase and t8n changes #507
Draft
spencer-tb
wants to merge
50
commits into
ethereum:verkle/main
Choose a base branch
from
spencer-tb:verkle/pydantic-rebase
base: verkle/main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat(fw): verkle pydantic rebase and t8n changes #507
spencer-tb
wants to merge
50
commits into
ethereum:verkle/main
from
spencer-tb:verkle/pydantic-rebase
Conversation
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 was referenced Apr 12, 2024
spencer-tb
force-pushed
the
verkle/pydantic-rebase
branch
2 times, most recently
from
April 12, 2024 16:45
28b389a
to
5ca669d
Compare
spencer-tb
changed the title
feat(fw): verkle pydantic rebase
feat(fw): verkle pydantic rebase and t8n changes
Apr 12, 2024
* test(fw): add json serialization tests for new pydantic models * fix(fw): fix exception enum serialization in pydantic models This required: 1. Changing the from_pipe_str() BeforeValidator method to convert the serialized exception string back to an Exception enum instance (or list). 2. Modifying the annotated types to also accept single TransactionException or BlockchainException types so that they are also correctly coerced via from_pipe_str(). * chore: update whitelist * fix(fw): deserialize an empty Transaction 'to' field as None This fixes src/ethereum_test_tools/tests/test_types.py::TestPydanticModelConversion::test_json_serialization[transaction_t8n_to_none]. An additional class TransactionTransitionToolConverter now specifies how an evm transition tool should validate and serialize the to field. Whilst this didn't break test generation, it caused deserialization to fail on individual Transaction models. * fix(fw): fix fixture hash generation if info field already exists The incorrect field name was specified. This only became apparent when deserializing fixtures, as the info field is not present when the hash gets generated after filling. Patches up existing tests and also adds a dedicated test for this: src/ethereum_test_tools/tests/test_spec_base.py::test_json_dict * refactor(fw): prefix fixture class names with type * feat(fw): add pydantic root models for json fixture files * feat(fw): add a cli command to verify fixture serialization/deserialization * test(fw): fix fixture tests when executed with solc<0.8.21 * test(fw): refactor tests - use valid json fixtuers in test_filling * refactor: use snek case for script module and function names * chore: remove test code in script * test(fw): use check_fixtures to verify test helper fixtures * docs: update changelog * chore: make cli modules importable; fix mypy/tox * Update src/cli/check_fixtures.py * fix(fw): rollback fixture class rename --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
…ereum#508) * refactor(fw): augment & use Fixtures model in fixture collection * docs: update changelog
* chore: soften trie package requirements for compatibility w/eth2spec * chore: soften minor/patch & sharpen major dependency versions * docs: update changelog
* feat(all): add EOF fixture format and test spec * feat(tests): add EOF example * feat(fw): EOF library tools/vm: EOF opcode changes tools: CREATE3 helper tox: EOF Keywords post rebase changes: align EOF tests with main. Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk> post rebase: tox fixes. Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk> Fix existing EOF tests (#11) Co-authored-by: Hugo <jhugodc@gmail.com> * new(tests): prague: EOF V1 tests tests/eof: move to prague tests/eof: fixes post rebase changes: align EOF tests with main. (tests) Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk> post rebase: tox fixes (tests). Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk> Fix existing EOF tests (tests) (#11) Co-authored-by: Hugo <jhugodc@gmail.com> * refactor(fw): EOF container code * fix(fw): vm: re-order JUMPDEST, NOOP * fix(fw): cli tests * fix(tests): refactor fixes * fix(fw): eof: fix raw bytes processing * fix(tests): eof: change `test_code_validation.py` to use `EOFTestFiller` * eof unit tests * fix eof exceptions * refactor(fw): compute_create3_address * fix(tests): tox * refactor(fw): eof_v1: use pydantic * fix(fw): tpx * fix(fw): RJUMPV custom dataportion parser * fix(tests): eofv1: RJUMPI calls * new(fw): RJUMPV unit test * feat(fw): subscriptable opcodes * fix(fw): Opcode add, mul * fix(tests): test hardcoding bytecode of initcode * fix(fw): fix * fix(tests): eof: fix RJUMP*, CALLF data portions * hack(fw): Add str as allowed EOF exception * fix(tests): eof: fix test_execution_function.py * changelog * chore: add unknown words to dictionary * fetch exceptions with evmone lots of TODOs * eof .py test example * fix(fw): add unchecked_stack opcode property (CALLF) * refactor(fw): eof: refactor and add section creation helpers * fix: tox * fix(tests): eof: refactor * refactor(tests): replace Section(kind=, with Section.Code, Section.Data * fix(fw): eof: consistent magic, version, and header terminator types. * fix(fw): eof: proper magic * rm(tests): eof: duplicate prague folder with redundant examples * fix(fw): eof: data-container body order * docs: add EOF * fix(docs): word * fix(tests): eof: file rename --------- Co-authored-by: Mario Vega <marioevz@gmail.com> Co-authored-by: Hugo <jhugodc@gmail.com> Co-authored-by: danceratopz <danceratopz@gmail.com>
* Updates based on non-returning sections Update tests to conform with besu * sample code needs non-returning and data * all codesection zeros need to be non-returning * RETF is not valid in non-returning sections * CALL is not in EOF, use EXTCALL Signed-off-by: Danno Ferrin <danno@numisight.com> * Apply suggestions from code review --------- Signed-off-by: Danno Ferrin <danno@numisight.com> Co-authored-by: Mario Vega <marioevz@gmail.com>
Creates a set of containers and tests DATA* operations along the test boundaries of zero, too little, just right, and more than enough. Including validation tests. Signed-off-by: Danno Ferrin <danno@numisight.com> Co-authored-by: Mario Vega <marioevz@gmail.com>
…um#527) * chore(ci): Update workflow actions to use Node.js 20 versions. * chore: Add changelog.
Add support for adding traces to output when using Besu. Signed-off-by: Danno Ferrin <danno@numisight.com>
…thereum#519) Co-authored-by: Dimitry Kh <dimitry@ethereum.org> Co-authored-by: danceratopz <danceratopz@gmail.com>
…um#542) * feat(pytest): use --tb=short as the default failure traceback style * docs: update changelog * chore: update whitelist
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: spencer <spencer.taylor-brown@ethereum.org> Co-authored-by: Mario Vega <marioevz@gmail.com>
* fix formatting, add eofparse string to whitelist * translate Ori's validInvalid eof tests * fix eof opcodes implementation rjumpv and jumpf * add a few more tweaks to eof Container class * add new EOF exceptions * add a few efExample ori tests * fix unit tests and tox * changelog, address pr review issues * Apply suggestions from code review --------- Co-authored-by: Mario Vega <marioevz@gmail.com>
spencer-tb
force-pushed
the
verkle/pydantic-rebase
branch
from
May 13, 2024 15:06
5ca669d
to
3462127
Compare
This just allows easier checking of the the modified values in the Verkle tree.
Requested by Guillaume for testing
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
Adds specific changes from #465 & #485, including a rebase onto main after the pydantic PR #486.
Usage
Use the following geth branch
gballet/t8n-verkle-exec
to *both fill and execute tests.Fill tests with the following commands (until we update the framework fully).
Execute tests using the
consume rlp
eest based hive simulator. Run the following command after generating the tests:Future Todos
STILL TO BE UPDATED
Tweaks
VerkleTree
model and its integration within theTransitionToolOutput
model.Fixture Validation
evm verkle tree-keys
command to convert the post state expected allocation to its verkle tree representation. Compare these values with those from the final verkle tree output from t8n. Example subcommand usage below for an idea of what happens when calling the command:evm t8n ... --output.witness
to each block in the fixture, furthermore utilize during filling to backtest the vkt keys and values against the witness generated for each block.Basic Fixture Execution
consume rlp
simulator.The below errors all occur on the first verkle block, and look to be from the same cause:
evm blocktest
command. Note the following error below. This can be ran within the same directory as fill.engine_newPayloadV2
, against the dockerized client under test. Currently we get a similar error. But from the engine new payload method.This can be ran on the following branch - https://github.com/spencer-tb/hive/tree/verkle/pyspec using this command below. We are using the
kaustinan-with-shapella
geth branch.Further Fixture Generation and Execution
Once we are passing the basic fixture generation we should add the verkle transition for all tests.
Furthermore, add the filling and exection of all these tests starting from Prague. Note the input alloc to t8n will no longer exist in this case so we should first convert it using the
evm verkle tree-keys
subcommand to VKT reprenstation.🔗 Related Issues & PRs
None
✅ PR Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.