Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handling very large numbers gracefully #3491

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

petertonysmith94
Copy link
Contributor

@petertonysmith94 petertonysmith94 commented Dec 19, 2024

Release notes

In this release, we:

  • Very large number values (> Number.MAX_SAFE_INTEGER) will now be thrown when using BigNumberCoder.

Summary

  • Any number bigger than Number.MAX_SAFE_INTEGER, encoded using the BigNumber coder, could lead to malformed data. We should ensure that the numbers of MAX_SAFE_INTEGER are encoded correctly and throw an error when attempting to handle a number more than this value.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

@petertonysmith94 petertonysmith94 added the bug Issue is a bug label Dec 19, 2024
@petertonysmith94 petertonysmith94 self-assigned this Dec 19, 2024
Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:37pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:37pm
ts-docs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 5:37pm

Copy link

codspeed-hq bot commented Dec 19, 2024

CodSpeed Performance Report

Merging #3491 will degrade performances by 47.27%

Comparing ps/fix/issue-with-big-numbers (a0f983f) with master (41c72fb)

Summary

❌ 1 regressions
✅ 17 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark master ps/fix/issue-with-big-numbers Change
should successfully conduct a custom transfer between wallets (x20 times) 50.3 ms 95.4 ms -47.27%

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.33%(+0%) 69.88%(+0.04%) 74.2%(+0%) 76.34%(+0%)
Changed Files:

Coverage values did not change👌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle large number values gracefully
2 participants