Skip to content

Gloas vc ptc duty - #8338

Merged
mergify[bot] merged 9 commits into
sigp:unstablefrom
shane-moore:gloas-vc-ptc-duty
Apr 16, 2026
Merged

Gloas vc ptc duty#8338
mergify[bot] merged 9 commits into
sigp:unstablefrom
shane-moore:gloas-vc-ptc-duty

Conversation

@shane-moore

@shane-moore shane-moore commented Oct 30, 2025

Copy link
Copy Markdown
Member

Changes

  • added polling of ptc duties to the VC per spec

How This Works

  • The VC is currently checking whether one of its registered validators are in a voting committee, such as sync or attestation, or if they are the proposer for a slot. With epbs, it's possible for a validator to also be in a ptc committee for at most one slot of the epoch. More context on how validators are selected to be in a ptc was discussed on discord.

Implemented in the PR

duties_service will 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 endpoint POST 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 cached dependent_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 on HISTORICAL_DUTIES_EPOCHS.

Todo

  • add tests noted in the diffs
  • create beacon node (server side) response that will send the ptc duties to the VC. Some of this work has already been done in other PR's such as the get_ptc helper, but the warp implementation still needs to be complete as to send the response to the VC

@ethDreamer
@eserilev

@chong-he chong-he added the gloas label Nov 3, 2025
@shane-moore
shane-moore changed the base branch from gloas-envelope-processing to gloas-validator December 2, 2025 02:13
@shane-moore
shane-moore force-pushed the gloas-vc-ptc-duty branch 4 times, most recently from 807ba02 to e9a1c2c Compare December 18, 2025 02:29
@ethDreamer

Copy link
Copy Markdown
Member

Since re-org is possible, we also poll every slot.

I don't believe this is correct. Have a look at get_ptc()

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 MIN_SEED_LOOKAHEAD = 1 epoch

@ethDreamer

Copy link
Copy Markdown
Member

ohhh you just mean that you check the cache every slot to ensure we have the same dependent root.

Comment thread validator_client/validator_services/src/duties_service.rs Outdated
@michaelsproul michaelsproul added the val-client Relates to the validator client binary label Jan 20, 2026
@michaelsproul michaelsproul mentioned this pull request Jan 20, 2026
40 tasks
@eserilev
eserilev changed the base branch from gloas-validator to unstable February 3, 2026 03:07
@eserilev eserilev added the ready-for-review The code is ready for review label Apr 15, 2026

@eserilev eserilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mergify

mergify Bot commented Apr 15, 2026

Copy link
Copy Markdown

Some required checks have failed. Could you please take a look @shane-moore? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Apr 15, 2026

@pawanjay176 pawanjay176 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a question

Comment thread validator_client/validator_services/src/duties_service.rs Outdated
@eserilev eserilev removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label Apr 16, 2026
@eserilev eserilev added the ready-for-merge This PR is ready to merge. label Apr 16, 2026
@eserilev

Copy link
Copy Markdown
Member

@mergify requeue

@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Required conditions to enter a queue
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue rule default]:
      • #approved-reviews-by >= 1
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • check-success=license/cla
      • check-success=target-branch-check
      • label!=do-not-merge

@mergify mergify Bot added the queued label Apr 16, 2026
@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 29 minutes 45 seconds in the queue, including 28 minutes 8 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • check-success=local-testnet-success
  • check-success=test-suite-success

@mergify

mergify Bot commented Apr 16, 2026

Copy link
Copy Markdown

requeue

☑️ This pull request is already queued

mergify Bot added a commit that referenced this pull request Apr 16, 2026
@mergify
mergify Bot merged commit 794718e into sigp:unstable Apr 16, 2026
39 checks passed
@mergify mergify Bot removed the queued label Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gloas ready-for-merge This PR is ready to merge. val-client Relates to the validator client binary

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants