From 7995cd57920ae2c9f8581eed55025154eb3fa015 Mon Sep 17 00:00:00 2001 From: Nicholas Dudfield Date: Tue, 14 Apr 2026 13:48:32 +0700 Subject: [PATCH] feat: recognise type=none as null-nodestore config NullFactory (type=none) already provides the exact null-backend semantics: fetchNodeObject returns notFound, store is a no-op, no disk I/O. Previously SHAMapStoreImp treated any non-"rwdb" type as disk-backed and called dbPaths() unconditionally, crashing with boost::filesystem::create_directories on an empty path. - Recognise "none" alongside "rwdb" as a memory backend (skips dbPaths() and takes the memory-backend rotation path). - On type=none, set XAHAU_RWDB_NULL=1 (overwrite=0) so the existing isRWDBNullMode() helpers in SHAMapSync, InboundLedger, Ledger etc. detect null-mode semantics (FBC liveness+anchor, setFullyWired, rotation-copy skip) without requiring the env var to be set separately. Makes type=none a first-class null-backend config declaration, equivalent to type=rwdb + XAHAU_RWDB_NULL=1 but without the env-var dance. Users can now write: [node_db] type = none online_delete = 16 --- src/xrpld/app/misc/SHAMapStoreImp.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xrpld/app/misc/SHAMapStoreImp.cpp b/src/xrpld/app/misc/SHAMapStoreImp.cpp index b3dd12d66..c20984028 100644 --- a/src/xrpld/app/misc/SHAMapStoreImp.cpp +++ b/src/xrpld/app/misc/SHAMapStoreImp.cpp @@ -154,7 +154,17 @@ SHAMapStoreImp::SHAMapStoreImp( } get_if_exists(section, "online_delete", deleteInterval_); - isMemoryBackend_ = boost::iequals(get(section, "type"), "rwdb"); + auto const backendType = get(section, "type"); + isMemoryBackend_ = boost::iequals(backendType, "rwdb") || + boost::iequals(backendType, "none"); + + // type=none is the declared null-nodestore config (via NullFactory). + // Propagate to XAHAU_RWDB_NULL so isRWDBNullMode() in other components + // (SHAMapSync, InboundLedger, Ledger) picks up null-mode semantics via + // their file-local helpers. overwrite=0 preserves any value the user + // has already set. + if (boost::iequals(backendType, "none")) + ::setenv("XAHAU_RWDB_NULL", "1", 0); // For RWDB, default online_delete to ledger_history only if user did not // explicitly set online_delete. Clamp to the minimum so an implicit