feat(api): attester duties, committees, and bulk validator status endpoints - #823
Merged
Conversation
… endpoints
Add three general-purpose read APIs that expose data Dora already computes
internally, so external tools can resolve attester committees and validator
status without a beacon node:
- GET /api/v1/epoch/{epoch}/duties - attester committees per slot for an epoch
- GET /api/v1/slot/{slot}/committees - attester committees for a single slot
- GET|POST /api/v1/validators/status - bulk validator status (up to 10k indices)
Also expose `slashed` and `withdrawable_epoch` on GET /api/v1/validators.
Committees are served from in-memory epoch stats with a blockdb fallback (no
beacon-node call). Duties return 404 when unavailable for an epoch so callers
can distinguish "no data" from "empty". Swagger regenerated.
APIEpochDutiesV1 called GetSlotCommittees for every slot in the epoch. On the blockdb/S3 fallback path each of those calls loads the entire epoch duties object, so a full epoch reloaded the same object once per slot (32x on mainnet). Add ChainService.GetEpochCommittees(epoch), which resolves committees for all slots from a single source read (in-memory epoch stats, or one blockdb GetEpochDuties fetch), and switch the handler to it.
barnabasbusa
approved these changes
Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three general-purpose read-only API endpoints that surface data Dora already computes internally, so external tools (validator monitors, slashers, staking dashboards) can resolve attester committees and validator status without a beacon node.
New endpoints
/api/v1/epoch/{epoch}/duties/api/v1/slot/{slot}/committees?committee=0,1,2filter)/api/v1/validators/status?indices=or{"indices":[...]})Also adds
slashedandwithdrawable_epochtoGET /api/v1/validators(APIValidatorInfo).Details
ChainService.GetSlotCommittees— in-memory epoch stats with a blockdb fallback for finalized epochs. No beacon-node call; Dora computes the shuffling locally.epoch/{epoch}/dutiesreturns 404 only when all slots lack duties, so callers can distinguish "no data" from "empty". Future epochs beyond currentEpoch+1 return 400.validators/statuscaps at 10,000 indices; missing indices are omitted. Status derived as invalidator_v1.go.startApiwith call costs and OPTIONS; swaggo annotations added anddocs/regenerated viamake api-docs.Motivation
These back the slashoor slasher (which uses Dora as its durable block/duty store), but each is a standalone general-audience explorer API.
Checks
go build,go vet,gofmt -s, andgolangci-lint run --new-from-rev=origin/masterall pass.