Skip to content

fix: avoid integer overflow in MB→bytes conversion#2974

Open
kilavvy wants to merge 2 commits intochainwayxyz:nightlyfrom
kilavvy:patch-1
Open

fix: avoid integer overflow in MB→bytes conversion#2974
kilavvy wants to merge 2 commits intochainwayxyz:nightlyfrom
kilavvy:patch-1

Conversation

@kilavvy
Copy link

@kilavvy kilavvy commented Oct 14, 2025

Description:

  • Summary: Replace MB-to-bytes multiplications with saturating_mul and introduce MB_TO_BYTES constant in mempool.rs.
  • Why: Prevent silent u64 wrap-around in release builds that could shrink mempool size limits unexpectedly.
  • Changes:
    • Use: saturating_mul for pending/basefee/queued size limits.
    • Add: MB_TO_BYTES constant for clarity.

@kilavvy kilavvy requested a review from eyusufatik as a code owner October 14, 2025 15:25
@auto-assign auto-assign bot requested a review from jfldde October 14, 2025 15:25
@codecov
Copy link

codecov bot commented Oct 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.5%. Comparing base (0f617e2) to head (cc21f4b).

Additional details and impacted files
Files with missing lines Coverage Δ
crates/sequencer/src/mempool.rs 74.1% <100.0%> (ø)

... and 4 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.

@kilavvy kilavvy changed the title Sequencer mempool: avoid integer overflow in MB→bytes conversion fix: avoid integer overflow in MB→bytes conversion Oct 30, 2025
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