Skip to content

fix: prevent subtraction overflow in attestation size_reduction calc#78

Merged
avrabe merged 1 commit intomainfrom
fix/attestation-size-reduction-overflow
Apr 2, 2026
Merged

fix: prevent subtraction overflow in attestation size_reduction calc#78
avrabe merged 1 commit intomainfrom
fix/attestation-size-reduction-overflow

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

  • Fix panic in build_wsc_attestation at lib.rs:775 when fused output is larger than input
  • input_size - output_size overflows on unsigned integers (usize); convert to f64 before subtracting
  • This was the root cause of the Coverage CI failure on main

Test plan

  • test_address_rebasing_end_to_end now passes (was panicking with subtraction overflow)
  • Full test suite: 276 tests pass, 0 failures

🤖 Generated with Claude Code

When fused output is larger than input (e.g., single-component fusion),
`input_size - output_size` overflows on unsigned integers. Convert to
f64 before subtracting so the result can be negative.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit 57ad667 into main Apr 2, 2026
4 checks passed
@avrabe avrabe deleted the fix/attestation-size-reduction-overflow branch April 2, 2026 00:25
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.

1 participant