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
Replay blocks and generate state without sig verification #4943
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4943 +/- ##
========================================
Coverage ? 57.3%
========================================
Files ? 265
Lines ? 19800
Branches ? 0
========================================
Hits ? 11347
Misses ? 6849
Partials ? 1604 |
// ExecuteStateTransitionStateGen applies state transition on input historical state and block for state gen usages. | ||
// There's no signature verification involved given state gen only works with stored block and state in DB. | ||
// If the objects are already in stored in DB, one can omit redundant signature checks and ssz hashing calculations. | ||
// WARNING: This method should not be used for new block. |
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.
Can this be private? This warning makes me a bit nervous since it is not enforced
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.
Great point. I have moved it to stategen
package and made it private
@@ -268,6 +273,7 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{ | |||
disableStrictAttestationPubsubVerificationFlag, | |||
disableUpdateHeadPerAttestation, | |||
enableByteMempool, | |||
enableStateGenSigVerify, |
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.
Add to e2e flags?
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.
Good call
…abs#4943) * New file * Add transition_stategen.go * Update ProcessBlockForStateRoot * Feature flags * Fixed tests * Gaz * Make them private * E2e flags * Gazelle Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
As profiling shows, the biggest bottle neck to regenerate a historical state is 1.) randao signature verification 2.) proposer signature verification.
Given these are historical blocks in the DB, a node should be sure the saved blocks are fully verified. This PR added
ExecuteStateTransitionStateGen
to enable a cleaner way to replay historical blocks without skip slot cache dependency and extra signature verifications