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/vm/runtime: invoke tx-end hook #30711

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Nov 1, 2024

While updating goevmlab, I noticed that the way I invoked the executions, using the core/vm/runtime helpers, I didn't get any callbacks on the tx end. This PR fixes it by invoking them.

@holiman holiman requested a review from s1na November 1, 2024 10:31
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, we could set more fields in the receipt than just the gasUsed e.g. Type, PostState, Status, ... but I don't know if thats really important. The only thing that might be is PostState imo, but that would require us to call Commit() on the passed statedb. That is something that I don't think we should do

@holiman
Copy link
Contributor Author

holiman commented Nov 4, 2024

LGTM, we could set more fields in the receipt than just the gasUsed e.g. Type, PostState, Status, ... but I don't know if thats really important.

It is not important. It's IMO a bit annoying that we need to even create this pretend-receipt. I'd rather just pass in nil, but it turns out that some tracers crash on nil-receipts.

@holiman holiman added this to the 1.14.12 milestone Nov 4, 2024
@holiman holiman merged commit 014e2b0 into ethereum:master Nov 4, 2024
3 checks passed
@holiman holiman deleted the runtime_nits branch November 4, 2024 10:39
@karalabe
Copy link
Member

karalabe commented Nov 4, 2024

In general IMO it's not the best idea to pass too much, too high level data to callbacks directly. It expands our API surface a lot and also locks them in, since all of a sudden all the types are API with guarantees; and it also makes optimizations harder because you cannot avoid computing something that a tracer depends on later.

@holiman
Copy link
Contributor Author

holiman commented Nov 4, 2024

Yep, I agree

holiman added a commit that referenced this pull request Nov 19, 2024
When using the `core/vm/runtime` helpers to execute code, callbacks for the tx end were not invoked. This change fixes it by invoking them.
zfy0701 pushed a commit to sentioxyz/go-ethereum that referenced this pull request Dec 3, 2024
When using the `core/vm/runtime` helpers to execute code, callbacks for the tx end were not invoked. This change fixes it by invoking them.
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.

3 participants