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
1,184 changes: 815 additions & 369 deletions Cargo.lock

Large diffs are not rendered by default.

55 changes: 51 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,84 @@ version = "0.14.0"

[workspace.dependencies]
anyhow = "1.0.72"
async-lock = "3.4.0"
bincode = "1.3.3"
bitcoin = "0.32.5"
clap = { version = "4.5.4" }
blake3 = "1.4.1"
borsh = "1.3.1"
byteorder = "1.4.3"
bytes = "1.4.0"
clap = "4.5.4"
dirs = "5.0.1"
dotenvy = "0.15.7"
ed25519-dalek = "2.1.1"
ed25519-dalek-bip32 = "0.3.0"
educe = { version = "0.6.0", default-features = false }
eframe = "0.31.0"
error-fatality = "0.1.2"
fallible-iterator = "0.3.0"
futures = { version = "0.3.30", default-features = false }
governor = { version = "0.8.1", default-features = false }
hashlink = "0.10.0"
heed = "0.21.0"
hex = "0.4.3"
http = "1.2.0"
human-size = "0.4.3"
include_path = "0.1.1"
jsonrpsee = { version = "0.25.1", features = ["tracing"] }
libtest-mimic = "0.8.1"
merkle-cbt = "0.3.2"
mimalloc = "0.1.48"
nonempty = "0.11.0"
parking_lot = "0.12.1"
poll-promise = "0.3.0"
prost = "0.14.1"
prost-build = "0.14.1"
prost-types = "0.14.1"
protox = "0.9.0"
quinn = "0.11.6"
rayon = "1.7.0"
rcgen = "0.13.2"
reserve-port = "2.0.1"
rustls = { version = "0.23.21", default-features = false }
semver = "1.0.25"
serde = "1.0.179"
serde_json = "1.0.113"
serde_with = "3.4.0"
shlex = "1.3.0"
smallvec = "1.13.2"
sneed = "0.0.11"
strum = { version = "0.27.2", features = ["derive"] }
thiserror = "2.0.11"
tiny-bip39 = "2.0.0"
tokio = { version = "1.48.0", default-features = false, features = ["signal"] }
tokio = { version = "1.50.0", default-features = false }
tokio-stream = "0.1.15"
tokio-util = "0.7.18"
tonic = "0.14.2"
tonic-health = "0.14.2"
tonic-prost = "0.14.2"
tonic-prost-build = "0.14.2"
# needs to line up with jsonrpsee tower version...
tower = "0.5.2"
tower-http = "0.6.2"
tracing = "0.1.40"
tracing-appender = "0.2.3"
tracing-indicatif = "0.3.8"
tracing-subscriber = "0.3.20"
transitive = "1.0.1"
utoipa = { version = "5.2.0", default-features = false }
url = "2.5.4"
uuid = "1.13.1"

[workspace.dependencies.bip300301_enforcer_lib]
default-features = false
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
rev = "9c3eb0bdcb5b9a458e6f92cafb8bdbf76a860f74"
rev = "57bf4f8ace4454eddaec83dbc634dc706fc71516"

[workspace.dependencies.bip300301_enforcer_integration_tests]
default-features = false
git = "https://github.com/LayerTwo-Labs/bip300301_enforcer"
rev = "9c3eb0bdcb5b9a458e6f92cafb8bdbf76a860f74"
rev = "57bf4f8ace4454eddaec83dbc634dc706fc71516"

[workspace.dependencies.l2l-openapi]
git = "https://github.com/Ash-L2L/l2l-openapi"
Expand Down
29 changes: 16 additions & 13 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,40 +11,43 @@ anyhow = { workspace = true }
bincode = { workspace = true }
bitcoin = { workspace = true, features = ["serde"] }
clap = { workspace = true, features = ["derive"] }
dirs = "5.0.1"
eframe = "0.31.0"
dirs = { workspace = true }
eframe = { workspace = true }
fallible-iterator = { workspace = true }
futures = { workspace = true }
http = { workspace = true }
human-size = "0.4.3"
include_path = "0.1.1"
human-size = { workspace = true }
include_path = { workspace = true }
jsonrpsee = { workspace = true, features = ["server"] }
mimalloc = { version = "0.1.48", features = ["v3"] }
mimalloc = { workspace = true, features = ["v3"] }
parking_lot = { workspace = true }
poll-promise = { version = "0.3.0", features = ["tokio"] }
poll-promise = { workspace = true, features = ["tokio"] }
rustreexo = { workspace = true }
serde = { workspace = true, features = ["derive"] }
shlex = "1.3.0"
shlex = { workspace = true }
strum = { workspace = true }
thiserror = { workspace = true }
thunder = { path = "../lib", features = ["clap"] }
thunder_app_cli = { path = "../cli" }
thunder_app_rpc_api = { path = "../rpc-api" }
tiny-bip39 = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tokio-util = { workspace = true, features = ["rt"] }
tonic = { workspace = true }
tonic-health = "0.14.2"
tonic-health = { workspace = true }
# needs to line up with jsonrpsee tower version...
tower = "0.5.2"
tower-http = { version = "0.6.2", features = ["request-id", "trace"] }
tower = { workspace = true }
tower-http = { workspace = true, features = ["request-id", "trace"] }
tracing = { workspace = true }
tracing-appender = "0.2.3"
tracing-appender = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter", "json"] }
url = "2.5.4"
url = { workspace = true }
utoipa = { workspace = true }
uuid = { workspace = true }

[dependencies.tokio]
workspace = true
features = ["macros", "rt-multi-thread", "signal"]

[lints]
workspace = true

Expand Down
6 changes: 3 additions & 3 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version.workspace = true
[dependencies]
anyhow = { workspace = true }
bitcoin = { workspace = true, features = ["serde"] }
clap = { version = "4.5.4", features = ["derive"] }
clap = { workspace = true, features = ["derive"] }
http = { workspace = true }
jsonrpsee = { workspace = true, features = ["http-client"] }
serde_json = { workspace = true }
Expand All @@ -18,9 +18,9 @@ thunder_app_rpc_api = { path = "../rpc-api" }
tokio = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
url = "2.5.4"
url = { workspace = true }
utoipa = { workspace = true }
uuid = { workspace = true }
uuid = { workspace = true, features = ["v4"] }

[lints]
workspace = true
Expand Down
3 changes: 1 addition & 2 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ allow = [
"ISC",
"MIT",
"MITNFA",
"OpenSSL",
"Unicode-3.0",
"Unlicense",
]
Expand All @@ -121,7 +120,7 @@ exceptions = [
{ 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", version = "7.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-roots", version = "0.25.4" },
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ bip300301_enforcer_lib = { workspace = true }
bip300301_enforcer_integration_tests = { workspace = true }
bitcoin = { workspace = true }
clap = { workspace = true }
dotenvy = "0.15.7"
dotenvy = { workspace = true }
futures = { workspace = true }
jsonrpsee = { workspace = true }
libtest-mimic = "0.8.1"
reserve-port = "2.0.1"
libtest-mimic = { workspace = true }
reserve-port = { workspace = true }
thiserror = { workspace = true }
thunder = { path = "../lib", features = ["clap"] }
thunder_app_rpc_api = { path = "../rpc-api" }
tracing = { workspace = true }
tracing-indicatif = "0.3.8"
tracing-indicatif = { workspace = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tokio = { workspace = true, features = ["rt-multi-thread"] }

Expand Down
6 changes: 3 additions & 3 deletions integration_tests/ibd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async fn setup(
res_tx: mpsc::UnboundedSender<anyhow::Result<()>>,
) -> anyhow::Result<(EnforcerPostSetup, ThunderNodes)> {
let enforcer_pre_setup =
EnforcerPreSetup::new(bin_paths.others, Network::Regtest)?;
EnforcerPreSetup::new(&bin_paths.others, Network::Regtest)?;
let mut enforcer_post_setup = {
let setup_opts: EnforcerSetupOpts = Default::default();
enforcer_pre_setup
Expand All @@ -44,7 +44,7 @@ async fn setup(
};
let sidechain_sender = PostSetup::setup(
Init {
thunder_app: bin_paths.thunder.clone(),
thunder_app: bin_paths.thunder()?.clone(),
data_dir_suffix: Some("sender".to_owned()),
},
&enforcer_post_setup,
Expand All @@ -54,7 +54,7 @@ async fn setup(
tracing::info!("Setup thunder send node successfully");
let sidechain_syncer = PostSetup::setup(
Init {
thunder_app: bin_paths.thunder.clone(),
thunder_app: bin_paths.thunder()?.clone(),
data_dir_suffix: Some("syncer".to_owned()),
},
&enforcer_post_setup,
Expand Down
4 changes: 2 additions & 2 deletions integration_tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn deposit_withdraw_roundtrip_trial(
async move {
let (res_tx, _) = futures::channel::mpsc::unbounded();
let pre_setup =
EnforcerPreSetup::new(bin_paths.others, Network::Regtest)?;
EnforcerPreSetup::new(&bin_paths.others, Network::Regtest)?;
let post_setup = {
let setup_opts: EnforcerSetupOpts = Default::default();
pre_setup
Expand All @@ -143,7 +143,7 @@ fn deposit_withdraw_roundtrip_trial(
deposit_withdraw_roundtrip(
post_setup,
Init {
thunder_app: bin_paths.thunder,
thunder_app: bin_paths.thunder()?.clone(),
data_dir_suffix: None,
},
res_tx,
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async fn main() -> anyhow::Result<std::process::ExitCode> {
let failure_collector = TestFailureCollector::new();
tests.extend(
integration_test::tests(
util::BinPaths::from_env()?,
util::BinPaths::default(),
file_registry,
failure_collector,
)
Expand Down
8 changes: 4 additions & 4 deletions integration_tests/unknown_withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::{

/// Initial setup for the test
async fn setup(
enforcer_bin_paths: EnforcerBinPaths,
enforcer_bin_paths: &EnforcerBinPaths,
res_tx: mpsc::UnboundedSender<anyhow::Result<()>>,
) -> anyhow::Result<EnforcerPostSetup> {
let enforcer_pre_setup =
Expand Down Expand Up @@ -59,10 +59,10 @@ async fn unknown_withdrawal_task(
res_tx: mpsc::UnboundedSender<anyhow::Result<()>>,
) -> anyhow::Result<()> {
let mut enforcer_post_setup =
setup(bin_paths.others, res_tx.clone()).await?;
setup(&bin_paths.others, res_tx.clone()).await?;
let mut sidechain_withdrawer = PostSetup::setup(
Init {
thunder_app: bin_paths.thunder.clone(),
thunder_app: bin_paths.thunder()?.clone(),
data_dir_suffix: Some("withdrawer".to_owned()),
},
&enforcer_post_setup,
Expand Down Expand Up @@ -93,7 +93,7 @@ async fn unknown_withdrawal_task(
// New sidechain node, starting from scratch
let mut sidechain_successor = PostSetup::setup(
Init {
thunder_app: bin_paths.thunder,
thunder_app: bin_paths.thunder()?.clone(),
data_dir_suffix: Some("successor".to_owned()),
},
&enforcer_post_setup,
Expand Down
22 changes: 6 additions & 16 deletions integration_tests/util.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
use std::{
ffi::{OsStr, OsString},
path::PathBuf,
sync::OnceLock,
};

use bip300301_enforcer_integration_tests::util::{
AbortOnDrop, BinPaths as EnforcerBinPaths, VarError, get_env_var,
AbortOnDrop, BinPaths as EnforcerBinPaths, OnceLockExt as _, VarError,
spawn_command_with_args,
};
use thunder::types::Network;

fn load_env_var_from_string(s: &str) -> Result<(), VarError> {
dotenvy::from_read_override(s.as_bytes())
.map_err(|err| VarError::new(s, err))
}

#[derive(Clone, Debug)]
#[derive(Clone, Debug, Default)]
pub struct BinPaths {
pub thunder: PathBuf,
thunder: OnceLock<PathBuf>,
pub others: EnforcerBinPaths,
}

impl BinPaths {
/// Read from environment variables
pub fn from_env() -> Result<Self, VarError> {
let () = load_env_var_from_string("BITCOIN_UTIL=''")?;
let () = load_env_var_from_string("SIGNET_MINER=''")?;
Ok(Self {
thunder: get_env_var("THUNDER_APP")?.into(),
others: EnforcerBinPaths::from_env()?,
})
pub fn thunder(&self) -> Result<&PathBuf, VarError> {
self.thunder.get_or_try_init_from_env("THUNDER_APP")
}
}

Expand Down
Loading
Loading