Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump citrea-e2e #1346

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
run: make coverage
env:
RUST_BACKTRACE: 1
USE_DOCKER: "true"
TEST_BITCOIN_DOCKER: 1
SHORT_PREFIX: 1
CITREA_E2E_TEST_BINARY: ${{ github.workspace }}/target/debug/citrea
- name: Upload coverage
Expand Down Expand Up @@ -394,7 +394,7 @@ jobs:
RUST_BACKTRACE: 1
BONSAI_API_URL: ${{ secrets.BONSAI_API_URL }} # TODO: remove this once we don't use the client on tests
BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }} # TODO: remove this once we don't use the client on tests
USE_DOCKER: "true"
TEST_BITCOIN_DOCKER: 1
SHORT_PREFIX: 1
CITREA_E2E_TEST_BINARY: ${{ github.workspace }}/target/debug/citrea

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ rustc_version_runtime = { workspace = true }
# bitcoin-e2e dependencies
bitcoin.workspace = true
bitcoincore-rpc.workspace = true
citrea-e2e = { git = "https://github.com/chainwayxyz/citrea-e2e", rev = "72a77f0" }
citrea-e2e = { git = "https://github.com/chainwayxyz/citrea-e2e", rev = "fc12cb0" }

[features]
default = [] # Deviate from convention by making the "native" feature active by default. This aligns with how this package is meant to be used (as a binary first, library second).
Expand Down
12 changes: 10 additions & 2 deletions bin/citrea/tests/bitcoin_e2e/bitcoin_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use citrea_e2e::test_case::{TestCase, TestCaseRunner};
use citrea_e2e::traits::Restart;
use citrea_e2e::Result;

use super::get_citrea_path;

struct BasicSyncTest;

#[async_trait]
Expand Down Expand Up @@ -104,10 +106,16 @@ impl TestCase for RestartBitcoinTest {

#[tokio::test]
async fn test_basic_sync() -> Result<()> {
TestCaseRunner::new(BasicSyncTest).run().await
TestCaseRunner::new(BasicSyncTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}

#[tokio::test]
async fn test_restart_bitcoin() -> Result<()> {
TestCaseRunner::new(RestartBitcoinTest).run().await
TestCaseRunner::new(RestartBitcoinTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
5 changes: 4 additions & 1 deletion bin/citrea/tests/bitcoin_e2e/mempool_accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ impl TestCase for MempoolAcceptTest {

#[tokio::test]
async fn test_mempool_accept() -> Result<()> {
TestCaseRunner::new(MempoolAcceptTest).run().await
TestCaseRunner::new(MempoolAcceptTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
18 changes: 18 additions & 0 deletions bin/citrea/tests/bitcoin_e2e/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
use std::path::PathBuf;

pub mod bitcoin_test;
// pub mod mempool_accept;
pub mod prover_test;
pub mod sequencer_commitments;
pub mod sequencer_test;

pub(super) fn get_citrea_path() -> PathBuf {
std::env::var("CITREA_E2E_TEST_BINARY").map_or_else(
|_| {
let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
manifest_dir
.ancestors()
.nth(2)
.expect("Failed to find workspace root")
.join("target")
.join("debug")
.join("citrea")
},
PathBuf::from,
)
}
13 changes: 11 additions & 2 deletions bin/citrea/tests/bitcoin_e2e/prover_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use sov_rollup_interface::da::{DaData, SequencerCommitment};
use sov_rollup_interface::services::da::SenderWithNotifier;
use tokio::sync::mpsc::UnboundedSender;

use super::get_citrea_path;

/// This is a basic prover test showcasing spawning a bitcoin node as DA, a sequencer and a prover.
/// It generates soft confirmations and wait until it reaches the first commitment.
/// It asserts that the blob inscribe txs have been sent.
Expand Down Expand Up @@ -111,7 +113,10 @@ impl TestCase for BasicProverTest {

#[tokio::test]
async fn basic_prover_test() -> Result<()> {
TestCaseRunner::new(BasicProverTest).run().await
TestCaseRunner::new(BasicProverTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}

#[derive(Default)]
Expand Down Expand Up @@ -317,6 +322,7 @@ impl TestCase for SkipPreprovenCommitmentsTest {
#[tokio::test]
async fn prover_skips_preproven_commitments_test() -> Result<()> {
TestCaseRunner::new(SkipPreprovenCommitmentsTest::default())
.set_citrea_path(get_citrea_path())
.run()
.await
}
Expand Down Expand Up @@ -409,5 +415,8 @@ impl TestCase for LocalProvingTest {
#[tokio::test]
#[ignore]
async fn local_proving_test() -> Result<()> {
TestCaseRunner::new(LocalProvingTest).run().await
TestCaseRunner::new(LocalProvingTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
13 changes: 8 additions & 5 deletions bin/citrea/tests/bitcoin_e2e/sequencer_commitments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use citrea_primitives::REVEAL_BATCH_PROOF_PREFIX;
use rs_merkle::algorithms::Sha256;
use rs_merkle::MerkleTree;
use sov_rollup_interface::da::{BlobReaderTrait, DaData};

use super::get_citrea_path;
struct LedgerGetCommitmentsProverTest;

#[async_trait]
Expand Down Expand Up @@ -84,6 +86,7 @@ impl TestCase for LedgerGetCommitmentsProverTest {
#[tokio::test]
async fn test_ledger_get_commitments_on_slot_prover() -> Result<()> {
TestCaseRunner::new(LedgerGetCommitmentsProverTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
Expand All @@ -99,10 +102,6 @@ impl TestCase for LedgerGetCommitmentsTest {
}
}

fn sequencer_config() -> SequencerConfig {
SequencerConfig::default()
}

async fn run_test(&mut self, f: &mut TestFramework) -> Result<()> {
let sequencer = f.sequencer.as_ref().unwrap();
let da = f.bitcoin_nodes.get(0).expect("DA not running.");
Expand Down Expand Up @@ -157,7 +156,10 @@ impl TestCase for LedgerGetCommitmentsTest {

#[tokio::test]
async fn test_ledger_get_commitments_on_slot_full_node() -> Result<()> {
TestCaseRunner::new(LedgerGetCommitmentsTest).run().await
TestCaseRunner::new(LedgerGetCommitmentsTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}

struct SequencerSendCommitmentsToDaTest;
Expand Down Expand Up @@ -313,6 +315,7 @@ impl SequencerSendCommitmentsToDaTest {
#[tokio::test]
async fn test_sequencer_sends_commitments_to_da_layer() -> Result<()> {
TestCaseRunner::new(SequencerSendCommitmentsToDaTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
12 changes: 10 additions & 2 deletions bin/citrea/tests/bitcoin_e2e/sequencer_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ use citrea_e2e::test_case::{TestCase, TestCaseRunner};
use citrea_e2e::traits::Restart;
use citrea_e2e::Result;

use super::get_citrea_path;

struct BasicSequencerTest;

#[async_trait]
Expand Down Expand Up @@ -47,7 +49,10 @@ impl TestCase for BasicSequencerTest {

#[tokio::test]
async fn basic_sequencer_test() -> Result<()> {
TestCaseRunner::new(BasicSequencerTest).run().await
TestCaseRunner::new(BasicSequencerTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}

/// This test checks the sequencer behavior when missed DA blocks are detected.
Expand Down Expand Up @@ -130,5 +135,8 @@ impl TestCase for SequencerMissedDaBlocksTest {

#[tokio::test]
async fn test_sequencer_missed_da_blocks() -> Result<()> {
TestCaseRunner::new(SequencerMissedDaBlocksTest).run().await
TestCaseRunner::new(SequencerMissedDaBlocksTest)
.set_citrea_path(get_citrea_path())
.run()
.await
}
Loading