scripts: fix backwards compatibility test timing issues

The backwards compatibility test was failing intermittently due to two
related timing issues in the test setup.

The issue was that Dave's `wait_graph_sync dave 3` was hanging
for up to 60 minutes. Dave's initial gossip sync with Charlie could
complete before Charlie had forwarded the alice-bob channel
announcement, leaving Dave stuck at 2 channels until lnd's historical
syncer fired at its default interval of 1 hour. After this 1-hour idle,
some routing state had become stale, causing the subsequent payment from
alice to dave to fail with FAILURE_REASON_NO_ROUTE.

This issues is now addressed by setting `--historicalsyncinterval=10s` on
all nodes. This causes nodes to periodically re-sync the full gossip
state from their peers every 10 seconds instead of every hour. Dave
therefore picks up any missed channel announcements and routing policies
within seconds, and alice's routing graph stays up-to-date throughout
the test.

Additionally, lnd debug logs from all containers are now collected
before teardown on failure and uploaded as a CI artifact, making future
failures easier to diagnose.
This commit is contained in:
ziggie committed 2026-03-04 13:04:26 +01:00
1 parent e2dfd8f034
commit f6f6064938
5 files changed
+35 -2

No files matched your search

@@ -42,6 +42,7 @@ services:
--protocol.zero-conf
--protocol.simple-taproot-chans
--trickledelay=50
--historicalsyncinterval=10s
dave-pr:
image: lnd-dev:backward-compat-test-build
@@ -83,5 +84,6 @@ services:
--protocol.zero-conf
--protocol.simple-taproot-chans
--trickledelay=50
--historicalsyncinterval=10s
--db.backend=sqlite
--db.use-native-sql
@@ -71,6 +71,7 @@ services:
- "--protocol.zero-conf"
- "--protocol.simple-taproot-chans"
- "--trickledelay=50"
- "--historicalsyncinterval=10s"
bob:
image: lightninglabs/lnd:${LND_LATEST_VERSION}
@@ -111,6 +112,7 @@ services:
- "--protocol.zero-conf"
- "--protocol.simple-taproot-chans"
- "--trickledelay=50"
- "--historicalsyncinterval=10s"
charlie:
image: lightninglabs/lnd:${LND_LATEST_VERSION}
@@ -148,6 +150,7 @@ services:
- "--tlsextradomain=charlie"
- "--accept-keysend"
- "--trickledelay=50"
- "--historicalsyncinterval=10s"
dave:
image: lightninglabs/lnd:${LND_LATEST_VERSION}
@@ -185,6 +188,7 @@ services:
- "--tlsextradomain=dave"
- "--accept-keysend"
- "--trickledelay=50"
- "--historicalsyncinterval=10s"
- "--db.backend=sqlite"
- "--db.use-native-sql"
+18
View File
@@ -298,6 +298,24 @@ wait_for_active_chans() {
echo "🟢 $node now has exactly $expected_channels active channels!"
}
# collect_logs copies the lnd log file from each running container into a
# local ./logs directory. Call this before compose_down so logs are available
# for CI artifact upload even after the cluster is torn down.
function collect_logs() {
local log_dir="$DIR/logs"
mkdir -p "$log_dir"
for node in alice bob charlie dave bob-pr dave-pr; do
if docker ps -a --format '{{.Names}}' | grep -q "^${node}$"; then
mkdir -p "$log_dir/$node"
docker cp "$node:/root/.lnd/logs/bitcoin/regtest/lnd.log" \
"$log_dir/$node/lnd.log" 2>/dev/null || true
fi
done
echo "📋 Logs collected in $log_dir"
}
# mine mines a number of blocks on the regtest network. If no
# argument is provided, it defaults to 6 blocks.
function mine() {
+3 -2
View File
@@ -16,8 +16,9 @@ cd $DIR
compose_up
# Ensure that the cluster is shut down when the script exits
# regardless of success
trap compose_down EXIT
# regardless of success. Logs are collected first so they are
# available for CI artifact upload after the cluster is torn down.
trap 'collect_logs; compose_down' EXIT
# Set up the network.
setup_network