FinSim

Fault Injection & Deterministic Replay

Inject reproducible distributed-system failures at specific transfer stages and verify byte-level trace determinism with finsim/scenario/v1.

OpenAPI FaultRule types & Scenario DSL behaviors

Fault typeSimulated failure
DELAYAdds configurable latency before forwarding or returning a participant call.
TIMEOUTSimulates an unresponsive leg so FinSim transitions the transfer to UNKNOWN.
DUPLICATE_DELIVERYDelivers the same payment leg more than once to test participant Idempotency-Key handling.
RESPONSE_LOST_AFTER_PROCESSING (Scenario DSL TIMEOUT behavior)Configured as a TIMEOUT behavior in finsim/scenario/v1: allows the participant to commit the leg, then drops the HTTP response before it reaches FinSim (exposing this behavior directly on /api/v1/faults is tracked in #189).

Seeded PRNG and Scenario DSL

Fault probabilities use a deterministic seeded PRNG so probabilistic failure tests remain reproducible in CI and university labs. Declarative finsim/scenario/v1 YAML or JSON fixtures script fault rules, transfers, virtual-clock ADVANCE_TIME steps, and resolution checks in one file:

finsim scenario run docs/scenarios/lost-credit-timeout-and-recovery.yaml --verify-replay