feat(pipelining): complete attestations by build-slot end#22735
Draft
spalladino wants to merge 2 commits intomerge-train/spartanfrom
Draft
feat(pipelining): complete attestations by build-slot end#22735spalladino wants to merge 2 commits intomerge-train/spartanfrom
spalladino wants to merge 2 commits intomerge-train/spartanfrom
Conversation
Shifts the pipelining schedule so that proposal broadcast and attestation collection happen inside the build slot, letting the L1 submission fire at the target-slot boundary instead of trailing into it. - stdlib: PipelinedCheckpointTimingModel reserves assemble + round-trip p2p + last-block re-execution at end of slot, drops attestation grace into target slot to zero, and adds explicit early-acceptance windows for proposals and attestations. - p2p: PipeliningWindow now accepts next-slot proposals/attestations during the final seconds of the current slot (new isWithinEarly PipeliningWindow check) and pipes blockDurationMs through the libp2p validators. - Updates sequencer README and affected unit tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops the isWithinEarlyPipeliningWindow path (and its proposalEarlyWindow / attestationEarlyWindow getters and blockDurationMs plumbing): the existing main-path check `messageSlot === targetSlot || messageSlot === nextSlot` already accepts next-slot messages under both pipelining-on and pipelining-off receivers, so the early window was dead code in every realistic scenario. - Remove isWithinEarlyPipeliningWindow and the early-window interface fields. - Update JSDoc on isWithinPipeliningWindow to describe what the function actually guards (straggler messages for the previous target slot after slot rollover), now that windows are tight. - Revert blockDurationMs plumbing through ProposalValidator / CheckpointAttestationValidator / libp2p_service (no longer needed, and avoids the foot-gun where an omitted blockDurationMs silently shrank the window). - Fix README broadcast time: with assemble=1s the last block ends at T=61s and broadcast happens at T=62s, not T=61s. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Motivation
Under today's pipelining schedule, attestations for slot N's checkpoint trail into slot N+1 by
blockDuration + p2pPropagationTime(~8s with defaults), which delays the L1proposetx and pushes it toward the 3rd L1 block of the target slot. Shifting the broadcast ~8s earlier lets attestations finish by the build-slot boundary so the proposer can submit to L1 immediately at the target-slot start.Approach
Updates the pipelined timing model to reserve assembly, round-trip p2p, and last-block re-execution at the end of the build slot (rather than leaking into the target slot). Proposal broadcast now fires at ~T = slotDuration − timeReservedAtEnd inside the build slot, so attestations arrive before the boundary. Receiver acceptance windows are tightened accordingly:
proposalWindowIntoTargetSlotdrops fromp2pPropagationTimeto 0 (only clock-disparity grace remains) andattestationWindowIntoTargetSlotshrinks fromslotDuration − l1PublishingTime(60s at defaults) to2·p2pPropagationTime(4s).No new p2p validation path is needed: the main
messageSlot === targetSlot || messageSlot === nextSlotcheck already covers the steady state under pipelining.Changes
PipelinedCheckpointTimingModel.timeReservedAtEndis nowcheckpointAssembleTime + 2·p2pPropagationTime + blockDuration;pipeliningAttestationGracePerioddrops to 0 under pipelining.proposalWindowIntoTargetSlotdrops to 0 andattestationWindowIntoTargetSlotshrinks to2·p2pPropagationTime.PipeliningWindow.acceptsProposal/acceptsAttestationvia the new timing-model values;isWithinPipeliningWindowJSDoc is refreshed to describe the straggler-acceptance role explicitly.Rollout notes
The tightened straggler windows mean a receiver running this change will reject stale-schedule proposals that arrive more than 500ms into the target slot and stale-schedule attestations that arrive more than 4.5s into the target slot. Expect to roll this out across validators together (the merge-train/spartan flow already batches validator upgrades) rather than mixing old and new schedules on a live network.