mirror of
https://github.com/jmcorgan/fips.git
synced 2026-07-30 19:46:15 +00:00
Introduce a shared proto/codec module with a cursor Reader (short reads fail with
MessageTooShort { expected: position + needed, got: total }) and an append Writer,
and adopt them across the seven subsystem wire codecs, replacing the repetitive
manual slicing, try_into, and from_le_bytes extraction. Each existing length check
maps to the reader (an up-front minimum becomes require at position zero, so the
per-field expected values, including the tree-announce expected 99, are reproduced
exactly); the bloom exact-length check stays explicit since it also rejects
over-long payloads. Encoded bytes and decode decisions are unchanged.
20 lines
459 B
Rust
20 lines
459 B
Rust
//! Sans-IO (runtime-agnostic) protocol state machines.
|
|
//!
|
|
//! A module here has been migrated out of the async node shell; the async
|
|
//! I/O adapters remain in `node::handlers`.
|
|
|
|
mod error;
|
|
pub use error::Error;
|
|
|
|
pub(crate) mod bloom;
|
|
pub(crate) mod codec;
|
|
pub(crate) mod coord;
|
|
pub(crate) mod discovery;
|
|
pub(crate) mod fmp;
|
|
pub(crate) mod fsp;
|
|
pub(crate) mod link;
|
|
pub(crate) mod mmp;
|
|
pub(crate) mod rate_limit;
|
|
pub(crate) mod routing;
|
|
pub(crate) mod stp;
|