Skip to content

fix(inspector): clamp negative EIP-3155 refund to zero - #3872

Open
cuiweixie wants to merge 1 commit into
bluealloy:mainfrom
cuiweixie:fix/eip3155-clamp-negative-refund
Open

fix(inspector): clamp negative EIP-3155 refund to zero#3872
cuiweixie wants to merge 1 commit into
bluealloy:mainfrom
cuiweixie:fix/eip3155-clamp-negative-refund

Conversation

@cuiweixie

Copy link
Copy Markdown
Contributor

Summary

  • Clamp refunded with .max(0) before casting to u64 in the EIP-3155 tracer.
  • A negative i64 refund previously wrapped to a huge unsigned value in the JSON output; this matches the existing state_gas clamp.

Test plan

  • cargo nextest run -p revm-inspector
  • cargo clippy --workspace --all-targets --all-features

@codspeed-hq

codspeed-hq Bot commented Aug 19, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 218 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing cuiweixie:fix/eip3155-clamp-negative-refund (c3cb859) with main (8ca4052)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Casting a negative i64 refund to u64 wraps to a huge value in the tracer output; clamp like state_gas so the JSON field stays a valid unsigned counter.
@cuiweixie
cuiweixie force-pushed the fix/eip3155-clamp-negative-refund branch from 2ce4828 to c3cb859 Compare August 27, 2026 23:42
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