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

Carry bitcoin-da tests to e2e #1515

Merged
merged 26 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
812ac34
Carry citrea-e2e to workspace
yaziciahmet Nov 22, 2024
c5e452a
Implement get da service helper
yaziciahmet Nov 22, 2024
b33e68e
Add extra assert
yaziciahmet Nov 23, 2024
3a42ecc
Implement generate_mock_txs
yaziciahmet Nov 23, 2024
3a77ca7
Use MAX_TXBODY_SIZE for generating aggregate zkproofs
yaziciahmet Nov 23, 2024
898becd
Fund wallets early
yaziciahmet Nov 23, 2024
6b9e65b
Generate and return bitcoin block
yaziciahmet Nov 23, 2024
c8c734d
Clippy
yaziciahmet Nov 23, 2024
2c33f3b
Improve funding flow
yaziciahmet Nov 23, 2024
fef7095
Carry verifier tests to e2e
yaziciahmet Nov 23, 2024
8477aa9
Implement nonsegwit block test
yaziciahmet Nov 24, 2024
91e859f
Write extract blob tests for da service
yaziciahmet Nov 24, 2024
a2c58e5
Extract relevant proof and comm tests
yaziciahmet Nov 24, 2024
1237167
Make nonsegwit test work
yaziciahmet Nov 25, 2024
46f5cfe
Remove unnecessary test check
yaziciahmet Nov 25, 2024
130f51e
Carry nonsegwit txs into code
yaziciahmet Nov 25, 2024
e1b506b
Implement rest of the service tests
yaziciahmet Nov 25, 2024
ab8c155
Implemented all tests now
yaziciahmet Nov 25, 2024
5688fd7
Clear up old tests
yaziciahmet Nov 25, 2024
0cc0f18
Fix flakiness
yaziciahmet Nov 25, 2024
5f5b29d
Readd forgotten
yaziciahmet Nov 25, 2024
199f1aa
Merge branch 'nightly' into yaziciahmet/e2e-bitcoin-da-tests
yaziciahmet Nov 25, 2024
3417555
Assert test errors
yaziciahmet Nov 26, 2024
edced19
Merge branch 'nightly' into yaziciahmet/e2e-bitcoin-da-tests
yaziciahmet Nov 26, 2024
99154fc
Add mock txs merkle tree test back
yaziciahmet Nov 26, 2024
0d39546
Fix some tests that returned unexpected errors
yaziciahmet Nov 26, 2024
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
1 change: 1 addition & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,7 @@ tower-http = { version = "0.5.0", features = ["full"] }
tower = { version = "0.4.13", features = ["full"] }
hyper = { version = "1.4.0" }

citrea-e2e = { git = "https://github.com/chainwayxyz/citrea-e2e", rev = "5baaef3" }

[patch.crates-io]
bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/chainwayxyz/rust-bitcoincore-rpc.git", rev = "ca3cfa2" }
2 changes: 1 addition & 1 deletion bin/citrea/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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 = "5baaef3" }
citrea-e2e = { workspace = true }

[build-dependencies]
sp1-helper = { version = "3.0.0", default-features = false }
Expand Down
3 changes: 3 additions & 0 deletions crates/bitcoin-da/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ sha2 = { workspace = true }

bitcoincore-rpc = { workspace = true, optional = true }

[dev-dependencies]
citrea-e2e = { workspace = true }

[features]
default = []
native = [
Expand Down
10 changes: 6 additions & 4 deletions crates/bitcoin-da/src/helpers/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod tests {
use bitcoin::hashes::Hash;

use super::*;
use crate::helpers::test_utils::get_mock_txs;
use crate::helpers::parsers::parse_hex_transaction;

#[test]
fn test_merkle_root_with_proof() {
Expand Down Expand Up @@ -145,10 +145,12 @@ mod tests {
compare_merkle_tree_against_bitcoin_impl(vec![[200; 32]; 2]);
compare_merkle_tree_against_bitcoin_impl(vec![[99; 32]; 1]);

let txs = get_mock_txs()
.iter()
let txs = std::fs::read_to_string("test_data/mock_txs.txt")
.unwrap()
.lines()
.map(|tx_hex| parse_hex_transaction(tx_hex).unwrap())
.map(|tx| tx.compute_wtxid().to_byte_array())
.collect();
.collect::<Vec<_>>();
compare_merkle_tree_against_bitcoin_impl(txs);
}

Expand Down
2 changes: 0 additions & 2 deletions crates/bitcoin-da/src/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use sha2::{Digest, Sha256};
pub mod builders;
pub mod merkle_tree;
pub mod parsers;
#[cfg(test)]
pub mod test_utils;

/// Type represents a typed enum for LightClient kind
#[repr(u16)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bitcoin-da/src/helpers/parsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ mod batch_proof {
}
}

#[cfg(all(test, feature = "native"))]
#[cfg(feature = "native")]
pub fn parse_hex_transaction(
tx_hex: &str,
) -> Result<Transaction, bitcoin::consensus::encode::Error> {
Expand Down
154 changes: 0 additions & 154 deletions crates/bitcoin-da/src/helpers/test_utils.rs

This file was deleted.

Loading
Loading