-
Notifications
You must be signed in to change notification settings - Fork 107
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(fixtures,specs,tests): Transaction tests, EIP-7702 convert invalid tx tests #933
Conversation
Look at transaction test filler We used to have t9n in geth to ask the client for transaction test validity Now we have python implementation of transaction Basically its like difficulty test. Lets say we test data field. Then we iterate by forks by tx types. Data is empty - tx valid The exception here is. In this tests we don't care about pre or post state and out of funds exceptions or out of gas exceptions Same for gaslimit field. While transaction structure remains valid. Also for int fields we test rlp encryption. This test you can also treat as transaction deserialization tests from rlp. Because we can put an extra field in rlp or remove one. Or mess rlp headers. |
d1028ea
to
61e8fc9
Compare
61e8fc9
to
f5ef20d
Compare
Regarding this, I added the We can test sending these faulty transactions to the |
src/ethereum_test_specs/tests/fixtures/chainid_shanghai_blockchain_test_engine.json
Show resolved
Hide resolved
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.
This will read existing .json files as well?
also can be a good idea to export fields in readable format in the generated fixture json, not just tx bytes.
the purpose of this test is to test rlp decode of txbytes. where txbytes can be ANYTHING
also the test pass if tx gasLimit * gasPrice < 2^256, so a transaction with gasLimit * gasPrice == 2^255 is a valid one. (read from rlp works)
so the pre defenition with this check will not work.
ec2eada
to
25b1202
Compare
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.
Really nice! Already looks really good, happy to get this merged and iterate further in subsequent PRs.
8d57b00
to
111e5f4
Compare
Co-authored-by: danceratopz <[email protected]>
Co-authored-by: danceratopz <[email protected]>
97f8099
to
1d100d4
Compare
…id tx tests (ethereum#933) * new(fixtures): TransactionFixture format * new(specs): TransactionTest format * fix(forks): rename intrinsic cost calc parameter name * fix(tests): rename intrinsic cost calc parameter name * fix(specs): use `fork` intrinsic gas calculator * fix(fixtures): Add `TransactionFixture` to file * fix(fixtures): transaction type optional fields * feat(fixtures): Add fixture format to `_info` for easier parsing * fix(cli/check_fixtures): Allow a single fixture check * fix(types): Address(0) == "" * fix(fixtures,specs): fixes * feat(types): Allow nonce list in auth tuple, for testing purposes * fix(tests): EIP-7702: Convert invalid tx tests * docs: update, changelog * fix(docs): tox * fix(tests): EIP-7702: Move invalid tx tests to its own file * new(docs): Add Transaction Test to `consuming_tests` * fix(fixtures): fix `fixture_type_discriminator` * Update docs/consuming_tests/index.md Co-authored-by: danceratopz <[email protected]> * Apply suggestions from code review (fixture_type_discriminator) Co-authored-by: danceratopz <[email protected]> * nit --------- Co-authored-by: danceratopz <[email protected]>
🗒️ Description
Transaction Test Format
Introduce the Transaction test type to EEST.
TODOs:
ethereum/tests
At the moment the spec only generates the transaction fixture type, and automatically generating blockchain and engine blockchain tests could be added in the future.
Fixture format type in
_info
A new info key
fixture_format
is added to the_info
dictionary in the generated fixtures.This is done in order to better discriminate between fixture formats, since the addition of the transaction test format was causing issues in
checkfixtures
command.Convert EIP-77022 Invalid Transaction Tests
This PR also converts all tests in
tests/prague/eip7702_set_code_tx/test_set_code_txs.py
to a transaction test, in order to not produce any errors during the parsing of the state tests.I'm open to leave this out to a different PR to keep the commit granularity.
Fix
Transaction(to=Address(0)).to == None
Fixes a bug where a transaction with a destination address meant to be the zero address, ends up as a contract creating transaction instead.
🔗 Related Issues
None
✅ Checklist
mkdocs serve
locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.