-
Notifications
You must be signed in to change notification settings - Fork 960
Gloas vc ptc duty #8338
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-validator
Are you sure you want to change the base?
Gloas vc ptc duty #8338
Conversation
03fcda9 to
ec2d8aa
Compare
6c3fa35 to
807ba02
Compare
807ba02 to
e9a1c2c
Compare
I don't believe this is correct. Have a look at def get_ptc(state: BeaconState, slot: Slot) -> Vector[ValidatorIndex, PTC_SIZE]:
"""
Get the payload timeliness committee for the given ``slot``.
"""
epoch = compute_epoch_at_slot(slot)
seed = hash(get_seed(state, epoch, DOMAIN_PTC_ATTESTER) + uint_to_bytes(slot))
indices: List[ValidatorIndex] = []
# Concatenate all committees for this slot in order
committees_per_slot = get_committee_count_per_slot(state, epoch)
for i in range(committees_per_slot):
committee = get_beacon_committee(state, slot, CommitteeIndex(i))
indices.extend(committee)
return compute_balance_weighted_selection(
state, indices, seed, size=PTC_SIZE, shuffle_indices=False
)The committee selection appears constant for the same seed, and the seed is constant over |
|
ohhh you just mean that you check the cache every slot to ensure we have the same dependent root. |
|
|
||
| type AttesterMap = HashMap<PublicKeyBytes, HashMap<Epoch, (DependentRoot, DutyAndProof)>>; | ||
| type ProposerMap = HashMap<Epoch, (DependentRoot, Vec<ProposerData>)>; | ||
| type PtcMap = HashMap<Epoch, (DependentRoot, HashMap<PublicKeyBytes, PtcDuty>)>; |
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.
If the beacon node only returns duties for pubkeys that this validator custodies, then this should probably just be a
HashMap<Epoch, (DependentRoot, Vec<PtcDuty>)>
as this Vec will almost always be quite small and iterating through it will be fast
Changes
How This Works
Implemented in the PR
duties_servicewill now spawn a background polling task for the current and next epoch to check whether any of the registered validators are in a ptc committee. Since re-org is possible, we also poll every slot. The beacon node querying is performed by new request endpointPOST validator/duties/ptc/{epoch}per beacon api spec.To save on bandwidth similar to attestation committee polling, the ptc polling will make a tiny initial requests to learn the
dependent_root, compare with the cacheddependent_root, and only fetch full duties for the epoch if the root has changed (or if the root is unknown like for a new epoch). Old duties are pruned based onHISTORICAL_DUTIES_EPOCHS.Todo
get_ptchelper, but thewarpimplementation still needs to be complete as to send the response to the VC@ethDreamer
@eserilev