Skip to content

Add Byzantine fault tolerance scenarios for grid frequency regulation - #311

Closed
SAADabb wants to merge 1 commit into
projnanda:mainfrom
SAADabb:feat/grid-bft-byzantine-frequency-regulation
Closed

SAADabb wants to merge 1 commit into
projnanda:mainfrom
SAADabb:feat/grid-bft-byzantine-frequency-regulation

Conversation

@SAADabb

@SAADabb SAADabb commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

consensus.yaml only tolerates dropped acks (crash/omission); nandatown has no Byzantine model, and the README explicitly disclaims byzantine_agents as "not modeled." This adds one.

  • New grid_node role implementing Bracha reliable broadcast (propose → echo → ready → deliver; quorum n-f; amplify at f+1), which tolerates a Byzantine sender and Byzantine receivers at once, unlike the existing single-proposer consensus scenario.
  • A Byzantine node is defined purely by an equivocation config block (which peers get which value, at every broadcast it makes) — identical protocol timing to an honest node, only the content it sends differs.
  • Three scenarios, framed as grid frequency regulation, n=4, tolerance f=1:
    • grid_bft_byzantine_voter — one substation lies to everyone; the honest nodes still agree on the controller's real proposed action.
    • grid_bft_byzantine_controller — the proposer itself lies, splitting the substations; honest nodes still converge via ready-amplification.
    • grid_bft_double_fault — two Byzantine nodes at once, deliberately past f=1; two honest nodes verifiably commit different actions. Its agreement stage is expected to fail — that failure is the evidence the n>=3f+1 boundary was actually crossed, not a town malfunction.
  • New grid_bft validator: checks agreement/validity among honest nodes only (Byzantine-ness is read from scenario config, never inferred from behavior).
  • tests/test_sim.py's closed-world ALL_SCENARIOS/FAILING_SCENARIOS lists updated accordingly.

Test plan

  • pytest tests/test_lab_grid_bft.py — 12 new tests, all passing
  • pytest tests/test_sim.py — updated scenario-presence lists, passing
  • Full suite: 1743 passed, 26 skipped; the 19 remaining failures are pre-existing on main (Windows symlink/filesystem-permission tests), confirmed identical with this branch's changes stashed out
  • All three scenarios run end-to-end via run_lab, including bundle export and HMAC signature verification (verify_bundle(...) == [])

consensus.yaml only tolerates dropped acks (crash/omission); it has no
Byzantine model, and the README explicitly disclaims byzantine_agents
as not modeled. Add a grid_node role implementing Bracha reliable
broadcast (propose/echo/ready/deliver, quorum n-f, amplify at f+1),
which tolerates a Byzantine sender and Byzantine receivers at once.

Three scenarios frame this as grid frequency regulation, n=4, f=1:
- grid_bft_byzantine_voter: one substation lies; honest nodes still
  agree on the controller's real proposal.
- grid_bft_byzantine_controller: the proposer itself lies, splitting
  substations; honest nodes still converge via ready-amplification.
- grid_bft_double_fault: two Byzantine nodes at once, past f=1 on
  purpose; two honest nodes verifiably commit different actions,
  demonstrating the n>=3f+1 boundary rather than hiding it.

A Byzantine node is defined purely by an `equivocation` config block
(which peers get which value at every broadcast) - same protocol
timing as an honest node, only the content differs.
@SAADabb SAADabb closed this Oct 12, 2026
@SAADabb
SAADabb deleted the feat/grid-bft-byzantine-frequency-regulation branch October 14, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant