How to restart your staking server (faster)

Currently when I restart my server it spends hours upon hours doing this:


hainDB:Info:5] [2025-03-06 13:14:22.91 UTC] Validating chunk no. 4773 out of 6928. Progress: 68.88%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:24.29 UTC] Validated chunk no. 4773 out of 6928. Progress: 68.90%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:24.29 UTC] Validating chunk no. 4774 out of 6928. Progress: 68.90%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:26.08 UTC] Validated chunk no. 4774 out of 6928. Progress: 68.91%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:26.09 UTC] Validating chunk no. 4775 out of 6928. Progress: 68.91%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:28.19 UTC] Validated chunk no. 4775 out of 6928. Progress: 68.93%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:28.19 UTC] Validating chunk no. 4776 out of 6928. Progress: 68.93%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:29.70 UTC] Validated chunk no. 4776 out of 6928. Progress: 68.94%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:29.70 UTC] Validating chunk no. 4777 out of 6928. Progress: 68.94%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:31.22 UTC] Validated chunk no. 4777 out of 6928. Progress: 68.96%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:31.22 UTC] Validating chunk no. 4778 out of 6928. Progress: 68.96%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:32.80 UTC] Validated chunk no. 4778 out of 6928. Progress: 68.97%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:32.80 UTC] Validating chunk no. 4779 out of 6928. Progress: 68.97%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:36.07 UTC] Validated chunk no. 4779 out of 6928. Progress: 68.99%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:36.07 UTC] Validating chunk no. 4780 out of 6928. Progress: 68.99%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:38.34 UTC] Validated chunk no. 4780 out of 6928. Progress: 69.00%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:38.34 UTC] Validating chunk no. 4781 out of 6928. Progress: 69.00%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:39.71 UTC] Validated chunk no. 4781 out of 6928. Progress: 69.01%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:39.71 UTC] Validating chunk no. 4782 out of 6928. Progress: 69.01%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:41.47 UTC] Validated chunk no. 4782 out of 6928. Progress: 69.03%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:41.47 UTC] Validating chunk no. 4783 out of 6928. Progress: 69.03%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:43.41 UTC] Validated chunk no. 4783 out of 6928. Progress: 69.04%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:43.41 UTC] Validating chunk no. 4784 out of 6928. Progress: 69.04%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:44.75 UTC] Validated chunk no. 4784 out of 6928. Progress: 69.06%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:44.75 UTC] Validating chunk no. 4785 out of 6928. Progress: 69.06%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:46.12 UTC] Validated chunk no. 4785 out of 6928. Progress: 69.07%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:46.12 UTC] Validating chunk no. 4786 out of 6928. Progress: 69.07%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:48.08 UTC] Validated chunk no. 4786 out of 6928. Progress: 69.09%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:48.08 UTC] Validating chunk no. 4787 out of 6928. Progress: 69.09%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:50.77 UTC] Validated chunk no. 4787 out of 6928. Progress: 69.10%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:50.77 UTC] Validating chunk no. 4788 out of 6928. Progress: 69.10%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:54.50 UTC] Validated chunk no. 4788 out of 6928. Progress: 69.12%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:54.50 UTC] Validating chunk no. 4789 out of 6928. Progress: 69.12%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:56.14 UTC] Validated chunk no. 4789 out of 6928. Progress: 69.13%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:56.14 UTC] Validating chunk no. 4790 out of 6928. Progress: 69.13%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:58.69 UTC] Validated chunk no. 4790 out of 6928. Progress: 69.14%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:14:58.69 UTC] Validating chunk no. 4791 out of 6928. Progress: 69.14%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:15:01.18 UTC] Validated chunk no. 4791 out of 6928. Progress: 69.16%
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 13:15:01.18 UTC] Validating chunk no. 4792 out of 6928. Progress: 69.16%


All I needed to do was refresh my KES keys, but the entire process can take 24+ hours which is scary long right now.

How can I make it not feel the need to validate these chunks everytime or boot up faster? Is there no way?

The config I used is here

Node configuration: NodeConfiguration {ncSocketConfig = SocketConfig {ncNodeIPv4Addr = Last {getLast = Just 0.0.0.0}, ncNodeIPv6Addr = Last {getLast = Nothing}, ncNodePortNumber = Last {getLast = Just 6000}, ncSocketPath = Last {getLast = Just "/home/cardano/tts-pool/db/node.socket"}}, ncConfigFile = "/home/cardano/tts-pool/files/mainnet/mainnet-config.json", ncTopologyFile = "/home/cardano/tts-pool/files/mainnet/mainnet-topology.json", ncDatabaseFile = OnePathForAllDbs "/home/cardano/tts-pool/db", ncProtocolFiles = ProtocolFilepaths {byronCertFile = Nothing, byronKeyFile = Nothing, shelleyKESFile = Just "/home/cardano/tts-pool/keys/mainnet_kes.skey", shelleyVRFFile = Just "/home/cardano/tts-pool/keys/mainnet_vrf.skey", shelleyCertFile = Just "/home/cardano/tts-pool/keys/mainnet_opcert.cert", shelleyBulkCredsFile = Nothing}, ncValidateDB = False, ncShutdownConfig = ShutdownConfig {scIPC = Nothing, scOnSyncLimit = Just NoShutdown}, ncStartAsNonProducingNode = False, ncProtocolConfig = NodeProtocolConfigurationCardano (NodeByronProtocolConfiguration {npcByronGenesisFile = "/home/cardano/tts-pool/files/mainnet/byron-genesis.json", npcByronGenesisFileHash = Just "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", npcByronReqNetworkMagic = RequiresNoMagic, npcByronPbftSignatureThresh = Nothing, npcByronSupportedProtocolVersionMajor = 3, npcByronSupportedProtocolVersionMinor = 0, npcByronSupportedProtocolVersionAlt = 0}) (NodeShelleyProtocolConfiguration {npcShelleyGenesisFile = "/home/cardano/tts-pool/files/mainnet/shelley-genesis.json", npcShelleyGenesisFileHash = Just "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81"}) (NodeAlonzoProtocolConfiguration {npcAlonzoGenesisFile = "/home/cardano/tts-pool/files/mainnet/alonzo-genesis.json", npcAlonzoGenesisFileHash = Just "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874"}) (NodeConwayProtocolConfiguration {npcConwayGenesisFile = "/home/cardano/tts-pool/files/mainnet/conway-genesis.json", npcConwayGenesisFileHash = Just "15a199f895e461ec0ffc6dd4e4028af28a492ab4e806d39cb674c88f7643ef62"}) (NodeHardForkProtocolConfiguration {npcExperimentalHardForksEnabled = False, npcTestShelleyHardForkAtEpoch = Nothing, npcTestShelleyHardForkAtVersion = Nothing, npcTestAllegraHardForkAtEpoch = Nothing, npcTestAllegraHardForkAtVersion = Nothing, npcTestMaryHardForkAtEpoch = Nothing, npcTestMaryHardForkAtVersion = Nothing, npcTestAlonzoHardForkAtEpoch = Nothing, npcTestAlonzoHardForkAtVersion = Nothing, npcTestBabbageHardForkAtEpoch = Nothing, npcTestBabbageHardForkAtVersion = Nothing, npcTestConwayHardForkAtEpoch = Nothing, npcTestConwayHardForkAtVersion = Nothing}), ncDiffusionMode = InitiatorAndResponderDiffusionMode, ncNumOfDiskSnapshots = DefaultNumOfDiskSnapshots, ncSnapshotInterval = DefaultSnapshotInterval, ncExperimentalProtocolsEnabled = False, ncMaxConcurrencyBulkSync = Nothing, ncMaxConcurrencyDeadline = Nothing, ncLoggingSwitch = True, ncLogMetrics = True, ncTraceConfig = TracingOnLegacy (TraceSelection {traceVerbosity = NormalVerbosity, traceAcceptPolicy = OnOff {isOn = True}, traceBlockFetchClient = OnOff {isOn = False}, traceBlockFetchDecisions = OnOff {isOn = False}, traceBlockFetchProtocol = OnOff {isOn = False}, traceBlockFetchProtocolSerialised = OnOff {isOn = False}, traceBlockFetchServer = OnOff {isOn = False}, traceBlockchainTime = OnOff {isOn = False}, traceChainDB = OnOff {isOn = True}, traceChainSyncBlockServer = OnOff {isOn = False}, traceChainSyncClient = OnOff {isOn = False}, traceChainSyncHeaderServer = OnOff {isOn = False}, traceChainSyncProtocol = OnOff {isOn = False}, traceConnectionManager = OnOff {isOn = True}, traceConnectionManagerCounters = OnOff {isOn = True}, traceConnectionManagerTransitions = OnOff {isOn = False}, traceDebugPeerSelectionInitiatorTracer = OnOff {isOn = False}, traceDebugPeerSelectionInitiatorResponderTracer = OnOff {isOn = False}, traceDiffusionInitialization = OnOff {isOn = True}, traceDnsResolver = OnOff {isOn = False}, traceDnsSubscription = OnOff {isOn = True}, traceErrorPolicy = OnOff {isOn = True}, traceForge = OnOff {isOn = True}, traceForgeStateInfo = OnOff {isOn = True}, traceGDD = OnOff {isOn = False}, traceHandshake = OnOff {isOn = True}, traceInboundGovernor = OnOff {isOn = True}, traceInboundGovernorCounters = OnOff {isOn = True}, traceInboundGovernorTransitions = OnOff {isOn = True}, traceIpSubscription = OnOff {isOn = True}, traceKeepAliveClient = OnOff {isOn = False}, traceLedgerPeers = OnOff {isOn = True}, traceLocalChainSyncProtocol = OnOff {isOn = False}, traceLocalConnectionManager = OnOff {isOn = True}, traceLocalErrorPolicy = OnOff {isOn = True}, traceLocalHandshake = OnOff {isOn = True}, traceLocalInboundGovernor = OnOff {isOn = True}, traceLocalMux = OnOff {isOn = False}, traceLocalRootPeers = OnOff {isOn = True}, traceLocalServer = OnOff {isOn = True}, traceLocalStateQueryProtocol = OnOff {isOn = False}, traceLocalTxMonitorProtocol = OnOff {isOn = False}, traceLocalTxSubmissionProtocol = OnOff {isOn = False}, traceLocalTxSubmissionServer = OnOff {isOn = False}, traceMempool = OnOff {isOn = True}, traceMux = OnOff {isOn = False}, tracePeerSelection = OnOff {isOn = True}, tracePeerSelectionCounters = OnOff {isOn = True}, tracePeerSelectionActions = OnOff {isOn = True}, tracePublicRootPeers = OnOff {isOn = True}, traceSanityCheckIssue = OnOff {isOn = False}, traceServer = OnOff {isOn = True}, traceTxInbound = OnOff {isOn = True}, traceTxOutbound = OnOff {isOn = True}, traceTxSubmissionProtocol = OnOff {isOn = False}, traceTxSubmission2Protocol = OnOff {isOn = False}, traceGsm = OnOff {isOn = True}}), ncTraceForwardSocket = Nothing, ncMaybeMempoolCapacityOverride = Nothing, ncProtocolIdleTimeout = 5s, ncTimeWaitTimeout = 60s, ncChainSyncIdleTimeout = NoTimeoutOverride, ncAcceptedConnectionsLimit = AcceptedConnectionsLimit {acceptedConnectionsHardLimit = 512, acceptedConnectionsSoftLimit = 384, acceptedConnectionsDelay = 5s}, ncTargetNumberOfRootPeers = 100, ncTargetNumberOfKnownPeers = 100, ncTargetNumberOfEstablishedPeers = 50, ncTargetNumberOfActivePeers = 20, ncTargetNumberOfKnownBigLedgerPeers = 15, ncTargetNumberOfEstablishedBigLedgerPeers = 10, ncTargetNumberOfActiveBigLedgerPeers = 5, ncEnableP2P = EnabledP2PMode, ncPeerSharing = PeerSharingDisabled}

I also get this warning at start up:

[f1acebfe:cardano.node.ChainDB:Warning:5] [2025-03-06 10:45:31.57 UTC] ChainDB is not clean. Validating all immutable chunks
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 10:45:31.57 UTC] Started opening Chain DB
[f1acebfe:cardano.node.ChainDB:Info:5] [2025-03-06 10:45:31.57 UTC] Started opening Immutable DB


So I’m curious if maybe there is some technique when starting that might help with this process to speed it up.

On another note, I am using a docker container to run the cardano node from and I volume in the necessary files, I currently have the latest node installed on it to my knowledge, minting a block today even.

1 Like

Seems as if the node doesn’t shut down cleanly which is why it thinks the database is not clean and revalidates it.

Is whatever you use to start and stop the node (systemd?) killing it before it can cleanly close the database?

2 Likes

I’m currently closing it by just saying docker down basically, which I guess just kills it. If I have to login to the container to properly kill it what would be the way to do it?

Maybe put another way, what is the way you are currently shutting it down right now that is working nicely?

I don’t use Docker.

My systemd unit is:

[Unit]
Description=Cardano Node
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
WorkingDirectory=%h/.local/cardano/chains/%i/
EnvironmentFile=%h/.local/cardano/chains/%i/env
ExecStart=%h/.local/bin/cardano-node run --topology config/topology.json --database-path db --socket-path socket --config config/config.json --port ${CARDANO_NODE_PORT}
SyslogIdentifier=cnode@%i
KillSignal=SIGINT
TimeoutStopSec=300
LimitNOFILE=32768
Restart=always
RestartSec=5

[Install]
WantedBy=default.target

The KillSignal=SIGINT and TimeoutStopSec=300 are relevant for how it is shutdown.

1 Like

They once fixed that in the official Docker image:

But I can’t find it in the current configuration anymore:

Also: According to my searches, docker stop might be more appropriate than down.

1 Like