11A state-machine fuzzer for Aztec contract interactions. It talks to a running
2- sandbox via a persistent Node.js HTTP bridge (` bridge.mjs ` ), compares the
2+ sandbox via a persistent Node.js HTTP bridge (` wallet- bridge.mjs` ), compares the
33sandbox's behavior to an in-memory model, and asserts on any divergence.
44
55Two machines are available:
@@ -19,16 +19,22 @@ it uses the standard `Token` contract that ships with the wallet CLI:
1919cargo run -- token --max-steps 100
2020```
2121
22- The ** side-effect** machine requires the ** nightly** sandbox because it deploys custom
23- contracts compiled against the nightly's aztec-nr. Use ` setup-nightly-sandbox.sh ` to
24- automate the full setup (defaults to the last tested nightly tag; pass ` --latest ` to
25- try the newest one). See ` SANDBOX_INSTRUCTIONS.md ` for manual steps.
22+ The ** side-effect** machine requires custom contracts. There are two ways to set it up:
2623
24+ ** Local setup** (no Docker, uses your repo build):
25+ ```
26+ bash setup-local.sh # compiles contracts, starts anvil + node + bridge
27+ cargo run -- side-effect --artifacts-dir contracts/target --max-steps 100
2728```
28- bash setup-nightly-sandbox.sh
2929
30+ ** Nightly Docker setup** (defaults to the last tested nightly tag; pass ` --latest ` for newest):
31+ ```
32+ bash setup-nightly-sandbox.sh
3033cargo run -- side-effect --max-steps 100
3134```
35+ The nightly script places artifacts at ` /tmp/ ` inside the container (the default ` --artifacts-dir ` ).
36+
37+ See ` SANDBOX_INSTRUCTIONS.md ` for manual nightly steps and troubleshooting.
3238
3339To replay a specific failure seed:
3440
@@ -44,8 +50,15 @@ cargo run -- side-effect --max-steps 100000 --seed 0x5a7211231dcd6500
4450--seed 0xHEX Replay a specific seed
4551--max-steps N Max fuzzing steps (default: 400)
4652--max-batch-size N Max parallel sends per batch (default: 8)
53+ --artifacts-dir DIR Contract artifact directory (side-effect only, default: /tmp)
4754```
4855
56+ > ** Note:** ` --artifacts-dir ` is resolved on the host and sent as-is to the bridge.
57+ > For ** local** setup the bridge runs on the host, so use the real path (e.g.
58+ > ` contracts/target ` ). For ** nightly Docker** the bridge runs inside the container,
59+ > so the path must be valid inside it — the default ` /tmp ` works because the nightly
60+ > script places artifacts at ` /tmp/*.json ` inside the container.
61+
4962### Parallel batching
5063
5164Consecutive non-conflicting state-changing commands are batched and fired concurrently,
@@ -64,12 +77,16 @@ Conflict rules (conservative -- false positives only reduce batch size):
6477To verify that the sandbox is running correctly, run the integration smoke tests:
6578
6679```
67- cargo test -- --ignored --nocapture
80+ ARTIFACTS_DIR=contracts/target cargo test -- --ignored --nocapture
6881```
6982
7083These are ` #[ignore] ` d by default because they require a running sandbox. With
7184bridge + fast slots, a full suite run takes ~ 1-2 minutes (~ 5-13s per transaction).
7285
86+ Environment variables for tests:
87+ - ` ARTIFACTS_DIR ` -- contract artifact directory (default: ` /tmp ` )
88+ - ` BRIDGE_URL ` -- bridge server URL (default: ` http://localhost:8089 ` )
89+
7390## Contracts
7491
7592Contract sources live in ` contracts/ ` within this crate, not in ` noir-contracts/ ` . They
@@ -82,9 +99,9 @@ with oracle calls (like `utilityLog`) that the nightly PXE doesn't support.
8299- ** Parent** (` contracts/parent_contract/ ` ) -- forwards calls to SideEffect for
83100 cross-contract call testing
84101
85- Artifacts are built by ` setup-nightly-sandbox.sh ` inside the nightly container and
86- placed in ` contracts/target/ ` (not checked into git) .
102+ Artifacts are built by ` setup-local.sh ` or ` setup- nightly-sandbox.sh` and placed in
103+ ` contracts/target/ ` . Pre-built artifacts are checked into git for convenience .
87104
88- The setup script auto-detects the nightly commit by matching the container's nargo
89- hash against ` origin/next ` . See ` SANDBOX_INSTRUCTIONS.md ` for the full build pipeline,
90- version matrix, and troubleshooting.
105+ The nightly setup script auto-detects the nightly commit by matching the container's
106+ nargo hash against ` origin/next ` . See ` SANDBOX_INSTRUCTIONS.md ` for the full build
107+ pipeline, version matrix, and troubleshooting.
0 commit comments