Skip to content

[ARCH-06] MemNetwork and IrohNetwork have asymmetric unknown-event handling — test double hides production bugs #258

@intendednull

Description

@intendednull

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions