-
Notifications
You must be signed in to change notification settings - Fork 930
Gloas add process_payload_attestation #8286
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: gloas-envelope-processing
Are you sure you want to change the base?
Gloas add process_payload_attestation #8286
Conversation
ead409c to
c13e42e
Compare
| iteration: usize, | ||
| spec: &ChainSpec, | ||
| ) -> Result<bool, Error> { | ||
| let effective_balance = self.get_effective_balance(index)?; |
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.
Since this is called in a loop, I wonder if it would be worth while to get the effective balance from the epoch cache rather than fetching it each time? To do that, you'd have to ensure the epoch cache is initialized. You could look into this or you could leave a TODO here for later.
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.
Analysis:
The epoch cache is a singleton per each BeaconState instance. It gets initialized anytime we have a state transition as to ensure we're always getting fresh validator balances. A few places it's initialized:
- start of every per block processing
- start of every per epoch processing
build_all_cacheswhen loading state from disk- during block production's
produce_partial_beacon_block
compute_balance_weighted_acceptance is nested in compute_balance_weighted_selection, which will be called post-gloas by:
compute_proposer_indices(11 call sites)get_next_sync_committee_indices(4 call sites)get_ptc(1 so far)
since cargo nextest run isn't applicable to gloas yet, we can't simply try to use epoch cache to get validator balances during compute_balance_weighted_acceptance and see what fails, so I think a TODO is the right approach for now. I'm open to other ideas as well. From investigating a few call sites of compute_proposer_indices, it seems there's a few places we'd need to initialize the epoch cache for this optimization to work.
add todo in fab18e7. lmk if is all good!
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.
looks good to me!
|
you may need to rebase this against the latest |
fab18e7 to
7573ba9
Compare
|
@ethDreamer, rebased! should be all set |
7573ba9 to
6f8f6fc
Compare
Changes per spec
process_payload_attestationget_indexed_payload_attestationis_valid_indexed_payload_attestationget_ptccompute_balance_weighted_selectioncompute_balance_weighted_acceptancecompute_proposer_indicesget_next_sync_committee_indicesprocess_operationsHow This Works
CL blocks will now contain payload attestations that are collected from PTC members from the previous slot. The payload attestations indicate whether the payload envelope and blobs arrived by the PTC deadline. During block processing, we will now check over the payload attestations to ensure they're valid. Hence, this PR introduces
process_payload_attestationto do just that.Since a payload attestation to validate includes a
Bitvectorof sizePTC_SIZE, we need to map each1bit to the ptc committee member from the previous slot in order to validate their signatures. This is accomplished via introducing or modifying the helpers listed above.@ethDreamer