Skip to content

Commit 32d41a0

Browse files
committed
nix | wb: add utxo_lsmt attrs for LedgerDB.V2LSM config
1 parent e5ea401 commit 32d41a0

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

nix/nixos/cardano-node-service.nix

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ let
117117
hasPrometheus = map (n: if isInt n then n + i else n) baseConfig.hasPrometheus;
118118
})
119119
)
120+
// optionalAttrs (cfg.withUtxoHdLsmt i){
121+
LedgerDB = {
122+
Backend = "V2LSM";
123+
LSMDatabasePath = cfg.lmdbDatabasePath i;
124+
}
120125
// optionalAttrs (cfg.withUtxoHdLmdb i){
121126
LedgerDB = {
122127
Backend = "V1LMDB";
@@ -427,7 +432,7 @@ in {
427432
default = null;
428433
apply = x : if lib.isFunction x then x else if x == null then _: null else _: x;
429434
description = ''
430-
A node UTxO-HD LMDB path for performant disk I/O, for each instance.
435+
A node UTxO-HD on-disk (LMDB or LSM-trees) path for performant disk I/O, for each instance.
431436
This could point to a direct-access SSD, with a specifically created journal-less file system and optimized mount options.
432437
'';
433438
};
@@ -802,6 +807,16 @@ in {
802807
'';
803808
};
804809

810+
withUtxoHdLsmt = mkOption {
811+
type = funcToOr bool;
812+
default = false;
813+
apply = x: if lib.isFunction x then x else _: x;
814+
description = ''
815+
On a UTxO-HD enabled node, the in-memory backend is the default.
816+
This activates the on-disk backend (LSM-Trees) instead.
817+
'';
818+
};
819+
805820
extraArgs = mkOption {
806821
type = listOf str;
807822
default = [];

nix/workbench/service/nodes.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ let
7676
# Allow for local clusters to have multiple LMDB directories in the same physical ssd_directory;
7777
# non-block producers (like the explorer node) keep using the in-memory backend
7878
withUtxoHdLmdb = profile.node.utxo_lmdb && isProducer;
79+
withUtxoHdLsmt = profile.node.utxo_lsmt && isProducer;
7980
lmdbDatabasePath = liveTablesPath i;
8081

8182
## Combine:
@@ -127,8 +128,15 @@ let
127128
LedgerDB = {
128129
Backend = "V1LMDB";
129130
LiveTablesPath = liveTablesPath i;
130-
};
131-
})
131+
}
132+
} // optionalAttrs (profile.node.utxo_lsmt && isProducer)
133+
{
134+
LedgerDB = {
135+
Backend = "V2LSM";
136+
LSMDatabasePath = liveTablesPath i;
137+
}
138+
};
139+
)
132140
(if __hasAttr "preset" profile && profile.preset != null
133141
## It's either an undisturbed preset,
134142
## or a hardforked setup.

0 commit comments

Comments
 (0)