fix(spec-tools): load txs that carry no signature material - #14
Merged
Conversation
The CLI parser builds testing `Transaction` objects and RLP-encodes them for the returned body. A tx with neither `v`/`r`/`s` nor `secretKey` made `Transaction.rlp` auto-sign a key-less tx and die on `assert signing_key is not None`, failing every json_loader case that replays such a fixture (136 in CI, all `test_bad_v_r_s`). Default the missing signature components to zero in `_normalize_tx_json`, matching the previous parser (`t8n_types.Txs.parse_json_tx`): the tx then executes with an invalid signature and the fork rejects it, which is exactly what these fixtures assert via `expectException`. Verified against locally filled `bad_v_r_s` fixtures for Homestead and Prague.
4 tasks
danceratopz
commented
Jul 6, 2026
danceratopz
commented
Jul 6, 2026
gurukamath
approved these changes
Jul 6, 2026
gurukamath
merged commit Jul 6, 2026
84fd374
into
gurukamath:refactor/testing-alloc-as-prestate
6 of 15 checks passed
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.
Fixes the
json-loaderCI failure on this branch: 136 cases, alltest_bad_v_r_s, all failing withAssertionError: secret_key or signer must be set(run 28782882693) from ethereum#2924.Bug
Filled state tests store a tx whose signature is deliberately invalid with no signature material at all: the state-test fixture format cannot express explicit
v/r/s(the blockchain format carries them insidetxbytes), so these fixtures rely onexpectException. The json_loader feeds that tx to the CLI t8n verbatim. The new CLI parser builds a testingTransactionand RLP-encodes it for the returned body; RLP serialization auto-signs a tx whosev/r/swere never set and hitsassert signing_key is not Nonebecause there is nosecretKeyand the sender EOA carries no key. The previous parser (t8n_types.Txs.parse_json_tx) defaulted each missing component to0x00and let the fork reject the invalid signature.Fix
_normalize_tx_jsonnow defaultsv/r/sto zero when a tx carries none ofv/r/s/secretKey, restoring the previous parser's behavior: the tx executes with an invalid signature and is rejected, which is exactly what these fixtures assert.Verification
bad_v_r_s.jsonfixture is byte-identical between this branch andforks/amsterdam(only the provenance URL differs), so the failure is purely in the loader path and this fix cannot change any fixture output.tests/frontier/validation/test_transaction.py::test_bad_v_r_slocally intotests/json_loader/fixturesfor Homestead and Prague and ranpytest tests/json_loader: all cases pass with this fix and reproduce the CI assertion without it.secretKey-carrying txs take exactly the same path as before, so behavior for every other input is unchanged.