diff --git a/docs/stellar-core_example.cfg b/docs/stellar-core_example.cfg index d99f51f23d..62fffec320 100644 --- a/docs/stellar-core_example.cfg +++ b/docs/stellar-core_example.cfg @@ -207,31 +207,32 @@ FLOOD_DEMAND_BACKOFF_DELAY_MS = 500 # against each other. MAX_DEX_TX_OPERATIONS_IN_TX_SET = 0 -# EXPERIMENTAL_BUCKETLIST_DB (bool) default false -# Determines whether BucketListDB is used as the primary key-value store -# for Ledger Entry lookups. Currently experimental, should be set to false. -EXPERIMENTAL_BUCKETLIST_DB = false +# DEPRECATED_SQL_LEDGER_STATE (bool) default false +# When set to true, SQL is used to store all ledger state instead of +# BucketListDB. This is not recommended and may cause performance degregradation. +# This is deprecated and will be removed in the future. +DEPRECATED_SQL_LEDGER_STATE = false -# EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT (Integer) default 14 +# BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT (Integer) default 14 # Determines page size used by BucketListDB for range indexes, where -# pageSize == 2^EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT. If set to +# pageSize == 2^BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT. If set to # 0, indiviudal index is always used. Default page size 16 kb. -EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 14 +BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 14 -# EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF (Integer) default 20 +# BUCKETLIST_DB_INDEX_CUTOFF (Integer) default 20 # Size, in MB, determining whether a bucket should have an individual # key index or a key range index. If bucket size is below this value, range # based index will be used. If set to 0, all buckets are range indexed. If -# EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT == 0, value ingnored and all +# BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT == 0, value ingnored and all # buckets have individual key index. -EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 20 +BUCKETLIST_DB_INDEX_CUTOFF = 20 -# EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX (bool) default true +# BUCKETLIST_DB_PERSIST_INDEX (bool) default true # Determines whether BucketListDB indexes are saved to disk for faster # startup. Should only be set to false for testing. # Validators do not currently support persisted indexes. If NODE_IS_VALIDATOR=true, # this value is ingnored and indexes are never persisted. -EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX = true +BUCKETLIST_DB_PERSIST_INDEX = true # PREFERRED_PEERS (list of strings) default is empty # These are IP:port strings that this server will add to its DB of peers. diff --git a/docs/stellar-core_example_validators.cfg b/docs/stellar-core_example_validators.cfg index a1203e1047..10d6ced3ee 100644 --- a/docs/stellar-core_example_validators.cfg +++ b/docs/stellar-core_example_validators.cfg @@ -4,6 +4,7 @@ PUBLIC_HTTP_PORT=false NETWORK_PASSPHRASE="Example configuration" DATABASE="sqlite3://example.db" +DEPRECATED_SQL_LEDGER_STATE = false NODE_SEED="SA7FGJMMUIHNE3ZPI2UO5I632A7O5FBAZTXFAIEVFA4DSSGLHXACLAIT a3" NODE_HOME_DOMAIN="domainA" diff --git a/docs/stellar-core_standalone.cfg b/docs/stellar-core_standalone.cfg index 858e97d002..b9fd80a509 100644 --- a/docs/stellar-core_standalone.cfg +++ b/docs/stellar-core_standalone.cfg @@ -12,6 +12,7 @@ NODE_IS_VALIDATOR=true #DATABASE="postgresql://dbname=stellar user=postgres password=password host=localhost" DATABASE="sqlite3://stellar.db" +DEPRECATED_SQL_LEDGER_STATE = false COMMANDS=["ll?level=debug"] diff --git a/docs/stellar-core_testnet.cfg b/docs/stellar-core_testnet.cfg index 981105b7a6..77c834eb62 100644 --- a/docs/stellar-core_testnet.cfg +++ b/docs/stellar-core_testnet.cfg @@ -4,6 +4,7 @@ PUBLIC_HTTP_PORT=false NETWORK_PASSPHRASE="Test SDF Network ; September 2015" DATABASE="sqlite3://stellar.db" +DEPRECATED_SQL_LEDGER_STATE = false # Stellar Testnet validators [[HOME_DOMAINS]] diff --git a/docs/stellar-core_testnet_legacy.cfg b/docs/stellar-core_testnet_legacy.cfg index 0ff9909c9f..946e7c8bc9 100644 --- a/docs/stellar-core_testnet_legacy.cfg +++ b/docs/stellar-core_testnet_legacy.cfg @@ -9,6 +9,7 @@ KNOWN_PEERS=[ "core-testnet3.stellar.org"] DATABASE="sqlite3://stellar.db" +DEPRECATED_SQL_LEDGER_STATE = false UNSAFE_QUORUM=true FAILURE_SAFETY=1 diff --git a/docs/stellar-core_testnet_validator.cfg b/docs/stellar-core_testnet_validator.cfg index fa329c0c43..c5d5768e87 100644 --- a/docs/stellar-core_testnet_validator.cfg +++ b/docs/stellar-core_testnet_validator.cfg @@ -4,6 +4,7 @@ PUBLIC_HTTP_PORT=false NETWORK_PASSPHRASE="Test SDF Network ; September 2015" DATABASE="sqlite3://stellar.db" +DEPRECATED_SQL_LEDGER_STATE = false # Configuring the node as a validator # note that this is an unsafe configuration in this particular setup: diff --git a/src/bucket/BucketIndexImpl.cpp b/src/bucket/BucketIndexImpl.cpp index 6456491ed6..e25a2a5e63 100644 --- a/src/bucket/BucketIndexImpl.cpp +++ b/src/bucket/BucketIndexImpl.cpp @@ -46,13 +46,13 @@ static inline std::streamoff effectivePageSize(Config const& cfg, size_t bucketSize) { // Convert cfg param from MB to bytes - if (auto cutoff = cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF * 1000000; + if (auto cutoff = cfg.BUCKETLIST_DB_INDEX_CUTOFF * 1000000; bucketSize < cutoff) { return 0; } - auto pageSizeExp = cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; + auto pageSizeExp = cfg.BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; releaseAssertOrThrow(pageSizeExp < 32); return pageSizeExp == 0 ? 0 : 1UL << pageSizeExp; } diff --git a/src/bucket/readme.md b/src/bucket/readme.md index 72dc57acb4..29d4b81bd8 100644 --- a/src/bucket/readme.md +++ b/src/bucket/readme.md @@ -28,9 +28,9 @@ The individual buckets that compose each level are checkpointed to history storage by the [history module](../history). The difference from the current bucket list (a subset of the buckets) is retrieved from history and applied in order to perform "fast" catchup. -# BucketList Index [experimental] +# BucketListDB Index -Currently, the state of the ledger is redundantly copied in two places: the local SQL database +Previously, the state of the ledger is redundantly copied in two places: the local SQL database and the BucketList. The BucketList is used to quickly compute the hash for a ledger, while the database is used for key-value lookup. This disjoint setup leads to write and disk amplification. Additionally, SQL is not the most efficient database for our read/write patterns. The database @@ -59,7 +59,8 @@ corresponding `BucketIndex` kept in memory allowing minimal disk IO for each loa Due to the large number of `LedgerKey`'s, it is not possible to map each entry in a `Bucket` individually. Because of this, there are two types of indexes, the -`IndividualIndex` and the `RangeIndex`. The `IndividualIndex` maps individual `LedgerKey`'s to a file offset as previously described. The `RangeIndex` maps a range of +`IndividualIndex` and the `RangeIndex`. The `IndividualIndex` maps individual `LedgerKey`'s to a +file offset as previously described. The `RangeIndex` maps a range of `LedgerKey`'s to a given page in the file. Because the `LedgerEntry`'s in each bucket file on disk are sorted, the `RangeIndex` can provide the page where a given entry may exist. However, the `RangeIndex` cannot determine if the given entry exists @@ -69,7 +70,7 @@ must be iterated through in order to determine if the target entry exists in the To avoid additional disk reads from these "false positives", the `RangeIndex` also uses a bloom filter to determine if a given entry exists in the `Bucket` before doing a disk read -and iterating through the corresponding page. The bloom filter is probabalistic and still +and iterating through the corresponding page. The bloom filter is probabilistic and still has a false positive rate, but it is low (1/1000). Even with the bloom filter, the `RangeIndex` must still iterate through each entry in a @@ -82,20 +83,20 @@ for smaller memory overhead. Because the `BucketIndex`'s must be in memory, there is a tradeoff between BucketList lookup speed and memory overhead. The following configuration flags control these options: -- `EXPERIMENTAL_BUCKETLIST_DB` - - When set to true, the `BucketList` is indexed and used for ledger entry lookup -- `EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT` +- `DEPRECATED_SQL_LEDGER_STATE` + - When set to false, the `BucketList` is indexed and used for ledger entry lookup +- `BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT` - Page size used for `RangeIndex`, where `pageSize == - 2^EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT`. + 2^BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT`. Larger values slow down lookup speed but decrease memory usage. -- `EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF` - - Bucket file size, in MB, tyhat determines wether the `IndividualIndex` or +- `BUCKETLIST_DB_INDEX_CUTOFF` + - Bucket file size, in MB, that determines wether the `IndividualIndex` or `RangeIndex` is used. Default value is 20 MB, which indexes the first ~3 levels with the `IndividualIndex`. Larger values speed up lookups but increase memory usage. -- `EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX` +- `BUCKETLIST_DB_PERSIST_INDEX` - When set to true, BucketListDB indexes are saved to disk to avoid reindexing on startup. Defaults to true, should only be set to false for testing purposes. Validators do not currently support persisted indexes. If NODE_IS_VALIDATOR=true, - this value is ingnored and indexes are never persisted. + this value is ignored and indexes are never persisted. diff --git a/src/bucket/test/BucketIndexTests.cpp b/src/bucket/test/BucketIndexTests.cpp index 241581b6a7..d7efdbea87 100644 --- a/src/bucket/test/BucketIndexTests.cpp +++ b/src/bucket/test/BucketIndexTests.cpp @@ -455,26 +455,26 @@ testAllIndexTypes(std::function f) SECTION("individual index only") { Config cfg(getTestConfig()); - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 0; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; + cfg.BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 0; f(cfg); } SECTION("individual and range index") { Config cfg(getTestConfig()); - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; // First 3 levels individual, last 3 range index - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 1; + cfg.BUCKETLIST_DB_INDEX_CUTOFF = 1; f(cfg); } SECTION("range index only") { Config cfg(getTestConfig()); - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 0; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; + cfg.BUCKETLIST_DB_INDEX_CUTOFF = 0; f(cfg); } } @@ -543,9 +543,9 @@ TEST_CASE("serialize bucket indexes", "[bucket][bucketindex][!hide]") Config cfg(getTestConfig(0, Config::TESTDB_ON_DISK_SQLITE)); // First 3 levels individual, last 3 range index - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 1; - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; - cfg.EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX = true; + cfg.BUCKETLIST_DB_INDEX_CUTOFF = 1; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; + cfg.BUCKETLIST_DB_PERSIST_INDEX = true; // Node is not a validator, so indexes will persist cfg.NODE_IS_VALIDATOR = false; @@ -580,8 +580,8 @@ TEST_CASE("serialize bucket indexes", "[bucket][bucketindex][!hide]") // Restart app with different config to test that indexes created with // different config settings are not loaded from disk. These params will // invalidate every index in BL - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 0; - cfg.EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 10; + cfg.BUCKETLIST_DB_INDEX_CUTOFF = 0; + cfg.BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 10; test.restartWithConfig(cfg); for (auto const& bucketHash : buckets) diff --git a/src/bucket/test/BucketListTests.cpp b/src/bucket/test/BucketListTests.cpp index 2e48788521..8b83a59868 100644 --- a/src/bucket/test/BucketListTests.cpp +++ b/src/bucket/test/BucketListTests.cpp @@ -759,7 +759,7 @@ TEST_CASE_VERSIONS("eviction scan", "[bucketlist]") // BucketTestApplication writes directly to BL and circumvents LedgerTxn // interface, so we have to use BucketListDB for lookups - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; auto app = createTestApplication(clock, cfg); for_versions_from(20, *app, [&] { @@ -1119,7 +1119,7 @@ TEST_CASE_VERSIONS("Searchable BucketListDB snapshots", "[bucketlist]") { VirtualClock clock; Config cfg(getTestConfig(0, Config::TESTDB_IN_MEMORY_SQLITE)); - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; auto app = createTestApplication(clock, cfg); LedgerManagerForBucketTests& lm = app->getLedgerManager(); diff --git a/src/bucket/test/BucketManagerTests.cpp b/src/bucket/test/BucketManagerTests.cpp index 070403e364..78ef3062a1 100644 --- a/src/bucket/test/BucketManagerTests.cpp +++ b/src/bucket/test/BucketManagerTests.cpp @@ -191,7 +191,7 @@ TEST_CASE_VERSIONS("bucketmanager ownership", "[bucket][bucketmanager]") if (bucketListDB) { // Enable BucketListDB with persistent indexes - cfg.EXPERIMENTAL_BUCKETLIST_DB = true; + cfg.DEPRECATED_SQL_LEDGER_STATE = false; cfg.NODE_IS_VALIDATOR = false; cfg.FORCE_SCP = false; } diff --git a/src/history/test/HistoryTestsUtils.cpp b/src/history/test/HistoryTestsUtils.cpp index 8eb6c39ad9..87889f97f6 100644 --- a/src/history/test/HistoryTestsUtils.cpp +++ b/src/history/test/HistoryTestsUtils.cpp @@ -721,7 +721,7 @@ CatchupSimulation::createCatchupApplication( mCfgs.back().CATCHUP_COMPLETE = count == std::numeric_limits::max(); mCfgs.back().CATCHUP_RECENT = count; - mCfgs.back().EXPERIMENTAL_BUCKETLIST_DB = useBucketListDB; + mCfgs.back().DEPRECATED_SQL_LEDGER_STATE = !useBucketListDB; if (ledgerVersion) { mCfgs.back().TESTING_UPGRADE_LEDGER_PROTOCOL_VERSION = *ledgerVersion; diff --git a/src/main/ApplicationImpl.cpp b/src/main/ApplicationImpl.cpp index a6f0ec3859..f8449c9d83 100644 --- a/src/main/ApplicationImpl.cpp +++ b/src/main/ApplicationImpl.cpp @@ -705,14 +705,36 @@ ApplicationImpl::validateAndLogConfig() "requires --in-memory"); } - if (mConfig.EXPERIMENTAL_BUCKETLIST_DB) + if (mConfig.isInMemoryMode()) + { + CLOG_WARNING( + Bucket, + "in-memory mode is enabled. This feature is deprecated! Node " + "may see performance degredation and lose sync with the network."); + } + + if (mConfig.DEPRECATED_SQL_LEDGER_STATE) + { + if (mPersistentState->getState(PersistentState::kDBBackend) == + BucketIndex::DB_BACKEND_STATE) + { + throw std::invalid_argument( + "To downgrade to DEPRECATED_SQL_LEDGER_STATE, run " + "stellar-core new-db."); + } + + CLOG_WARNING( + Bucket, + "SQL for ledger state is enabled. This feature is deprecated! Node " + "may see performance degredation and lose sync with the network."); + } + else { if (mConfig.isUsingBucketListDB()) { mPersistentState->setState(PersistentState::kDBBackend, BucketIndex::DB_BACKEND_STATE); - auto pageSizeExp = - mConfig.EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; + auto pageSizeExp = mConfig.BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; if (pageSizeExp != 0) { // If the page size is less than 256 bytes, it is essentially @@ -721,7 +743,7 @@ ApplicationImpl::validateAndLogConfig() if (pageSizeExp < 8) { throw std::invalid_argument( - "EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT " + "BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT " "must be at least 8 or set to 0 for individual entry " "indexing"); } @@ -730,7 +752,7 @@ ApplicationImpl::validateAndLogConfig() if (pageSizeExp > 31) { throw std::invalid_argument( - "EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT " + "BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT " "must be less than 32"); } } @@ -738,27 +760,20 @@ ApplicationImpl::validateAndLogConfig() CLOG_INFO(Bucket, "BucketListDB enabled: pageSizeExponent: {} indexCutOff: " "{}MB, persist indexes: {}", - pageSizeExp, - mConfig.EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF, + pageSizeExp, mConfig.BUCKETLIST_DB_INDEX_CUTOFF, mConfig.isPersistingBucketListDBIndexes()); } else { CLOG_WARNING( Bucket, - "EXPERIMENTAL_BUCKETLIST_DB flag set but " - "BucketListDB not enabled. To enable BucketListDB, " + "DEPRECATED_SQL_LEDGER_STATE set to false but " + "deprecated SQL ledger state is active. To disable deprecated " + "SQL ledger state, " "MODE_ENABLES_BUCKETLIST must be set and --in-memory flag " "must not be used."); } } - else if (mPersistentState->getState(PersistentState::kDBBackend) == - BucketIndex::DB_BACKEND_STATE) - { - throw std::invalid_argument( - "To downgrade from EXPERIMENTAL_BUCKETLIST_DB, run " - "stellar-core new-db."); - } if (isNetworkedValidator && mConfig.isInMemoryMode()) { diff --git a/src/main/Config.cpp b/src/main/Config.cpp index 156d0a45c5..c651be9399 100644 --- a/src/main/Config.cpp +++ b/src/main/Config.cpp @@ -139,10 +139,10 @@ Config::Config() : NODE_SEED(SecretKey::random()) CATCHUP_COMPLETE = false; CATCHUP_RECENT = 0; EXPERIMENTAL_PRECAUTION_DELAY_META = false; - EXPERIMENTAL_BUCKETLIST_DB = false; - EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 14; // 2^14 == 16 kb - EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = 20; // 20 mb - EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX = true; + DEPRECATED_SQL_LEDGER_STATE = false; + BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = 14; // 2^14 == 16 kb + BUCKETLIST_DB_INDEX_CUTOFF = 20; // 20 mb + BUCKETLIST_DB_PERSIST_INDEX = true; PUBLISH_TO_ARCHIVE_DELAY = std::chrono::seconds{0}; // automatic maintenance settings: // short and prime with 1 hour which will cause automatic maintenance to @@ -1038,23 +1038,21 @@ Config::processConfig(std::shared_ptr t) { EXPERIMENTAL_PRECAUTION_DELAY_META = readBool(item); } - else if (item.first == "EXPERIMENTAL_BUCKETLIST_DB") + else if (item.first == "DEPRECATED_SQL_LEDGER_STATE") { - EXPERIMENTAL_BUCKETLIST_DB = readBool(item); + DEPRECATED_SQL_LEDGER_STATE = readBool(item); } - else if (item.first == - "EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT") + else if (item.first == "BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT") { - EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = - readInt(item); + BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT = readInt(item); } - else if (item.first == "EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF") + else if (item.first == "BUCKETLIST_DB_INDEX_CUTOFF") { - EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF = readInt(item); + BUCKETLIST_DB_INDEX_CUTOFF = readInt(item); } - else if (item.first == "EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX") + else if (item.first == "BUCKETLIST_DB_PERSIST_INDEX") { - EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX = readBool(item); + BUCKETLIST_DB_PERSIST_INDEX = readBool(item); } else if (item.first == "METADATA_DEBUG_LEDGERS") { @@ -1572,6 +1570,15 @@ Config::processConfig(std::shared_ptr t) // Validators default to starting the network from local state FORCE_SCP = NODE_IS_VALIDATOR; + if (!t->contains("DEPRECATED_SQL_LEDGER_STATE")) + { + std::string msg = + "Invalid configuration: " + "DEPRECATED_SQL_LEDGER_STATE not set. Default setting is FALSE " + "and is appropriate for most nodes."; + throw std::runtime_error(msg); + } + // process elements that potentially depend on others if (t->contains("VALIDATORS")) { @@ -2099,14 +2106,14 @@ Config::isInMemoryMode() const bool Config::isUsingBucketListDB() const { - return EXPERIMENTAL_BUCKETLIST_DB && !MODE_USES_IN_MEMORY_LEDGER && + return !DEPRECATED_SQL_LEDGER_STATE && !MODE_USES_IN_MEMORY_LEDGER && MODE_ENABLES_BUCKETLIST; } bool Config::isPersistingBucketListDBIndexes() const { - return isUsingBucketListDB() && EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX; + return isUsingBucketListDB() && BUCKETLIST_DB_PERSIST_INDEX; } bool diff --git a/src/main/Config.h b/src/main/Config.h index 954ea1fdbe..54a8e9252e 100644 --- a/src/main/Config.h +++ b/src/main/Config.h @@ -309,22 +309,22 @@ class Config : public std::enable_shared_from_this // configuration) to delay emitting metadata by one ledger. bool EXPERIMENTAL_PRECAUTION_DELAY_META; - // A config parameter that when set uses the BucketList as the primary - // key-value store for LedgerEntry lookups - bool EXPERIMENTAL_BUCKETLIST_DB; + // A config parameter that when set uses SQL as the primary + // key-value store for LedgerEntry lookups instead of BucketListDB. + bool DEPRECATED_SQL_LEDGER_STATE; // Page size exponent used by BucketIndex when indexing ranges of // BucketEntry's. If set to 0, BucketEntry's are individually indexed. // Otherwise, pageSize == - // 2^EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT. - size_t EXPERIMENTAL_BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; + // 2^BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT. + size_t BUCKETLIST_DB_INDEX_PAGE_SIZE_EXPONENT; // Size, in MB, determining whether a bucket should have an individual // key index or a key range index. If bucket size is below this value, range // based index will be used. If set to 0, all buckets are range indexed. If // index page size == 0, value ingnored and all buckets have individual key // index. - size_t EXPERIMENTAL_BUCKETLIST_DB_INDEX_CUTOFF; + size_t BUCKETLIST_DB_INDEX_CUTOFF; // When set to true, BucketListDB indexes are persisted on-disk so that the // BucketList does not need to be reindexed on startup. Defaults to true. @@ -332,7 +332,7 @@ class Config : public std::enable_shared_from_this // Validators do not currently support persisted indexes. If // NODE_IS_VALIDATOR=true, this value is ingnored and indexes are never // persisted. - bool EXPERIMENTAL_BUCKETLIST_DB_PERSIST_INDEX; + bool BUCKETLIST_DB_PERSIST_INDEX; // A config parameter that stores historical data, such as transactions, // fees, and scp history in the database diff --git a/src/main/test/ConfigTests.cpp b/src/main/test/ConfigTests.cpp index d9a64a1169..e6154825d6 100644 --- a/src/main/test/ConfigTests.cpp +++ b/src/main/test/ConfigTests.cpp @@ -225,6 +225,7 @@ TEST_CASE("bad validators configs", "[config]") NODE_SEED="SA7FGJMMUIHNE3ZPI2UO5I632A7O5FBAZTXFAIEVFA4DSSGLHXACLAIT a3" {NODE_HOME_DOMAIN} NODE_IS_VALIDATOR=true +DEPRECATED_SQL_LEDGER_STATE=true ############################ # list of HOME_DOMAINS @@ -411,7 +412,9 @@ TEST_CASE("nesting level", "[config]") auto secretKey = SecretKey::fromSeed(hash); return secretKey.getStrKeyPublic(); }; - std::string configNesting = "UNSAFE_QUORUM=true"; + std::string configNesting = + "DEPRECATED_SQL_LEDGER_STATE=true\n" // Required for all configs + "UNSAFE_QUORUM=true"; std::string quorumSetNumber = ""; std::string quorumSetTemplate = R"( @@ -472,6 +475,7 @@ TEST_CASE("operation filter configuration", "[config]") }; std::stringstream ss; + ss << "DEPRECATED_SQL_LEDGER_STATE=true\n"; // required for all configs ss << "UNSAFE_QUORUM=true\n"; toConfigStr(vals, ss); ss << "\n[QUORUM_SET]\n"; diff --git a/src/test/test.cpp b/src/test/test.cpp index b5a1939b93..9b8fe1f3c4 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -308,6 +308,10 @@ getTestConfig(int instanceNumber, Config::TestDbMode mode) thisConfig.PEER_READING_CAPACITY = 20; thisConfig.PEER_FLOOD_READING_CAPACITY = 20; thisConfig.FLOW_CONTROL_SEND_MORE_BATCH_SIZE = 10; + + // Tests default to using SQL for ledger state + thisConfig.DEPRECATED_SQL_LEDGER_STATE = true; + #ifdef BEST_OFFER_DEBUGGING thisConfig.BEST_OFFER_DEBUGGING_ENABLED = true; #endif diff --git a/src/transactions/test/InvokeHostFunctionTests.cpp b/src/transactions/test/InvokeHostFunctionTests.cpp index ab03fcf040..c1a965f4e9 100644 --- a/src/transactions/test/InvokeHostFunctionTests.cpp +++ b/src/transactions/test/InvokeHostFunctionTests.cpp @@ -2732,7 +2732,6 @@ TEST_CASE("settings upgrade command line utils", "[tx][soroban][upgrades]") VirtualClock clock; auto cfg = getTestConfig(); cfg.ENABLE_SOROBAN_DIAGNOSTIC_EVENTS = true; - cfg.EXPERIMENTAL_BUCKETLIST_DB = false; auto app = createTestApplication(clock, cfg); auto root = TestAccount::createRoot(*app); auto& lm = app->getLedgerManager();