# Week 15 This week I began work on the issue [Implement /eth/v1/validator/sync_committee_subscriptions](https://github.com/ReamLabs/ream/issues/236). According to the [Beacon API spec for this endpoint](https://github.com/ethereum/beacon-APIs/blob/master/apis/validator/sync_committee_subscriptions.yaml), the endpoint enables validator clients to subscribe validator indices to specific sync committee subnets so they can publish and receive sync committee messages. To understand how it should work in detail, I reviewed how this endpoint was built in the Lighthouse and Grandine clients. ## Lighthouse - **Request processing** Lighthouse registers each validator with `BeaconChain::validator_monitor` and enqueues `ValidatorSubscriptionMessage::SyncCommitteeSubscribe` via the bounded validator-subscription channel. - **Task scheduling** If the channel is saturated, the handler returns an HTTP 500 and logs a warning about overload. - **Network layer** It converts the message into `Subscription::SyncCommittee` items and forwards them. - **Subnet management** It schedules gossip subscriptions, ENR updates, and peer discovery per sync subnet until `until_epoch`. Repeated requests extend existing expirations; expired or invalid times are skipped with warnings. - **Ongoing maintenance** It maintains active sync subscriptions, issues `SubnetServiceMessage` events (`Subscribe`, `DiscoverPeers`, `EnrAdd`, later `Unsubscribe`/`EnrRemove`), and leverages `HashSetDelay` timers to drop subnets after duties finish. ## Grandine - **Request processing** It computes the current epoch from `controller.slot()`, then emits `ToSubnetService::UpdateSyncCommitteeSubscriptions(current_epoch, subscriptions)` on the shared channel. - **Task scheduling** The handler routes the message to `update_sync_committee_subscriptions()`, which forwards the epoch and subscriptions to `SyncCommitteeSubnets::update()`. That method merges expiration epochs per subnet, determines whether to subscribe, unsubscribe, or trigger peer discovery, and sends the corresponding action to the P2P layer. - **Subnet management** It schedules peer discovery, translates subscriptions into gossip mesh changes, and keeps the node’s ENR aligned with current subnet memberships. - **Ongoing maintenance** `SubnetService::on_slot()` runs every slot to expire outdated sync committee entries and retrigger discovery or subscription actions as needed, keeping peer connectivity healthy over time. ## Resources [Lighthouse: Ethereum consensus client](https://github.com/sigp/lighthouse) [Grandine: A fast and lightweight Ethereum consensus client](https://github.com/grandinetech/grandine)