-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: upstream trace formatting from Foundry #38
Conversation
src/tracing/mod.rs
Outdated
@@ -391,7 +398,7 @@ impl TracingInspector { | |||
|
|||
// The gas cost is the difference between the recorded gas remaining at the start of the | |||
// step the remaining gas here, at the end of the step. | |||
step.gas_cost = step.gas_remaining - self.gas_inspector.gas_remaining(); | |||
// step.gas_cost = step.gas_remaining - self.gas_inspector.gas_remaining(); |
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.
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.
hard to find what's happening inside revm here
but this here would also overflow if nut saturating:
unclear why, I assume it must have something to do with a RETURN,
because this overflow happens after a call ended (call_end
)
any ideas @rakita
@DaniPopes I think for now we can just saturate, even if not accurate
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.
call_end returned the gas that is not spend to the caller after sub call get returned.
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.
But with loop calls this behaviour is changed. It should not be effected. So overflow can only happen is step_end has more remaining_gas
than step
and step is always first called.
src/tracing/mod.rs
Outdated
@@ -391,7 +398,7 @@ impl TracingInspector { | |||
|
|||
// The gas cost is the difference between the recorded gas remaining at the start of the | |||
// step the remaining gas here, at the end of the step. | |||
step.gas_cost = step.gas_remaining - self.gas_inspector.gas_remaining(); | |||
// step.gas_cost = step.gas_remaining - self.gas_inspector.gas_remaining(); |
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.
hard to find what's happening inside revm here
but this here would also overflow if nut saturating:
unclear why, I assume it must have something to do with a RETURN,
because this overflow happens after a call ended (call_end
)
any ideas @rakita
@DaniPopes I think for now we can just saturate, even if not accurate
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.
ok with this although we initially said we shouldnt :p
Will need a follow-up to add the "decoded" fields.
Ref #14