From b75c20f5bb993f932b11611a919a580e971683c9 Mon Sep 17 00:00:00 2001 From: John Lotoski Date: Thu, 24 Apr 2025 21:18:15 -0500 Subject: [PATCH] imp: add ledger db default config for 10.4.0 --- cardano-lib/default.nix | 4 ++-- cardano-lib/mainnet-config.nix | 21 ++++++++++++++++++++- cardano-lib/preprod-config.nix | 21 ++++++++++++++++++++- cardano-lib/preview-config.nix | 21 ++++++++++++++++++++- cardano-lib/testnet-template/config.json | 6 ++++++ 5 files changed, 68 insertions(+), 5 deletions(-) diff --git a/cardano-lib/default.nix b/cardano-lib/default.nix index 201132d0..a82e013a 100644 --- a/cardano-lib/default.nix +++ b/cardano-lib/default.nix @@ -120,8 +120,8 @@ let # as needed. Any node version string suffixes, such as `-pre`, should be # removed from this string identifier. # - # Min currently 10.2.1 for `GenesisMode` support. - minNodeVersion = { MinNodeVersion = "10.2.1"; }; + # Min currently 10.4.0 for `LedgerDB` config support. + minNodeVersion = { MinNodeVersion = "10.4.0"; }; environments = mapAttrs (name: env: { inherit name; diff --git a/cardano-lib/mainnet-config.nix b/cardano-lib/mainnet-config.nix index 19db356b..ce8bc789 100644 --- a/cardano-lib/mainnet-config.nix +++ b/cardano-lib/mainnet-config.nix @@ -3,7 +3,7 @@ ############### Cardano Node Configuration ############### ########################################################## -{ +with builtins; { ##### Locations ##### ByronGenesisFile = ./mainnet + "/byron-genesis.json"; @@ -50,6 +50,25 @@ SyncTargetNumberOfKnownBigLedgerPeers = 100; MinBigLedgerPeersForTrustedState = 5; + # Default Ledger Configuration + # Additional configuration options can be found at: + # https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/utxo-hd/migrating + LedgerDB = { + # The time interval between snapshots, in seconds. + SnapshotInterval = (fromJSON (readFile ./mainnet/shelley-genesis.json)).securityParam * 2; + + # The number of disk snapshots to keep. + NumOfDiskSnapshots = 2; + + # When querying the store for a big range of UTxOs (such as with + # QueryUTxOByAddress), the store will be read in batches of this size. + QueryBatchSize = 100; + + # The backend can either be in memory with `V2InMemory` or on disk with + # `V1LMDB`. + Backend = "V2InMemory"; + }; + ##### Update system parameters ##### # This protocol version number gets used by block producing nodes as part diff --git a/cardano-lib/preprod-config.nix b/cardano-lib/preprod-config.nix index 05d0b639..dc768193 100644 --- a/cardano-lib/preprod-config.nix +++ b/cardano-lib/preprod-config.nix @@ -3,7 +3,7 @@ ############### Cardano Node Configuration ############### ########################################################## -{ +with builtins; { ##### Locations ##### ByronGenesisFile = ./preprod + "/byron-genesis.json"; @@ -45,6 +45,25 @@ SyncTargetNumberOfKnownBigLedgerPeers = 100; MinBigLedgerPeersForTrustedState = 5; + # Default Ledger Configuration + # Additional configuration options can be found at: + # https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/utxo-hd/migrating + LedgerDB = { + # The time interval between snapshots, in seconds. + SnapshotInterval = (fromJSON (readFile ./preprod/shelley-genesis.json)).securityParam * 2; + + # The number of disk snapshots to keep. + NumOfDiskSnapshots = 2; + + # When querying the store for a big range of UTxOs (such as with + # QueryUTxOByAddress), the store will be read in batches of this size. + QueryBatchSize = 100; + + # The backend can either be in memory with `V2InMemory` or on disk with + # `V1LMDB`. + Backend = "V2InMemory"; + }; + ##### Update system parameters ##### # This protocol version number gets used by block producing nodes as part diff --git a/cardano-lib/preview-config.nix b/cardano-lib/preview-config.nix index 97c42145..c1e9e173 100644 --- a/cardano-lib/preview-config.nix +++ b/cardano-lib/preview-config.nix @@ -3,7 +3,7 @@ ############### Cardano Node Configuration ############### ########################################################## -{ +with builtins; { ##### Locations ##### ByronGenesisFile = ./preview + "/byron-genesis.json"; @@ -45,6 +45,25 @@ SyncTargetNumberOfKnownBigLedgerPeers = 100; MinBigLedgerPeersForTrustedState = 5; + # Default Ledger Configuration + # Additional configuration options can be found at: + # https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/utxo-hd/migrating + LedgerDB = { + # The time interval between snapshots, in seconds. + SnapshotInterval = (fromJSON (readFile ./preview/shelley-genesis.json)).securityParam * 2; + + # The number of disk snapshots to keep. + NumOfDiskSnapshots = 2; + + # When querying the store for a big range of UTxOs (such as with + # QueryUTxOByAddress), the store will be read in batches of this size. + QueryBatchSize = 100; + + # The backend can either be in memory with `V2InMemory` or on disk with + # `V1LMDB`. + Backend = "V2InMemory"; + }; + ##### Update system parameters ##### LastKnownBlockVersion-Major = 3; diff --git a/cardano-lib/testnet-template/config.json b/cardano-lib/testnet-template/config.json index f168da12..fe7cf6ab 100644 --- a/cardano-lib/testnet-template/config.json +++ b/cardano-lib/testnet-template/config.json @@ -8,6 +8,12 @@ "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, "LastKnownBlockVersion-Minor": 1, + "LedgerDB": { + "Backend": "V2InMemory", + "NumOfDiskSnapshots": 2, + "QueryBatchSize": 100, + "SnapshotInterval": 216 + }, "MaxConcurrencyDeadline": 4, "MaxKnownMajorProtocolVersion": 2, "PBftSignatureThreshold": 1.1,