Skip to content

feat(twap-monitor): workspace + skeleton (BLEU-825)#2

Open
brunota20 wants to merge 1 commit into
dev/m2-basefrom
feat/twap-monitor-skeleton-bleu-825
Open

feat(twap-monitor): workspace + skeleton (BLEU-825)#2
brunota20 wants to merge 1 commit into
dev/m2-basefrom
feat/twap-monitor-skeleton-bleu-825

Conversation

@brunota20

Copy link
Copy Markdown
Collaborator

Summary

  • Add modules/twap-monitor/ as a workspace member with [lib] crate-type = [\"cdylib\"] for WASM Component output.
  • Deps: cowprotocol (default-features off), alloy-sol-types, wit-bindgen — pre-pulled so BLEU-826/827/828 can layer in event decoding and submission without churning Cargo.toml.
  • src/lib.rs binds against shepherd:cow/shepherd world; init logs once, on_event is a no-op stub until BLEU-826 (TWAP indexing) and BLEU-827 (poll path) land.
  • generate_all is required because the shepherd world include pulls nexum:host/types across packages — without it, wit_bindgen::generate! panics on the missing cross-package mapping.

Base: dev/m2-base (carries the in-flight nullislabs/shepherd PRs #8/#9/#12/#15 so M2 can build on top of them while upstream review continues).

Linear: BLEU-825.

Test plan

  • `cargo build --target wasm32-wasip2 --release -p twap-monitor` — emits 65 KB `twap_monitor.wasm`.
  • `cargo check --target wasm32-wasip2 -p twap-monitor`.
  • Engine load — gated on `module.toml` (BLEU-834).

Add modules/twap-monitor/ as a workspace member. Cargo.toml declares
[lib] crate-type = ["cdylib"] for WASM Component output, and pulls
the deps the TWAP module path needs: cowprotocol (default-features
off — only typed primitives and OrderCreation surface needed),
alloy-sol-types (event/return decoding lands in BLEU-826/827), and
wit-bindgen.

src/lib.rs binds against the shepherd:cow/shepherd world (event-
module imports + cow-api). generate_all is required because the
world include pulls nexum:host/types across packages — without it,
wit-bindgen panics on the missing cross-package mapping. init and
on_event are stubbed: init logs once; on_event is a no-op until the
Event::Log / Event::Block dispatch lands in BLEU-826 / BLEU-827.

Verification: cargo build --target wasm32-wasip2 --release -p
twap-monitor emits a 65 KB .wasm. Engine load is gated on
module.toml (BLEU-834).
@linear-code

linear-code Bot commented Jun 15, 2026

Copy link
Copy Markdown

BLEU-825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant