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: extends tracing.Hooks with OnSystemCallStartV2 #30786

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

Conversation

nebojsa94
Copy link
Contributor

This PR extends the Hooks interface with a new method, OnSystemCallStartV2, which takes VMContext as its parameter.

Motivation

By including VMContext as a parameter, the OnSystemCallStartV2 hook achieves parity with the OnTxStart hook in terms of provided insights. This alignment simplifies the inner tracer logic, enabling consistent handling of state changes and internal calls within the same framework.

@holiman
Copy link
Contributor

holiman commented Nov 22, 2024

The context won't be well defined here, missing coinbase and gasprice.

		Coinbase:    evm.Context.Coinbase,
		BlockNumber: evm.Context.BlockNumber,
		Time:        evm.Context.Time,
		Random:      evm.Context.Random,
		GasPrice:    evm.TxContext.GasPrice,
		StateDB:     evm.StateDB,

As for motivation, could you please instead explain the practical reason why you want/need this? The provided motivation is a bit theoretical, imo:

By including VMContext as a parameter, the OnSystemCallStartV2 hook achieves parity with the OnTxStart hook in terms of provided insights. This alignment simplifies the inner tracer logic, enabling consistent handling of state changes and internal calls within the same framework.

@nebojsa94
Copy link
Contributor Author

Sure, I've responded in a second PR with a practical usecase
#30784 (comment)

@maoueh
Copy link
Contributor

maoueh commented Nov 26, 2024

On OnSystemCallStartV2, as the original contributor of OnSystemCall/End, I would be fine on breaking the tracing interface and adjusting the existing call to receive the extra argument. Can be bundled with other "breaking changes" that will come soon (TDD, some changes on VMContext that might lend, etc).

It's of course a personal opinion, I'm quite fine if there is a preference to keep backward compatibility and introduce a OnSystemCallStartV2 version.

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