Skip to content

test(consensus): add automated regression test suite for validator consensus failure modes (closes #199) - #250

Open
guptakumarranjeet150 wants to merge 2 commits into
VeriNode-Labs:mainfrom
guptakumarranjeet150:validator-consensus-failure-regression-tests
Open

test(consensus): add automated regression test suite for validator consensus failure modes (closes #199)#250
guptakumarranjeet150 wants to merge 2 commits into
VeriNode-Labs:mainfrom
guptakumarranjeet150:validator-consensus-failure-regression-tests

Conversation

@guptakumarranjeet150

Copy link
Copy Markdown

Summary of Changes

Resolves #199.

This PR implements an end-to-end automated regression test suite verifying validator consensus safety, liveness, and recovery bounds across adversarial failure modes.

Key Architectural & Test Enhancements

  1. Network Partition & Healing Recovery:

    • Tests clean two-way split-brain network partition (testCleanNetworkPartitionBlocksConsensus) asserting zero quorum can be reached during disconnected states.
    • Tests partition healing (testHealedNetworkPartitionRecoversLiveness) asserting immediate convergence and consensus resumption within bounded rounds.
  2. Byzantine Equivocation Resilience:

    • Tests conflicting proposal broadcasts (testByzantineEquivocationResilience) verifying honest 2/3+ majority converges safely under $F < N/3$ threshold.
  3. Validator Crash & Timeout Faults:

    • Tests non-responsive validators (testValidatorTimeoutFaultAndRecovery) ensuring protocol liveness and recovery under bounded offline duration.
  4. Network Delay & Jitter Injection:

    • Tests probabilistic message delay and jitter latency bounds (testMessageDelayAndJitterBounds).
  5. Dynamic 2/3+ Quorum Threshold & Vote Invariance:

    • Verifies threshold calculation formula $\lfloor 2N/3 \rfloor + 1$ across cluster sizes from 1 to 100 nodes (testQuorumThresholdCalculations).
    • Verifies duplicate vote deduplication and unregistered validator rejection (testDuplicateAndIneligibleApprovalFiltering).
  6. Core Engine Consistency:

    • Fixed proposal alignment in src/consensus-sim/simulation.ts so honest validators vote on canonical round block proposals.
    • Added tests/consensus_sim.test.ts for the npm run test:consensus-sim target.

Verification

  • node tests/consensus/validator_failure_modes.test.cjs -> All 7 tests PASSED.
  • node scripts/validate-ci-workflow.cjs -> PASSED.
  • node scripts/validate-docker-cache-config.cjs -> PASSED.

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.

Automated Regression Test Suite for Validator Consensus Failure Modes

1 participant