Skip to content

Remove configuration reload action in cardano-rpc server startup#1114

Open
carbolymer wants to merge 1 commit intomasterfrom
mgalazyn/chore/remove-config-reload-action
Open

Remove configuration reload action in cardano-rpc server startup#1114
carbolymer wants to merge 1 commit intomasterfrom
mgalazyn/chore/remove-config-reload-action

Conversation

@carbolymer
Copy link
Contributor

@carbolymer carbolymer commented Feb 26, 2026

Changelog

- description: |
    Remove configuration reload action in cardano-rpc server startup
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
   - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
   - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...
# uncomment at least one main project this PR is associated with
  projects:
  # - cardano-api
  # - cardano-api-gen
   - cardano-rpc
  # - cardano-wasm

Context

This is not needed anymore, as configuration reload is implemented as whole server restart:

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

Copilot AI review requested due to automatic review settings February 26, 2026 16:28
@carbolymer carbolymer self-assigned this Feb 26, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the configuration reload action from cardano-rpc server startup, switching runRpcServer to accept a preloaded (RpcConfig, NetworkMagic) since reload is now handled via full server restart.

Changes:

  • Update runRpcServer signature to take (RpcConfig, NetworkMagic) instead of an IO reload action.
  • Inline destructuring of the configuration tuple in runRpcServer.
  • Remove outdated TODO/comment about logging on config reload.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 67 to +71
runRpcServer
:: Tracer IO TraceRpc
-> IO (RpcConfig, NetworkMagic)
-- ^ action which reloads RPC configuration
-> (RpcConfig, NetworkMagic)
-> IO ()
runRpcServer tracer loadRpcConfig = handleFatalExceptions $ do
( rpcConfig@RpcConfig
{ isEnabled = Identity isEnabled
, rpcSocketPath = Identity (File rpcSocketPathFp)
, nodeSocketPath = Identity nodeSocketPath
}
, networkMagic
) <-
loadRpcConfig
let config =
runRpcServer tracer rpcConfig = handleFatalExceptions $ do
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes runRpcServer from taking an IO action to taking a pure (RpcConfig, NetworkMagic) value, which is an API-breaking change for any existing call sites. If the project expects this function to remain stable for external/internal consumers, consider keeping a backward-compatible wrapper (e.g., runRpcServerWithReload :: Tracer IO TraceRpc -> IO (RpcConfig, NetworkMagic) -> IO ()) that calls the new runRpcServer after loading once.

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +79
runRpcServer tracer rpcConfig = handleFatalExceptions $ do
let ( RpcConfig
{ isEnabled = Identity isEnabled
, rpcSocketPath = Identity (File rpcSocketPathFp)
, nodeSocketPath = Identity nodeSocketPath
}
, networkMagic
) = rpcConfig
config =
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter name rpcConfig is misleading now that it holds a tuple (RpcConfig, NetworkMagic) (it’s not just the RpcConfig). Renaming it to something like rpcCfgAndMagic / rpcConfigAndMagic (or destructuring in the argument list) would make the code easier to read and reduce confusion.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants