From 836a810471d6553605a0a31fe0953733c9ffa6ac Mon Sep 17 00:00:00 2001 From: Arnaud Briche Date: Tue, 5 Aug 2025 17:33:44 +0200 Subject: [PATCH] fix: The DEPRECATED_SQL_LEDGER_STATE config param is not supported by stellar-core >= 23. This fix ensures this param is set to null when verison is >= 23 --- ingest/ledgerbackend/toml.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ingest/ledgerbackend/toml.go b/ingest/ledgerbackend/toml.go index 19f468df70..196fe816a0 100644 --- a/ingest/ledgerbackend/toml.go +++ b/ingest/ledgerbackend/toml.go @@ -511,9 +511,20 @@ func (c *CaptiveCoreToml) checkCoreVersion(params CaptiveCoreTomlParams) coreVer } } -var minVersionForBucketlistCaching = coreVersion{major: 22, minor: 2} +var ( + minVersionForBucketlistCaching = coreVersion{major: 22, minor: 2} + maxVersionForDeprecatedSqlLedgerState = coreVersion{major: 23, minor: 0} +) func (c *CaptiveCoreToml) setDefaults(params CaptiveCoreTomlParams) { + if len(params.CoreBinaryPath) == 0 { + if path := os.Getenv("STELLAR_CORE_BINARY_PATH"); len(path) > 0 { + params.CoreBinaryPath = path + } else { + params.CoreBinaryPath = "/usr/bin/stellar-core" + } + } + if params.UseDB && !c.tree.Has("DATABASE") { c.Database = "sqlite3://stellar.db" } @@ -591,6 +602,10 @@ func (c *CaptiveCoreToml) setDefaults(params CaptiveCoreTomlParams) { var disable uint = 0 c.BucketListDBMemoryForCaching = &disable } + + if c.checkCoreVersion(params).greaterThanOrEqual(maxVersionForDeprecatedSqlLedgerState) { + c.DeprecatedSqlLedgerState = nil + } } func enforceOption(opt **bool) {