-
Notifications
You must be signed in to change notification settings - Fork 810
refactor: add gas refund tracking to journal and host interfaces #2877
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
base: main
Are you sure you want to change the base?
Conversation
- 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.
CodSpeed Performance ReportMerging #2877 will not alter performanceComparing Summary
|
/// refund values being visible during individual call frame execution. | ||
#[inline] | ||
pub fn record_refund(&mut self, refund: i64) { | ||
self.refund += refund; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…g/stackoverflow etc.
This looks okay now, will see to merge it a little bit later so it does not affect downstream inspectors in the next release. |
close #2145
record_refund
,refund
, andreset_refund
methods in theJournalTr
trait to manage gas refunds at the journal level.Host
trait to include arecord_refund
method for recording gas refunds.DummyHost
andJournalInner
.