Add bounded council election contract#516
Open
huangminghuang wants to merge 4 commits into
Open
Conversation
loadtier resumed its staged snapshot by position (skip-count over the
live bytier enumeration). A tier-2/3 owner forcereg'd between batches
that sorted before an already-loaded owner shifted the enumeration, so
the resumed batch re-wrote a snapshotted owner (duplicate) and dropped
the newcomer, while finalizeinit's count cross-check still passed —
silently corrupting the frozen electorate.
Skip owners already present in the snapshot's byowner index instead.
No positional cursor remains to mis-align, and mid-load newcomers are
absorbed by whichever batch encounters them, so t{2,3}_loaded converges
on the live nodecount and finalizeinit stays reachable. This also makes
loadtier genuinely idempotent, matching DESIGN.md §9.
The loadtier_roa_churn_mid_load regression test now passes; wasm
rebuilt, ABI unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Bound candidate and election storage, bill candidate rows to registrants, replace per-round ballots with a vote bitmap, and use a lazy Fisher-Yates remap for tier-3 selection. Add authenticated settlement and entropy cranks, inclusive deadline handling, stale-action settlement, governance recovery, typed lifecycle state, staged generation cleanup, and complete Ricardian coverage. Expand contract and property tests across authorization, tier escalation, deterministic replay, maximum owner bounds, cleanup, and multi-generation history retention.
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.
Summary
Introduce the
sysio.counclsystem contract, which fills 21 council seats through a deterministic tier-1 → tier-2 → tier-3 nomination and strict-priority voting process.The contract:
Safety and lifecycle hardening
settleandstircallers before incorporating them into the deterministic entropy accumulator.forcebackfor governance recovery and stagedreset/purgecleanup for all ephemeral generation data.Tests
Coverage includes:
Validation
contracts_projectclean build with Wire CDT 4.2.0 from~/code/wire/wire-cdt/build/release, using-j32contracts_unit_test --run_test='council_math_tests,sysio_councl_tests' -- --sys-vm— 38 cases, no errors.clang-format --dry-run --Werrorandgit diff --checkpassReviewer notes
forceassign; the contract therefore does not promise unconditional wall-clock completion when governance is unavailable.