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/tracing, core/vm: add ContractCode to the OpContext #30466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kchojn
Copy link

@kchojn kchojn commented Sep 19, 2024

Extending the OpContext interface:

  • adding ContractCode - returns the code of the contract being executed.

Previous implementation of tracing had access to the contract code in Scope, the current one does not. And it was important in the context of custom tracers(e.g., in my case 👀).

So in reference to the conversation on discord (#tracing channel), I add such functionality.

I tried to follow the current naming convention, lmk if i should fix/change something!

…e to provide access to contract code

feat(vm/interpreter.go): add ContractCode method to ScopeContext to return the code of the contract being executed
@s1na
Copy link
Contributor

s1na commented Sep 19, 2024

To add some extra context here: it is possible to get the code via statedb.GetCode but that wouldn't work for init code.

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.

LGTM.

Note to self: should add to changelog

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.

2 participants