MCPcopy Index your code
hub / github.com/PierreZ/moonpool

github.com/PierreZ/moonpool @moonpool-core-v0.7.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release moonpool-core-v0.7.0 ↗ · + Follow
2,919 symbols 9,505 edges 185 files 753 documented · 26% updated 13d agov0.1.0 · 2024-05-29★ 443 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Moonpool

Deterministic simulation testing for distributed systems in Rust. Write your distributed system once, test it with deterministic simulation and chaos injection, then deploy with real networking — using identical application code.

Inspired by FoundationDB's simulation testing and Antithesis.

Note: This is a hobby-grade project under active development.

Architecture

moonpool                          Facade crate, re-exports everything
├── moonpool-transport            RPC, peer connections, wire format
│   └── moonpool-transport-derive #[service] proc-macro
├── moonpool-sim                  Simulation engine, chaos testing, assertions
│   └── moonpool-explorer         Fork-based multiverse exploration
└── moonpool-core                 Provider traits and core types

Which Crate to Use

Use case Crate
Full framework (recommended) moonpool
Provider traits only moonpool-core
Simulation without transport moonpool-sim
Transport without simulation moonpool-transport
Fork-based exploration internals moonpool-explorer
Proc-macro internals moonpool-transport-derive

Key Features

  • Provider pattern — Application code depends on traits (TimeProvider, NetworkProvider, TaskProvider, RandomProvider, StorageProvider), not concrete implementations. Same code runs in simulation and production.
  • Deterministic simulation — Same seed = identical execution. Logical time skips idle periods. Years of uptime simulated in seconds.
  • Chaos testing — Network delays, disconnects, partitions, bit flips, partial writes, storage corruption. buggify! fires with 25% probability at fault injection points.
  • Assertion suite — 15 Antithesis-style assertion macros (assert_always!, assert_sometimes!, numeric comparisons, compound assertions). Multi-seed testing runs until all sometimes assertions fire.
  • Fork-based exploration — When assertions discover new behavior, fork() explores alternate timelines with different RNG seeds. Adaptive energy budgets and coverage bitmaps guide exploration.
  • #[service] macro — Auto-generates RPC server/client boilerplate from a single trait definition.

Quick Start

# Enter development environment (Nix required)
nix develop

# Run tests
nix develop --command cargo nextest run

# Build documentation
nix develop --command cargo doc --open

Documentation

License

Apache 2.0

Extension points exported contracts — how you extend this code

NetworkProvider (Interface)
Provider trait for creating network connections and listeners. Clone allows sharing providers across multiple peers eff [5 …
moonpool-core/src/network.rs
Process (Interface)
(no doc) [7 implementers]
moonpool-sim/src/runner/process.rs
MessageReceiver (Interface)
Trait for receiving deserialized messages from the transport layer. Implementors handle incoming packets dispatched by [3 …
moonpool-transport/src/rpc/endpoint_map.rs
Store (Interface)
Trait for item persistence. In production, backed by a real database. In simulation, backed by an in-memory `BTreeMap` w [1 …
moonpool-sim-examples/src/axum_web.rs
PingPong (Interface)
(no doc)
moonpool-transport/examples/well_known_endpoint.rs
TcpListenerTrait (Interface)
Trait for TCP listeners that can accept connections. [5 implementers]
moonpool-core/src/network.rs
Workload (Interface)
(no doc) [21 implementers]
moonpool-sim/src/runner/workload.rs
TransportHandle (Interface)
Object-safe transport abstraction that erases provider generics. `NetTransport ` implements this trait, allowing user [1 …
moonpool-transport/src/rpc/transport_handle.rs

Core symbols most depended-on inside this repo

get
called by 186
docs/references/foundationdb/FlowTransport.actor.cpp
open
called by 168
moonpool-sim/src/storage/provider.rs
clone
called by 140
moonpool-transport/src/rpc/request_stream.rs
clone
called by 137
moonpool-sim/src/sim/world.rs
push
called by 127
moonpool-transport/src/rpc/net_notified_queue.rs
write
called by 126
moonpool-sim/src/storage/memory.rs
read
called by 115
moonpool-sim/src/storage/memory.rs
size
called by 104
docs/references/foundationdb/fdbrpc.h

Shape

Method 1,449
Function 1,005
Class 385
Enum 56
Interface 24

Languages

Rust69%
C++30%
C#1%

Modules by API surface

docs/references/foundationdb/sim2.actor.cpp195 symbols
docs/references/foundationdb/Net2.actor.cpp180 symbols
moonpool-sim/src/sim/world.rs120 symbols
docs/references/foundationdb/FlowTransport.actor.cpp117 symbols
docs/references/foundationdb/fdbrpc.h108 symbols
moonpool-transport/src/rpc/net_transport.rs86 symbols
moonpool-sim/src/runner/orchestrator.rs76 symbols
moonpool-sim/src/runner/builder.rs67 symbols
moonpool-transport/src/peer/core.rs54 symbols
moonpool-transport/src/rpc/net_notified_queue.rs41 symbols
moonpool-sim-examples/src/dungeon.rs41 symbols
docs/references/orleans/MessageCenter.cs41 symbols

For agents

$ claude mcp add moonpool \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact