-
Notifications
You must be signed in to change notification settings - Fork 63
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 TracerConfig Support and Implement Contract Tracer #683
base: dev-upgrade
Are you sure you want to change the base?
Conversation
c4de14a
to
2455b29
Compare
eth/tracers/native/contract.go
Outdated
|
||
func (t *contractTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, gas uint64, value *big.Int) { | ||
if create || t.config.OpCode == "CALL" { | ||
storeOpCode(t, env, to, input) |
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.
Can you please explain what this is 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.
If we only need to return the code without specifying an opcode, we should record the contract address here.
To find the CALL
opcode, we should search within CaptureState
. The CALL
opcode here isn’t part of the contract’s internal opcodes. I was confused about this but have now corrected it.
81a7f0c
to
cd73ea7
Compare
3694dcb
to
138d0ae
Compare
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.
Looks good to me. Great job on this!
138d0ae
to
f03ca1c
Compare
55dbfae
to
3d01f43
Compare
3d01f43
to
35a2f98
Compare
Proposed changes
Add
TracerConfig
to Existing Tracer:TracerConfig
option, primarily foronlyTopCall
, to provide more control over which calls are traced.Implement
ContractTracer
:ContractTracer
to locate created contracts and return their addresses.Example
Request
Response
Request
Response
Request
Response
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅
in the boxes that applyImpacted Components
Which part of the codebase this PR will touch base on,
Put an
✅
in the boxes that applyChecklist
Put an
✅
in the boxes once you have confirmed below actions (or provide reasons on not doing so) that