Skip to content

thenodes v0.2.0

Choose a tag to compare

@yerkeroa yerkeroa released this 28 Feb 13:33
· 20 commits to main since this release
cd9b606

thenodes v0.2.0

Overview

TheNodes v0.2.0 is a major pre-1.0 milestone focused on closing the planned release gaps across security, persistence, and relay networking.
Compared to v0.1.0, this release includes substantial protocol and runtime updates, plus integration and reliability hardening.

Breaking Changes

  • Wire message type tokens now use SCREAMING_SNAKE_CASE (e.g. PEER_REQUEST, RELAY_BIND).
  • Reason enum values now serialize as snake_case (e.g. policy_denied, timeout).
  • HELLO now includes optional capabilities.
  • connect_to_peer() now uses a ConnectToPeerParams struct instead of positional arguments; the struct gains a peer_store field that callers must supply.
  • send_to_addr / send_to_node_id changed from blocking .send().await to non-blocking try_send() behavior.
  • TrustMode::from_str and StoreNew::from_str are no longer plain associated functions; they now implement std::str::FromStr (callers must handle the Result).

Added

  • ADR-0001 complete: SecureChannel abstraction with backend selection.
    • TLS backend
    • Plaintext backend
    • Optional Noise backend (feature-gated via --features noise, uses snow 0.9)
  • ADR-0002 complete: Persistent peer store with config-driven load/save, TTL, caps, and periodic persistence.
  • ADR-0003 complete: Relay node core implementation:
    • RELAY_BIND, RELAY_BIND_ACK, RELAY_FWD, RELAY_UNBIND, RELAY_NOTIFY
    • ACK token and reliable retry/ack scaffolding
    • Store-and-forward queueing with TTL and cap controls
    • HRW/Rendezvous-based relay selection with capability gating
  • New config sections (all opt-in, omitting a section keeps previous behaviour):
    • [network.persistence] — enabled, path, max_entries, ttl_secs, save_interval_secs
    • [network.relay] — enabled, store_forward, queue_max_per_target, queue_max_global, selection
    • [encryption.backend] — selects tls | noise | plaintext at runtime
    • [encryption.noise] — pattern, curve, cipher, hash, static_key_path
  • 10 new integration tests: peer_store_cap, peer_store_persistence, peer_store_ttl, relay_notify, relay_store_forward, relay_ttl_unbind, reliable_ack, reliable_retry, qos_behavior, plus relay_helpers shared harness.

Changed

  • start_listener() internal implementation replaced: inline TLS/rustls code removed; now fully delegates to the SecureChannel factory (public signature is unchanged from v0.1.0).
  • Runtime now consistently uses SecureChannel factory wiring for inbound/outbound handshakes.
  • Startup now initializes peer persistence from merged runtime config.
  • Relay queue limits are now configurable (queue_max_per_target, queue_max_global) with safe defaults.
  • HELLO capability advertisement is centralized and config-driven across paths.
  • Documentation and templates were aligned to v0.2.0 API surface.

Fixed

  • Removed relay enqueue async lock/await hang risk in queue path.
  • Discovery periodic task now sends real PEER_REQUEST messages.
  • PEER_REQUEST now returns actual PEER_LIST responses.
  • Template generator now reliably materializes template files during app generation.

Quality Gates

All required release checks passed:

  • cargo fmt --all -- --check
  • cargo build --workspace
  • cargo test --workspace --all-features -- --nocapture
  • cargo clippy --workspace --all-targets --all-features -- -D clippy::correctness -D clippy::perf -W clippy::style -W clippy::complexity

Upgrade Notes

  • Treat this as a protocol/API upgrade from v0.1.0; mixed-version interop is not expected.
  • Update any integrations that depend on previous message token casing or old function signatures.
  • If using templates or custom hosts, regenerate or align startup/prompt/listener wiring to v0.2.0 contracts.