From 8fa8cc33d8fe67aad8dc375ba1ef77ce858fef19 Mon Sep 17 00:00:00 2001 From: Pravdyvy Date: Fri, 30 Jan 2026 14:58:41 +0200 Subject: [PATCH] fix: config fix --- Cargo.lock | 1 - integration_tests/configs/indexer/indexer_config.json | 2 +- .../bedrock_local_attached/sequencer_config.json | 1 + integration_tests/src/lib.rs | 10 ++++++++++ storage/Cargo.toml | 1 - storage/src/error.rs | 6 +++--- storage/src/indexer.rs | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9ceeb3b..b40f1c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5914,7 +5914,6 @@ dependencies = [ "borsh", "common", "nssa", - "nssa_core", "rocksdb", "thiserror 2.0.17", ] diff --git a/integration_tests/configs/indexer/indexer_config.json b/integration_tests/configs/indexer/indexer_config.json index 2d8658ea..f9174088 100644 --- a/integration_tests/configs/indexer/indexer_config.json +++ b/integration_tests/configs/indexer/indexer_config.json @@ -127,6 +127,6 @@ }, "resubscribe_interval_millis": 1000, "sequencer_client_config": { - "addr": "will_be_replaced_in_runtime" + "addr": "http://0.0.0.0" } } \ No newline at end of file diff --git a/integration_tests/configs/sequencer/bedrock_local_attached/sequencer_config.json b/integration_tests/configs/sequencer/bedrock_local_attached/sequencer_config.json index 3253115b..524edc70 100644 --- a/integration_tests/configs/sequencer/bedrock_local_attached/sequencer_config.json +++ b/integration_tests/configs/sequencer/bedrock_local_attached/sequencer_config.json @@ -6,6 +6,7 @@ "max_num_tx_in_block": 20, "mempool_max_size": 10000, "block_create_timeout_millis": 10000, + "retry_pending_blocks_timeout_millis": 240000, "port": 0, "initial_accounts": [ { diff --git a/integration_tests/src/lib.rs b/integration_tests/src/lib.rs index 8e4a6c36..abd653b0 100644 --- a/integration_tests/src/lib.rs +++ b/integration_tests/src/lib.rs @@ -46,6 +46,7 @@ pub struct TestContext { wallet: WalletCore, _temp_sequencer_dir: TempDir, _temp_wallet_dir: TempDir, + _temp_indexer_dir: Option, } impl TestContext { @@ -127,6 +128,12 @@ impl TestContext { indexer_config.sequencer_client_config.addr = Url::parse(&sequencer_addr).context("Failed to parse sequencer addr")?; + let temp_indexer_dir = + tempfile::tempdir().context("Failed to create temp dir for indexer home")?; + + debug!("Using temp indexer home at {:?}", temp_indexer_dir.path()); + indexer_config.home = temp_indexer_dir.path().to_owned(); + let indexer_core = IndexerCore::new(indexer_config).await?; let indexer_loop_handle = Some(tokio::spawn(async move { @@ -142,6 +149,7 @@ impl TestContext { wallet, _temp_sequencer_dir: temp_sequencer_dir, _temp_wallet_dir: temp_wallet_dir, + _temp_indexer_dir: Some(temp_indexer_dir), }) } else { Ok(Self { @@ -153,6 +161,7 @@ impl TestContext { wallet, _temp_sequencer_dir: temp_sequencer_dir, _temp_wallet_dir: temp_wallet_dir, + _temp_indexer_dir: None, }) } } @@ -255,6 +264,7 @@ impl Drop for TestContext { wallet: _, _temp_sequencer_dir, _temp_wallet_dir, + _temp_indexer_dir, } = self; sequencer_loop_handle.abort(); diff --git a/storage/Cargo.toml b/storage/Cargo.toml index f3c3c7d2..459da498 100644 --- a/storage/Cargo.toml +++ b/storage/Cargo.toml @@ -5,7 +5,6 @@ edition = "2024" [dependencies] common.workspace = true -nssa_core.workspace = true nssa.workspace = true thiserror.workspace = true diff --git a/storage/src/error.rs b/storage/src/error.rs index a3fd80b7..31a94094 100644 --- a/storage/src/error.rs +++ b/storage/src/error.rs @@ -1,16 +1,16 @@ #[derive(thiserror::Error, Debug)] pub enum DbError { - #[error("RocksDb error")] + #[error("RocksDb error {additional_info:#?}")] RocksDbError { error: rocksdb::Error, additional_info: Option, }, - #[error("Serialization error")] + #[error("Serialization error {additional_info:#?}")] SerializationError { error: borsh::io::Error, additional_info: Option, }, - #[error("Logic Error")] + #[error("Logic Error {additional_info:#?}")] DbInteractionError { additional_info: String }, } diff --git a/storage/src/indexer.rs b/storage/src/indexer.rs index 39311a8d..35d14fa9 100644 --- a/storage/src/indexer.rs +++ b/storage/src/indexer.rs @@ -81,9 +81,9 @@ impl RocksDBIO { Ok(dbio) } else if let Some((block, initial_state)) = start_data { let block_id = block.header.block_id; + dbio.put_meta_last_block_in_db(block_id)?; dbio.put_meta_first_block_in_db(block)?; dbio.put_meta_is_first_block_set()?; - dbio.put_meta_last_block_in_db(block_id)?; // First breakpoint setup dbio.put_breakpoint(0, initial_state)?;