@@ -235,6 +235,86 @@ jobs:
235235 ./configure --enable-debugbuild --enable-fuzzing --enable-address-sanitizer --enable-ub-sanitizer --disable-valgrind CC=clang
236236 uv run make -j $(nproc) check-fuzz
237237
238+ check-downgrade :
239+ name : Check we can downgrade the node
240+ runs-on : ubuntu-22.04
241+ needs :
242+ - compile
243+ strategy :
244+ fail-fast : false
245+ matrix :
246+ include :
247+ - CFG : compile-gcc
248+ TEST_DB_PROVIDER : sqlite3
249+ TEST_NETWORK : regtest
250+ VALGRIND : 1
251+ - CFG : compile-gcc
252+ TEST_DB_PROVIDER : postgres
253+ TEST_NETWORK : regtest
254+ - CFG : compile-gcc
255+ TEST_DB_PROVIDER : sqlite3
256+ TEST_NETWORK : liquid-regtest
257+ steps :
258+ - name : Checkout
259+ uses : actions/checkout@v4
260+
261+ - name : Set up Python 3.10
262+ uses : actions/setup-python@v5
263+ with :
264+ python-version : " 3.10"
265+
266+ - name : Install uv
267+ uses : astral-sh/setup-uv@v5
268+
269+ - name : Install dependencies
270+ run : |
271+ bash -x .github/scripts/setup.sh
272+
273+ - name : Install bitcoind
274+ env :
275+ TEST_NETWORK : ${{ matrix.TEST_NETWORK }}
276+ run : .github/scripts/install-bitcoind.sh
277+
278+ - name : Download build
279+ uses : actions/download-artifact@v4
280+ with :
281+ name : cln-${{ matrix.CFG }}.tar.bz2
282+
283+ - name : Unpack pre-built CLN
284+ env :
285+ CFG : ${{ matrix.CFG }}
286+ run : |
287+ tar -xaf cln-${CFG}.tar.bz2
288+
289+ - name : Fetch and unpack previous CLN
290+ run : |
291+ mkdir /tmp/old-cln
292+ cd /tmp/old-cln
293+ wget https://github.com/ElementsProject/lightning/releases/download/v25.09/clightning-v25.09-Ubuntu-22.04-amd64.tar.xz
294+ tar -xaf clightning-v25.09-Ubuntu-22.04-amd64.tar.xz
295+
296+ - name : Switch network
297+ if : ${{ matrix.TEST_NETWORK == 'liquid-regtest' }}
298+ run : |
299+ # Loading the network from config.vars rather than the envvar is a terrible idea...
300+ sed -i 's/TEST_NETWORK=regtest/TEST_NETWORK=liquid-regtest/g' config.vars
301+ cat config.vars
302+
303+ - name : Test
304+ env :
305+ SLOW_MACHINE : 1
306+ PYTEST_PAR : 10
307+ TEST_DEBUG : 1
308+ TEST_DB_PROVIDER : ${{ matrix.TEST_DB_PROVIDER }}
309+ TEST_NETWORK : ${{ matrix.TEST_NETWORK }}
310+ LIGHTNINGD_POSTGRES_NO_VACUUM : 1
311+ VALGRIND : ${{ matrix.VALGRIND }}
312+ PREV_LIGHTNINGD : /tmp/old-cln/usr/bin/lightningd
313+ run : |
314+ env
315+ cat config.vars
316+ uv run eatmydata pytest tests/test_downgrade.py -vvv -n ${PYTEST_PAR} ${PYTEST_OPTS}
317+
238318 integration :
239319 name : Test CLN ${{ matrix.name }}
240320 runs-on : ubuntu-22.04
@@ -627,6 +707,7 @@ jobs:
627707 - integration-valgrind
628708 - integration-sanitizers
629709 - min-btc-support
710+ - check-downgrade
630711 if : ${{ always() }}
631712 steps :
632713 - name : Complete
@@ -638,6 +719,7 @@ jobs:
638719 SANITIZERS : ${{ needs['integration-sanitizers'].result }}
639720 DOCS : ${{ needs['update-docs-examples'].result }}
640721 BTC : ${{ needs['min-btc-support'].result }}
722+ CHECK_DOWNGRADE : ${{ needs['check-downgrade'].result }}
641723 run : |
642724 failed=""
643725 for name in $JOB_NAMES; do
0 commit comments