Add IL committee duties polling to the VC - #9799
Conversation
…anaged validators
| /// Returns the epoch's dependent root alongside the duties for local validators who have | ||
| /// IL committee assignments at the given slot, or `None` if the duties for the slot's epoch | ||
| /// have not been downloaded yet. | ||
| pub fn get_il_duties_for_slot( |
There was a problem hiding this comment.
One thing to keep in mind for the BN endpoint follow-up: get_inclusion_list_committee fills all 16 positions with indices[i % len(indices)], so if there are fewer than 16 members in a slot, a validator can end up with multiple positions. The spec's assignment helper handles this by using in and returning a single slot.
I think the endpoint should dedupe by validator index as well, otherwise we could return the same duty more than once and end up publishing duplicate ILs for the slot.
There was a problem hiding this comment.
Good catch! Yes, we're deduping by validator index on the endpoint side as well. I have this already implemented and tested in the follow-up PR
| #[serde(with = "serde_utils::quoted_u64")] | ||
| pub validator_index: u64, | ||
| pub slot: Slot, | ||
| pub inclusion_list_committee_root: Hash256, |
There was a problem hiding this comment.
inclusion_list_committee_root looks stale to me. consensus-specs#5513 replaced it with dependent_root on the container, and consensus-specs#5544 removed committee roots from the IL flow altogether. The spec's assignment helper just returns Optional[Slot].
The beacon-APIs PR still has this as a required field, but it was last updated in July, so it predates both of those changes. I think we should update it there and drop it here, since DutiesResponse already has the dependent_root the producer needs.
There was a problem hiding this comment.
Yes, totally agree here. I was thinking about doing this as well while implementing, but I was reluctant to make the change without the spec changing first. Just removed it in e93dd6a and pointed this out in the spec PR
Issue Addressed
This PR adds polling of inclusion list committee duties to the VC per spec. This is part of adding FOCIL support in the Heze fork.
Proposed Changes
duties_serviceto spawn a dedicated IL duties polling task. This only spawns when the Heze fork is scheduled.heze_fork_epoch - 1epoch.dependent_rootis different than the cached one.dependent_rootthey were computed against, and they are fully replaced when the dependent root changes.POST validator/duties/inclusion_list/{epoch}, per beacon api spec.Additional Info