Skip to content
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

core, eth/tracer: initialize tracer statedb in CaptureStart #22333

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Feb 16, 2021

This is an alternative to #22276

  • Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on.
  • While at it, I also exposed the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracers.

@holiman holiman changed the title Tracer fixes core, eth/tracer: initialize tracer statedb in CaptureStart Feb 16, 2021
@holiman holiman requested a review from s1na February 17, 2021 09:42
eth/tracers/tracer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@s1na s1na left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using db in a tracer for both simple transfer and normal contract txes and it worked. The changes LGTM.

@karalabe karalabe modified the milestones: 1.10.0, 1.10.1 Feb 25, 2021
@karalabe karalabe modified the milestones: 1.10.1, 1.10.2 Mar 4, 2021
@holiman holiman force-pushed the tracer_fixes branch 2 times, most recently from 41afa02 to 4c1ac6a Compare March 8, 2021 09:07
@MariusVanDerWijden MariusVanDerWijden mentioned this pull request Mar 22, 2021
2 tasks
@holiman
Copy link
Contributor Author

holiman commented Mar 23, 2021

Fixed up, rebased, PTAL

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
(only thing I would say is that ScopeContext is a bit redundant, as Scope and Context mean similar things, but I don't have a better idea)

@holiman
Copy link
Contributor Author

holiman commented Mar 25, 2021

(only thing I would say is that ScopeContext is a bit redundant, as Scope and Context mean similar things, but I don't have a better idea)

In my mind, 'Scope' means the current call-scope, which is not per-transaction, but per CALL in the evm sense.
And Context means the contextual things.

So ScopeContext means "The contextual things related to a certain call-scope: like stack and memoy"

@holiman holiman merged commit 0fda25e into ethereum:master Mar 25, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
…pturestart (ethereum#22333)

Fixes the CaptureStart api to include the EVM, thus being able to set the statedb early on. This pr also exposes the struct we used internally in the interpreter to encapsulate the contract, mem, stack, rstack, so we pass it as a single struct to the tracer, and removes the error returns on the capture methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants