Types reorg and vote serialization - #3255
Open
michael-yxchen wants to merge 11 commits into
Open
michael-yxchen wants to merge 11 commits into
michael-yxchen wants to merge 11 commits into
Conversation
michael-yxchen
added this pull request to stack #3256
September 14, 2026 20:37
michael-yxchen
requested review from
ariqchowdhury,
dshulyak,
omegablitz and
xinyuan-dev
as code owners
September 14, 2026 20:37
xinyuan-dev
approved these changes
Sep 15, 2026
Replaces StubElection with NodeProposerSchedule, the RotatingProposerSchedule instantiation, so the binary elects proposers the way consensus does.
ProposalCreation now takes the two facts the chaining gate needs, handle_slot_open and handle_cap_advance, instead of SlotLifecycle. The cadence task hands the runtime a named FinalizationObserver so the conductor CloseSlots cap reaches the node as CadenceOutput::CapAdvance; the previous closure only forwarded handle_finalization and dropped handle_chain_advance on the floor. OffsetProposalCreation still proposes at deadline - propose_before_deadline and uses the cap only to prune due entries strictly below it. One behavior change: due entries were previously dropped on SlotLifecycle::Completed, which also fires when a slot faults. Pruning now follows the finalized prefix, so a faulted-but-not-finalized slot keeps its due entry until the cap passes it. A fault on one slot is no reason to stop proposing for an earlier still-open one. Nothing grows without bound: poll drains every due entry once its time passes, and cap-pruning only avoids proposing into already-finalized slots. Note for the next phase: the cap does not advance past a faulted slot, so handle_cap_advance goes inert after the first fault. Harmless here, since the gate is not live, but a liveness blocker before it can be. fn new leaves the trait (inherent on OffsetProposalCreation) so a scripted test double needs no EpochHandle; the schedule field is Arc<dyn ProposerSchedule> so unit tests can use FixedProposerSchedule. This code was generated using Claude Opus 5.
Replace OffsetProposalCreation with the tested ProposalPlanner behind
ProposalCreation. The planner's chaining gate is now live in the node:
the proposal for slot r is sealed only once slot r - y is chained, y =
observation_cutoff (3, read from the proposer schedule so the two cannot
drift). A node whose chained prefix lags more than y slots stops
proposing until it catches up. This is the spec's B_{r-y} prerequisite
and intentional back-pressure: a throughput cost, never a consensus one
(the index finalizes Negative).
The planner's wake commands collapse into a derived next_due(), so a
fact can move a slot's due time; poll returns (slot, index) and the
proposing task assembles the payload. The sim arms its seal alarm from
next_due after every fact. OffsetProposalCreation is deleted: with
observation_cutoff = 0 the planner is that policy.
This code was generated using Claude Opus 5.
`Slot`, `ProposalIndex` and `ProposalScope` are environment-independent, so define them once in `common_types` where `spec` and `env` can name them without picking a variant. `types` re-exports them. This code was generated using Claude Fable 5.1.
Each vote type names a `SigningDomain`; the signed bytes are that domain's prefix followed by the RLP list `[scope, vote]`. `IsVote` requires `Encodable` and provides `signing_bytes`. - spec::vote: `SigningDomain` (prefix `<len><name>\n`, checked at compile time), `signing_bytes`, and `signing_bytes_of` built with `alloy_rlp::encode_list` over `&[&dyn Encodable]`. - One domain per vote kind across fast, dummy and mvba. Since `FallbackEntry` encodes like `Entry`, the domain alone separates them. - mvba pre-prepare signs `[slot, view, entries, tc]`, with an absent TC encoded as an empty list. This code was generated using Claude Fable 5.1.
michael-yxchen
force-pushed
the
michael/signing-ser
branch
from
September 17, 2026 20:43
0de26d8 to
765d026
Compare
michael-yxchen
requested review from
andr-dev and
eclark0426
as code owners
September 17, 2026 20:43
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.
Reorganized Slot and ProposalScope to a top level module common_types so it's only instantiated once. Otherwise prod types won't compile
Implemented proper serialization for IsVote trait: adding SigningDomain, and prepend it to a RLP list serialization of [scope, vote]. mvba preprepare is only a placeholder