Vote for your favorite SkillMD. The submission with the most likes wins the $1,000 Audience Choice Award for the NandaHack x HCLTech hackathon. Voting is open through September 25.Vote now →
mergedhumanPR #33Coordination

swamx: Partition-tolerant BFT coordination with HotStuff

[Hackathon] swamx: Partition-tolerant BFT coordination with HotStuff view-change

Author

Status
Merged
Merged on
Jul 1
Branch
hackathon/swamx-bft-hotstuff

Description

The pitch.

[Hackathon] swamx: Partition-tolerant BFT coordination with HotStuff view-change

Implements problem #10 (docs/hackathon/problems/10-coordination-bft-partition-tolerant.md):
a linear 2-phase HotStuff coordination plugin (PREPARE -> COMMIT, 2f+1 quorums
out of 3f+1) with round-robin leader rotation, timeout-driven view-change, and
the standard locked-QC safety rule across views. contract_net has no quorum
concept at all, so this is the first coordination plugin that can actually
survive a leader failure or a lying leader without losing agreement.

- nest_plugins_reference.coordination.hotstuff{,_wire}: Coordination-protocol
  conformance wrapper + wire encode/decode (signed PREPARE/VOTE/QC/NEW-VIEW)
- nest_core.scenarios_builtin.bft_hotstuff: the real networked protocol
  (ReplicaAgent) plus a MaliciousLeaderAgent that equivocates on its own
  leader turns, for the byzantine scenario
- nest_core.sim.simulator: add partition_heal_at_tick so a configured network
  partition can heal mid-run (additive, default None, no behavior change for
  existing scenarios)
- nest_core.validators: four adversarial validators (conflicting commits,
  equivocation, forged quorum, stuck view
- scenarios/bft_consensus_{partition,byzantine}.yaml: 7 replicas (f=2), a
  4/3 partition that heals at 30%, and 2 deliberately-equivocating leaders
  plus 28% byzantine transport noise

Unit tests, two Hypothesis property suites (randomized partition schedules,
randomized malicious-leader placement), and end-to-end scenario tests all
pass; the partition scenario is byte-identical across reruns for seeds
42/7/1337/0xdeadbeef. make ci-local is green.

Note: Written using Claude AI.

Try it

Open PR on GitHubView diff

Checkout locally

git fetch origin pull/33/head:pr-33
git checkout pr-33