docs: add slots and intervals chapter - #578
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
🤖 Codex Code Review
Other than those doc-precision issues, I didn’t find code-correctness, security, or consensus-behavior regressions in this PR. The 5-interval timing model and the interval-0/4 promotion points match the current implementation. Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
🤖 Claude Code ReviewReview: PR 578 — docs: add slots and intervals chapterScope: Documentation-only ( Verification performedI cross-checked the PR's claims against the actual implementation rather than trusting the PR description's table:
Every claim I checked held up against the current source. No inaccuracies, stale references, or broken cross-links found. Observations
No issues to flag. This is a well-researched, source-verified documentation update. Automated review by Claude (Anthropic) · sonnet · custom prompt |
🗒️ Description / Motivation
The book explained what the consensus algorithms do (3SF-mini, LMD-GHOST) but never when
each duty is due. This adds a Slots and Intervals chapter documenting the 5-interval
structure of a slot: who acts in each interval, what they publish, and why the intervals are
ordered the way they are.
Writing it surfaced that
lmd_ghost.md's ethlambda scheduling section was stale: it stilldescribed 4 intervals of 1 second with the old duty order (safe target at 2, end of slot at
3) and named the long-gone
LatestNewAttestations/LatestKnownAttestationstables. Linkingthe two documents would have made them contradict each other, so that section is updated here
too.
What Changed
docs/slots_and_intervals.md(new) — duty table (interval / offset / who acts / what itpublishes), slot timeline diagram, and one section per interval. Each section covers the
mechanics plus the reasoning: why aggregation earns its own interval, what the safe target's
two-thirds threshold buys, why promotion is staged. ethlambda-specific behaviour lives in
blockquotes, following the convention the other consensus docs use.
docs/SUMMARY.md— new first chapter of the Consensus section, since it is theprerequisite for the other two.
docs/introduction.md— Consensus bullet now leads with it.docs/lmd_ghost.md— interval grid corrected to 5 × 800 ms, duty order and detailedsequence updated (aggregation at 2, safe target at 3, end of slot at 4), promotion points
corrected to intervals 0 and 4, and the attestation-pipeline blockquote now names the
in-memory
new_payloads/known_payloadsbuffers instead of the removed tables.Correctness / Behavior Guarantees
No code changes: documentation only.
Every claim was checked against the source rather than against the older docs:
INTERVALS_PER_SLOT,MILLISECONDS_PER_INTERVALincrates/common/types/src/constants.rsSlotIntervaland the tick dispatch incrates/blockchain/src/lib.rsstore::on_tickincrates/blockchain/src/store.rsslot % num_validatorscurrent_proposerincrates/blockchain/state_transition/src/lib.rs⌈2V/3⌉threshold; head: known votes, no thresholdupdate_safe_target/update_headincrates/blockchain/src/store.rsMAX_ATTESTATIONS_DATAincrates/common/types/src/block.rsvalidator_index % attestation_committee_countcrates/net/p2p/src/gossipsub/handler.rsblock/attestation_{id}/aggregationcrates/net/p2p/src/gossipsub/messages.rsTests Added / Run
make docs— clean, including themdbook-linkcheck2pass (warning-policy = "error").id=in the rendered HTML.eyeballing unreliable).
Related Issues / PRs
None.
✅ Verification Checklist
make fmt— N/A, no Rust touchedmake lint(clippy with-D warnings) — N/A, no Rust touchedmake test(cargo test --workspace --profile release-fast) — N/A, no Rust touched