Repository navigation
Parse extractAsUint256 values as unsigned decimal integers - #4894
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
PR SummaryHigh Risk Overview Invalid inputs—negative numbers,
Reviewed by Cursor Bugbot for commit ca82fd2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4894 +/- ##
==========================================
- Coverage 61.62% 61.62% -0.01%
==========================================
Files 2080 2080
Lines 162041 162041
==========================================
- Hits 99865 99862 -3
- Misses 62171 62174 +3
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
This change makes extractAsUint256 on the JSON precompile reject a leading + or - sign. Before, big.Int.SetString accepted signed input and FillBytes then returned the absolute value, so "-1" came back as 1. The new digits-only check closes the only extra forms that base-10 SetString allowed, and nothing blocks (reviewed against the PR merge tree; no Go toolchain was available, so the test was not run). Scout codex reported no findings, and that matches this review; it had no claims to keep or drop.
seidroid review · decision approve · session 5c10ecb0905d4281a42699eccda588c6 · turn resp_claude_cab9c177f39afd710318952f7a5d7c98 · item 0a7196227c5858959ccb2d1d8ad47a32
Findings: 0 blocking | 0 non-blocking | 0 posted inline
extractAsUint256on the JSON precompile parsed its value withbig.Int.SetString, which takes a wider input grammar than the unsigneduint256the method returns.ExtractAsUint256now accepts only a plain string of decimal digits, quoted or unquoted, and returns an error for any other form. Gas and the 100-character length cap are unchanged.Inputs outside that form now revert where they previously returned a value, so this is app-hash-breaking. Covered by the extended
TestExtractAsUint256.