Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query network state through LocalStateQuery mini-protocol #5033

Open
1 task
coot opened this issue Jan 3, 2025 · 0 comments
Open
1 task

Query network state through LocalStateQuery mini-protocol #5033

coot opened this issue Jan 3, 2025 · 0 comments
Assignees
Labels
diffusion Issues / PRs related to diffusion layer

Comments

@coot
Copy link
Contributor

coot commented Jan 3, 2025

In the first instance we will make it possible to query node-to-node state through LocalStateQuery mini-protocol (part of the node-to-client suite).

data ConnectionManagerState peeraddr = ConnectionManagerState {
    connectionMap                 :: Map (ConnectionId peeraddr) AbstractState,
    -- ^ map of connections, without outbound connections in
    -- `ReservedOutboundSt` state.

    registeredOutboundConnections :: Set peeraddr
    -- ^ set of outbound connections in `ReserverdOutboundSt` state.
  }
  deriving (Eq, Show)


data InboundState peeraddr = InboundState {
    remoteHotSet  :: !(Set (ConnectionId peeraddr)),
    remoteWarmSet :: !(Set (ConnectionId peeraddr)),
    remoteColdSet :: !(Set (ConnectionId peeraddr)),
    remoteIdleSet :: !(Set (ConnectionId peeraddr))
  }
  deriving (Eq, Show)

data OutboundState peeraddr = OutboundState {
    coldPeers :: Set peeraddr,
    warmPeers :: Set peeraddr,
    hotPeers  :: Set peeraddr
  }
  deriving (Eq, Show)


data NetworkState peeraddr = NetworkState {
    connectionManagerState :: ConnectionManagerState peeraddr,
    inboundGovernorState   :: InboundState peeraddr,
    outboundGovernorState  :: OutboundState peeraddr
  }
  deriving (Eq, Show)

At a later stage, the NetworkState will be extended with Handshake results.
This work will be merged / released once #5007 is merged.

TODOs

  • provide a CDDL spec for NetworkState CBOR encoding

Possible Future Extensions

  • add handshake versions & version data
  • add node-to-client data about inbound connections
  • a new mini-protocol which allows to subscribe to network state changes (this could be useful for monitoring local roots)

Branch

https://github.com/IntersectMBO/ouroboros-network/tree/coot/public-network-state

@coot coot added the diffusion Issues / PRs related to diffusion layer label Jan 3, 2025
@coot coot self-assigned this Jan 3, 2025
@coot coot changed the title Make it possible to query network state through LocalStateQuery mini-protocol (ntc) Query network state through LocalStateQuery mini-protocol (ntc) Jan 3, 2025
@coot coot changed the title Query network state through LocalStateQuery mini-protocol (ntc) Query network state through LocalStateQuery mini-protocol Jan 3, 2025
@coot coot moved this to In Progress in Ouroboros Network Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diffusion Issues / PRs related to diffusion layer
Projects
Status: In Progress
Development

No branches or pull requests

1 participant