From 21ff5e665661a142d5ccac161b42062c4c7e4422 Mon Sep 17 00:00:00 2001 From: erhant Date: Tue, 23 Jun 2026 16:46:56 +0300 Subject: [PATCH] fix: better start/stop --- flake.lock | 20 ++++++++++---------- src/lez_explorer_ui_backend.cpp | 6 +++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 23c0109..a3d988a 100644 --- a/flake.lock +++ b/flake.lock @@ -21,11 +21,11 @@ "logos-module-builder": "logos-module-builder_4" }, "locked": { - "lastModified": 1782215779, - "narHash": "sha256-x9L1jcK6XfVl40tsqpfrdERLmuGaEDBsFYzNIDdiZPM=", + "lastModified": 1782222303, + "narHash": "sha256-T//08rBmSvOOhvZZ5if8Gnaq1okEuSGt2ASym1eDyPY=", "ref": "erhant/migr-to-logos-module-builder-update-LEZ", - "rev": "b5a283124a909854eba695ed213356269b45b414", - "revCount": 45, + "rev": "06396d7aeccdd7c3e7310c5acf4e687c12109052", + "revCount": 47, "type": "git", "url": "https://github.com/logos-blockchain/lez-indexer-module" }, @@ -2013,16 +2013,16 @@ "rust-rapidsnark": "rust-rapidsnark" }, "locked": { - "lastModified": 1782215206, - "narHash": "sha256-BKwz2qgH2Mu1fSCooc203iYOcxBREcjLnFDF07Ro/H0=", - "ref": "erhant/fix-indexer-ffi", - "rev": "84c84d885af1f6ccf3ae76a99d93183dbdc3a925", - "revCount": 2778, + "lastModified": 1782219627, + "narHash": "sha256-mF9P5483XSGudP69VWlCeRTYFocklDwHGvPNujnDxTM=", + "ref": "main", + "rev": "a9df90c5b655446708395c99f627834eb822c48d", + "revCount": 2790, "type": "git", "url": "https://github.com/logos-blockchain/logos-execution-zone" }, "original": { - "ref": "erhant/fix-indexer-ffi", + "ref": "main", "type": "git", "url": "https://github.com/logos-blockchain/logos-execution-zone" } diff --git a/src/lez_explorer_ui_backend.cpp b/src/lez_explorer_ui_backend.cpp index 5b8afec..888fa1b 100644 --- a/src/lez_explorer_ui_backend.cpp +++ b/src/lez_explorer_ui_backend.cpp @@ -35,7 +35,7 @@ constexpr quint64 kGapRebuildThreshold = 8; const char* const kDefaultConfig = R"JSON({ "consensus_info_polling_interval": "1s", "bedrock_config": { - "addr": "http://localhost:8080", + "addr": "http://localhost:18080", "backoff": { "start_delay": "100ms", "max_retries": 5 @@ -588,6 +588,10 @@ QString LezExplorerUiBackend::readConfigFile() const bool LezExplorerUiBackend::startIndexerFromFile() { + // start_indexer is idempotent and won't restart a running indexer, so stop + // any current one first — this is what lets a re-saved config (e.g. a new + // bedrock addr) actually take effect. No-op on the first start. + modules().lez_indexer_module.stop_indexer(); const qlonglong code = modules().lez_indexer_module.start_indexer(configFilePath()); if (code != 0) { emit error(QStringLiteral("start_indexer failed (code %1)").arg(code));