feat: move to hegota-testnet (chain 8141) and EIP-8250 keyed nonces - #25
Merged
Merged
Conversation
nikhilkumar1612
suggested changes
Sep 24, 2026
nikhilkumar1612
left a comment
Contributor
There was a problem hiding this comment.
validate nonceKeys during transaction preparation
prepareFrameTransaction() currently validates only that nonceKeys is non-empty and that all selected keys have the same sequence.
It can therefore return a transaction containing consensus-invalid key sets such as:
[2n, 1n] // not strictly increasing
[1n, 1n] // duplicate keys
[0n, 1n] // key 0 mixed with another key
Array(17).fill(1n) // exceeds MAX_NONCE_KEYS|
🎉 This PR is included in version 0.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
What this changes
Moves the library from the chain-81410 frames devnet to hegota-testnet (chain 8141,
rpc1.privacy.ethrex.xyz, ethrexbdfc5d8), whose frame transactions carry EIP-8250 keyed nonces in an 8-field envelope. It also removes the rule-set API, which now always prices identically, and exports ahegotaTestnetchain definition.Why
81410 was only a stopgap while the 8141 faucet was broken. 8141 is the upstream ethrex line: its build is 341 commits ahead of, and 0 behind, the commit this library was pinned to. It refuses our 7-field bytes at decode (
Error decoding field 'nonce_keys').Breaking API changes, all in this release:
FrameTransaction.nonce→nonceKeys: bigint[]+nonceSeq: bigint; same forRpcFrameTransactiongetNonce({ key?, blockTag? });getValidationData({ calls, chainId, nonceKeys, nonceSeq })frameTxGas(tx),frameTxMaxCost(tx, blobBaseFee)andestimateFrameGas({ transaction })lose therulesargument;RuleSet,compareRuleSetsandGasDivergenceare removedAdded:
prepareFrameTransaction(…, { nonceKeys }), which refuses keys that sit at different sequencesNONCE_MANAGER,keyedNonceSlotandgetFrameNonceSeq(keyed nonces read througheth_getStorageAt)MAX_NONCE_KEYS,nonceCalldata,KEYED_NONCE_FIRST_USE_STATE_GAS(97,920),NEW_ACCOUNT_STATE_GAS(183,600)hegotaTestnetscripts/send-eth-eoa.tsnow simulates before broadcasting and refuses to send anything the node reports invalidDocs:
docs/DESIGN.mdis rewritten as a compact spec of the client;docs/OPEN-ITEMS.mdis removed.How the new behaviour is pinned
frame_tx_wire_tests.rs: re-transcribed frombdfc5d8:69-70test/chain.oracle.test.tschecks, per fixture, the recovered signer, ourmaxCostagainst the node's, and receiptgasUsedBefore choosing fixtures I ran the checks over all 198 frame transactions on the 8141 genesis. Every hash reproduced, every signer recovered, and every
maxCostmatched the node's exactly. The receipt formula ismax(intrinsic + Σ execution, calldata floor) + Σ state: exact on 176, with the other 22 lower by storage refunds that frame receipts don't itemize. Fixtures come from the refund-free set.The fixture suite can fail. With the nonce calldata taken out of the gas model, 26 of its tests fail.
Live: an ETH transfer from a funded code-less EOA through
toEoaFrameAccountlanded as0xa05de9a4f929ac36a2d6b7ed09bdc6506656b3ac0c374c85a34f3b9e6954fc12(block 129,105) and is fixture 14.Load-bearing rules
No
Yes, and the argument for it is below
Golden vector and sig-hash replaced. Not edited to pass: re-transcribed verbatim from the same upstream test at the new pinned commit.
scripts/hegota-testnet/frametx.py:113asserts the same string.Captured fixtures replaced. The 5 old ones came from a retired genesis and a 9-field envelope neither chain serves; they remain in git history. The replacements are unedited captures from
scripts/capture-fixtures.ts, which can now capture specific transactions by hash.Gas constants added as literal published figures, not derived.
Module order. New
nonceandchainmodules depend only onerrorsand viem.gasstill doesn't importenvelope, andencodeFrameTxstill doesn't validate.Checks
bun run test(340 passed)bun run typecheckbun run build && bunx @arethetypeswrong/cli --pack .(new root exports)bun run test:liveRelease impact
fix)feat)feat!or aBREAKING CHANGE:footer)This breaks the public API, but ships as a minor under the pre-1.0 convention, as #24 did.
.releaserc.jsonuses the default analyzer, so a!or aBREAKING CHANGE:footer anywhere in the history would publish 1.0.0.