Skip to content

Commit edf8512

Browse files
committed
f: move 0FC eclair interop test to eclair workflow
1 parent fbb18cf commit edf8512

4 files changed

Lines changed: 32 additions & 68 deletions

File tree

.github/workflows/0fc-integration.yml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -47,54 +47,3 @@ jobs:
4747
- name: Test with 0FC enabled
4848
run: |
4949
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg tokio_unstable --cfg zero_fee_commitment_tests" cargo test -- --test-threads=1
50-
eclair-interop-test:
51-
timeout-minutes: 60
52-
runs-on: ubuntu-latest
53-
steps:
54-
- name: Checkout repository
55-
uses: actions/checkout@v4
56-
57-
- name: Start bitcoind and electrs
58-
run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d bitcoin electrs
59-
60-
- name: Wait for bitcoind to be healthy
61-
run: |
62-
for i in $(seq 1 30); do
63-
if docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getblockchaininfo > /dev/null 2>&1; then
64-
echo "bitcoind is ready"
65-
exit 0
66-
fi
67-
echo "Waiting for bitcoind... ($i/30)"
68-
sleep 2
69-
done
70-
echo "ERROR: bitcoind not ready"
71-
exit 1
72-
73-
- name: Create wallets on bitcoind
74-
run: |
75-
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet eclair
76-
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass -rpcwallet=eclair getnewaddress
77-
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet ldk_node_test
78-
79-
- name: Start Eclair with 0FC enabled
80-
env:
81-
ECLAIR_EXTRA_JAVA_OPTS: "-Declair.features.zero_fee_commitments=optional"
82-
run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d eclair
83-
84-
- name: Wait for Eclair to be ready
85-
run: |
86-
for i in $(seq 1 60); do
87-
if curl -sf -u :eclairpassword -X POST http://127.0.0.1:8080/getinfo > /dev/null 2>&1; then
88-
echo "Eclair is ready"
89-
exit 0
90-
fi
91-
echo "Waiting for Eclair... ($i/60)"
92-
sleep 5
93-
done
94-
echo "Eclair failed to start"
95-
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml logs eclair
96-
exit 1
97-
98-
- name: Run Eclair 0FC integration tests
99-
run: |
100-
RUSTFLAGS="--cfg eclair_test --cfg zero_fee_commitment_tests" cargo test --test integration_tests_eclair -- --show-output --test-threads=1

.github/workflows/eclair-integration.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@ concurrency:
88

99
jobs:
1010
check-eclair:
11+
name: check-eclair (${{ matrix.name }})
1112
timeout-minutes: 60
1213
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- name: standard
19+
eclair_extra_java_opts: ""
20+
rustflags: "--cfg eclair_test"
21+
- name: zero-fee-commitments
22+
eclair_extra_java_opts: "-Declair.features.zero_fee_commitments=optional"
23+
rustflags: "--cfg eclair_test --cfg zero_fee_commitment_tests"
1324
steps:
1425
- name: Checkout repository
1526
uses: actions/checkout@v4
@@ -37,6 +48,8 @@ jobs:
3748
docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet ldk_node_test
3849
3950
- name: Start Eclair
51+
env:
52+
ECLAIR_EXTRA_JAVA_OPTS: ${{ matrix.eclair_extra_java_opts }}
4053
run: docker compose -p ldk-node -f tests/docker/docker-compose-eclair.yml up -d eclair
4154

4255
- name: Wait for Eclair to be ready
@@ -54,4 +67,5 @@ jobs:
5467
exit 1
5568
5669
- name: Run Eclair integration tests
57-
run: RUSTFLAGS="--cfg eclair_test" cargo test --test integration_tests_eclair -- --show-output --test-threads=1
70+
run: |
71+
RUSTFLAGS="${{ matrix.rustflags }}" cargo test --test integration_tests_eclair -- --show-output --test-threads=1

tests/common/scenarios/channel.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use std::time::Duration;
99

1010
use electrsd::corepc_node::Client as BitcoindClient;
1111
use electrsd::electrum_client::ElectrumApi;
12+
#[cfg(all(eclair_test, zero_fee_commitment_tests))]
13+
use ldk_node::ReserveType;
1214
use ldk_node::{Event, Node};
1315

1416
use super::super::external_node::ExternalNode;
@@ -41,6 +43,21 @@ pub(crate) async fn open_channel_to_external<E: ElectrumApi>(
4143
.map(|ch| ch.channel_id.clone())
4244
.unwrap_or_else(|| panic!("Could not find channel on external node {}", peer.name()));
4345

46+
#[cfg(all(eclair_test, zero_fee_commitment_tests))]
47+
{
48+
let channel = node
49+
.list_channels()
50+
.into_iter()
51+
.find(|channel| channel.user_channel_id == user_channel_id)
52+
.expect("opened channel should be listed");
53+
let channel_type = channel.channel_type.as_ref().expect("channel type should be set");
54+
assert_eq!(channel.counterparty.node_id, ext_node_id);
55+
assert!(channel.counterparty.features.supports_anchor_zero_fee_commitments());
56+
assert!(channel_type.requires_anchor_zero_fee_commitments());
57+
assert_eq!(channel.feerate_sat_per_1000_weight, 0);
58+
assert_eq!(channel.reserve_type, Some(ReserveType::Adaptive));
59+
}
60+
4461
(user_channel_id, ext_channel_id)
4562
}
4663

tests/common/scenarios/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ use std::time::Duration;
2020
use bitcoin::Amount;
2121
use electrsd::corepc_node::Client as BitcoindClient;
2222
use electrsd::electrum_client::ElectrumApi;
23-
#[cfg(zero_fee_commitment_tests)]
24-
use ldk_node::ReserveType;
2523
use ldk_node::{Event, Node};
2624

2725
use super::external_node::ExternalNode;
@@ -166,20 +164,6 @@ pub(crate) async fn basic_channel_cycle_scenario<E: ElectrumApi>(
166164
)
167165
.await;
168166

169-
#[cfg(zero_fee_commitment_tests)]
170-
{
171-
let ext_node_id = peer.get_node_id().await.unwrap();
172-
let channel = node
173-
.list_channels()
174-
.into_iter()
175-
.find(|channel| channel.user_channel_id == user_ch)
176-
.expect("opened channel should be listed");
177-
assert_eq!(channel.counterparty.node_id, ext_node_id);
178-
assert!(channel.counterparty.features.supports_anchor_zero_fee_commitments());
179-
assert_eq!(channel.feerate_sat_per_1000_weight, 0);
180-
assert_eq!(channel.reserve_type, Some(ReserveType::Adaptive));
181-
}
182-
183167
payment::send_bolt11_to_peer(node, peer, 10_000_000, "basic-send").await;
184168
payment::receive_bolt11_payment(node, peer, 10_000_000).await;
185169

0 commit comments

Comments
 (0)