Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
- uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
with:
tool: nextest
# Build all 18 guest wasms ONCE (17 modules + the cow adapter,
# Build all 17 guest wasms ONCE (16 modules + the cow adapter,
# release/wasm32-wasip2): the single
# source of truth for guest buildability and the artifacts the integration
# tests load. Replaces the deleted 9-way build-module matrix, which recompiled
Expand All @@ -88,7 +88,7 @@ jobs:
run: |
cargo build --release --target wasm32-wasip2 --locked \
-p example -p twap-monitor -p ethflow-watcher -p price-alert \
-p balance-tracker -p stop-loss -p http-probe -p echo-venue \
-p balance-tracker -p http-probe -p echo-venue \
-p echo-client -p echo-keeper -p clock-reader -p flaky-bomb -p flaky-venue \
-p fuel-bomb -p memory-bomb -p panic-bomb -p slow-host
# Separate invocation on purpose: unifying `cow-venue/adapter`
Expand Down
15 changes: 0 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ members = [
"modules/examples/echo-venue",
"modules/examples/http-probe",
"modules/examples/price-alert",
"modules/examples/stop-loss",
"modules/fixtures/clock-reader",
"modules/fixtures/flaky-bomb",
"modules/fixtures/flaky-venue",
Expand Down
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ COPY --from=planner /src/recipe.json recipe.json
RUN cargo chef cook --release -p shepherd --recipe-path recipe.json \
&& cargo chef cook --release --target wasm32-wasip2 \
-p twap-monitor -p ethflow-watcher -p price-alert \
-p balance-tracker -p stop-loss --recipe-path recipe.json \
-p balance-tracker --recipe-path recipe.json \
&& cargo chef cook --release --target wasm32-wasip2 \
-p cow-venue --features cow-venue/adapter --recipe-path recipe.json

Expand All @@ -82,14 +82,13 @@ COPY . .
# is used verbatim so builds are reproducible.
RUN cargo build -p shepherd --release --locked

# Five production modules plus the bundled cow venue adapter. The wasm
# Four production modules plus the bundled cow venue adapter. The wasm
# artefacts land under
# `target/wasm32-wasip2/release/<name_with_underscores>.wasm`.
RUN cargo build -p twap-monitor --target wasm32-wasip2 --release --locked \
&& cargo build -p ethflow-watcher --target wasm32-wasip2 --release --locked \
&& cargo build -p price-alert --target wasm32-wasip2 --release --locked \
&& cargo build -p balance-tracker --target wasm32-wasip2 --release --locked \
&& cargo build -p stop-loss --target wasm32-wasip2 --release --locked \
&& cargo build -p cow-venue --target wasm32-wasip2 --release --locked --features adapter

# ----------------------------------------------------------------- runtime
Expand Down Expand Up @@ -126,7 +125,6 @@ COPY --from=build /src/modules/twap-monitor/module.toml /opt/shepherd/manifes
COPY --from=build /src/modules/ethflow-watcher/module.toml /opt/shepherd/manifests/ethflow-watcher.toml
COPY --from=build /src/modules/examples/price-alert/module.toml /opt/shepherd/manifests/price-alert.toml
COPY --from=build /src/modules/examples/balance-tracker/module.toml /opt/shepherd/manifests/balance-tracker.toml
COPY --from=build /src/modules/examples/stop-loss/module.toml /opt/shepherd/manifests/stop-loss.toml

# The bundled cow venue adapter's manifests; installed via the
# engine.toml [[adapters]] stanza, never compiled into the engine.
Expand Down
2 changes: 1 addition & 1 deletion crates/nexum-runtime/src/supervisor/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ fn progress_marker_key_uses_numeric_chain_id() {
/// corresponding select arm is never selected.
///
/// Surfaced when wiring up `engine.m3.toml` for the M3 testnet runbook:
/// the 3 M3 example modules (price-alert, balance-tracker, stop-loss)
/// the M3 example modules (price-alert, balance-tracker)
/// all subscribe to blocks only, no logs. The engine bailed within
/// ~50 ms of `supervisor ready` until this fix landed.
#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion crates/nexum-sdk/src/chain/chainlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! latestRoundData.answer` flow against a Chainlink AggregatorV3
//! oracle. Returns `Some(answer)` on success or `None` on any host /
//! decode failure (logging the failure at Warn). Used by oracle-driven
//! example modules (price-alert, stop-loss) so they consume the SDK
//! example modules (price-alert) so they consume the SDK
//! instead of redefining the `AggregatorV3` ABI + read loop locally.
//!
//! The shape is deliberately `Option<I256>` rather than
Expand Down
3 changes: 1 addition & 2 deletions crates/nexum-sdk/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
//! repeatedly: required-key lookup, optional-key lookup, and decimal
//! parsing for thresholds / amounts. Hoisting these here keeps the
//! example modules consuming the SDK rather than re-implementing the
//! same loops around it (each copy in price-alert + stop-loss had
//! started to drift in error wording).
//! same loops around it.

use alloy_primitives::{I256, U256};
use thiserror::Error;
Expand Down
2 changes: 1 addition & 1 deletion docs/00-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ shepherd/
├── modules/
│ ├── twap-monitor/ TWAP order monitoring module
│ ├── ethflow-watcher/ Ethflow order monitoring module
│ └── examples/ price-alert, balance-tracker, stop-loss, http-probe reference modules
│ └── examples/ price-alert, balance-tracker, http-probe reference modules
├── wit/
│ ├── nexum-host/ Universal WIT package (chain, identity, local-store, remote-store, messaging, logging)
│ └── shepherd-cow/ CoW Protocol WIT package (cow-api, shepherd)
Expand Down
4 changes: 2 additions & 2 deletions docs/05-sdk-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ the venue stays orderbook-only:
`sweep` slice composing the poll loop over the typed `CowClient`.

The shipped CoW keepers - `modules/twap-monitor`,
`modules/ethflow-watcher`, `modules/examples/stop-loss` - are ordinary
`#[videre_sdk::keeper]` modules on this surface.
`modules/ethflow-watcher` - are ordinary `#[videre_sdk::keeper]`
modules on this surface.

## Non-Rust module and adapter authors

Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ manifest = "/opt/shepherd/manifests/twap-monitor.toml"
[[modules]]
path = "/opt/shepherd/modules/ethflow_watcher.wasm"
manifest = "/opt/shepherd/manifests/ethflow-watcher.toml"
# Add price-alert / balance-tracker / stop-loss the same way.
# Add price-alert / balance-tracker the same way.
```

If you want compose to use this file instead of the bundled
Expand Down
5 changes: 2 additions & 3 deletions docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ The local-store is a single redb file at
`last_dispatched_block:{chain_id}` keys; losing it on a
production module forces a from-scratch resync (twap-monitor
re-discovers `watch:` from the next `ConditionalOrderCreated`
log; stop-loss re-issues a `submitted:` write if the trigger
fires again).
log).

### 4.1 Cold backup (recommended for first deploy + before upgrades)

Expand Down Expand Up @@ -461,7 +460,7 @@ defaults.
| Class | Modules typical | Fuel/event | Memory cap | Notes |
|---|---|---|---|---|
| **Light indexer** | price-alert, balance-tracker | 200M | 16 MiB | Block-tick poll + 1-2 RPC reads. Defaults are 5× headroom. |
| **TWAP-style polling** | twap-monitor, stop-loss | 1B (default) | 64 MiB (default) | Per-block `getTradeableOrderWithSignature` calls per registered order; long ABI decode + signature work. Defaults sized for this case. |
| **TWAP-style polling** | twap-monitor | 1B (default) | 64 MiB (default) | Per-block `getTradeableOrderWithSignature` calls per registered order; long ABI decode + signature work. Defaults sized for this case. |
| **Multi-chain swarm** | 5+ modules × 2+ chains | 2B | 128 MiB | More headroom for parallel dispatch overhead; modules don't share state, but the per-store wasmtime overhead is per-(module, chain). |

A module that consistently traps `OutOfFuel` is a bug, not a
Expand Down
2 changes: 1 addition & 1 deletion docs/testing-runtime-harness.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before writing a runtime test.
`nexum-sdk-test::MockHost` (CoW modules: `shepherd-sdk-test::MockHost`).
No wasmtime, no component boundary, no engine crate at all. This is
already the dominant pattern across every shipped module (twap-monitor,
ethflow-watcher, stop-loss, price-alert, balance-tracker) - see
ethflow-watcher, price-alert, balance-tracker) - see
[docs/sdk.md](sdk.md#companions-nexum-sdk-test-and-shepherd-sdk-test).
**New module-logic tests belong here.**
- **The engine harness (this page) is reserved for engine, host, and
Expand Down
6 changes: 1 addition & 5 deletions engine.docker.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ rpc_url = "${BASE_RPC_URL}"

# ---- modules ----
#
# The image bakes all five production modules at the paths below.
# The image bakes all four production modules at the paths below.
# Comment out any you don't intend to run on this deployment.

[[modules]]
Expand All @@ -74,10 +74,6 @@ manifest = "/opt/shepherd/manifests/price-alert.toml"
path = "/opt/shepherd/modules/balance_tracker.wasm"
manifest = "/opt/shepherd/manifests/balance-tracker.toml"

[[modules]]
path = "/opt/shepherd/modules/stop_loss.wasm"
manifest = "/opt/shepherd/manifests/stop-loss.toml"

# ---- adapters ----
#
# The bundled cow venue adapter: the venue registry resolves the `cow`
Expand Down
9 changes: 2 additions & 7 deletions engine.e2e.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# E2E testnet integration config for nexum.
#
# Boots all 5 production + example modules on Sepolia simultaneously
# Boots all 4 production + example modules on Sepolia simultaneously
# for the 4-6 h E2E run:
#
# - twap-monitor (modules/twap-monitor)
# - ethflow-watcher (modules/ethflow-watcher)
# - price-alert (modules/examples/price-alert)
# - balance-tracker (modules/examples/balance-tracker)
# - stop-loss (modules/examples/stop-loss)
#
# This is the integration step between the M3 single-chain runbook
# (`engine.m3.toml`, 3 modules) and the 7-day soak
# (`engine.m3.toml`, 2 modules) and the 7-day soak
# (Sepolia + Arb Sepolia, all modules, no human-in-the-loop). The
# E2E run validates correctness in a real-chain dispatch context;
# the soak validates stability afterwards.
Expand Down Expand Up @@ -62,10 +61,6 @@ manifest = "modules/examples/price-alert/module.toml"
path = "target/wasm32-wasip2/release/balance_tracker.wasm"
manifest = "modules/examples/balance-tracker/module.toml"

[[modules]]
path = "target/wasm32-wasip2/release/stop_loss.wasm"
manifest = "modules/examples/stop-loss/module.toml"

# --- adapters ---------------------------------------------------------

# The cow venue adapter twap-monitor submits through (`just
Expand Down
15 changes: 5 additions & 10 deletions engine.m3.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# M3 smoke / validation config for nexum.
#
# Boots the 3 M3 example modules (price-alert + balance-tracker +
# stop-loss) against Sepolia. The 3 modules exercise the full SDK
# helper surface (chain::request via Chainlink read, local-store
# diffing, pool submit through the cow adapter with PreSign).
# Boots the 2 M3 example modules (price-alert + balance-tracker)
# against Sepolia. The modules exercise the full SDK helper surface
# (chain::request via Chainlink read, local-store diffing, pool submit
# through the cow adapter with PreSign).
#
# Usage:
# just run-m3
# # or:
# cargo build -p price-alert --target wasm32-wasip2 --release
# cargo build -p balance-tracker --target wasm32-wasip2 --release
# cargo build -p stop-loss --target wasm32-wasip2 --release
# cargo build -p cow-venue --features adapter --target wasm32-wasip2 --release
# cargo run -p shepherd -- --engine-config engine.m3.toml

Expand All @@ -32,13 +31,9 @@ manifest = "modules/examples/price-alert/module.toml"
path = "target/wasm32-wasip2/release/balance_tracker.wasm"
manifest = "modules/examples/balance-tracker/module.toml"

[[modules]]
path = "target/wasm32-wasip2/release/stop_loss.wasm"
manifest = "modules/examples/stop-loss/module.toml"

# --- adapters ---------------------------------------------------------

# The cow venue adapter stop-loss submits through (`just
# The cow venue adapter the modules submit through (`just
# build-cow-venue`). Sepolia manifest: the adapter's orderbook must
# match the chain the oracle is read on.
[[adapters]]
Expand Down
4 changes: 0 additions & 4 deletions engine.soak.docker.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ manifest = "/opt/shepherd/manifests/price-alert.toml"
path = "/opt/shepherd/modules/balance_tracker.wasm"
manifest = "/opt/shepherd/manifests/balance-tracker.toml"

[[modules]]
path = "/opt/shepherd/modules/stop_loss.wasm"
manifest = "/opt/shepherd/manifests/stop-loss.toml"

# --- adapters -----------------------------------------------------------

# The cow venue adapter twap-monitor submits through. Sepolia
Expand Down
6 changes: 1 addition & 5 deletions engine.soak.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# cargo build --release -p nexum-cli
# cargo build --target wasm32-wasip2 --release \
# -p twap-monitor -p ethflow-watcher -p price-alert \
# -p balance-tracker -p stop-loss
# -p balance-tracker
# cargo build --target wasm32-wasip2 --release \
# -p cow-venue --features cow-venue/adapter
# ./target/release/nexum --engine-config engine.soak.toml
Expand Down Expand Up @@ -65,10 +65,6 @@ manifest = "modules/examples/price-alert/module.toml"
path = "target/wasm32-wasip2/release/balance_tracker.wasm"
manifest = "modules/examples/balance-tracker/module.toml"

[[modules]]
path = "target/wasm32-wasip2/release/stop_loss.wasm"
manifest = "modules/examples/stop-loss/module.toml"

# --- adapters ---------------------------------------------------------

# The cow venue adapter twap-monitor submits through (`just
Expand Down
15 changes: 7 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ build-m2:
run-m2: build-m2 build-cow-venue build-engine
cargo run -p shepherd -- --engine-config engine.m2.toml --pretty-logs

# Build the M3 example modules (price-alert + balance-tracker + stop-loss)
# for wasm32-wasip2.
# Build the M3 example modules (price-alert + balance-tracker) for
# wasm32-wasip2.
build-m3:
cargo build -p price-alert --target wasm32-wasip2 --release
cargo build -p balance-tracker --target wasm32-wasip2 --release
cargo build -p stop-loss --target wasm32-wasip2 --release

# Run nexum wired for the M3 smoke / validation scenario
# (Sepolia, 3 example modules). See `docs/operations/m3-testnet-runbook.md`.
# (Sepolia, 2 example modules). See `docs/operations/m3-testnet-runbook.md`.
# --pretty-logs keeps the runbook-friendly human-readable formatter;
# production deploys omit the flag and emit JSON.
run-m3: build-m3 build-cow-venue build-engine
Expand All @@ -65,11 +64,11 @@ run-m3: build-m3 build-cow-venue build-engine
build-http-probe:
cargo build -p http-probe --target wasm32-wasip2 --release

# Build all 5 modules required by the E2E run (twap-monitor +
# ethflow-watcher + price-alert + balance-tracker + stop-loss).
# Build all 4 modules required by the E2E run (twap-monitor +
# ethflow-watcher + price-alert + balance-tracker).
build-e2e: build-m2 build-m3

# Run the 4-6 h E2E integration scenario on Sepolia. All 5 modules
# Run the 4-6 h E2E integration scenario on Sepolia. All 4 modules
# dispatched simultaneously against a live RPC; metrics scraped at
# 127.0.0.1:9100/metrics. JSON logs (no --pretty-logs) so a
# downstream `jq` filter can mine submitted/dropped/backoff markers
Expand Down Expand Up @@ -108,7 +107,7 @@ ci:
cargo doc --workspace --no-deps
cargo build --release --target wasm32-wasip2 \
-p example -p twap-monitor -p ethflow-watcher -p price-alert \
-p balance-tracker -p stop-loss -p http-probe -p echo-venue \
-p balance-tracker -p http-probe -p echo-venue \
-p echo-client -p clock-reader -p flaky-bomb -p flaky-venue -p fuel-bomb \
-p memory-bomb -p panic-bomb -p slow-host
cargo test --workspace --all-features --no-fail-fast
27 changes: 0 additions & 27 deletions modules/examples/stop-loss/Cargo.toml

This file was deleted.

Loading
Loading