HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulekes-agent-1.3.0.0Haskell2010

Cardano.KESAgent.Processes.Agent.Type

The Agent type, representing the state of a running KES agent process.

  • 3 types
  • 1 value
datadata AgentTrace
#
Instances2Show, Pretty
  • Show AgentTraceDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Processes.Agent.Type
  • Pretty AgentTraceDefined in kes-agent-1.3.0.0 · Cardano.KESAgent.Processes.Agent.Type
datadata AgentOptions (m :: Type -> Type) addr c
#

Configuration options for creating a new KES agent process.

Constructors

  • AgentOptions
    • agentTracer :: Tracer m AgentTrace
    • agentControlAddr :: Maybe addr

      Socket on which the agent will be listening for control messages, i.e., KES keys being pushed from a control server. For "relay" agents that don't need to receive any control connections, this can be Nothing.

    • agentServiceAddr :: addr

      Socket on which the agent will send KES keys to any connected nodes.

    • agentBootstrapAddr :: [addr]

      Sockets that the agent will use for bootstrapping from other agents.

    • agentEvolutionConfig :: EvolutionConfig

      Evolution configuration: genesis, slot duration, slots per KES period

    • agentGetCurrentTime :: m UTCTime

      Return the current time. Should normally be set to getPOSIXTime, but overriding this may be desirable for testing purposes.

    • agentColdVerKey :: VerKeyDSIGN (DSIGN c)

      Cold verification key, used for verifying operational certificates. The KES agent will only accept operational certificates signed using the corresponding cold signing key.

    • agentGenSeed :: m (MLockedSeed (SeedSizeKES (KES c)))

      Seed generator for generating KES signing keys. This is configurable for testing purposes. *It is vitally important for the security of generated keys that a cryptographically sound seed generator is used here. Production code should always use mlockedSeedNewRandom from cardano-crypto-class here.*

datadata Agent c (m :: Type -> Type) fd addr
#

KES agent state.

Constructors

  • Agent
    • agentSnocket :: Snocket m fd addr
    • agentMRB :: MakeRawBearer m fd
    • agentOptions :: AgentOptions m addr c
    • agentCurrentKeyVar :: TMVar m (Maybe (TaggedBundle m c))

      Holds the currently active bundle, if any. By convention, the possible states and their meanings are: - Empty TMVar: a thread is actively accessing the key bundle store. Use takeTMVar to block until it's your turn. - Nothing: no key bundle has been received, or the last active key bundle has reached the end of its available evolutions. We do not need to propagate this fact to service clients. - Just TaggedBundle { taggedBundle = Nothing }: a bundle has been deleted. We should propagate this to service clients. - Just TaggedBundle { taggedBundle = bundle }: we have an active bundle. We should propagate this to service clients. Further, we must hold a reference to any key stored here, and release that reference when we remove the key from the store.

    • agentStagedKeyVar :: TMVar m (Maybe (CRef m (SignKeyWithPeriodKES (KES c))))

      Holds the staged KES signing key, if any. We must hold a reference to this key for the duration it is stored here. When moving a key from the staged area to the current slot (agentCurrentKeyVar), we may reuse the reference.

    • agentNextKeyChan :: TChan m (TaggedBundle m c)

      Used for broadcasting new keys and forced key deletions as they are installed. Clients should obtain a reference to the contained keys before using them.

    • agentServiceFD :: fd

      Snocket-specific file descriptor for the service socket.

    • agentControlFD :: Maybe fd

      Snocket-specific file descriptor for the control socket, if any.

    • agentBootstrapConnections :: TMVar m (Map Text ConnectionStatus)

      Boostrapping connections. Each of these acts as a service client to another KES agent, receiving keys and installing them locally. This is the core mechanism for achieving redundancy / self-healing.