Repository navigation
feat(test-specs): check transaction fixtures against the reference implementation - #3916
Open
Mannan-Goyal wants to merge 4 commits into
Open
Mannan-Goyal wants to merge 4 commits into
Mannan-Goyal wants to merge 4 commits into
Conversation
2 tasks done
Note in types_of_tests.md that filling with the in-process t8n decodes a transaction test's bytes with the fork's own code, so undecodable bytes without error= fail the fill. Use imperative one-line summaries for the new unit tests and check_reference_verdict.
Add a unit test where a frame transaction decodes and validates but the test sets error=, so the reference check must raise. No fork on this base ships FrameTransaction, so Cancun's type-2 class stands in for it.
…test Patch resolve_fork in the transaction spec with a SimpleNamespace fork instead of adding attributes to Cancun's transactions module and putting a Mock in sys.modules. No real spec module is changed by the test.
This branch has not been deployed
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
Before this change,
TransactionTest.generatediscarded the transition tool (del t8n). A transaction fixture therefore recordedtx.errorwithout any check against EELS. Block-based fills can't catch this either: they send the tool the transaction as JSON, and the t8n's JSON loader (TransactionLoad) rebuilds the transaction from its fields, ignoringrlpOverride.With this PR, when filling with the in-process EELS t8n, every transaction fixture's exact bytes are decoded by the fork's EELS code:
FrameTransaction(EIP-8141), decoded frame txs also go throughvalidate_frame_transaction, so a frame tx it accepts must have no expected error. On forks without it, this step does nothing.validate_frame_transactionapplies every transaction-only rule except the chain ID, which EELS checks against the block's chain ID when it processes the transaction. A frametransaction_testwhose only fault is its chain ID would therefore be reported as an unexpected success. None of the EIP-8141transaction_testcases does this today:test_wrong_chain_idis astate_test, and the raw-RLP chain ID of 2**64 already fails decoding.Only the accept/reject verdict is compared, not the exception class. Other t8n tools are unaffected.
The frame step is exercised for real on the EIP-8141 branch (#3878). No fork on this branch ships
FrameTransaction, so the success-direction error is unit-tested with a fake fork whose decoder returns a stand-in frame transaction (test_reference_check_rejects_accepted_frame_transaction).Documented under
docs/writing_tests/types_of_tests.md→ Transaction Tests.Verified:
transaction_testdirectory fills clean--until Bogota(11265 passed);transaction_testcases fill clean, and an EELSFrameTransaction.senderwidth mutation is caught bysender_19_bytes,sender_21_bytesandsender_empty;todecoding in EELS is caught bytest_valid_reencoded_transaction;just test-tests: 4013 passed, 0 failed; the new unit test fails (DID NOT RAISE UnexpectedExecutionSuccessError) when the success-direction raise is removed.Related Issues or PRs
*_transactioncases there currently fill unchanged whatever EELS does.FrameTransactiononforks/bogota.Checklist
just static<type>(<area>): <description>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture