Skip to content

Conversation

jackwener
Copy link
Contributor

close #2145

  • Introduced record_refund, refund, and reset_refund methods in the JournalTr trait to manage gas refunds at the journal level.
  • Updated the Host trait to include a record_refund method for recording gas refunds.
  • Implemented the corresponding methods in DummyHost and JournalInner.
  • Adjusted gas handling in various components to ensure refunds are recorded correctly, adhering to EIP-3529 limits.
  • Refactored related functions in the handler and interpreter to utilize the new refund tracking system.

- Introduced `record_refund`, `refund`, and `reset_refund` methods in the `JournalTr` trait to manage gas refunds at the journal level.
- Updated the `Host` trait to include a `record_refund` method for recording gas refunds.
- Implemented the corresponding methods in `DummyHost` and `JournalInner`.
- Adjusted gas handling in various components to ensure refunds are recorded correctly, adhering to EIP-3529 limits.
- Refactored related functions in the handler and interpreter to utilize the new refund tracking system.
Copy link

codspeed-hq bot commented Aug 11, 2025

CodSpeed Performance Report

Merging #2877 will not alter performance

Comparing jackwener:refund (fb38d75) with main (012aace)

Summary

✅ 171 untouched benchmarks

/// refund values being visible during individual call frame execution.
#[inline]
pub fn record_refund(&mut self, refund: i64) {
self.refund += refund;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Journal entry for refund should be made so refund can be reverted in case of revert/oog/stackoverflow etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case of revert/oog/stackoverflow etc.

Look like these aren't covered by test.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah will ping ef testing team

@rakita
Copy link
Member

rakita commented Aug 18, 2025

This looks okay now, will see to merge it a little bit later so it does not affect downstream inspectors in the next release.

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.

Refactor: migrate from call local refund to global journal refund
2 participants