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
72 changes: 67 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Start regtest services
run: ./regtest.sh start
- name: Run lib_sdk tests
run: cargo test --features "uniffi,test-utils,vls" --test lib_sdk -- --test-threads=1
run: SKIP_INIT=1 cargo test --features "uniffi,test-utils,vls" --test lib_sdk -- --test-threads=1 --nocapture
- name: Stop regtest services
if: always()
run: ./regtest.sh stop
Expand All @@ -139,20 +139,82 @@ jobs:
rustflags: ""
- name: Build with vss feature
run: cargo build --features vss
- name: Run deterministic VSS durability regressions
run: cargo test --features vss "test::vss_durability_gaps" -- --test-threads=1
- name: Start regtest and VSS services
run: VSS=1 ./regtest.sh start
- name: Run VSS tests (e2e against regtest + VSS server)
run: cargo test --features vss "test::vss::tests" -- --test-threads=1
run: SKIP_INIT=1 cargo test --features vss "test::vss::tests" -- --test-threads=1
- name: Run VSS unreachable openchannel e2e test
run: cargo test --features vss "test::vss_unreachable_openchannel" -- --test-threads=1
run: SKIP_INIT=1 cargo test --features vss "test::vss_unreachable_openchannel" -- --test-threads=1
- name: Run local SQLite process-kill matrix
run: cargo test --features "uniffi,test-utils,vls,vss" --lib kv_store_os_kill_matrix -- --test-threads=1
- name: Run VSS process-kill matrix
run: cargo test --features "uniffi,test-utils,vls,vss" --bin rgb-lightning-node synced_kv_os_kill_matrix -- --ignored --test-threads=1
- name: Run VSS full-restore e2e test (wipe node dir, restore from seed)
run: cargo test --features "uniffi,test-utils,vls,vss" --test lib_sdk vss_restore -- --test-threads=1
run: SKIP_INIT=1 cargo test --features "uniffi,test-utils,vls,vss" --test lib_sdk vss_restore -- --test-threads=1
- name: Run consignment re-import e2e test (restore without RGB backup)
run: cargo test --features "uniffi,test-utils,vls,vss" --test lib_sdk vss_consignment_reimport -- --test-threads=1
- name: Stop regtest and VSS services
if: always()
run: docker compose --profile vss down -v --remove-orphans

persistence-sanitizers:
runs-on: ubuntu-latest
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
sanitizer: [address, thread]
env:
CARGO_BUILD_JOBS: 1
RUSTFLAGS: >-
-Zsanitizer=${{ matrix.sanitizer }} -Cdebuginfo=0 -Copt-level=0
-Ccodegen-units=256 -Clinker=clang -Clink-arg=-fuse-ld=lld
RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }}
ASAN_OPTIONS: detect_leaks=1:halt_on_error=1
TSAN_OPTIONS: halt_on_error=1
steps:
- uses: actions/checkout@v6
with:
submodules: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rust-src
- name: Install sanitizer build dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang lld cmake pkg-config libssl-dev libsqlite3-dev protobuf-compiler libudev-dev
- name: Run SQLite persistence kill matrix under AddressSanitizer
if: matrix.sanitizer == 'address'
run: >-
cargo +nightly test -Zbuild-std --target x86_64-unknown-linux-gnu
--features "uniffi,test-utils,vls,vss" --lib
kv_store::persistence_tests::kv_store_os_kill_matrix -- --exact --test-threads=1
- name: Start VSS services for ThreadSanitizer
if: matrix.sanitizer == 'thread'
run: |
docker compose --profile vss up -d --build vss-postgres vss-server
for attempt in $(seq 1 60); do
if curl --silent --show-error --max-time 2 --output /dev/null http://127.0.0.1:8081/vss/list-key-versions; then
exit 0
fi
sleep 2
done
docker compose --profile vss logs vss-postgres vss-server
exit 1
- name: Run VSS ordering regression under ThreadSanitizer
if: matrix.sanitizer == 'thread'
run: >-
cargo +nightly test -Zbuild-std --target x86_64-unknown-linux-gnu
--all-features --bin rgb-lightning-node
test::vss::tests::synced_kv_store_drain_never_regresses_newer_write
-- --exact --test-threads=1
- name: Stop sanitizer VSS services
if: always() && matrix.sanitizer == 'thread'
run: docker compose --profile vss down -v --remove-orphans

gossip-tests:
runs-on: warp-ubuntu-latest-x64-16x
timeout-minutes: 60
Expand All @@ -168,7 +230,7 @@ jobs:
- name: Start regtest services
run: ./regtest.sh start
- name: Run gossip tests (e2e against regtest + RGS server)
run: cargo test "test::gossip_" -- --test-threads=1
run: SKIP_INIT=1 cargo test "test::gossip_" -- --test-threads=1
- name: Dump gossip service logs (on failure)
if: failure()
run: |
Expand Down
4 changes: 2 additions & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ services:
bitcoind:
platform: linux/amd64
image: registry.gitlab.com/hashbeam/docker/bitcoind:30.2
command: ["-fallbackfee=0.0002", "-rest"]
command: ["-fallbackfee=0.0002", "-rest", "-rpcallowip=0.0.0.0/0"]
environment:
MYUID: 1000
MYGID: 1000
RPCAUTH: "user:84c66d54d736d8b02aaa5b02e07e759b$$cc56c229b2a49ae2bfd5932cc8a6135d435bb9a7ac037ddd351d65936082c03d"
ports:
- 18443:18443
- 127.0.0.1:18443:18443
volumes:
- ./datacore:/srv/app/.bitcoin
electrs:
Expand Down
25 changes: 24 additions & 1 deletion regtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,28 @@ _wait_for_proxy() {
done
}

_wait_for_esplora() {
start_time=$(date +%s)
until curl --fail --silent "http://127.0.0.1:3002/block-height/0" >/dev/null; do
current_time=$(date +%s)
if [ $((current_time - start_time)) -gt $TIMEOUT ]; then
echo "Timeout waiting for Esplora to start"
$COMPOSE --profile esplora logs esplora
exit 1
fi
sleep 1
done
}

_start_services() {
_stop_services

mkdir -p data{core,index,ldk0,ldk1,ldk2,rgs}
# see compose.yaml for the exposed ports
EXPOSED_PORTS=(3000 50001)
if [ "${ESPLORA:-}" = "1" ]; then
EXPOSED_PORTS+=(3002)
fi
for port in "${EXPOSED_PORTS[@]}"; do
if _is_port_bound "$port"; then
_die "port $port is already bound, services can't be started"
Expand All @@ -102,6 +118,13 @@ _start_services() {
echo "waiting for proxy to be ready"
_wait_for_proxy

if [ "${ESPLORA:-}" = "1" ]; then
echo "starting Esplora server..."
$COMPOSE --profile esplora up -d esplora
_wait_for_esplora
echo "Esplora server available at http://localhost:3002"
fi

# optionally start VSS server
if [ "${VSS:-}" = "1" ]; then
echo "starting VSS server..."
Expand All @@ -111,7 +134,7 @@ _start_services() {
}

_stop_services() {
$COMPOSE --profile gossip down -v --remove-orphans
$COMPOSE --profile gossip --profile vss --profile esplora down -v --remove-orphans
rm -rf data{core,index,ldk0,ldk1,ldk2,rgs} 2>/dev/null || sudo rm -rf data{core,index,ldk0,ldk1,ldk2,rgs}
}

Expand Down
Loading
Loading