Skip to content

bug: BytesUtils.compare() Arithmetic Overflow #420

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged

bug: BytesUtils.compare() Arithmetic Overflow #420

merged 2 commits into from
Mar 18, 2025

Conversation

adraffy
Copy link
Member

@adraffy adraffy commented Mar 16, 2025

The difference int256 - int256 exceeds int256 range.

Example: type(int256).min - 1 < type(int256).min


  • change BytesUtils.compare() to fix overflow
  • add test case for maximum signed difference (caused error before)
  • to test: bun run test test/dnssec-oracle/TestSolidityTests.ts

@adraffy adraffy requested a review from Arachnid March 17, 2025 21:41
@adraffy adraffy merged commit f130873 into staging Mar 18, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants