Skip to content

feat: add aggregated attestation inclusion distance#610

Merged
barnabasbusa merged 1 commit intomasterfrom
feat/attestation-inclusion-distance
Mar 18, 2026
Merged

feat: add aggregated attestation inclusion distance#610
barnabasbusa merged 1 commit intomasterfrom
feat/attestation-inclusion-distance

Conversation

@barnabasbusa
Copy link
Copy Markdown
Collaborator

@barnabasbusa barnabasbusa commented Mar 18, 2026

Summary

Adds aggregated attestation inclusion distance to Dora, computed exclusively from cached blocks (last 2 epochs) — no attestation database index required.

  • New getValidatorInclusionDistance on the in-memory activity cache returns attestation count and total delay for the last N epochs without any DB queries
  • Individual validator page — new "Avg. Inclusion Distance" row in the main info card, colour-coded green (≤1.01) / yellow (≤1.3) / red (>1.3)
  • Validator summary page — fifth overview card alongside Validators / Total Effective Balance / Online Stake / Network Health; "Avg. Inclusion Dist." column added to both EL and CL client breakdown tables, with fixed column widths so both tables stay aligned
Screenshot 2026-03-18 at 11 34 13

Test plan

  • Visit /validators/summary — confirm "Avg. Inclusion Distance" card appears in the overview row alongside the existing four cards
  • Confirm colour coding: green for ≤1.01, yellow for ≤1.3, red for >1.3
  • Confirm EL and CL breakdown tables both show "Avg. Inclusion Dist." column with consistent column widths
  • Visit /validator/{index} for an active validator — confirm "Avg. Inclusion Distance" row appears in the info card
  • Confirm value is absent (shown as -) for pending/never-active validators
  • Restart with INDEXER_IN_MEMORY_EPOCHS=2 and verify only cached blocks are used (no DB attestation queries)

🤖 Generated with Claude Code

Adds average attestation inclusion distance (based on cached blocks only,
last 2 epochs) to the individual validator page and the validator summary
page, broken down by EL/CL client combination.

- New getValidatorInclusionDistance() on the activity cache returns
  attestation count and total delay for the last N epochs without
  touching the database
- Exposed through Indexer and ChainService layers
- Validator detail page shows avg inclusion distance in the main info
  section (coloured green ≤1.01, yellow ≤1.3, red >1.3)
- Validator summary page adds a 5th overview card and an
  "Avg. Inclusion Dist." column to both EL and CL breakdown tables,
  with matching fixed-width columns so both tables stay aligned

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@barnabasbusa barnabasbusa requested a review from pk910 March 18, 2026 10:35
@barnabasbusa barnabasbusa merged commit 4b05c62 into master Mar 18, 2026
2 checks passed
@barnabasbusa barnabasbusa deleted the feat/attestation-inclusion-distance branch March 18, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants