fix: keep legacy transaction v computation in BigInt to avoid precision loss - #210
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughFixes a precision bug in createAndSignLegacyRawTransaction by computing legacy ChangesLegacy Transaction v Computation Fix
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ff3f2a39c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // producing an unrecoverable signature. Verified independently by parsing | ||
| // the raw transaction with ethers and checking the recovered sender. | ||
|
|
||
| const ak = require("../dist/index.cjs"); |
There was a problem hiding this comment.
Update the built dist artifacts
This new regression test imports ../dist/index.cjs, but the commit only updates src/utils7702.ts; the checked-in dist/index.cjs still computes v with Number(chainId), while package.json also points main/exports at dist. In the current tree, npx jest --runTestsByPath test/utils7702.test.js --runInBand fails because the large-chainId case parses back as 4337433743374337518n, so CI and any consumers using the committed package entrypoint still get the old precision-loss behavior until the dist outputs are rebuilt and committed.
Useful? React with 👍 / 👎.
Fixes #128
Red/green verified:
test/utils7702.test.jssigns a legacy tx with chainId 4337433743374337433 (> 2^53) and parses it back with ethers; on pre-fix dev the recovered sender is wrong (1 failed), with the fix both chainId and sender recover exactly (2 passed).Summary by CodeRabbit
Bug Fixes
Tests
Documentation