Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
014b90a
refactor(observability): rename the RuntimeAddOns trait to RuntimeAddOn
mfw78 Jul 8, 2026
5972f64
refactor(runtime): drop the unread LaunchContext.data_dir and comment…
mfw78 Jul 8, 2026
796fabb
docs(runtime): clarify the preset add-on lifetime comment
mfw78 Jul 8, 2026
87e4dc0
refactor(runtime): future-proof the shutdown tally, fix its doc
mfw78 Jul 8, 2026
5aa6bfb
fix(runtime): give the component build path a typed error
mfw78 Jul 8, 2026
85c424c
fix(runtime): make the CLI launch root the explicit executor seam
mfw78 Jul 8, 2026
a8aebe7
refactor(runtime): bind the default executor to a local and correct t…
mfw78 Jul 8, 2026
c13c909
style(runtime): collapse the with_add_ons signature onto one line
mfw78 Jul 8, 2026
e1282d9
test(runtime): assert guest-observed wasi:clocks time under a ManualC…
mfw78 Jul 8, 2026
9f9f513
docs(host): tidy the error.rs fault mapping and label docs
mfw78 Jul 8, 2026
a2eb561
feat(cow-ext): carry the orderbook rejection data payload to the guest
mfw78 Jul 6, 2026
a951ae3
refactor(cow-sdk): drop the stale ApiError prelude re-export
mfw78 Jul 6, 2026
19acdeb
docs(cow): fix the OrderRejection.data and prelude surface docs
mfw78 Jul 8, 2026
0359b40
feat(sdk + twap-monitor): submit appData hash-only and retire resolve…
mfw78 Jul 6, 2026
c9f1120
feat(sdk): add the chassis stores over the local-store host trait
mfw78 Jul 6, 2026
624f84b
refactor(ethflow-watcher): record observed markers through the chassi…
mfw78 Jul 6, 2026
f5ec806
feat(sdk): add the chassis conditional-source seam, retry ledger, and…
mfw78 Jul 6, 2026
a5779c0
docs(sdk): disambiguate the materialise intra-doc link
mfw78 Jul 6, 2026
60f534e
fix(cow): build the classify_poll_error test RpcError data as Bytes
mfw78 Jul 8, 2026
ae2bd05
feat(sdk): log materialiser diagnostics through the tracing facade
mfw78 Jul 6, 2026
cf2a241
refactor(twap-monitor): port the poll loop onto the chassis composition
mfw78 Jul 6, 2026
19c3317
feat(sdk-test): namespace the mock local store and share its limits
mfw78 Jul 6, 2026
265f467
feat(sdk-test): add the programmable MockVenue on the cow-api seam
mfw78 Jul 6, 2026
1b567c9
test(#60,#61): assert topic-0 values and add EthFlow error-path tests
lgahdl Jul 9, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
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 flaky-bomb -p fuel-bomb -p memory-bomb -p panic-bomb
-p clock-reader -p flaky-bomb -p fuel-bomb -p memory-bomb -p panic-bomb
- run: cargo test --workspace --all-features --no-fail-fast --locked

docs:
Expand Down
40 changes: 23 additions & 17 deletions Cargo.lock

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

11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"modules/examples/http-probe",
"modules/examples/price-alert",
"modules/examples/stop-loss",
"modules/fixtures/clock-reader",
"modules/fixtures/flaky-bomb",
"modules/fixtures/fuel-bomb",
"modules/fixtures/memory-bomb",
Expand Down Expand Up @@ -99,7 +100,7 @@ alloy-chains = { version = "0.2", default-features = false, features = ["std", "
# hoisting). The engine takes `http-client` for `OrderBookApi`;
# guest-side consumers (SDK, strategies) express their own
# `default-features = false` builds for the `cdylib` wasm target.
cowprotocol = { version = "0.1.0", default-features = false, features = ["http-client"] }
cowprotocol = { version = "0.2.0", default-features = false, features = ["http-client"] }

# HTTP transport for `cow_api::request` REST passthrough and the
# orderbook-mock test surface.
Expand Down Expand Up @@ -182,6 +183,14 @@ unsafe_op_in_unsafe_fn = "warn"
dbg_macro = "deny"
todo = "deny"

# `cowprotocol` 0.2.0 (the `OrderCreationAppData` hash-only submission
# shape plus the WASI clock fix that keeps `js_sys` out of non-browser
# wasm builds) is not published yet; the latest crates.io release is
# 0.2.0-alpha.1 without either. Patch to the cow-rs rev carrying both.
# Drop once a cowprotocol release with the hash-only constructor ships.
[patch.crates-io]
cowprotocol = { git = "https://github.com/nullislabs/cow-rs", rev = "17fc0c5f55d04fad38963911da07d5da9290fefb" }

[profile.dev]
panic = "abort"

Expand Down
9 changes: 7 additions & 2 deletions crates/nexum-cli/src/launch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

use std::path::Path;

use nexum_runtime::addons::{PrometheusAddOn, RuntimeAddOns};
use nexum_runtime::addons::{PrometheusAddOn, RuntimeAddOn};
use nexum_runtime::builder::RuntimeBuilder;
use nexum_runtime::engine_config::EngineConfig;
use nexum_runtime::host::component::{
ComponentsBuilder, LocalStoreBuilder, ProviderPoolBuilder, RuntimeTypes,
};
use nexum_runtime::host::local_store_redb::LocalStore;
use nexum_runtime::host::provider_pool::ProviderPool;
use nexum_runtime::runtime::task::TokioExecutor;
use shepherd_cow_host::{ReferenceExt, ReferenceExtBuilder, extension};

/// The backends the reference engine ships: the core seams plus the
Expand Down Expand Up @@ -40,7 +41,7 @@ pub async fn run_from_config(
// Attach the reference add-on set. The binary ships the Prometheus
// exporter; an embedder omits or replaces it by choosing a different
// list here.
let add_ons: [&dyn RuntimeAddOns; 1] = [&PrometheusAddOn];
let add_ons: [&dyn RuntimeAddOn; 1] = [&PrometheusAddOn];

// Assemble and launch over the type-state builder: bind the reference
// lattice, wire cow-api as an extension (linker hook plus capability
Expand All @@ -51,6 +52,10 @@ pub async fn run_from_config(
.with_types::<ReferenceTypes>()
.with_extensions([extension::<ReferenceTypes>()])
.with_module_source(wasm.map(Path::to_path_buf), manifest.map(Path::to_path_buf))
// The launch root is the executor-selection seam: the binary spawns on
// tokio, while an embedder or a non-tokio target substitutes its own
// executor here.
.with_executor(&TokioExecutor)
.with_components(ComponentsBuilder::new(
ProviderPoolBuilder,
LocalStoreBuilder,
Expand Down
8 changes: 4 additions & 4 deletions crates/nexum-runtime/src/addons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! replaces any of them instead of inheriting a fixed install.
//!
//! A future control-surface add-on (an admin or RPC socket) slots in beside
//! [`PrometheusAddOn`]: implement [`RuntimeAddOns`], read its own section
//! [`PrometheusAddOn`]: implement [`RuntimeAddOn`], read its own section
//! from [`AddOnsContext`], and add it to the launcher's list at the
//! composition root.

Expand Down Expand Up @@ -39,15 +39,15 @@ impl AddOnHandle {

/// A process-wide facility attached to the launch path. `install` reads the
/// resolved config from `ctx` and returns a handle the launcher retains.
pub trait RuntimeAddOns {
pub trait RuntimeAddOn {
/// Install the facility, returning its live handle.
fn install(&self, ctx: &AddOnsContext<'_>) -> anyhow::Result<AddOnHandle>;
}

/// An owned, ordered add-on set gathered behind one value. A preset or
/// composition root returns this so a heterogeneous set travels together;
/// the launcher borrows each element to install it.
pub type AddOns = Vec<Box<dyn RuntimeAddOns>>;
pub type AddOns = Vec<Box<dyn RuntimeAddOn>>;

/// The Prometheus exporter add-on. With `[engine.metrics].enabled = true`
/// it binds an HTTP listener serving `/metrics`; otherwise it installs the
Expand All @@ -56,7 +56,7 @@ pub type AddOns = Vec<Box<dyn RuntimeAddOns>>;
/// production with observability by flipping one config flag.
pub struct PrometheusAddOn;

impl RuntimeAddOns for PrometheusAddOn {
impl RuntimeAddOn for PrometheusAddOn {
fn install(&self, ctx: &AddOnsContext<'_>) -> anyhow::Result<AddOnHandle> {
if ctx.metrics.enabled {
let addr: std::net::SocketAddr = ctx.metrics.bind_addr.parse().map_err(|e| {
Expand Down
5 changes: 2 additions & 3 deletions crates/nexum-runtime/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

use std::path::Path;

use crate::addons::RuntimeAddOns;
use crate::addons::RuntimeAddOn;
use crate::builder::{AssembledRuntime, LaunchContext, LaunchRuntime};
use crate::engine_config::EngineConfig;
use crate::host::component::{Components, RuntimeTypes};
Expand All @@ -34,7 +34,7 @@ pub async fn run<T: RuntimeTypes>(
manifest: Option<&Path>,
components: &Components<T>,
extensions: &[Extension<T>],
add_ons: &[&dyn RuntimeAddOns],
add_ons: &[&dyn RuntimeAddOn],
) -> anyhow::Result<()> {
let runtime = AssembledRuntime {
components: components.clone(),
Expand All @@ -47,7 +47,6 @@ pub async fn run<T: RuntimeTypes>(
let executor = TokioExecutor;
let ctx = LaunchContext {
executor: &executor,
data_dir: &engine_cfg.engine.state_dir,
config: engine_cfg,
};
runtime.launch(ctx).await?.wait().await
Expand Down
Loading