-
Notifications
You must be signed in to change notification settings - Fork 21k
core/vm: introduce a tracer wrapper #32273
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: master
Are you sure you want to change the base?
Conversation
you mean setting the |
340fd66
to
4297593
Compare
Yeap, I was meaning that. But I replaced that with a different approach that uses generics now. |
In order to measure the impact of this change in a real-world benchmark, we need to introduce the |
Of course, I will follow up with that. But note that I don't see this solely as a performance optimization but something that I hope will make further optimizations (like #32160) possible with less friction. |
4297593
to
5fac41e
Compare
Tested with this diff diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go
index 70ad4470d..e6d9eb156 100644
--- a/core/vm/interpreter.go
+++ b/core/vm/interpreter.go
@@ -202,7 +202,7 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool) (
gasCopy uint64 // for EVMLogger to log gas remaining before execution
logged bool // deferred EVMLogger should ignore already logged steps
res []byte // result of the opcode execution function
- debug = in.evm.Config.Tracer != nil
+ debug = in.evm.Config.Tracer != nil && tracingEnabled[TracingDisabled]()
)
// Don't move this deferred function, it's placed before the OnOpcode-deferred method,
// so that it gets executed _after_: the OnOpcode needs the stacks before
|
to clean up the callsites a little and allow compile time disabling of tracing.
5fac41e
to
f6643b6
Compare
to clean up the callsites a little and allow compile time disabling of tracing. The generic can be bubbled up to the
vm.EVM
andvm.EVMInterpreter
to allow traced and not-traced versions of them.