-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Flow EVM] Run tracing hooks OnTxStart
, OnTxEnd
for DryRunTransaction
#6491
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,6 +283,11 @@ func (bl *BlockView) DryRunTransaction( | |
// we need to skip nonce check for dry run | ||
msg.SkipAccountChecks = true | ||
|
||
// call tracer | ||
if proc.evm.Config.Tracer != nil && proc.evm.Config.Tracer.OnTxStart != nil { | ||
proc.evm.Config.Tracer.OnTxStart(proc.evm.GetVMContext(), tx, msg.From) | ||
} | ||
|
||
// return without committing the state | ||
txResult, err = proc.run(msg, tx.Hash(), tx.Type()) | ||
if txResult.Successful() { | ||
|
@@ -306,6 +311,13 @@ func (bl *BlockView) DryRunTransaction( | |
txResult.GasConsumed += txResult.GasRefund | ||
} | ||
|
||
// call tracer on tx end | ||
if proc.evm.Config.Tracer != nil && | ||
proc.evm.Config.Tracer.OnTxEnd != nil && | ||
txResult != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I saw that if err != nil {
return nil, err
} Besides, this is the exact same condition for both |
||
proc.evm.Config.Tracer.OnTxEnd(txResult.Receipt(), txResult.ValidationError) | ||
} | ||
|
||
return txResult, err | ||
} | ||
|
||
|
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.
I am not sure if this should be before or after adjusting the
txResult.GasConsumed
with the various buffers.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.
I think it's correct the way it is now