diff --git a/bin/citrea/tests/all_tests.rs b/bin/citrea/tests/all_tests.rs index f8026ec74..bec910984 100644 --- a/bin/citrea/tests/all_tests.rs +++ b/bin/citrea/tests/all_tests.rs @@ -12,5 +12,5 @@ mod test_helpers; const DEFAULT_MIN_SOFT_CONFIRMATIONS_PER_COMMITMENT: u64 = 1000; const DEFAULT_DEPOSIT_MEMPOOL_FETCH_LIMIT: usize = 10; -const DEFAULT_PROOF_WAIT_DURATION: u64 = 300; // 5 minutes +const DEFAULT_PROOF_WAIT_DURATION: u64 = 600; // 10 minutes const TEST_DATA_GENESIS_PATH: &str = "../../resources/test-data/integration-tests"; diff --git a/bin/citrea/tests/bitcoin_e2e/tests/sequencer_commitments.rs b/bin/citrea/tests/bitcoin_e2e/tests/sequencer_commitments.rs index 61eb93f6a..49ea84d07 100644 --- a/bin/citrea/tests/bitcoin_e2e/tests/sequencer_commitments.rs +++ b/bin/citrea/tests/bitcoin_e2e/tests/sequencer_commitments.rs @@ -121,9 +121,10 @@ impl TestCase for LedgerGetCommitmentsTest { sequencer.client.send_publish_batch_request().await; } - da.generate(1, None).await?; + // disable this since it's the only difference from other tests?? + // da.generate(1, None).await?; - sequencer.client.send_publish_batch_request().await; + // sequencer.client.send_publish_batch_request().await; // Wait for blob tx to hit the mempool da.wait_mempool_len(1, None).await?; @@ -132,7 +133,7 @@ impl TestCase for LedgerGetCommitmentsTest { da.generate(FINALITY_DEPTH + 1, None).await?; full_node - .wait_for_l2_height(MIN_SOFT_CONF_PER_COMMITMENT + 1, None) + .wait_for_l2_height(MIN_SOFT_CONF_PER_COMMITMENT, None) .await; let finalized_height = da.get_finalized_height().await?; @@ -150,13 +151,13 @@ impl TestCase for LedgerGetCommitmentsTest { let hash = da.get_block_hash(finalized_height).await?; - let commitments_hash = full_node + let commitments_node = full_node .client .ledger_get_sequencer_commitments_on_slot_by_hash(hash.as_raw_hash().to_byte_array()) .await .unwrap() .unwrap(); - assert_eq!(commitments_hash, commitments); + assert_eq!(commitments_node, commitments); Ok(()) } } diff --git a/bin/citrea/tests/e2e/mod.rs b/bin/citrea/tests/e2e/mod.rs index 3fa3fb90d..3c0121837 100644 --- a/bin/citrea/tests/e2e/mod.rs +++ b/bin/citrea/tests/e2e/mod.rs @@ -197,7 +197,7 @@ async fn test_all_flow() { assert_eq!(commitments_hash, commitments); let prover_proof = prover_node_test_client - .ledger_get_proof_by_slot_height(3) + .ledger_get_proofs_by_slot_height(3) .await[0] .clone(); @@ -295,7 +295,7 @@ async fn test_all_flow() { assert_eq!(commitments.len(), 1); let prover_proof_data = prover_node_test_client - .ledger_get_proof_by_slot_height(5) + .ledger_get_proofs_by_slot_height(5) .await[0] .clone(); diff --git a/bin/citrea/tests/e2e/proving.rs b/bin/citrea/tests/e2e/proving.rs index 1735d7001..1dde91987 100644 --- a/bin/citrea/tests/e2e/proving.rs +++ b/bin/citrea/tests/e2e/proving.rs @@ -146,7 +146,7 @@ async fn full_node_verify_proof_and_store() { assert_eq!(commitments_hash, commitments); let prover_proof = prover_node_test_client - .ledger_get_proof_by_slot_height(3) + .ledger_get_proofs_by_slot_height(3) .await[0] .clone(); diff --git a/bin/citrea/tests/e2e/sequencer_behaviour.rs b/bin/citrea/tests/e2e/sequencer_behaviour.rs index 3bc48d066..5b03263f0 100644 --- a/bin/citrea/tests/e2e/sequencer_behaviour.rs +++ b/bin/citrea/tests/e2e/sequencer_behaviour.rs @@ -187,7 +187,7 @@ async fn test_sequencer_commitment_threshold() { .unwrap(); } seq_test_client.send_publish_batch_request().await; - wait_for_l2_block(&seq_test_client, i, Some(Duration::from_secs(10))).await; + wait_for_l2_block(&seq_test_client, i, None).await; } wait_for_l2_block(&seq_test_client, 11, Some(Duration::from_secs(60))).await; @@ -205,7 +205,7 @@ async fn test_sequencer_commitment_threshold() { .unwrap(); } seq_test_client.send_publish_batch_request().await; - wait_for_l2_block(&seq_test_client, i, Some(Duration::from_secs(10))).await; + wait_for_l2_block(&seq_test_client, i, None).await; } wait_for_l2_block(&seq_test_client, 21, Some(Duration::from_secs(60))).await; diff --git a/bin/citrea/tests/test_client/mod.rs b/bin/citrea/tests/test_client/mod.rs index 5a86ab634..199c59555 100644 --- a/bin/citrea/tests/test_client/mod.rs +++ b/bin/citrea/tests/test_client/mod.rs @@ -540,7 +540,7 @@ impl TestClient { .map_err(|e| e.into()) } - pub(crate) async fn ledger_get_proof_by_slot_height(&self, height: u64) -> Vec { + pub(crate) async fn ledger_get_proofs_by_slot_height(&self, height: u64) -> Vec { self.http_client .request("ledger_getProofsBySlotHeight", rpc_params![height]) .await diff --git a/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/client.rs b/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/client.rs index 42a173930..c388a0643 100644 --- a/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/client.rs +++ b/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/client.rs @@ -63,12 +63,12 @@ pub trait Rpc { ) -> RpcResult>>; /// Gets proof by slot height. - #[method(name = "getProofBySlotHeight")] - async fn get_proof_by_slot_height(&self, height: u64) -> RpcResult>; + #[method(name = "getProofsBySlotHeight")] + async fn get_proofs_by_slot_height(&self, height: u64) -> RpcResult>; /// Gets proof by slot hash. - #[method(name = "getProofBySlotHash")] - async fn get_proof_by_slot_hash(&self, hash: [u8; 32]) -> RpcResult>; + #[method(name = "getProofsBySlotHash")] + async fn get_proofs_by_slot_hash(&self, hash: [u8; 32]) -> RpcResult>; /// Gets the height pf most recent committed soft confirmation. #[method(name = "getHeadSoftConfirmation")] diff --git a/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/server.rs b/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/server.rs index a5cb0550f..fe64df661 100644 --- a/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/server.rs +++ b/crates/sovereign-sdk/full-node/sov-ledger-rpc/src/server.rs @@ -118,7 +118,7 @@ where .map_err(|e| to_jsonrpsee_error_object(LEDGER_RPC_ERROR, e)) })?; - rpc.register_blocking_method("ledger_getProofBySlotHash", move |params, ledger, _| { + rpc.register_blocking_method("ledger_getProofsBySlotHash", move |params, ledger, _| { // Returns proof on DA slot with given height let hash: [u8; 32] = params.one()?; let height = ledger diff --git a/crates/sovereign-sdk/full-node/sov-ledger-rpc/tests/empty_ledger.rs b/crates/sovereign-sdk/full-node/sov-ledger-rpc/tests/empty_ledger.rs index 04e54b478..36ef86fde 100644 --- a/crates/sovereign-sdk/full-node/sov-ledger-rpc/tests/empty_ledger.rs +++ b/crates/sovereign-sdk/full-node/sov-ledger-rpc/tests/empty_ledger.rs @@ -51,7 +51,9 @@ async fn getters_succeed() { .await .unwrap(); - rpc_client.get_proof_by_slot_hash([0; 32]).await.unwrap(); + rpc_client.get_proofs_by_slot_height(0).await.unwrap(); + + rpc_client.get_proofs_by_slot_hash([0; 32]).await.unwrap(); rpc_client .get_head_soft_confirmation_height()