From 04e1dca16afdb0834c8758ce0bc8eed3796812ec Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 21 Oct 2020 15:14:31 +1100 Subject: [PATCH 1/4] Fix dependency to cross-curve-dleq and ecdsa_fun --- xmr-btc/Cargo.toml | 4 ++-- xmr-btc/src/alice.rs | 2 +- xmr-btc/src/bob.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xmr-btc/Cargo.toml b/xmr-btc/Cargo.toml index 0b6cf7e7..3e1457de 100644 --- a/xmr-btc/Cargo.toml +++ b/xmr-btc/Cargo.toml @@ -8,9 +8,9 @@ edition = "2018" anyhow = "1" async-trait = "0.1" bitcoin = { version = "0.23", features = ["rand"] } -cross-curve-dleq = { git = "https://github.com/comit-network/cross-curve-dleq", rev = "a3e57a70d332b4ce9600663453b9bd02936d76bf" } +cross-curve-dleq = { git = "https://github.com/comit-network/cross-curve-dleq", rev = "49171f5e08473d46f951fb1fc338fe437d974d3c" } curve25519-dalek = "2" -ecdsa_fun = { version = "0.3.1", features = ["libsecp_compat"] } +ecdsa_fun = { git = "https://github.com/LLFourn/secp256kfun", rev = "510d48ef6a2b19805f7f5c70c598e5b03f668e7a", features = ["libsecp_compat"] } ed25519-dalek = "1.0.0-pre.4" # Cannot be 1 because they depend on curve25519-dalek version 3 futures = "0.3" genawaiter = "0.99.1" diff --git a/xmr-btc/src/alice.rs b/xmr-btc/src/alice.rs index a8a1ea20..9b398464 100644 --- a/xmr-btc/src/alice.rs +++ b/xmr-btc/src/alice.rs @@ -188,7 +188,7 @@ impl State0 { pub fn receive(self, msg: bob::Message0) -> Result { msg.dleq_proof_s_b.verify( - &msg.S_b_bitcoin.clone().into(), + msg.S_b_bitcoin.clone().into(), msg.S_b_monero .point .decompress() diff --git a/xmr-btc/src/bob.rs b/xmr-btc/src/bob.rs index 55099ed6..2b62c749 100644 --- a/xmr-btc/src/bob.rs +++ b/xmr-btc/src/bob.rs @@ -160,7 +160,7 @@ impl State0 { W: BuildTxLockPsbt, { msg.dleq_proof_s_a.verify( - &msg.S_a_bitcoin.clone().into(), + msg.S_a_bitcoin.clone().into(), msg.S_a_monero .point .decompress() From 8b48191e1cb70c168a0ed0f7b67372727d142b9b Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 21 Oct 2020 15:55:20 +1100 Subject: [PATCH 2/4] Increase Rust minimum stack size in CI --- .github/workflows/ci.yml | 1 + xmr-btc/tests/e2e.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 531def83..c92878bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,4 +76,5 @@ jobs: - name: Cargo test run: cargo test --workspace --all-features env: + RUST_MIN_STACK: 10000000 MONERO_ADDITIONAL_SLEEP_PERIOD: 60000 diff --git a/xmr-btc/tests/e2e.rs b/xmr-btc/tests/e2e.rs index 2eb3cf70..2b3bc461 100644 --- a/xmr-btc/tests/e2e.rs +++ b/xmr-btc/tests/e2e.rs @@ -142,6 +142,11 @@ pub async fn init_test( } mod tests { + // NOTE: For some reason running these tests overflows the stack. In order to + // mitigate this run them with: + // + // RUST_MIN_STACK=10000000 cargo test + use crate::{ harness, harness::node::{run_alice_until, run_bob_until}, From 917aabcc03e643d2674846ce197c00c47a9c088f Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 21 Oct 2020 16:04:41 +1100 Subject: [PATCH 3/4] Increase Rust minimum stack size a lot more --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c92878bc..e3a8d6fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,5 +76,5 @@ jobs: - name: Cargo test run: cargo test --workspace --all-features env: - RUST_MIN_STACK: 10000000 + RUST_MIN_STACK: 100000000 MONERO_ADDITIONAL_SLEEP_PERIOD: 60000 From d3a7689059f82e03eba4689cdac7819718961e71 Mon Sep 17 00:00:00 2001 From: Lucas Soriano del Pino Date: Wed, 21 Oct 2020 16:10:20 +1100 Subject: [PATCH 4/4] Update comment about minimum stack size --- xmr-btc/tests/e2e.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmr-btc/tests/e2e.rs b/xmr-btc/tests/e2e.rs index 2b3bc461..024fb1ca 100644 --- a/xmr-btc/tests/e2e.rs +++ b/xmr-btc/tests/e2e.rs @@ -145,7 +145,7 @@ mod tests { // NOTE: For some reason running these tests overflows the stack. In order to // mitigate this run them with: // - // RUST_MIN_STACK=10000000 cargo test + // RUST_MIN_STACK=100000000 cargo test use crate::{ harness,