-
Notifications
You must be signed in to change notification settings - Fork 1
feat(notebooks): add attestation buildup analysis #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
queries/attestation_buildup.py
Outdated
| FROM default.canonical_beacon_elaborated_attestation | ||
| WHERE meta_network_name = '{network}' | ||
| AND {date_filter} | ||
| AND block_slot - slot BETWEEN 1 AND 32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we limiting the inclusion time to only 32 slots?
Since EIP-7045, attestations for the first block in epoch N would have until the end of epoch N+1 to be included, meaning that the max inclusion distance is 63 slots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, this needs to be updated for EIP-7045. I'll take a stab later today.
6c124c0 to
bfe7637
Compare
Add notebook 09-attestation-buildup analyzing how validator attestations accumulate over time. For each slot, attestations can be included in blocks up to 32 slots later. This analysis shows: - Attestation inclusion CDF heatmaps by slot and epoch - Correlation with blob count and block size - Block propagation timing effects on attestation inclusion - Time series trends of network health Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
bfe7637 to
7125486
Compare
Preview Deployment🚀 Preview is ready! URL: https://observatory-staging.ethp2p.dev/pr-49/ Updated: 2026-01-30T11:55:54.425Z |
…ggregates The canonical_beacon_elaborated_attestation table stores multiple aggregate attestations per committee at different positions in the same block. These aggregates have massively overlapping validator sets (up to 98% overlap), causing sum(length(validators)) to overcount by 6-7x. Fix by using arrayUniq(arrayFlatten(groupArray(validators))) to count unique validators across all aggregates for each (slot, delay) combination. Also fixes: - Add nullif() to prevent division by zero on empty slots - Remove unused Path import - Remove unused numpy import from notebook - Fix markdown error: "Size indicates total validators" -> "block size" - Remove hardcoded blob count range "(0-6)" from markdown - Add box plot legend annotations per CLAUDE.md requirements
EIP-7045 (Deneb) extended attestation validity from 32 slots to the end of epoch N+1, giving a variable window of 32-64 slots depending on the attestation's position within its epoch. Update query to capture delays 1-64 instead of 1-32, and update notebook visualizations (heatmaps, CDF curves, summary stats) accordingly.
The canonical_beacon_elaborated_attestation table stores attestations in every block where they were included, not just the first. This caused the same validator to be counted at multiple inclusion delays, inflating totals by ~2x. Fix: Use ARRAY JOIN to explode validators, then min(block_slot) per validator to find first inclusion. Each validator is now counted exactly once at their earliest inclusion delay. Verified: Slot 13564099 now shows 99.76% at delay 1 (was 49.94%).
Adds a new notebook analyzing how validator attestations accumulate over time after the attested slot.
Features
Technical notes
First-inclusion deduplication: The
canonical_beacon_elaborated_attestationtable stores attestations in every block where they were included, not just the first. The query usesARRAY JOIN validatorswithmin(block_slot)per validator to find each validator's first inclusion, ensuring accurate CDF calculations.EIP-7045 compliance: Per EIP-7045 (Deneb), attestations can now be included through the end of epoch N+1, giving a variable inclusion window of 32-64 slots depending on the attestation's position within its epoch. The query captures delays 1-64 to reflect this extended window.