Skip to content

sgns::peerregistry::PeerRegistry

Interface of an authorization authority that resolves the current authorized peer set and its quorum threshold from cached state. SecureCrdtRegistryEntry carries an optional shared_ptr to the PeerRegistry instance owning the registered key pattern, making the per-key association explicit instead of implicitly assuming TrustedPeerRegistry (D-04).

#include <PeerRegistry.hpp>

Inherited by sgns::networkregistry::NetworkRegistry, sgns::trustedpeer::TrustedPeerRegistry

Public Functions

Name
virtual ~PeerRegistry() =default
virtual outcome::result< sgns::securecrdt::SignerSetSnapshot > CurrentSignerSet() const =0
Resolves the current authorized signer set and required signature count.
virtual std::vector< std::string > GetCurrentPeers() const =0
Returns the cached current authorized peer set (e.g. for connection-gater allow-list polling). Cached-only, same re-entrancy guard as CurrentSignerSet().
virtual sgns::crdt::HierarchicalKey BaseKey() const =0
Returns the CRDT base key this registry is registered under (e.g. "trusted-peer-registry" or "network-registry/").

Public Functions Documentation

function ~PeerRegistry

virtual ~PeerRegistry() =default

function CurrentSignerSet

virtual outcome::result< sgns::securecrdt::SignerSetSnapshot > CurrentSignerSet() const =0

Resolves the current authorized signer set and required signature count.

Return: Snapshot of the current signer set + quorum threshold, or an error if the registry cannot resolve a set yet.

Reimplemented by: sgns::networkregistry::NetworkRegistry::CurrentSignerSet, sgns::trustedpeer::TrustedPeerRegistry::CurrentSignerSet

Implementations MUST resolve from cached state ONLY and MUST NEVER re-enter the SecureCrdt quorum-read path (re-entrancy guard): this method is invoked from inside SecureCrdt's verification flow, so reading quorum state again would deadlock or double-count (see TrustedPeerRegistry:: ResolveSignerSet's cached-only contract).

function GetCurrentPeers

virtual std::vector< std::string > GetCurrentPeers() const =0

Returns the cached current authorized peer set (e.g. for connection-gater allow-list polling). Cached-only, same re-entrancy guard as CurrentSignerSet().

Return: Current authorized peer identifiers.

Reimplemented by: sgns::networkregistry::NetworkRegistry::GetCurrentPeers, sgns::trustedpeer::TrustedPeerRegistry::GetCurrentPeers

function BaseKey

virtual sgns::crdt::HierarchicalKey BaseKey() const =0

Returns the CRDT base key this registry is registered under (e.g. "trusted-peer-registry" or "network-registry/").

Return: HierarchicalKey of this registry's CRDT branch.

Reimplemented by: sgns::networkregistry::NetworkRegistry::BaseKey, sgns::trustedpeer::TrustedPeerRegistry::BaseKey


Updated on 2026-10-06 at 13:34:20 +0000