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
120 changes: 11 additions & 109 deletions Cargo.lock

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

20 changes: 5 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ members = [
"crates/nexum-world",
"crates/no-std-probe",
"crates/shepherd",
"crates/shepherd-cow-host",
"crates/shepherd-sdk",
"crates/shepherd-sdk-test",
"crates/videre-host",
"crates/videre-macros",
"crates/videre-sdk",
Expand Down Expand Up @@ -123,19 +120,12 @@ alloy-transport-ws = { version = "2.1", default-features = false }
# the engine can key maps and signatures on `Chain` instead of a bare u64.
alloy-chains = { version = "0.2", default-features = false, features = ["std", "serde"] }

# CoW Protocol bindings. Pinned to one version across the workspace
# (was `1.0.0-alpha` in engine vs `1.0.0-alpha.3` in SDK before
# 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.2.0", default-features = false, features = ["http-client"] }

# HTTP transport for `cow_api::request` REST passthrough and the
# orderbook-mock test surface.
# HTTP transport for the SDK helpers and the orderbook-mock test
# surface.
reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
# Typed HTTP method/request/response for the CoW passthrough and the
# engine's wasi:http gate. Single `http` version in the graph via reqwest,
# so `reqwest::Method` is `http::Method`.
# Typed HTTP method/request/response for the engine's wasi:http gate.
# Single `http` version in the graph via reqwest, so `reqwest::Method`
# is `http::Method`.
http = "1"
# Body trait + combinators (already in the graph via wasmtime-wasi-http)
# for the engine's response-body cap on the wasi:http gate.
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ Looking for the org? See **[github.com/nullislabs](https://github.com/nullislabs
| `crates/nexum-runtime/` | The **engine** - the Nexum Runtime's reference host: a wasmtime implementation of the `nexum:host` contract. |
| `crates/nexum-launch/` | The generic launcher library - shared CLI, config load, tracing, and the preset-driven launch. |
| `crates/nexum-cli/` | The bare `nexum` binary - the core lattice with no extension payload. |
| `crates/shepherd/` | The `shepherd` binary - the cow composition root wiring the cow-api extension. |
| `crates/shepherd/` | The `shepherd` binary - the cow composition root registering the videre venue platform. |
| `crates/nexum-sdk/` | Generic guest SDK - the host trait seam, bind macro, chain/config/address helpers, wasi:http `fetch`, and tracing facade for any module. |
| `crates/shepherd-sdk/` | CoW-domain guest SDK - the cow-api trait and CoW Protocol helpers on top of `nexum-sdk`. |
| `wit/nexum-host/` | The **`nexum:host`** WIT package - the host/guest contract every engine implements and every module imports. |
| `wit/shepherd-cow/` | The `shepherd:cow` WIT package - CoW Protocol extensions on top of `nexum:host`. |
| `wit/shepherd-cow/` | The `shepherd:cow` WIT package - the CoW event ABIs of record. |
| `modules/` | Guest modules - TWAP and EthFlow watch-towers, examples, and test fixtures. |
| `docs/` | Architecture and design notes. Start with [`docs/00-overview.md`](docs/00-overview.md). |

Expand Down Expand Up @@ -84,7 +83,7 @@ name = "twap-monitor"
version = "0.1.0"

[capabilities]
required = ["chain", "local-store", "cow-api"]
required = ["chain", "local-store", "client"]
optional = ["http"]

[[subscription]]
Expand Down
17 changes: 16 additions & 1 deletion crates/composable-cow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "ComposableCoW keeper machinery: the conditional-order body and the structured poll Verdict, with the deployed 1.x revert decoding quarantined behind LegacyRevertAdapter."
description = "ComposableCoW keeper machinery: the conditional-order body, the structured poll Verdict with the deployed 1.x revert decoding quarantined behind LegacyRevertAdapter, and the sweep composition over the venue client."

[lib]
# Plain library, keeper-side only. The CoW venue crate is orderbook-only
Expand All @@ -21,6 +21,21 @@ alloy-sol-types.workspace = true
borsh.workspace = true
cowprotocol = { version = "0.2.0", default-features = false }
nexum-sdk = { path = "../nexum-sdk" }
# `sweep` slice: the keeper run over the typed CoW client on the
# `videre:venue/client` seam.
cow-venue = { path = "../cow-venue", features = ["client", "assembly"], optional = true }
videre-sdk = { path = "../videre-sdk", optional = true }
tracing = { workspace = true, optional = true }

[features]
# The poll-loop composition conditional-commitment keepers share:
# gate/journal discipline, pool submission, and retry dispatch.
sweep = ["dep:cow-venue", "dep:videre-sdk", "dep:tracing"]

[dev-dependencies]
proptest.workspace = true
nexum-sdk-test = { path = "../nexum-sdk-test" }

[[test]]
name = "sweep"
required-features = ["sweep"]
7 changes: 6 additions & 1 deletion crates/composable-cow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
//! ComposableCoW keeper machinery, kept out of the CoW venue: the
//! conditional-order body ([`ComposableBody`]) and the structured poll
//! seam ([`Verdict`]), with the deployed 1.x reverting wire quarantined
//! behind [`LegacyRevertAdapter`].
//! behind [`LegacyRevertAdapter`]. The `sweep` slice adds the shared
//! poll-loop composition ([`run`]) over the typed CoW venue client.
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![warn(missing_docs)]

pub mod body;
pub mod poll;
#[cfg(feature = "sweep")]
pub mod sweep;

pub use body::ComposableBody;
pub use poll::{IConditionalOrder, LegacyRevertAdapter, Verdict};
#[cfg(feature = "sweep")]
pub use sweep::run;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Keeper run: the poll-loop composition conditional-
//! Keeper sweep: the poll-loop composition conditional-
//! commitment modules share.
//!
//! [`run`] walks the keeper watch set, polls each gate-ready
Expand All @@ -19,7 +19,8 @@
//! the composed behaviour with one capture.

use alloy_primitives::{Address, Bytes, hex};
use composable_cow::Verdict;
use cow_venue::assembly::{gpv2_to_order_data, order_data_to_body};
use cow_venue::{CowClient, CowIntent, CowIntentBody, SignedOrder, intent_id};
use cowprotocol::GPv2OrderData;
use nexum_sdk::host::{Fault, LocalStoreHost};
use nexum_sdk::keeper::{
Expand All @@ -28,10 +29,7 @@ use nexum_sdk::keeper::{
use videre_sdk::keeper::retry_action;
use videre_sdk::{ClientError, SubmitOutcome, VenueTransport, rt};

use super::{
CowClient, CowIntent, CowIntentBody, SignedOrder, gpv2_to_order_data, intent_id,
order_data_to_body,
};
use crate::Verdict;

/// Poll every gate-ready watch once at `tick` and run each outcome's
/// effect. One source poll per ready watch; a `Post` outcome makes at
Expand Down
Loading
Loading