Skip to content

Commit 8cb5b08

Browse files
committed
feat: add LSM and mixed UTXO backends support
- Add LSM backend support in configuration, through existing `disk` backend. - Add `disklmdb` and `empty` as valid values for `UTXO_BACKEND`. - Introduce `MIXED_UTXO_BACKENDS` environment variable for mixed setups. - Update regression scripts and workflows to recognize new backend options. - Document new variables and backend types in README. - Bump `cardonnay` dependency to 0.2.11.
1 parent 53cb63b commit 8cb5b08

File tree

8 files changed

+29
-23
lines changed

8 files changed

+29
-23
lines changed

.github/regression.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fi
7777

7878
# Decrease the number of tests per cluster if we are using the "disk" (LMDB) UTxO backend to avoid
7979
# having too many concurrent readers.
80-
if [ -z "${MAX_TESTS_PER_CLUSTER:-""}" ] && [ "${UTXO_BACKEND:-""}" = "disk" ]; then
80+
if [ -z "${MAX_TESTS_PER_CLUSTER:-""}" ] && [[ "${UTXO_BACKEND:-""}" = "disk"* ]]; then
8181
export MAX_TESTS_PER_CLUSTER=5
8282
fi
8383

.github/workflows/regression-dbsync.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ on:
5151
- ""
5252
- mem
5353
- disk
54+
- disklmdb
5455
default: ""
5556
byron_cluster:
5657
type: boolean

.github/workflows/regression.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ on:
4343
- ""
4444
- mem
4545
- disk
46+
- disklmdb
4647
default: ""
4748
byron_cluster:
4849
type: boolean

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,22 +114,23 @@ For workflows requiring repeated test runs on a persistent testnet cluster:
114114

115115
You can fine-tune test runs using these environment variables:
116116

117-
| Variable | Description |
118-
| ----------------------- | ------------------------------------------ |
119-
| `BOOTSTRAP_DIR` | Bootstrap testnet directory. |
120-
| `CLUSTERS_COUNT` | Number of clusters to launch (default: 9). |
121-
| `CLUSTER_ERA` | Cluster era (default: `conway`). |
122-
| `COMMAND_ERA` | CLI command target era. |
123-
| `ENABLE_LEGACY` | Use legacy networking. |
124-
| `KEEP_CLUSTERS_RUNNING` | Don't shut down clusters after tests. |
125-
| `MARKEXPR` | Marker expression for pytest filtering. |
126-
| `MAX_TESTS_PER_CLUSTER` | Max tests per cluster (default: 8). |
127-
| `MIXED_P2P` | Use a mix of P2P and legacy networking. |
128-
| `NUM_POOLS` | Number of stake pools (default: 3). |
129-
| `PORTS_BASE` | Starting port number for cluster services. |
130-
| `SCHEDULING_LOG` | Path to scheduler log output. |
131-
| `TESTNET_VARIANT` | Name of the testnet variant to use. |
132-
| `UTXO_BACKEND` | Backend type: `mem` or `disk`. |
117+
| Variable | Description |
118+
| ----------------------- | --------------------------------------------------- |
119+
| `BOOTSTRAP_DIR` | Bootstrap testnet directory. |
120+
| `CLUSTERS_COUNT` | Number of clusters to launch (default: 9). |
121+
| `CLUSTER_ERA` | Cluster era (default: `conway`). |
122+
| `COMMAND_ERA` | CLI command target era. |
123+
| `ENABLE_LEGACY` | Use legacy networking. |
124+
| `KEEP_CLUSTERS_RUNNING` | Don't shut down clusters after tests. |
125+
| `MARKEXPR` | Marker expression for pytest filtering. |
126+
| `MAX_TESTS_PER_CLUSTER` | Max tests per cluster (default: 8). |
127+
| `MIXED_P2P` | Use a mix of P2P and legacy networking. |
128+
| `NUM_POOLS` | Number of stake pools (default: 3). |
129+
| `PORTS_BASE` | Starting port number for cluster services. |
130+
| `SCHEDULING_LOG` | Path to scheduler log output. |
131+
| `TESTNET_VARIANT` | Name of the testnet variant to use. |
132+
| `UTXO_BACKEND` | Backend type: `mem`, `disk`, `disklmdb` or `empty`. |
133+
| `MIXED_UTXO_BACKENDS` | List of UTXO backends for mixed setup. |
133134

134135
### ▶️ Additional for `regression.sh`
135136

cardano_node_tests/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def pytest_configure(config: tp.Any) -> None:
102102
config.stash[metadata_key]["MIXED_P2P"] = str(configuration.MIXED_P2P)
103103
config.stash[metadata_key]["NUM_POOLS"] = str(configuration.NUM_POOLS)
104104
config.stash[metadata_key]["UTXO_BACKEND"] = configuration.UTXO_BACKEND
105+
config.stash[metadata_key]["MIXED_UTXO_BACKENDS"] = configuration.MIXED_UTXO_BACKENDS
105106
config.stash[metadata_key]["MAX_TESTS_PER_CLUSTER"] = configuration.MAX_TESTS_PER_CLUSTER
106107
# If not explicitly specified, the `CLUSTERS_COUNT` is calculated based on number of xdist
107108
# workers, which is not known yet by the time this fixture runs.

cardano_node_tests/utils/configuration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727

2828
# Used also in startup scripts
2929
UTXO_BACKEND = os.environ.get("UTXO_BACKEND") or ""
30-
if UTXO_BACKEND not in ("", "mem", "disk"):
30+
if UTXO_BACKEND not in ("", "mem", "disk", "disklmdb", "empty"):
3131
msg = f"Invalid UTXO_BACKEND: {UTXO_BACKEND}"
3232
raise RuntimeError(msg)
33+
# Used also in startup scripts
34+
MIXED_UTXO_BACKENDS = os.environ.get("MIXED_UTXO_BACKENDS") or ""
3335

3436
# Resolve CARDANO_NODE_SOCKET_PATH
3537
STARTUP_CARDANO_NODE_SOCKET_PATH = (

poetry.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ classifiers = [
2626
dependencies = [
2727
"allure-pytest (>=2.15.2,<3.0.0)",
2828
"cardano-clusterlib (>=0.9.8,<0.10.0)",
29-
"cardonnay (>=0.2.10,<0.3.0)",
29+
"cardonnay (>=0.2.11,<0.3.0)",
3030
"cbor2 (>=5.7.1,<6.0.0)",
3131
"filelock (>=3.20.0,<4.0.0)",
3232
"hypothesis (>=6.148.7,<7.0.0)",

0 commit comments

Comments
 (0)