Skip to content

feat(sei-cosmos): add string limits#3532

Open
arajasek wants to merge 1 commit into
mainfrom
asr/limits
Open

feat(sei-cosmos): add string limits#3532
arajasek wants to merge 1 commit into
mainfrom
asr/limits

Conversation

@arajasek
Copy link
Copy Markdown
Contributor

@arajasek arajasek commented Jun 2, 2026

Describe your changes and provide context

Sanity check and early fail.

Testing performed to validate your change

@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 2, 2026

PR Summary

Low Risk
Tightens input validation on parsing only; legitimate on-chain values remain far below these limits, with a small chance of rejecting pathological or malformed oversized strings earlier.

Overview
Adds early length checks before parsing numeric strings into big.Int / SDK types, so oversized inputs fail fast instead of going through full parse paths.

The JSON precompile extractAsUint256 now rejects string values longer than 100 characters before decimal big.Int conversion. NewDecFromStr applies the same 100-character cap. Int parsing via unmarshalText and Uint binary Unmarshal already used 100; this PR extends limits to newIntegerFromString (300 for NewIntFromString) and ParseUint (300), aligning string-entry points with defensive bounds described in the PR as a sanity check.

Reviewed by Cursor Bugbot for commit 8d9eccc. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 3, 2026, 1:07 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.27%. Comparing base (2151ba0) to head (8d9eccc).

Files with missing lines Patch % Lines
sei-cosmos/types/int.go 0.00% 2 Missing and 2 partials ⚠️
precompiles/json/json.go 0.00% 1 Missing and 1 partial ⚠️
sei-cosmos/types/uint.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3532      +/-   ##
==========================================
- Coverage   59.12%   58.27%   -0.86%     
==========================================
  Files        2213     2140      -73     
  Lines      182814   174441    -8373     
==========================================
- Hits       108096   101662    -6434     
+ Misses      64993    63729    -1264     
+ Partials     9725     9050     -675     
Flag Coverage Δ
sei-chain-pr 86.62% <20.00%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/types/decimal.go 87.40% <100.00%> (+0.06%) ⬆️
precompiles/json/json.go 63.55% <0.00%> (-1.22%) ⬇️
sei-cosmos/types/uint.go 84.37% <0.00%> (-1.34%) ⬇️
sei-cosmos/types/int.go 87.19% <0.00%> (-1.76%) ⬇️

... and 73 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants