-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add native stateDiff tracer #470
Add native stateDiff tracer #470
Conversation
…ame JS stateDiff tracer to legacy one
…or both JS and Native support
eth/tracers/native: add native stateDiffTracer (draft) core/vm,eth/tracers,eth/tracers/internal/tracetest: make it compile eth/tracers/internal/tracetest/testdata/state_diff: add some tests eth/tracers/internal/tracetest/testdata/state_diff,eth/tracers/native: stateDiff
this is useful for creating tests for stateDiff tracer
…h/tracers/js/internal/tracers,eth/tracers/js,eth/tracers/logger,eth/tracers/native: remove use of CapturePreEVM for JS legacy tracers
…r stateDiff tracer
…Dies on same call
…: stateDiff handle OOG on SELFDESTRUCT
// CaptureStart implements the EVMLogger interface to initialize the tracing operation. | ||
func (t *prestateTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) { | ||
t.env = env | ||
t.create = create | ||
t.to = to | ||
|
||
t.lookupAccount(t.env.Context.Coinbase) |
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.
What's this for?
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.
So as it includes the miner's prestate for that block. Miner prestate is useful for creating stateDiff
tests. We can remove this (comment out) and use it only when needed by me.
When I will create this PR to upstream geth, I am going to question this line.
LGTM 🚀 |
This PR converts the
stateDiff
tracer from a JS tracer to a native Go tracer.