-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Clean up the VMTracer and trace events interface in TS #5429
Conversation
This gives a more granular access and doesn't require the callers to necessarily be concerned with details they might not be interested in.
These are already included in `BaseMessageTrace`.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
LGTM!
One nitpick
packages/hardhat-core/src/internal/hardhat-network/provider/provider.ts
Outdated
Show resolved
Hide resolved
Congrats, your important contribution to this open-source project has earned you a GitPOAP! GitPOAP: 2024 Hardhat Contributor: Head to gitpoap.io & connect your GitHub account to mint! Learn more about GitPOAPs here. |
Rather than defining the callbacks at the provider instantiation time for the entire lifetime of the provider, this allows for a more granular control of injecting the trace event listener (VMTracer), thus simplifying how the information flows. In the test logic, we no longer tightly couple two classes but have to keep them side by side and we can stop observing the EVM if needed, without paying the runtime cost.
While technically it's a standalone improvement, the NomicFoundation/edr#531 can nicely build on top if it as it will also allow us to conveniently observe the trace whenever needed all at once in Rust (with the Rust port of
VmTracer
in that PR); it also removes some dead code.