Skip to content
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
3,283 changes: 1,542 additions & 1,741 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ http = "1.2.0"
itertools = "0.14.0"
jsonrpsee = { version = "0.25.1", features = ["tracing"] }
parking_lot = "0.12.1"
prost = "0.13.3"
prost = "0.14.3"
semver = "1.0.2"
serde = "1.0.179"
serde_json = "1.0.113"
serde_with = "3.4.0"
strum = { version = "0.26.3", default-features = false }
thiserror = "2.0.11"
serde_with = { version = "3.4.0", default-features = false }
strum = { version = "0.27.2", default-features = false }
thiserror = "=2.0.16"
tiny-bip39 = "2.0.0"
tokio = { version = "1.29.1", default-features = false }
tokio-util = "0.7.10"
tonic = "0.12.3"
tokio = { version = "1.48.0", default-features = false }
tokio-util = "0.7.18"
tonic = "0.14.3"
tracing = "0.1.40"
tracing-subscriber = "0.3.20"
url = "2.5.4"
Expand All @@ -43,12 +44,12 @@ uuid = "1.13.1"
[workspace.dependencies.bip300301_enforcer_lib]
default-features = false
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
rev = "efc538e2b10619a2984acb197b9392cb17e05313"
rev = "94bc123e0b26af9c18d10c933803d53af62f034c"

[workspace.dependencies.bip300301_enforcer_integration_tests]
default-features = false
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
rev = "efc538e2b10619a2984acb197b9392cb17e05313"
rev = "94bc123e0b26af9c18d10c933803d53af62f034c"

[workspace.dependencies.l2l-openapi]
git = "https://github.com/Ash-L2L/l2l-openapi"
Expand Down
2 changes: 1 addition & 1 deletion app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tiny-bip39 = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal"] }
tokio-util = { workspace = true, features = ["rt"] }
tonic = { workspace = true }
tonic-health = "0.12.3"
tonic-health = "0.14.3"
# needs to line up with jsonrpsee tower version...
tower = "0.5.2"
tower-http = { version = "0.6.2", features = ["request-id", "trace"] }
Expand Down
19 changes: 7 additions & 12 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ ignore = [
{ id = "RUSTSEC-2024-0370", reason = "Temporary ignore until the ouroboros branch gets updated"},
# paste (via aws-lc-rs) is unmaintained
# https://github.com/aws/aws-lc-rs/issues/722
{ id = "RUSTSEC-2024-0436", reason = "Temporary ignore until aws-lc-rs and rustls-webpki get updated"}
{ id = "RUSTSEC-2024-0436", reason = "Temporary ignore until aws-lc-rs and rustls-webpki get updated"},
{ id = "RUSTSEC-2025-0141", reason = "Temporary ignore until heed migrates to wincode"},
]
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
Expand Down Expand Up @@ -116,14 +117,15 @@ confidence-threshold = 0.8
exceptions = [
# Each entry is the crate and version constraint, and its specific allow
# list
{ allow = ["CDLA-Permissive-2.0"], name = "webpki-root-certs", version = "0.26.11" },
{ allow = ["CDLA-Permissive-2.0"], name = "webpki-root-certs", version = "1.0.5" },
{ allow = ["CDLA-Permissive-2.0"], name = "webpki-roots", version = "1.0.5" },
{ allow = ["LicenseRef-UFL-1.0", "OFL-1.1", "Ubuntu-font-1.0"], name = "epaint_default_fonts", version = "0.31.0" },
{ allow = ["MPL-2.0"], name = "bitmaps", version = "3.2.1" },
{ allow = ["MPL-2.0"], name = "imbl", version = "3.0.0" },
{ allow = ["MPL-2.0"], name = "imbl-sized-chunks", version = "0.1.3" },
{ allow = ["MPL-2.0"], name = "option-ext", version = "0.2.0" },
{ allow = ["MPL-2.0"], name = "webpki-root-certs", version = "0.26.7" },
{ allow = ["MPL-2.0"], name = "webpki-roots", version = "0.25.4" },
{ allow = ["MPL-2.0"], name = "webpki-roots", version = "0.26.7" },
{ allow = ["Zlib"], crate = "foldhash" },
{ allow = ["Zlib"], name = "slotmap", version = "1.0.7" },
{ allow = ["Zlib"], name = "typewit", version = "1.11.0" },
Expand Down Expand Up @@ -233,24 +235,18 @@ skip-tree = [
#"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies
#{ crate = "ansi_term@0.11.0", depth = 20 },
{ crate = "base64@0.21.7" },
{ crate = "bitcoin_hashes@0.13.0" },
{ crate = "hashbrown@0.14.5" },
{ crate = "hashlink@0.9.1" },
{ crate = "heck@0.4.1" },
{ crate = "hex-conservative@0.1.2" },
{ crate = "itertools@0.11.0" },
{ crate = "itertools@0.13.0" },
{ crate = "litrs@0.2.3" },
{ crate = "quick-xml@0.30.0" },
{ crate = "redox_syscall@0.4.1" },
{ crate = "regex-automata@0.1.10" },
{ crate = "regex-syntax@0.6.29" },
{ crate = "rustc-hash@1.1.0" },
{ crate = "rustls-platform-verifier@0.3.4" },
{ crate = "rustls-platform-verifier@0.5.3" },
{ crate = "thiserror@1" },
{ crate = "tower@0.4.13" },
{ crate = "unicode-width@0.1.14" },
{ crate = "windows-core@0.52.0" },
{ crate = "windows-core@0.58.0" },
{ crate = "windows-sys@0.45.0" },
{ crate = "windows-sys@0.52.0" },
{ crate = "windows-targets@0.42.2" },
Expand All @@ -277,7 +273,6 @@ allow-git = [
"https://github.com/LayerTwo-Labs/bitcoin-jsonrpsee.git",
"https://github.com/LayerTwo-Labs/bip300301_enforcer.git",
"https://github.com/LayerTwo-Labs/cusf-enforcer-mempool.git",
"https://github.com/mit-dci/rustreexo.git",
"https://github.com/torkelrogstad/tokio-tracing.git?branch=log-rotation-size",
]

Expand Down
18 changes: 14 additions & 4 deletions integration_tests/ibd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use bip300301_enforcer_integration_tests::{
Mode, Network, PostSetup as EnforcerPostSetup, Sidechain as _,
setup as setup_enforcer,
},
util::{AbortOnDrop, AsyncTrial},
util::{AbortOnDrop, AsyncTrial, TestFailureCollector, TestFileRegistry},
};
use futures::{FutureExt, StreamExt as _, channel::mpsc, future::BoxFuture};
use plain_bitassets_app_rpc_api::RpcClient as _;
Expand Down Expand Up @@ -161,11 +161,14 @@ async fn initial_block_download_task(
}
drop(bitassets_nodes.syncer);
drop(bitassets_nodes.sender);
tracing::info!("Removing {}", enforcer_post_setup.out_dir.path().display());
tracing::info!(
"Removing {}",
enforcer_post_setup.directories.base_dir.path().display()
);
drop(enforcer_post_setup.tasks);
// Wait for tasks to die
sleep(std::time::Duration::from_secs(1)).await;
enforcer_post_setup.out_dir.cleanup()?;
enforcer_post_setup.directories.base_dir.cleanup()?;
Ok(())
}

Expand All @@ -188,6 +191,13 @@ async fn ibd(bin_paths: BinPaths) -> anyhow::Result<()> {

pub fn ibd_trial(
bin_paths: BinPaths,
file_registry: TestFileRegistry,
failure_collector: TestFailureCollector,
) -> AsyncTrial<BoxFuture<'static, anyhow::Result<()>>> {
AsyncTrial::new("initial_block_download", ibd(bin_paths).boxed())
AsyncTrial::new(
"initial_block_download",
ibd(bin_paths).boxed(),
file_registry,
failure_collector,
)
}
56 changes: 42 additions & 14 deletions integration_tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bip300301_enforcer_integration_tests::{
setup::{Mode, Network},
util::AsyncTrial,
util::{AsyncTrial, TestFailureCollector, TestFileRegistry},
};
use futures::{FutureExt, future::BoxFuture};

Expand All @@ -14,25 +14,53 @@ use crate::{

fn deposit_withdraw_roundtrip(
bin_paths: BinPaths,
file_registry: TestFileRegistry,
failure_collector: TestFailureCollector,
) -> AsyncTrial<BoxFuture<'static, anyhow::Result<()>>> {
AsyncTrial::new("deposit_withdraw_roundtrip", async move {
bip300301_enforcer_integration_tests::integration_test::deposit_withdraw_roundtrip::<PostSetup>(
bin_paths.others, Network::Regtest, Mode::Mempool,
Init {
bitassets_app: bin_paths.bitassets,
data_dir_suffix: None,
},
).await
}.boxed())
AsyncTrial::new(
"deposit_withdraw_roundtrip",
async move {
let (res_tx, _) = futures::channel::mpsc::unbounded();
let post_setup = bip300301_enforcer_integration_tests::setup::setup(
&bin_paths.others,
Network::Regtest,
Mode::Mempool,
res_tx
).await?;
bip300301_enforcer_integration_tests::integration_test::deposit_withdraw_roundtrip::<PostSetup>(
post_setup,
Init {
bitassets_app: bin_paths.bitassets,
data_dir_suffix: None,
},
).await
}.boxed(),
file_registry,
failure_collector,
)
}

pub fn tests(
bin_paths: BinPaths,
file_registry: TestFileRegistry,
failure_collector: TestFailureCollector,
) -> Vec<AsyncTrial<BoxFuture<'static, anyhow::Result<()>>>> {
vec![
deposit_withdraw_roundtrip(bin_paths.clone()),
ibd_trial(bin_paths.clone()),
unknown_withdrawal_trial(bin_paths.clone()),
vote_trial(bin_paths),
deposit_withdraw_roundtrip(
bin_paths.clone(),
file_registry.clone(),
failure_collector.clone(),
),
ibd_trial(
bin_paths.clone(),
file_registry.clone(),
failure_collector.clone(),
),
unknown_withdrawal_trial(
bin_paths.clone(),
file_registry.clone(),
failure_collector.clone(),
),
vote_trial(bin_paths, file_registry, failure_collector),
]
}
15 changes: 12 additions & 3 deletions integration_tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use bip300301_enforcer_integration_tests::util::{
TestFailureCollector, TestFileRegistry,
};
use clap::Parser;
use tracing_subscriber::{filter as tracing_filter, layer::SubscriberExt};

Expand Down Expand Up @@ -93,10 +96,16 @@ async fn main() -> anyhow::Result<std::process::ExitCode> {

// Create a list of tests
let mut tests = Vec::<libtest_mimic::Trial>::new();
let file_registry = TestFileRegistry::new();
let failure_collector = TestFailureCollector::new();
tests.extend(
integration_test::tests(util::BinPaths::from_env()?)
.into_iter()
.map(|trial| trial.run_blocking(rt_handle.clone())),
integration_test::tests(
util::BinPaths::from_env()?,
file_registry,
failure_collector,
)
.into_iter()
.map(|trial| trial.run_blocking(rt_handle.clone())),
);
// Run all tests and exit the application appropriatly.
let exit_code = libtest_mimic::run(&args.test_args, tests).exit_code();
Expand Down
5 changes: 3 additions & 2 deletions integration_tests/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ impl Sidechain for PostSetup {
let reserved_ports = ReservedPorts::new()?;
let bitassets_dir = if let Some(suffix) = init.data_dir_suffix {
post_setup
.out_dir
.directories
.base_dir
.path()
.join(format!("bitassets-{suffix}"))
} else {
post_setup.out_dir.path().join("bitassets")
post_setup.directories.base_dir.path().join("bitassets")
};
std::fs::create_dir(&bitassets_dir)
.map_err(Self::SetupError::CreateBitAssetsDir)?;
Expand Down
18 changes: 14 additions & 4 deletions integration_tests/unknown_withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bip300301_enforcer_integration_tests::{
Mode, Network, PostSetup as EnforcerPostSetup, Sidechain as _,
setup as setup_enforcer,
},
util::{AbortOnDrop, AsyncTrial},
util::{AbortOnDrop, AsyncTrial, TestFailureCollector, TestFileRegistry},
};
use futures::{
FutureExt as _, StreamExt as _, channel::mpsc, future::BoxFuture,
Expand Down Expand Up @@ -141,11 +141,14 @@ async fn unknown_withdrawal_task(
}
drop(sidechain_successor);
drop(sidechain_withdrawer);
tracing::info!("Removing {}", enforcer_post_setup.out_dir.path().display());
tracing::info!(
"Removing {}",
enforcer_post_setup.directories.base_dir.path().display()
);
drop(enforcer_post_setup.tasks);
// Wait for tasks to die
sleep(std::time::Duration::from_secs(1)).await;
enforcer_post_setup.out_dir.cleanup()?;
enforcer_post_setup.directories.base_dir.cleanup()?;
Ok(())
}

Expand All @@ -167,6 +170,13 @@ async fn unknown_withdrawal(bin_paths: BinPaths) -> anyhow::Result<()> {

pub fn unknown_withdrawal_trial(
bin_paths: BinPaths,
file_registry: TestFileRegistry,
failure_collector: TestFailureCollector,
) -> AsyncTrial<BoxFuture<'static, anyhow::Result<()>>> {
AsyncTrial::new("unknown_withdrawal", unknown_withdrawal(bin_paths).boxed())
AsyncTrial::new(
"unknown_withdrawal",
unknown_withdrawal(bin_paths).boxed(),
file_registry,
failure_collector,
)
}
15 changes: 11 additions & 4 deletions integration_tests/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bip300301_enforcer_integration_tests::{
Mode, Network, PostSetup as EnforcerPostSetup, Sidechain as _,
setup as setup_enforcer,
},
util::{AbortOnDrop, AsyncTrial},
util::{AbortOnDrop, AsyncTrial, TestFailureCollector, TestFileRegistry},
};
use futures::{
FutureExt as _, StreamExt as _, channel::mpsc, future::BoxFuture,
Expand Down Expand Up @@ -293,12 +293,12 @@ async fn vote_task(
drop(bitassets_nodes);
tracing::info!(
"Removing {}",
enforcer_post_setup.out_dir.path().display()
enforcer_post_setup.directories.base_dir.path().display()
);
drop(enforcer_post_setup.tasks);
// Wait for tasks to die
sleep(std::time::Duration::from_secs(1)).await;
enforcer_post_setup.out_dir.cleanup()?;
enforcer_post_setup.directories.base_dir.cleanup()?;
}
Ok(())
}
Expand All @@ -321,6 +321,13 @@ async fn vote(bin_paths: BinPaths) -> anyhow::Result<()> {

pub fn vote_trial(
bin_paths: BinPaths,
file_registry: TestFileRegistry,
failure_collector: TestFailureCollector,
) -> AsyncTrial<BoxFuture<'static, anyhow::Result<()>>> {
AsyncTrial::new("vote", vote(bin_paths).boxed())
AsyncTrial::new(
"vote",
vote(bin_paths).boxed(),
file_registry,
failure_collector,
)
}
13 changes: 7 additions & 6 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ version.workspace = true

[build-dependencies]
prost = { workspace = true }
prost-build = "0.13.3"
protox = "0.7.1"
tonic-build = "0.12.3"
prost-build = "0.14.3"
protox = "0.9.1"
tonic-prost-build = "0.14.3"

[dependencies]
addr = "0.15.6"
Expand Down Expand Up @@ -40,7 +40,7 @@ nonempty = { version = "0.11.0", features = ["serialize"] }
num = "0.4.1"
parking_lot = { workspace = true }
prost = { workspace = true }
prost-types = "0.13.3"
prost-types = "0.14.3"
quinn = "0.11.6"
rayon = "1.7.0"
rcgen = "0.13.2"
Expand All @@ -50,16 +50,17 @@ serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_with = { workspace = true, features = ["alloc", "macros"] }
smallvec = { version = "1.13.2", features = ["write"] }
sneed = { version = "0.0.11", features = ["observe"] }
sneed = { version = "0.0.19", features = ["observe"] }
strum = { workspace = true, features = ["derive"] }
thiserror = { workspace = true }
tiny-bip39 = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "sync"] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
tokio-util = { workspace = true, features = ["rt"] }
tonic = { workspace = true }
tonic-prost = "0.14.3"
tracing = { workspace = true }
transitive = "1.0.1"
transitive = "1.2.0"
utoipa = { workspace = true, features = ["macros", "non_strict_integers"] }
x25519-dalek = { version = "2.0.0", features = ["serde", "static_secrets"] }
zeromq = { version = "0.4.1", optional = true }
Expand Down
Loading
Loading