feat(lstar): add tiered block-production strategy as a selectable alternative#1149
Open
MegaRedHand wants to merge 8 commits into
Open
feat(lstar): add tiered block-production strategy as a selectable alternative#1149MegaRedHand wants to merge 8 commits into
MegaRedHand wants to merge 8 commits into
Conversation
…ernative The proposer can fill a block by two interchangeable algorithms that share the build-block contract. The default round-based fixed-point selection stays the active strategy; a tiered greedy scorer that ranks finalize over justify over build is added as a dormant alternative. Both live as separate mixins so a fork composes exactly one. Selecting the tiered scorer is a one-line import swap in the fork facade, after which the two block-production test vectors must be regenerated. Keeping the default unchanged leaves all committed vectors byte-identical.
This was referenced Jun 17, 2026
Two fork-choice fillers asserted the simple builder's exact block body, so generation aborted when the tiered builder was wired in. Both now succeed whichever block-production mixin the fork composes. The max-attestations filler adopts a single-voter, justifiable-target scenario where the entry cap alone bounds the body, so both builders fill to exactly the limit. The self-heals filler keeps one scenario but selects the divergent block body by the active strategy: the fixed-point builder keeps a redundant vote, the tiered builder drops it.
The filler branched its block-body assertion on which block-production mixin the fork composed, coupling a test vector to a proposer-strategy choice. Drop the body-count assertion and the strategy probe. The justified slot is the strategy-independent witness of the self-heal: reaching slot 1 is only possible once the block incorporates the slot-1 votes. The exact body composition is a proposer choice, not a consensus outcome, so it is no longer asserted.
3 tasks
A fork composes exactly one block-production mixin, and the tiered strategy is selected by swapping a single import in the fork facade. By default it has no call site, so vulture reports it as an unused class. It is a real, selectable strategy, not dead code, so whitelist it like the other statically invisible uses.
…ed-block-production
c2f6d26 to
01e2d62
Compare
Contributor
Author
|
Note: the dead-code CI check will be red on this PR until #1150 merges. #1150 fixes a pre-existing stale |
…ed-block-production
…d scoring The tiered greedy builder broke ties on the smallest target and attestation slot. Prefer the largest instead so the projected justified slot advances as close to the tip as possible, shortening recovery from a justification or finalization stall (mirrors the Zeam devnet4 fix). The threshold-crossing tiers (finalize, justify) now rank a larger target slot above new-voter coverage, since they justify regardless; the build tier keeps coverage first since it only adds marginal voters toward the threshold. Claude-Session: https://claude.ai/code/session_01WHwxcstQNAwYfYfaMmF7a2
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.
What
Adds a second proposer-side block-building algorithm for the lstar fork, kept alongside the existing one as an interchangeable mixin.
BlockProductionMixin(default)block_production.pyTieredBlockProductionMixin(new)block_production_tiered.pyBoth share the
build_blockcontract declared onLstarSpecBase, so a fork composes exactly one.How to switch
The default stays the round-based selection. To select the tiered scorer, swap a single import in
spec.py:then regenerate:
Test changes: fixtures generate under either mixin
Two fork-choice fillers used to assert the simple builder's exact block body. The two builders include a different number of votes in those scenarios, so generation aborted when the tiered builder was wired in. Both fillers now generate cleanly under either mixin without any test depending on which mixin is active (verified: 540 vectors pass and the determinism check passes, under both).
Each filler is made mixin-independent in the way that fits its scenario:
test_produce_block_enforces_max_attestations_data_limit— switched to a single-voter, justifiable-target scenario. No vote reaches the two-thirds supermajority, so no entry justifies its target and the entry cap alone bounds the body. Both builders therefore fill to exactly the limit, and the scenario asserts that count for both. (This is the more robust setup originally written for feat: tiered attestation scoring #791; it changes this one committed vector.)test_justified_divergence_self_heals_in_next_block— the divergence here is real and same-scenario: the fixed-point builder keeps a vote already recorded on-chain, the tiered builder drops it as adding no new voters. That body difference is a proposer-strategy choice, not a consensus outcome, so it is no longer asserted. The test instead asserts the justified slot, which is the strategy-independent witness of the self-heal: the chain can only reach justified slot 1 once the block incorporates the slot-1 votes.The committed vectors are generated by the default (simple) strategy.
Notes
just checkpasses (lint, format, ty, codespell, mdformat).just deadcodepasses.