From f06a37e403afa05b17c192e3e5a38fe4ad6014e0 Mon Sep 17 00:00:00 2001 From: Esad Yusuf Atik Date: Wed, 11 Sep 2024 01:29:14 +0300 Subject: [PATCH] include pending utxos in get_utxos (#1154) --- bin/citrea/tests/e2e/syncing.rs | 2 -- crates/bitcoin-da/src/service.rs | 2 +- crates/sequencer/src/sequencer.rs | 9 ++++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/bin/citrea/tests/e2e/syncing.rs b/bin/citrea/tests/e2e/syncing.rs index e90595318..d6bf362a4 100644 --- a/bin/citrea/tests/e2e/syncing.rs +++ b/bin/citrea/tests/e2e/syncing.rs @@ -551,8 +551,6 @@ async fn test_healthcheck() { let full_node_addr = full_node_port_rx.await.unwrap(); let full_node_test_client = make_test_client(full_node_addr).await.unwrap(); - wait_for_l2_block(&full_node_test_client, 2, None).await; - let status = full_node_test_client.healthcheck().await.unwrap(); assert_eq!(status, 200); diff --git a/crates/bitcoin-da/src/service.rs b/crates/bitcoin-da/src/service.rs index cbf66821f..e0587d020 100644 --- a/crates/bitcoin-da/src/service.rs +++ b/crates/bitcoin-da/src/service.rs @@ -265,7 +265,7 @@ impl BitcoinService { async fn get_utxos(&self) -> Result, anyhow::Error> { let utxos = self .client - .list_unspent(None, None, None, None, None) + .list_unspent(Some(0), None, None, None, None) .await?; if utxos.is_empty() { return Err(anyhow::anyhow!("There are no UTXOs")); diff --git a/crates/sequencer/src/sequencer.rs b/crates/sequencer/src/sequencer.rs index 01d17e1c1..ced3a7fb2 100644 --- a/crates/sequencer/src/sequencer.rs +++ b/crates/sequencer/src/sequencer.rs @@ -604,10 +604,10 @@ where info!("Resubmitting pending commitments"); let pending_db_commitments = self.ledger_db.get_pending_commitments_l2_range()?; - debug!("Pending db commitments: {:?}", pending_db_commitments); + info!("Pending db commitments: {:?}", pending_db_commitments); let pending_mempool_commitments = self.get_pending_mempool_commitments().await; - debug!( + info!( "Commitments that are already in DA mempool: {:?}", pending_mempool_commitments ); @@ -619,7 +619,7 @@ where let mined_commitments = self .get_mined_commitments_from(last_commitment_l1_height) .await?; - debug!( + info!( "Commitments that are already mined by DA: {:?}", mined_commitments ); @@ -628,7 +628,6 @@ where pending_commitments_to_remove.extend(pending_mempool_commitments); pending_commitments_to_remove.extend(mined_commitments); - // TODO: also take mined DA blocks into account for (l2_start, l2_end) in pending_db_commitments { if pending_commitments_to_remove.iter().any(|commitment| { commitment.l2_start_block_number == l2_start.0 @@ -642,7 +641,7 @@ where } }; - // Delete from pending db if it is already in DA mempool + // Delete from pending db if it is already in DA mempool or mined self.ledger_db .delete_pending_commitment_l2_range(&(l2_start, l2_end))?; } else {