Skip to content

Commit 443aa30

Browse files
committed
ci: Reproduce Esplora 0.0.0.0 connection failure on macOS
Force Esplora chain source and run on macOS to reproduce the fee rate estimation failure caused by electrsd exposing 0.0.0.0 as the Esplora URL. On macOS, connecting to 0.0.0.0 as a destination address results in ConnectionRefused. AI tools were used in preparing this commit.
1 parent a555133 commit 443aa30

File tree

2 files changed

+10
-81
lines changed

2 files changed

+10
-81
lines changed

.github/workflows/rust.yml

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,13 @@ concurrency:
88

99
jobs:
1010
build:
11-
strategy:
12-
matrix:
13-
platform: [
14-
ubuntu-latest,
15-
macos-latest,
16-
windows-latest,
17-
]
18-
toolchain: [
19-
stable,
20-
beta,
21-
1.85.0, # Our MSRV
22-
]
23-
include:
24-
- toolchain: stable
25-
check-fmt: true
26-
build-uniffi: true
27-
platform: ubuntu-latest
28-
- toolchain: stable
29-
platform: macos-latest
30-
- toolchain: stable
31-
platform: windows-latest
32-
- toolchain: 1.85.0
33-
msrv: true
34-
runs-on: ${{ matrix.platform }}
11+
runs-on: macos-latest
3512
steps:
3613
- name: Checkout source code
3714
uses: actions/checkout@v3
38-
- name: Install Rust ${{ matrix.toolchain }} toolchain
15+
- name: Install Rust stable toolchain
3916
run: |
40-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ matrix.toolchain }}
41-
- name: Check formatting on Rust ${{ matrix.toolchain }}
42-
if: matrix.check-fmt
43-
run: rustup component add rustfmt && cargo fmt --all -- --check
44-
- name: Set RUSTFLAGS to deny warnings
45-
if: "matrix.toolchain == 'stable'"
46-
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
17+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain stable
4718
- name: Enable caching for bitcoind
4819
id: cache-bitcoind
4920
uses: actions/cache@v4
@@ -57,7 +28,7 @@ jobs:
5728
path: bin/electrs-${{ runner.os }}-${{ runner.arch }}
5829
key: electrs-${{ runner.os }}-${{ runner.arch }}
5930
- name: Download bitcoind/electrs
60-
if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
31+
if: "steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true'"
6132
run: |
6233
source ./scripts/download_bitcoind_electrs.sh
6334
mkdir bin
@@ -67,32 +38,8 @@ jobs:
6738
run: |
6839
echo "BITCOIND_EXE=$( pwd )/bin/bitcoind-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
6940
echo "ELECTRS_EXE=$( pwd )/bin/electrs-${{ runner.os }}-${{ runner.arch }}" >> "$GITHUB_ENV"
70-
- name: Build on Rust ${{ matrix.toolchain }}
41+
- name: Build
7142
run: cargo build --verbose --color always
72-
- name: Build with UniFFI support on Rust ${{ matrix.toolchain }}
73-
if: matrix.build-uniffi
74-
run: cargo build --features uniffi --verbose --color always
75-
- name: Check release build on Rust ${{ matrix.toolchain }}
76-
run: cargo check --release --verbose --color always
77-
- name: Check release build with UniFFI support on Rust ${{ matrix.toolchain }}
78-
if: matrix.build-uniffi
79-
run: cargo check --release --features uniffi --verbose --color always
80-
- name: Test on Rust ${{ matrix.toolchain }}
81-
if: "matrix.platform != 'windows-latest'"
43+
- name: Reproduce Esplora 0.0.0.0 connection issue (temporary)
8244
run: |
83-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test
84-
- name: Test with UniFFI support on Rust ${{ matrix.toolchain }}
85-
if: "matrix.platform != 'windows-latest' && matrix.build-uniffi"
86-
run: |
87-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --features uniffi
88-
89-
doc:
90-
name: Documentation
91-
runs-on: ubuntu-latest
92-
env:
93-
RUSTDOCFLAGS: -Dwarnings
94-
steps:
95-
- uses: actions/checkout@v6
96-
- uses: dtolnay/rust-toolchain@nightly
97-
- uses: dtolnay/install@cargo-docs-rs
98-
- run: cargo docs-rs
45+
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test --test integration_tests_rust

tests/common/mod.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -236,28 +236,10 @@ pub(crate) fn setup_bitcoind_and_electrsd() -> (BitcoinD, ElectrsD) {
236236
}
237237

238238
pub(crate) fn random_chain_source<'a>(
239-
bitcoind: &'a BitcoinD, electrsd: &'a ElectrsD,
239+
_bitcoind: &'a BitcoinD, electrsd: &'a ElectrsD,
240240
) -> TestChainSource<'a> {
241-
let r = rand::random_range(0..3);
242-
match r {
243-
0 => {
244-
println!("Randomly setting up Esplora chain syncing...");
245-
TestChainSource::Esplora(electrsd)
246-
},
247-
1 => {
248-
println!("Randomly setting up Electrum chain syncing...");
249-
TestChainSource::Electrum(electrsd)
250-
},
251-
2 => {
252-
println!("Randomly setting up Bitcoind RPC chain syncing...");
253-
TestChainSource::BitcoindRpcSync(bitcoind)
254-
},
255-
3 => {
256-
println!("Randomly setting up Bitcoind REST chain syncing...");
257-
TestChainSource::BitcoindRestSync(bitcoind)
258-
},
259-
_ => unreachable!(),
260-
}
241+
println!("Forcing Esplora chain syncing to reproduce 0.0.0.0 connection issue...");
242+
TestChainSource::Esplora(electrsd)
261243
}
262244

263245
pub(crate) fn random_storage_path() -> PathBuf {

0 commit comments

Comments
 (0)