Commit: 2f26d91 · Finding: ARCH-06
Problem
crates/network/src/mem.rs:275 has a catch-all _ => return Some(Ok(event)) that forwards everything as a successful event. crates/network/src/iroh.rs has no equivalent catch-all. The test-utils feature on willow-network is consumed broadly (client, agent, relay dev-deps, worker dev-deps), so many tests trust MemNetwork to model reality — but a schema mismatch between the two implementations won't be caught.
Fix
- Make
MemNetwork enumerate the same event shapes explicitly; remove the _ => arm so schema mismatch is a compile error.
- Alternatively, derive both from a shared
NetworkEvent enum with a single canonical decoder used by both backends.
Commit:
2f26d91· Finding:ARCH-06Problem
crates/network/src/mem.rs:275has a catch-all_ => return Some(Ok(event))that forwards everything as a successful event.crates/network/src/iroh.rshas no equivalent catch-all. Thetest-utilsfeature onwillow-networkis consumed broadly (client, agent, relay dev-deps, worker dev-deps), so many tests trustMemNetworkto model reality — but a schema mismatch between the two implementations won't be caught.Fix
MemNetworkenumerate the same event shapes explicitly; remove the_ =>arm so schema mismatch is a compile error.NetworkEventenum with a single canonical decoder used by both backends.