Open
Conversation
Phase 1 of the instance-based libqaul refactoring. Each router submodule now has a *State struct that owns what was previously in global statics, enabling multiple independent nodes in one process. - RouterState: top-level struct owning all router sub-state - NeighboursState: per-module neighbour tables (internet/lan/ble) - ConnectionTableState: per-module connection tables + local routes - RoutingTableState: global routing table with instance methods - SchedulerState: routing info scheduler - FlooderState, FeedRequester/ResponserState, UserRequester/ResponserState - UsersState: in-memory user table (no DB dependency) All global statics are preserved for backward compatibility. The existing code paths are unchanged — all 20 libqaul tests pass. New qaul-sim crate provides full-mesh routing simulation: - Topology: line, ring, grid, star, full-mesh graph builders - Network: latency sampling with jitter and packet loss - Simulator: discrete-time driver calling real libqaul code - Metrics: convergence and reachability tracking - Scenarios: predefined topologies + timed events - Criterion benchmarks for convergence performance 24 simulation tests pass including convergence for line, ring, grid, star, full-mesh topologies, link failure/recovery, latency spikes, and network partition/heal scenarios.
…de/storage/rpc Add *State structs to all modules with global statics, enabling multi-instance use for simulation. Phases 2-4 of the instance-based refactor: - Phase 2 (Services): MessagingState, FeedState, ChatState, ChatFileState, CryptoStorageState, GroupStorageState, DtnModuleState, ServicesState - Phase 3 (Connections): InternetState, BleModuleState, ConnectionsState - Phase 4 (Node/Storage/RPC): UserAccountsState, ConfigurationState, DatabaseState, RpcState, SysRpcState, AuthenticationState, FileLoggerState Global statics remain for backward compatibility. All existing tests pass.
…on tests - Add connection module support to links (BLE, Internet, LAN per link) - Simulator now uses each link's module for routing differentiation - Enhanced metrics: avg/max hop count, routes-by-module breakdown - New scenarios: BLE-only mesh, mixed BLE+LAN, Internet relay, mixed star BLE+Internet - Integration tests verifying all State structs are independently constructible and composable without global state - New benchmarks for BLE mesh, mixed BLE+LAN, Internet relay convergence - Total: 36 tests (up from 24), all passing
…ased refactoring Remove ~950 lines of duplicate static→instance forwarding methods, unused instance methods, _inner indirection, and dead code that accumulated during the global-to-instance state migration: - Router: remove ConnectionTable/Neighbours/RoutingTable static forwarders, callers now use router state directly - Services: inline Feed/Messaging/DTN _inner methods into their State structs, remove static forwarding methods - Rpc/Sys: remove unused RpcState/SysRpcState instance methods and no-op inits - Authentication: inline _impl standalone functions into Authentication methods, remove unused AuthenticationState instance methods - UserAccounts: remove unused UserAccountsState instance methods and no-op init - Dead code: remove no-op Rtc::init and its callers
360ccf8 to
23ae124
Compare
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.
closes #786