Skip to content

Commit 89e3944

Browse files
committed
nix: remove lmdb
1 parent c61bee7 commit 89e3944

6 files changed

Lines changed: 7 additions & 51 deletions

File tree

configuration/cardano/mainnet-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ LedgerDB:
8686
QueryBatchSize: 100000
8787

8888
# The backend can either be in memory with `V2InMemory` or on disk with
89-
# `V1LMDB` or `V2LSM`.
89+
# `V2LSM`.
9090
Backend: V2InMemory
9191

9292
# Instead of an object with individual options, a predefined snapshot

nix/docker/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,13 @@ state types as needed, without relying on host level tooling or full
216216
chain ledger replays.
217217

218218
An example follows to convert preprod ledger state in a named docker volume
219-
from a memory based ledger snapshot to an LMDB snapshot when node is not
219+
from a memory based ledger snapshot to an LSM snapshot when node is not
220220
already running:
221221
```
222222
docker run -v preprod-data:/data --rm -it --entrypoint=bash ghcr.io/intersectmbo/cardano-node:dev -c '
223223
mv /data/db/ledger /data/db/ledger-old \
224-
&& mkdir -p /data/db/ledger \
225-
&& snapshot-converter --mem-in /data/db/ledger-old/20807240 --lmdb-out /data/db/ledger/20807240 --config /opt/cardano/config/preprod/config.json
224+
&& mkdir -p /data/db/ledger /data/db/lsm \
225+
&& snapshot-converter --input-mem /data/db/ledger-old/20807240 --output-lsm-snapshot /data/db/ledger/20807240 --output-lsm-database /data/db/lsm --config /opt/cardano/config/preprod/config.json
226226
'
227227
```
228228

nix/haskell.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ let
5454
# These programs will be available inside the nix-shell.
5555
nativeBuildInputs = with pkgs.pkgsBuildBuild; [
5656
alejandra
57-
lmdb
5857
nix-prefetch-git
5958
pkg-config
6059
git

nix/nixos/cardano-node-service.nix

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ let
8282
Backend = "V2LSM";
8383
LSMDatabasePath = cfg.lsmDatabasePath i;
8484
};
85-
}
86-
// optionalAttrs (cfg.withUtxoHdLmdb i){
87-
LedgerDB = {
88-
Backend = "V1LMDB";
89-
LiveTablesPath = cfg.lmdbDatabasePath i;
90-
};
9185
};
9286
in i: let
9387
instanceConfig = recursiveUpdate (baseInstanceConfig i) (cfg.extraNodeInstanceConfig i);
@@ -393,16 +387,6 @@ in {
393387
description = ''The node database path, for each instance.'';
394388
};
395389

396-
lmdbDatabasePath = mkOption {
397-
type = funcToOr nullOrStr;
398-
default = null;
399-
apply = x : if lib.isFunction x then x else if x == null then _: null else _: x;
400-
description = ''
401-
A node UTxO-HD on-disk LMDB path for performant disk I/O, for each instance.
402-
This could point to a direct-access SSD, with a specifically created journal-less file system and optimized mount options.
403-
'';
404-
};
405-
406390
lsmDatabasePath = mkOption {
407391
type = funcToOr nullOrStr;
408392
default = null;
@@ -757,16 +741,6 @@ in {
757741
'';
758742
};
759743

760-
withUtxoHdLmdb = mkOption {
761-
type = funcToOr bool;
762-
default = false;
763-
apply = x: if lib.isFunction x then x else _: x;
764-
description = ''
765-
On a UTxO-HD enabled node, the in-memory backend is the default.
766-
This activates the on-disk backend (LMDB) instead.
767-
'';
768-
};
769-
770744
withUtxoHdLsmt = mkOption {
771745
type = funcToOr bool;
772746
default = false;
@@ -858,7 +832,6 @@ in {
858832
};
859833

860834
config = mkIf cfg.enable ( let
861-
lmdbPaths = filter (x: x != null) (map (e: cfg.lmdbDatabasePath e) (genList trivial.id cfg.instances));
862835
lsmPaths = filter (x: x != null) (map (e: cfg.lsmDatabasePath e) (genList trivial.id cfg.instances));
863836
genInstanceConf = f: listToAttrs (if cfg.instances > 1
864837
then genList (i: let n = "cardano-node-${toString i}"; in nameValuePair n (f n i)) cfg.instances
@@ -988,18 +961,10 @@ in {
988961
assertion = !cfg.systemdSocketActivation;
989962
message = "Systemd socket activation cannot be used with p2p topology due to a systemd socket re-use issue.";
990963
}
991-
{
992-
assertion = (length lmdbPaths) == (length (lists.unique lmdbPaths));
993-
message = "When configuring multiple LMDB enabled nodes on one instance, lmdbDatabasePath must be unique.";
994-
}
995964
{
996965
assertion = (length lsmPaths) == (length (lists.unique lsmPaths));
997966
message = "When configuring multiple LSM enabled nodes on one instance, lsmDatabasePath must be unique.";
998967
}
999-
{
1000-
assertion = all (i: !(cfg.withUtxoHdLmdb i && cfg.withUtxoHdLsmt i)) (genList trivial.id cfg.instances);
1001-
message = "Each instance can only declare either withUtxoHdLmdb or withUtxoHdLsmt";
1002-
}
1003968
{
1004969
assertion = count (o: o != null) (with cfg; [
1005970
(tracerSocketPathAccept i)

nix/workbench/backend/nomad/cloud.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,13 @@ allocate-run-nomadcloud() {
701701
read -p "Hit enter to continue ..."
702702
fi
703703
fi
704-
# Clean, only producers, the "host_volumes" if being used for LMDB/LSMT.
704+
# Clean, only producers, the "host_volumes" if being used for LSMT.
705705
# We do this for each producer instead of for all producer at once because
706706
# even if modules have the same name from a Nomad perspective, in each
707707
# client the real path is defined in Nomad's config file and may differ!
708708
# It's "slow" (fetches individual client configs), done only if necessary.
709709
if test "${node_name}" != "explorer" \
710-
&& jqtest '.node.utxo_lmdb or .node.utxo_lsmt' "${dir}"/profile.json \
710+
&& jqtest '.node.utxo_lsmt' "${dir}"/profile.json \
711711
&& jqtest '(.cluster.nomad.host_volumes.producer | length) > 0' "${dir}"/profile.json
712712
then
713713
# Iterate over the profile's Nomad "host_volumes" array by key/index.

nix/workbench/service/nodes.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,9 @@ let
7373
topology = "topology.json";
7474
nodeConfigFile = "config.json";
7575

76-
# Allow for local clusters to have multiple LMDB directories in the same physical ssd_directory;
76+
# Allow for local clusters to have multiple on-disk (LSM-tree) directories in the same physical ssd_directory;
7777
# non-block producers (like the explorer node) keep using the in-memory backend
78-
withUtxoHdLmdb = profile.node.utxo_lmdb && isProducer;
7978
withUtxoHdLsmt = profile.node.utxo_lsmt && isProducer;
80-
lmdbDatabasePath = liveTablesPath i;
8179
lsmDatabasePath = liveTablesPath i;
8280

8381
## Combine:
@@ -130,12 +128,6 @@ let
130128
Backend = "V2LSM";
131129
LSMDatabasePath = liveTablesPath i;
132130
};
133-
} // optionalAttrs (profile.node.utxo_lmdb && isProducer)
134-
{
135-
LedgerDB = {
136-
Backend = "V1LMDB";
137-
LiveTablesPath = liveTablesPath i;
138-
};
139131
})
140132
(if __hasAttr "preset" profile && profile.preset != null
141133
## It's either an undisturbed preset,

0 commit comments

Comments
 (0)