Skip to content

Phase 7 follow-up: end-to-end simulation test for governance ban chain #4301

Description

@sanity

Context

Spawned from PR #4299 multi-model review. Per the tracking issue #4296 this is a required gate before flipping Enforce mode on gateways.

PR #4299 adds a synchronous end-to-end regression test (`contract::governance::tests::governance_to_ban_list_end_to_end`) that drives a contract through evict → recover → re-feed → BanTriggered via `GovernanceManager`, runs decisions through `Ring::apply_ban_decisions`, and asserts the contract lands on a fresh `ContractBanList`. That covers the wiring at the unit level.

What is missing is a simulation-network test that:

  1. Spins up a small `run_simulation_direct` network (~5-10 nodes).
  2. Injects the May 21 incident pattern (one abuser contract that triggers repeated evictions via the rate-limit → MAD → eviction → ban chain).
  3. Asserts the full chain fires on each node observing the abuse:
    • Rate limit rejects excess UPDATE traffic for the abuser.
    • MAD detector flags the abuser in the cost distribution.
    • State machine transitions Normal → Borderline → WouldEvict → Evicted.
    • Re-eviction within ban_window triggers Banned.
    • ContractBanList drops subsequent wire traffic for the abuser.
  4. Asserts non-abuser contracts in the simulation continue to function (no collateral damage).

Why this matters

The unit and pin tests in #4299 lock the wiring in place, but they cannot detect emergent issues from the chain running against real network traffic (timing assumptions, message ordering, multi-node consensus on who's the abuser). The deferred sim test is the only way to validate "Enforce mode actually works as designed in a real network" before flipping the gateway config.

Spawned from

[AI-assisted - Claude]

Metadata

Metadata

Assignees

Labels

A-contractsArea: Contract runtime, SDK, and executionA-developer-xpArea: developer experienceA-networkingArea: Networking, ring protocol, peer discoveryE-hardExperience needed to fix/implement: Hard / a lotP-highHigh priorityT-enhancementType: Improvement to existing functionality

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions