-
Notifications
You must be signed in to change notification settings - Fork 450
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
Fix Stylus Tracer in v1.14.0 Merge #2725
Fix Stylus Tracer in v1.14.0 Merge #2725
Conversation
system_tests/program_gas_test.go
Outdated
@@ -385,6 +390,10 @@ func evmOpcodesGasUsage(ctx context.Context, rpcClient rpc.ClientInterface, tx * | |||
op := vm.StringToOp(result.StructLogs[i].Op) | |||
gasUsed := uint64(0) | |||
if op == vm.CALL || op == vm.STATICCALL || op == vm.DELEGATECALL || op == vm.CREATE || op == vm.CREATE2 { | |||
if result.StructLogs[i].GasCost == 0 { | |||
// ignore mock call emitted by arbos |
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 don't think we want to inject these logs into normal EVM execution, unless a precompile call was part of execution or similar.
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.
Yes, that makes sense. These happen at the end of the execution, regardless of whether the contract was an EVM contract or a stylus one. They were not being injected before geth 1.14. I wonder why it changed.
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.
the extra call logged comes from arbos/util/transfer.go TransferBalance: info.MockCall.
It seems like a problem in the condition (if/else) but I want to learn more about the code there.
arbos/util/transfer.go
Outdated
@@ -36,7 +36,7 @@ func TransferBalance( | |||
return errors.New("tracing scenario mismatch") | |||
} | |||
|
|||
if scenario != TracingDuringEVM { | |||
if scenario != TracingDuringEVM && tracer.CaptureArbitrumTransfer != 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.
that && makes the "else" branch be taken when it previously wasn't
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.
LGTM, though one question on if a change is still necessary
@@ -127,6 +119,9 @@ func (t *stylusTracer) OnEnter(depth int, typ byte, from common.Address, to comm | |||
if t.interrupt.Load() { | |||
return | |||
} | |||
if depth == 0 { | |||
return |
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.
Is this necessary now that @tsahee's fix was applied?
…gneul/fix-update-gethpin-v1.14.0
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.
LGTM. It'd be good to figure out why the if statement is required but it seems to work and is definitely an improvement.
fixes NIT-2881