-
Notifications
You must be signed in to change notification settings - Fork 21.7k
core/state, core/tracing: new state update hook #33490
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
base: master
Are you sure you want to change the base?
Conversation
672b701 to
752e16a
Compare
7df337b to
1d415b4
Compare
add statesize tracer create file debug log deal with genesis debug logs fix storage bytes fix storage fix storage 2 Revert "fix storage 2" This reverts commit cfbefaa. Revert "fix storage" This reverts commit 62a4189. Revert "fix storage bytes" This reverts commit 1b42707. fix storage 3 remove debug logs remove lint lint chore revert lint fix lint fix nil add depth count debug depth created and deleted nodes
ab2f926 to
abbe71b
Compare
core/tracing/hooks.go
Outdated
| type CodeChange struct { | ||
| Hash common.Hash | ||
| Code []byte | ||
| Exists bool // true if the code already deployed before |
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.
We should may be also expose the original value of the deployed code.
Originally the code is immutable and will never be changed since the deployment. With EIP-7702, it's possible to re-deploy the delegation.
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.
added
|
Maybe I wasn't being clear. The |
Description
Add a new
OnStateUpdatehook which gets invoked after state is committed.Rationale
For our particular use case, we need to obtain the state size metrics at every single block when fuly syncing from genesis. With the current state sizer, whenever the node is stopped, the background process must be freshly initialized. During this re-initialization, it can skip some blocks while the node continues executing blocks, causing gaps in the recorded metrics.
Using this state update hook allows us to customize our own data persistence logic, and we would never skip blocks upon node restart.
The
statesizetracer shows how the hook is used. Will remove once this PR is ready for merging.