Repository navigation
Add isolated Crown Phase 2 Tendermint-style consensus state machine - #18
Conversation
Co-authored-by: defunctec <9864793+defunctec@users.noreply.github.com>
Co-authored-by: defunctec <9864793+defunctec@users.noreply.github.com>
Agent-Logs-Url: https://github.com/defunctec/crown-core/sessions/444d8abf-b27b-4d1f-9334-4a8a1ae4d06b Co-authored-by: defunctec <9864793+defunctec@users.noreply.github.com>
|
@copilot Continue the interrupted Phase 2 consensus-safety review on this existing PR. The previous session stopped because the Copilot usage limit was reached. IMPORTANT:
First:
Then continue ONLY the unfinished work. The safety review remains focused on Tendermint-style consensus correctness, specifically:
Compare the implemented behavior against established Tendermint-style safety semantics. Add adversarial regression tests for any missing cases discovered. Do NOT add new protocol features. Do NOT modify:
At completion:
Do not begin Phase 3. |
Co-authored-by: defunctec <9864793+defunctec@users.noreply.github.com>
Addressed in I completed the remaining safety-review work by fixing late cross-round quorum handling so delayed precommit quorums from an earlier round can still drive a commit after a validator has advanced rounds, without weakening locking or double-sign protections. Added adversarial regressions for:
Re-ran the relevant Crown and directly affected upstream test suites, and the no-conflicting-commit invariant still holds. Remote HEAD is |
This PR adds the Phase 2 Crown consensus PoC as an isolated native C++ state machine over abstract
BlockIDvalues, without touching Bitcoin block production, fork choice, validation, or live P2P. It implements deterministicPROPOSE -> PREVOTE -> PRECOMMIT -> COMMITexecution for the static four-validator set, including NIL handling, round changes, locking, valid-round semantics, and Byzantine vote detection.Consensus engine
src/crown/consensus/height,round,step,locked_block,locked_round,valid_block, andvalid_roundProposal and vote types
ProposalandVotetypes for abstractBlockIDconsensusNILas an explicit consensus value for both prevotes and precommitsSafety rules
>2/3voting-power quorum using existing Phase 1 helpersDeterministic simulation coverage
Documentation and patch surface
Proposal proposal{ .height = m_state.height, .round = m_state.round, .proposer_id = m_local_signer->validator_id, .block_id = block_id, .valid_round = valid_round, }; Vote vote{ .type = VoteType::PREVOTE, .height = m_state.height, .round = m_state.round, .validator_id = m_local_signer->validator_id, .block_id = std::nullopt, // explicit NIL };