Skip to content

Add Storm messaging - #2

Merged
ivanlele merged 1 commit into
masterfrom
feature/storm
Aug 6, 2026
Merged

Add Storm messaging#2
ivanlele merged 1 commit into
masterfrom
feature/storm

Conversation

@ivanlele

@ivanlele ivanlele commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Implementation of Storm Communication Layer by the Document design

@ivanlele ivanlele self-assigned this Aug 6, 2026
@ivanlele
ivanlele requested a lite review from Copilot August 6, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Rust workspace member (storm) that implements a Storm peer-to-peer messaging layer using Noise-authenticated/encrypted TCP connections, peer discovery coordination, and routing of application-defined custom messages.

Changes:

  • Added the storm crate with core types (peers, messages, errors, state) and the Storm/StormHandle APIs.
  • Implemented network transport (Noise handshake + framed encrypted I/O), peer connection management, and discovery table exchange.
  • Added an interactive example binary (basic) plus config/docs and a comprehensive test suite.

Reviewed changes

Copilot reviewed 29 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
storm/src/tests.rs End-to-end and unit tests covering connections, discovery, message routing, and error behavior.
storm/src/storm.rs Defines Storm, StormHandle, handler registration, and public send API.
storm/src/state.rs Adds StormState and connection planning logic.
storm/src/peer.rs Introduces Peer and PeerStatus models.
storm/src/network.rs Implements listener lifecycle, handshakes, encrypted connection loop, and frame I/O.
storm/src/message.rs Defines StormMessage encoding/decoding and stream reassembly.
storm/src/message_handlers/pears_socket_info.rs Handles discovery/peer-table socket info exchange and validation.
storm/src/message_handlers/mod.rs Declares message handler modules and dispatches by payload type/version.
storm/src/message_handlers/heartbeat.rs Adds a heartbeat handler (no-op).
storm/src/message_handlers/error.rs Defines error payload format, encoding, and logging handler.
storm/src/message_handlers/custom.rs Defines CustomMsg wire format and handler dispatch via registered callback.
storm/src/message_handlers/ask_peers_socket_info.rs Implements request/response flow to retrieve peer socket table.
storm/src/lib.rs Crate root exports and module wiring for storm.
storm/src/handle.rs Implements StormHandle operations: send, connect, discovery broadcast, discovery completion.
storm/src/error.rs Defines Error types for networking/handshake/messaging and config misuse.
storm/src/crypto.rs Provides a Snow resolver mapping DH choice to secp256k1 ECDH.
storm/src/constants.rs Adds protocol constants (bind addr, protocol version, Noise params/prologue).
storm/README.md High-level crate description and how to run the example.
storm/EXAMPLE_NODE.md Walkthrough for discovery/discoverable/restored example node modes.
storm/config/restored.toml Example restored-mode config.
storm/config/discovery.toml Example discovery-coordinator config.
storm/config/discoverable.toml Example discoverable-node config.
storm/config/discoverable-third.toml Example third-node discoverable config.
storm/Cargo.toml Adds crate metadata, deps, and example binary definition.
storm/bin/tui.rs TUI UI + log plumbing for the example node.
storm/bin/config.rs TOML config parsing + peer persistence for the example node.
storm/bin/basic.rs CLI entrypoint for running discovery/discoverable/restored example nodes.
rust-toolchain.toml Pins the Rust toolchain channel for the workspace.
Cargo.toml Defines a workspace including the storm crate.
Cargo.lock Locks dependency versions for the new workspace/crate.
.gitignore Ignores build output and generated peers files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread storm/src/message.rs
Comment thread storm/src/message_handlers/mod.rs Outdated
pub(crate) mod custom;
pub(crate) mod error;
mod heartbeat;
pub(crate) mod pears_socket_info;

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You got me

@ivanlele
ivanlele merged commit dc64064 into master Aug 6, 2026
2 checks passed
@ivanlele
ivanlele deleted the feature/storm branch August 6, 2026 15:04
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.

2 participants