-
Notifications
You must be signed in to change notification settings - Fork 20.9k
core,eth/tracers: don't panic in OnTxEnd if receipt is nil #30109
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
Conversation
|
d726920
to
faa87b0
Compare
Okay I see, I updated the PR to just fix 1). Thanks |
eth/tracers/logger/logger.go
Outdated
@@ -268,7 +268,9 @@ func (l *StructLogger) OnTxEnd(receipt *types.Receipt, err error) { | |||
} | |||
return | |||
} | |||
l.usedGas = receipt.GasUsed | |||
if receipt != nil { |
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'm surprised you've seen a panic here. As far as I can see in state processor either receipt is nil and error is non-nil (in which case struct logger returns) or there is a receipt.
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.
Ah you're right. The issue issue is actually that Sorry it actually wasn't a problem in the err
is redeclared.state_processor
, it's in the test runner.
faa87b0
to
4050f57
Compare
Closing this for now as my change doesn't address the issue and the current code in go-ethereum/tests/state_test_util.go Line 302 in 2d9d423
|
There are two issues currently with the tracer's
OnTxEnd
invocation instate_processor
ApplyTransactionWithEVM
.OnTxEnd
expects the receipt to be non-nil, so this causes a panic.The error fromresult
is never set into the named return valueerr
. So the error reporting forOnTxEnd
isn't really correct.This PR fixes both of these issues.
cc @s1na