Add Storm messaging - #2
Merged
Merged
Conversation
There was a problem hiding this comment.
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
stormcrate with core types (peers, messages, errors, state) and theStorm/StormHandleAPIs. - 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.
| pub(crate) mod custom; | ||
| pub(crate) mod error; | ||
| mod heartbeat; | ||
| pub(crate) mod pears_socket_info; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of Storm Communication Layer by the Document design