-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Feature] - Store Only Blinded Beacon Blocks Post-Merge #11010
Conversation
@@ -537,6 +537,27 @@ func (s *Service) InsertSlashingsToForkChoiceStore(ctx context.Context, slashing | |||
} | |||
} | |||
|
|||
func getBlockPayloadHash(blk interfaces.BeaconBlock) ([32]byte, error) { |
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.
This function needed edits to be future-proof. That is, it should be able to deal with blocks that have an execution payload or a payload header (blinded blocks)
…sm into feature-blinded-blocks
Some optimistic sync scenarios break here |
@@ -68,7 +68,7 @@ type EngineCaller interface { | |||
ExchangeTransitionConfiguration( | |||
ctx context.Context, cfg *pb.TransitionConfiguration, | |||
) error | |||
ExecutionBlockByHash(ctx context.Context, hash common.Hash) (*pb.ExecutionBlock, error) | |||
ExecutionBlockByHash(ctx context.Context, hash common.Hash, withTxs bool) (*pb.ExecutionBlock, error) |
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.
I know we don't like bool flag as argument but I think it's fine here
Co-authored-by: terencechain <terence@prysmaticlabs.com>
…sm into feature-blinded-blocks
@@ -123,6 +121,10 @@ var ( | |||
Name: "enable-gossip-batch-aggregation", | |||
Usage: "Enables new methods to further aggregate our gossip batches before verifying them.", | |||
} | |||
EnableOnlyBlindedBeaconBlocks = &cli.BoolFlag{ |
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 not be exported?
EnableOnlyBlindedBeaconBlocks = &cli.BoolFlag{ | |
enableOnlyBlindedBeaconBlocks = &cli.BoolFlag{ |
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.
@terencechain it's used in a DB method that tells the user via a log to remove the flag if they want to resync full blocks. Without exporting it, i would have to hardcode the flag name as a string, which can change
What type of PR is this?
What does this PR do? Why is it needed?
In a design document here, we outline how important it is that Prysm only stores blinded beacon blocks post-merge in the database.
if we do not have this feature, we foresee the storage requirements of Prysm growing significantly over time. Today, the avg Ethereum block size is 82Kb. Assuming we get a block every 10 seconds, this means 492Kb per minute, or 29.52 Mb per hour. Given there are 8760 hours per year, this could amount to 8760*29.52Mb = 258Gb per year that needs to be stored in Geth and in Prysm. It is unreasonable to store this same data twice, which is why this feature is important for us to ship.
https://etherscan.io/chart/blocksize see here for avg blocksize data at the time of writing, on July 5th, 2022.
This PR adds a feature flag
--enable-only-blinded-beacon-blocks
which stores Bellatrix beacon blocks as blinded format in our database. This will change our behavior with p2p and API requests to reconstruct full Bellatrix blocks from blinded format.Which issues(s) does this PR fix?
Fixes #10589