diff --git a/.github/scripts/setup.sh b/.github/scripts/setup.sh index c9414b068d96..861d2dbb2b0c 100755 --- a/.github/scripts/setup.sh +++ b/.github/scripts/setup.sh @@ -7,75 +7,99 @@ sudo mkdir -p /var/cache/apt/archives mkdir -p ~/ci-cache/apt/ sudo cp -a ~/ci-cache/apt/. /var/cache/apt/archives/ 2>/dev/null || true -sudo apt-get update +# GitHub ubuntu-24.04 runners pre-configure packages.microsoft.com, which we +# do not use and which transiently returns 403 Forbidden on apt-get update. +sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list /etc/apt/sources.list.d/microsoft-prod.sources + +sudo apt-get -o Acquire::Retries=3 update # Install eatmydata, then use it for the rest. sudo apt-get install --no-install-recommends --allow-unauthenticated -yy \ + -o Acquire::Retries=3 \ -o APT::Keep-Downloaded-Packages=true \ eatmydata +# Runtime packages needed to execute prebuilt binaries and integration tests. +TEST_PKGS=( + git + jq + libpq-dev + libsodium-dev + libsqlite3-dev + libssl-dev + lowdown + make + net-tools + postgresql + python3 + python3-dev + sudo + tshark + unzip + valgrind + wget + wireshark-common + zlib1g-dev +) + +# Extra toolchain/lint packages only needed by build, lint, and fuzz jobs. +BUILD_PKGS=( + autoconf + automake + binfmt-support + build-essential + clang + cppcheck + docbook-xml + gcc-aarch64-linux-gnu + gcc-arm-linux-gnueabihf + gcc-arm-none-eabi + gettext + gnupg + libc6-dev-arm64-cross + libc6-dev-armhf-cross + libev-dev + libevent-dev + libffi-dev + libicu-dev + libprotobuf-c-dev + pkg-config + libtool + libxml2-utils + locales + python3-pip + python3-setuptools + qemu-system + qemu-system-arm + qemu-user-static + shellcheck + software-properties-common + tcl + tclsh + xsltproc + systemtap-sdt-dev +) + +if [ "${TEST_ONLY:-0}" = "1" ]; then + PKGS=("${TEST_PKGS[@]}") +else + PKGS=("${TEST_PKGS[@]}" "${BUILD_PKGS[@]}") +fi + sudo eatmydata apt-get install --no-install-recommends --allow-unauthenticated -yy \ + -o Acquire::Retries=3 \ -o APT::Keep-Downloaded-Packages=true \ - autoconf \ - automake \ - binfmt-support \ - build-essential \ - clang \ - cppcheck \ - docbook-xml \ - gcc-aarch64-linux-gnu \ - gcc-arm-linux-gnueabihf \ - gcc-arm-none-eabi \ - gettext \ - git \ - gnupg \ - jq \ - libc6-dev-arm64-cross \ - libc6-dev-armhf-cross \ - libev-dev \ - libevent-dev \ - libffi-dev \ - libicu-dev \ - libpq-dev \ - libprotobuf-c-dev \ - libsodium-dev \ - libsqlite3-dev \ - libssl-dev \ - pkg-config \ - libtool \ - libxml2-utils \ - locales \ - lowdown \ - net-tools \ - postgresql \ - python3 \ - python3-dev \ - python3-pip \ - python3-setuptools \ - qemu-system \ - qemu-system-arm \ - qemu-user-static \ - shellcheck \ - software-properties-common \ - sudo \ - tcl \ - tclsh \ - tshark \ - unzip \ - valgrind \ - wget \ - wireshark-common \ - xsltproc \ - systemtap-sdt-dev \ - zlib1g-dev + "${PKGS[@]}" echo "tester ALL=(root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/tester sudo chmod 0440 /etc/sudoers.d/tester "$(dirname "$0")"/install-bitcoind.sh ~/ci-cache/ -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ - -y --default-toolchain ${RUST_VERSION} +if [ "${TEST_ONLY:-0}" != "1" ]; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ + -y --default-toolchain ${RUST_VERSION} +fi uv sync --all-extras --all-groups # required for reckless till poetry to uv migration diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fdcd4b8a15eb..57dc2a44b280 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -287,6 +287,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh # We're going to check BOLT quotes, so get the latest version @@ -426,6 +427,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -436,7 +438,6 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz @@ -518,6 +519,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -528,7 +530,6 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz @@ -543,11 +544,11 @@ jobs: TEST_DB_PROVIDER: ${{ matrix.TEST_DB_PROVIDER }} TEST_NETWORK: ${{ matrix.TEST_NETWORK }} LIGHTNINGD_POSTGRES_NO_VACUUM: 1 - PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42 + PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} run: | env cat config.vars - VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}" + VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --balanced-group=${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}" - name: Upload test results if: always() uses: actions/upload-artifact@v7 @@ -557,7 +558,7 @@ jobs: if-no-files-found: ignore full-integration: - name: Test CLN ${{ matrix.name }} Full Integration + name: Test CLN ${{ matrix.NAME }} (${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}) runs-on: ubuntu-24.04 timeout-minutes: 120 env: @@ -575,6 +576,22 @@ jobs: COMPILER: gcc TEST_DB_PROVIDER: postgres TEST_NETWORK: regtest + GROUP: 1 + GROUP_COUNT: 3 + - NAME: postgres + CFG: compile-gcc-O3 + COMPILER: gcc + TEST_DB_PROVIDER: postgres + TEST_NETWORK: regtest + GROUP: 2 + GROUP_COUNT: 3 + - NAME: postgres + CFG: compile-gcc-O3 + COMPILER: gcc + TEST_DB_PROVIDER: postgres + TEST_NETWORK: regtest + GROUP: 3 + GROUP_COUNT: 3 # And don't forget about elements (like cdecker did when # reworking the CI...) - NAME: liquid @@ -582,6 +599,22 @@ jobs: COMPILER: gcc TEST_NETWORK: liquid-regtest TEST_DB_PROVIDER: sqlite3 + GROUP: 1 + GROUP_COUNT: 3 + - NAME: liquid + CFG: compile-gcc-O3 + COMPILER: gcc + TEST_NETWORK: liquid-regtest + TEST_DB_PROVIDER: sqlite3 + GROUP: 2 + GROUP_COUNT: 3 + - NAME: liquid + CFG: compile-gcc-O3 + COMPILER: gcc + TEST_NETWORK: liquid-regtest + TEST_DB_PROVIDER: sqlite3 + GROUP: 3 + GROUP_COUNT: 3 # And dual funding! - NAME: dual-fund CFG: compile-gcc @@ -589,6 +622,8 @@ jobs: COMPILER: gcc TEST_NETWORK: regtest EXPERIMENTAL_DUAL_FUND: 1 + GROUP: 1 + GROUP_COUNT: 1 steps: - name: Checkout uses: actions/checkout@v7 @@ -609,6 +644,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -619,7 +655,6 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz @@ -645,12 +680,12 @@ jobs: run: | env cat config.vars - VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}" + VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --balanced-group=${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}" - name: Upload test results if: always() uses: actions/upload-artifact@v7 with: - name: pytest-results-integration-${{ matrix.name }} + name: pytest-results-integration-${{ matrix.NAME }}-${{ matrix.GROUP }} path: report.xml if-no-files-found: ignore @@ -661,13 +696,13 @@ jobs: env: RUST_PROFILE: small # Has to match the one in the compile step needs: - - check-compiled-source + - compile strategy: fail-fast: false matrix: CFG: [compile-gcc-O1] - GROUP: [1,2,3,4,5,6,7,8,9,10,11,12] - GROUP_COUNT: [12] + GROUP: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16] + GROUP_COUNT: [16] steps: - name: Checkout uses: actions/checkout@v7 @@ -686,6 +721,8 @@ jobs: key: apt-${{ runner.os }} - name: Install dependencies + env: + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -696,7 +733,6 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz @@ -705,14 +741,15 @@ jobs: env: SLOW_MACHINE: 1 TEST_DEBUG: 1 - PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42 + PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} + PYTEST_MIN_AVAIL_MB: "4096" run: | .github/scripts/mem-monitor.sh & mem_pid=$! trap 'kill $mem_pid 2>/dev/null' EXIT # -n $(nproc) rather than $(nproc)+1: one fewer parallel node-cluster # keeps peak RSS under the 16GB hosted-runner ceiling. - VALGRIND=1 sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}" + VALGRIND=1 sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) ${PYTEST_OPTS} --balanced-group=${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}" - name: Upload test results if: always() uses: actions/upload-artifact@v7 @@ -757,6 +794,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -767,20 +805,24 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz - name: Test env: - PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} --test-group-random-seed=42 + PYTEST_OPTS: ${{ env.PYTEST_OPTS_BASE }} + # Cap per-process ASan quarantine (default 256MB) to cut daemon RSS by + # ~25-45% while keeping all sanitizer checks enabled, and throttle new + # xdist worker starts if runner MemAvailable dips below 4 GB. + ASAN_OPTIONS: "quarantine_size_mb=32" + PYTEST_MIN_AVAIL_MB: "4096" run: | .github/scripts/mem-monitor.sh & mem_pid=$! trap 'kill $mem_pid 2>/dev/null' EXIT # loadgroup: tests marked heavy run one at a time on a single worker. - sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) --dist loadgroup ${PYTEST_OPTS} --test-group=${{ matrix.GROUP }} --test-group-count=${{ matrix.GROUP_COUNT }}" + sg wireshark "uv run eatmydata pytest tests/ -n $(nproc) --dist loadgroup ${PYTEST_OPTS} --balanced-group=${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}" - name: Upload test results if: always() uses: actions/upload-artifact@v7 @@ -820,6 +862,8 @@ jobs: key: apt-${{ runner.os }} - name: Install dependencies + env: + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -894,7 +938,7 @@ jobs: if-no-files-found: ignore min-btc-support: - name: Test minimum supported BTC v${{ matrix.MIN_BTC_VERSION }} with ${{ matrix.NAME }} + name: Test minimum supported BTC v${{ matrix.MIN_BTC_VERSION }} with ${{ matrix.NAME }} (${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}) runs-on: ubuntu-24.04 timeout-minutes: 120 env: @@ -911,6 +955,16 @@ jobs: COMPILER: clang TEST_NETWORK: regtest MIN_BTC_VERSION: "25.0" + GROUP: 1 + GROUP_COUNT: 2 + - NAME: clang + CFG: compile-clang + TEST_DB_PROVIDER: sqlite3 + COMPILER: clang + TEST_NETWORK: regtest + MIN_BTC_VERSION: "25.0" + GROUP: 2 + GROUP_COUNT: 2 steps: - name: Checkout uses: actions/checkout@v7 @@ -931,6 +985,7 @@ jobs: - name: Install dependencies env: TEST_NETWORK: ${{ matrix.TEST_NETWORK }} + TEST_ONLY: 1 run: | bash -x .github/scripts/setup.sh @@ -953,7 +1008,6 @@ jobs: - name: Unpack prebuilt binaries run: | - git submodule sync && git submodule update --init --recursive # Make sure source appears older than what we're about to unpack find . -type f -print0 | xargs -0 touch -d yesterday tar xaf cln-${{ matrix.CFG }}.tar.gz @@ -971,12 +1025,12 @@ jobs: run: | env cat config.vars - VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS}" + VALGRIND=0 sg wireshark "uv run eatmydata pytest tests/ -n $(($(nproc) + 1)) ${PYTEST_OPTS} --balanced-group=${{ matrix.GROUP }}/${{ matrix.GROUP_COUNT }}" - name: Upload test results if: always() uses: actions/upload-artifact@v7 with: - name: pytest-results-min-btc-support-${{ matrix.NAME }} + name: pytest-results-min-btc-support-${{ matrix.NAME }}-${{ matrix.GROUP }} path: report.xml if-no-files-found: ignore diff --git a/channeld/channeld.c b/channeld/channeld.c index ffeb1f10f98f..67be0a840d17 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -5361,15 +5361,19 @@ static void peer_in(struct peer *peer, const u8 *msg) } } - /* For cleaner errors, we check message is valid during STFU mode */ - if (peer->stfu_wait_single_msg) - if (!VALID_STFU_MESSAGE(type)) - peer_failed_warn(peer->pps, &peer->channel_id, - "Got invalid message during STFU " - "mode: %s", - peer_wire_name(type)); + /* For cleaner errors, we check message is valid during STFU mode. + * A belated announcement_signatures (sent asynchronously via connectd) + * can arrive here too and must not consume stfu_wait_single_msg. */ + if (type != WIRE_ANNOUNCEMENT_SIGNATURES) { + if (peer->stfu_wait_single_msg) + if (!VALID_STFU_MESSAGE(type)) + peer_failed_warn(peer->pps, &peer->channel_id, + "Got invalid message during STFU " + "mode: %s", + peer_wire_name(type)); - peer->stfu_wait_single_msg = false; + peer->stfu_wait_single_msg = false; + } switch (type) { case WIRE_CHANNEL_READY: diff --git a/common/memleak.c b/common/memleak.c index de321a9a7c66..fa6b3d524060 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -81,12 +80,29 @@ void *notleak_(void *ptr, bool plus_children) static size_t hash_ptr(const void *elem, void *unused UNNEEDED) { - static struct siphash_seed seed; - return siphash24(&seed, &elem, sizeof(elem)); + uintptr_t h = (uintptr_t)elem; + + /* Fast invertible pointer mix (memtable only holds local heap ptrs). */ + h ^= h >> 16; +#if UINTPTR_MAX > 0xffffffffU + h *= 0xbf58476d1ce4e5b9ULL; + h ^= h >> 30; + h *= 0x94d049bb133111ebULL; + h ^= h >> 31; +#else + h *= 0x45d9f3bU; + h ^= h >> 16; +#endif + return h; } bool memleak_ptr(struct htable *memtable, const void *p) { + /* Fast reject: any pointer in memtable matches common_mask/common_bits. */ + if (memtable->elems == 0 + || ((uintptr_t)p & memtable->common_mask) != memtable->common_bits) + return false; + return htable_del(memtable, hash_ptr(p, NULL), p); } diff --git a/connectd/multiplex.c b/connectd/multiplex.c index b02f1c6d0378..6e3784777fc5 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -143,6 +143,7 @@ void disconnect_peer(struct peer *peer) close_subd_timeout, peer->subds[i])); } else { /* We told lightningd that peer spoke, but it hasn't returned yet. */ + tal_free(peer->subds[i]); tal_arr_remove(&peer->subds, i); i--; } @@ -1746,6 +1747,7 @@ static void destroy_peer_conn(struct io_conn *peer_conn, struct peer *peer) for (size_t i = 0; i < tal_count(peer->subds); i++) { /* Might not be connected yet (no destructor, simple) */ if (!peer->subds[i]->conn) { + tal_free(peer->subds[i]); tal_arr_remove(&peer->subds, i); i--; continue; diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json index c70ec2be8da2..26d431b428dd 100644 --- a/contrib/msggen/msggen/schema.json +++ b/contrib/msggen/msggen/schema.json @@ -23429,6 +23429,11 @@ "source": "cmdline", "plugin": "/usr/local/libexec/plugins/bcli" }, + "dev-bkpr-currencyrate-tolerance": { + "value_int": 60, + "source": "default", + "plugin": "/usr/local/libexec/plugins/bookkeeper" + }, "askrene-max-threads": { "value_int": 4, "source": "default", diff --git a/contrib/pyln-testing/pyln/testing/btcproxy.py b/contrib/pyln-testing/pyln/testing/btcproxy.py index fc641ace9662..09ed47457908 100644 --- a/contrib/pyln-testing/pyln/testing/btcproxy.py +++ b/contrib/pyln-testing/pyln/testing/btcproxy.py @@ -10,7 +10,6 @@ import flask # type: ignore import json import logging -import socket import threading import time @@ -84,32 +83,36 @@ def proxy(self): def start(self): d = PathInfoDispatcher({'/': self.app}) self.server = Server(('127.0.0.1', self.rpcport), d) + # Default 0.5s makes ConnectionManager.stop() stall up to 500ms per proxy. + self.server.expiration_interval = 0.05 self.proxy_thread = threading.Thread(target=self.server.start) self.proxy_thread.daemon = True self.proxy_thread.start() - if self.rpcport == 0: - while self.server.bind_addr[1] == 0: - time.sleep(0.01) - self.rpcport = self.server.bind_addr[1] - + # Wait for cheroot's prepare() to finish (including setting + # server.ready = True); probing TCP connect alone can succeed after + # listen() but before server.ready is set, causing a prompt stop() + # to no-op and proxy_thread.join() to hang forever. deadline = time.time() + 10 while time.time() < deadline: - try: - s = socket.create_connection(('127.0.0.1', self.rpcport), - timeout=0.5) - s.close() + if self.server.ready: break - except OSError: - time.sleep(0.05) + time.sleep(0.01) else: raise RuntimeError("BitcoinRpcProxy failed to bind on " "127.0.0.1:{}".format(self.rpcport)) + + if self.rpcport == 0: + self.rpcport = self.server.bind_addr[1] + logging.debug("BitcoinRpcProxy proxying incoming port {} to {}".format(self.rpcport, self.bitcoind.rpcport)) def stop(self): self.server.stop() - self.proxy_thread.join() + self.proxy_thread.join(timeout=10) + if self.proxy_thread.is_alive(): + self.server.stop() + self.proxy_thread.join(timeout=10) logging.debug("BitcoinRpcProxy shut down after processing {} requests".format(self.request_count)) def mock_rpc(self, method, response=None): diff --git a/contrib/pyln-testing/pyln/testing/db.py b/contrib/pyln-testing/pyln/testing/db.py index d7bea9eecb53..79080885e131 100644 --- a/contrib/pyln-testing/pyln/testing/db.py +++ b/contrib/pyln-testing/pyln/testing/db.py @@ -10,6 +10,7 @@ import sqlite3 import string import subprocess +import threading import time from typing import Dict, List, Optional, Union @@ -76,13 +77,15 @@ def __init__(self, dbname, port): self.dbname = dbname self.port = port self.provider = None + self._conn = None - self.conn = psycopg2.connect("dbname={dbname} user=postgres host=localhost port={port}".format( - dbname=dbname, port=port - )) - cur = self.conn.cursor() - cur.execute('SELECT 1') - cur.close() + @property + def conn(self): + if self._conn is None or self._conn.closed: + self._conn = psycopg2.connect( + f"dbname={self.dbname} user=postgres host=localhost port={self.port}" + ) + return self._conn def get_dsn(self): return "postgres://postgres:password@localhost:{port}/{dbname}".format( @@ -117,11 +120,19 @@ def executemany(self, query: str, seq_of_params: list[tuple]) -> None: def stop(self): """Clean up the database. """ - self.conn.close() - conn = psycopg2.connect("dbname=postgres user=postgres host=localhost port={self.port}") - cur = conn.cursor() - cur.execute("DROP DATABASE {};".format(self.dbname)) - cur.close() + if self._conn is not None and not self._conn.closed: + self._conn.close() + self._conn = None + if self.provider is not None: + self.provider.drop_db(self.dbname) + return + conn = psycopg2.connect(f"dbname=postgres user=postgres host=localhost port={self.port}") + try: + conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) + with conn.cursor() as cur: + cur.execute(f"DROP DATABASE IF EXISTS {self.dbname};") + finally: + conn.close() def wipe_db(self): cur = self.conn.cursor() @@ -144,10 +155,42 @@ def get_db(self, node_directory: str, testname: str, node_id: int) -> Sqlite3Db: ) return Sqlite3Db(path) + def drop_db(self, dbname: str) -> None: + pass + def stop(self) -> None: pass +class ScopedDbProvider(object): + """Per-test wrapper around a session-scoped DbProvider that cleans up + databases created during a single test.""" + + def __init__(self, provider) -> None: + self._provider = provider + self._lock = threading.Lock() + self._dbs: List[BaseDb] = [] + + def get_db(self, node_directory: str, testname: str, node_id: int): + db = self._provider.get_db(node_directory, testname, node_id) + db.provider = self + with self._lock: + self._dbs.append(db) + return db + + def drop_db(self, dbname: str) -> None: + self._provider.drop_db(dbname) + + def cleanup(self) -> None: + with self._lock: + dbs, self._dbs = self._dbs, [] + for db in dbs: + db.stop() + + def __getattr__(self, name): + return getattr(self._provider, name) + + class PostgresDbProvider(object): # Postgres truncates identifiers at NAMEDATALEN - 1 bytes. MAX_IDENTIFIER_LEN = 63 @@ -156,6 +199,8 @@ def __init__(self, directory): self.directory = directory self.port = None self.proc = None + self.conn = None + self.lock = threading.Lock() print("Starting PostgresDbProvider") def locate_path(self): @@ -203,7 +248,13 @@ def start(self): ]) conffile = os.path.join(self.pgdir, 'postgresql.conf') with open(conffile, 'a') as f: - f.write('max_connections = 1000\nshared_buffers = 240MB\n') + f.write( + 'max_connections = 1000\n' + 'shared_buffers = 240MB\n' + 'synchronous_commit = off\n' + 'full_page_writes = off\n' + 'checkpoint_timeout = 30min\n' + ) self.port = reserve_unused_port() self.proc = subprocess.Popen([ @@ -216,12 +267,16 @@ def start(self): ]) # Hacky but seems to work ok (might want to make the postgres proc a # TailableProc as well if too flaky). - for i in range(30): + last_err = None + for i in range(300): try: self.conn = psycopg2.connect("dbname=template1 user=postgres host=localhost port={}".format(self.port)) break - except Exception: - time.sleep(0.5) + except Exception as e: + last_err = e + time.sleep(0.05) + if self.conn is None: + raise last_err # Required for CREATE DATABASE to work self.conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) @@ -242,12 +297,29 @@ def get_db(self, node_directory, testname, node_id): nonce = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(8)) dbname = self.db_name(testname, node_id, nonce) - cur = self.conn.cursor() - cur.execute("CREATE DATABASE {};".format(dbname)) - cur.close() + with self.lock: + cur = self.conn.cursor() + cur.execute("CREATE DATABASE {};".format(dbname)) + cur.close() db = PostgresDb(dbname, self.port) return db + def drop_db(self, dbname): + with self.lock: + cur = self.conn.cursor() + try: + cur.execute(f"DROP DATABASE IF EXISTS {dbname};") + except psycopg2.Error: + # Terminate any lingering connections (e.g. after a failed test) and retry. + cur.execute( + "SELECT pg_terminate_backend(pid) FROM pg_stat_activity " + "WHERE datname = %s AND pid <> pg_backend_pid();", + (dbname,), + ) + cur.execute(f"DROP DATABASE IF EXISTS {dbname};") + finally: + cur.close() + def stop(self): # Send fast shutdown signal see [1] for details: # @@ -261,6 +333,8 @@ def stop(self): # rendering the backup useless. # # [1] https://www.postgresql.org/docs/9.1/server-shutdown.html + if self.conn is not None and not self.conn.closed: + self.conn.close() self.proc.send_signal(signal.SIGINT) self.proc.wait() shutil.rmtree(self.pgdir) diff --git a/contrib/pyln-testing/pyln/testing/fixtures.py b/contrib/pyln-testing/pyln/testing/fixtures.py index 832cdba92d5e..edb5d2ddc24d 100644 --- a/contrib/pyln-testing/pyln/testing/fixtures.py +++ b/contrib/pyln-testing/pyln/testing/fixtures.py @@ -1,5 +1,5 @@ from concurrent import futures -from pyln.testing.db import SqliteDbProvider, PostgresDbProvider +from pyln.testing.db import SqliteDbProvider, PostgresDbProvider, ScopedDbProvider from pyln.testing.utils import ( NodeFactory, BitcoinD, @@ -15,6 +15,7 @@ from typing import Dict from pathlib import Path +import functools import json import jsonschema # type: ignore import logging @@ -238,6 +239,7 @@ def teardown_checks(request): raise ValueError(str(errors)) +@functools.lru_cache(maxsize=2) def _extra_validator(is_request: bool): """JSON Schema validator with additions for our specialized types""" @@ -525,7 +527,7 @@ def _load_schema(filename): ] -@pytest.fixture(autouse=True) +@pytest.fixture(scope="session", autouse=True) def jsonschemas(): """Load schema file if it exist: returns request/response schemas by pairs""" try: @@ -554,73 +556,77 @@ def node_factory( node_cls, jsonschemas, ): + scoped_db_provider = ScopedDbProvider(db_provider) nf = NodeFactory( request, test_name, bitcoind, executor, directory=directory, - db_provider=db_provider, + db_provider=scoped_db_provider, node_cls=node_cls, jsonschemas=jsonschemas, ) yield nf - ok, errs = nf.killall([not n.may_fail for n in nf.nodes]) - - for e in errs: - teardown_checks.add_error(e) - - def map_node_error(nodes, f, msg): - ret = False - for n in nodes: - if n and f(n): - ret = True - teardown_checks.add_node_error(n, msg.format(n=n)) - return ret - - map_node_error(nf.nodes, printValgrindErrors, "reported valgrind errors") - map_node_error(nf.nodes, printCrashLog, "had crash.log files") - map_node_error(nf.nodes, checkBroken, "had BROKEN or That's weird messages") - map_node_error( - nf.nodes, - lambda n: not n.allow_warning and n.daemon.is_in_log(r" WARNING:"), - "had warning messages", - ) - map_node_error(nf.nodes, checkReconnect, "had unexpected reconnections") - map_node_error(nf.nodes, checkPluginJSON, "had malformed hooks/notifications") + try: + ok, errs = nf.killall([not n.may_fail for n in nf.nodes]) + + for e in errs: + teardown_checks.add_error(e) + + def map_node_error(nodes, f, msg): + ret = False + for n in nodes: + if n and f(n): + ret = True + teardown_checks.add_node_error(n, msg.format(n=n)) + return ret + + map_node_error(nf.nodes, printValgrindErrors, "reported valgrind errors") + map_node_error(nf.nodes, printCrashLog, "had crash.log files") + map_node_error(nf.nodes, checkBroken, "had BROKEN or That's weird messages") + map_node_error( + nf.nodes, + lambda n: not n.allow_warning and n.daemon.is_in_log(r" WARNING:"), + "had warning messages", + ) + map_node_error(nf.nodes, checkReconnect, "had unexpected reconnections") + map_node_error(nf.nodes, checkPluginJSON, "had malformed hooks/notifications") - # On any bad gossip complaints, print out every nodes' gossip_store - if map_node_error(nf.nodes, checkBadGossip, "had bad gossip messages"): - for n in nf.nodes: - dumpGossipStore(n) + # On any bad gossip complaints, print out every nodes' gossip_store + if map_node_error(nf.nodes, checkBadGossip, "had bad gossip messages"): + for n in nf.nodes: + dumpGossipStore(n) - map_node_error( - nf.nodes, lambda n: n.daemon.is_in_log("Bad reestablish"), "had bad reestablish" - ) - map_node_error( - nf.nodes, - lambda n: n.daemon.is_in_log("bad hsm request"), - "had bad hsm requests", - ) - map_node_error( - nf.nodes, - lambda n: n.daemon.is_in_log(r"Accessing a null column"), - "Accessing a null column", - ) - map_node_error(nf.nodes, checkMemleak, "had memleak messages") - map_node_error( - nf.nodes, - lambda n: n.rc != 0 and not n.may_fail, - "Node exited with return code {n.rc}", - ) - if not ok: map_node_error( - nf.nodes, prinErrlog, "some node failed unexpected, non-empty errlog file" + nf.nodes, lambda n: n.daemon.is_in_log("Bad reestablish"), "had bad reestablish" + ) + map_node_error( + nf.nodes, + lambda n: n.daemon.is_in_log("bad hsm request"), + "had bad hsm requests", + ) + map_node_error( + nf.nodes, + lambda n: n.daemon.is_in_log(r"Accessing a null column"), + "Accessing a null column", + ) + map_node_error(nf.nodes, checkMemleak, "had memleak messages") + map_node_error( + nf.nodes, + lambda n: n.rc != 0 and not n.may_fail, + "Node exited with return code {n.rc}", ) + if not ok: + map_node_error( + nf.nodes, prinErrlog, "some node failed unexpected, non-empty errlog file" + ) - for n in nf.nodes: - n.daemon.cleanup_files() + for n in nf.nodes: + n.daemon.cleanup_files() + finally: + scoped_db_provider.cleanup() def getErrlog(node): @@ -741,10 +747,8 @@ def checkBroken(node): return 0 -def checkPluginJSON(node): - if node.bad_notifications: - return 0 - +@functools.lru_cache(maxsize=1) +def _plugin_schemas(): try: notificationfiles = os.listdir("doc/schemas/notification") except FileNotFoundError: @@ -771,6 +775,15 @@ def checkPluginJSON(node): # Request is 0 and Response is 1 hooks[base] = _load_schema(os.path.join("doc/schemas/hook", fname)) + return notifications, hooks + + +def checkPluginJSON(node): + if node.bad_notifications: + return 0 + + notifications, hooks = _plugin_schemas() + for f in (Path(node.daemon.lightning_dir) / "plugin-io").iterdir(): # e.g. hook_in-peer_connected-124567-358 try: @@ -836,7 +849,7 @@ def checkMemleak(node): } -@pytest.fixture +@pytest.fixture(scope="session") def db_provider(test_base_dir): provider = providers[os.getenv("TEST_DB_PROVIDER", "sqlite3")](test_base_dir) provider.start() diff --git a/contrib/pyln-testing/pyln/testing/utils.py b/contrib/pyln-testing/pyln/testing/utils.py index 4ec2d7ac83b4..e5c43ee4998c 100644 --- a/contrib/pyln-testing/pyln/testing/utils.py +++ b/contrib/pyln-testing/pyln/testing/utils.py @@ -16,6 +16,7 @@ import tempfile import errno +import functools import json import logging import lzma @@ -97,15 +98,14 @@ def env(name, default=None): def wait_for(success, timeout=TIMEOUT): start_time = time.time() - interval = 0.25 + interval = 0.05 + max_interval = 2 if SLOW_MACHINE else 1 while not success(): time_left = start_time + timeout - time.time() if time_left <= 0: raise ValueError("Timeout while waiting for {}".format(success)) time.sleep(min(interval, time_left)) - interval *= 2 - if interval > 5: - interval = 5 + interval = min(interval * 2, max_interval) def write_config(filename, opts, regtest_opts=None, section_name='regtest'): @@ -521,10 +521,14 @@ def wait_for_logs(self, regexs, timeout=TIMEOUT): logging.debug("Waiting for {} in the logs".format(regexs)) exs = [re.compile(r) for r in regexs] start_time = time.time() + poll_interval = 0.02 while True: if self.logsearch_start >= len(self.logs): if not self.logs_catchup(): - time.sleep(0.25) + time.sleep(poll_interval) + poll_interval = min(poll_interval * 2, 0.25) + else: + poll_interval = 0.02 if timeout is not None and time.time() > start_time + timeout: print("Time-out: can't find {} in logs".format(exs)) @@ -673,10 +677,14 @@ def start(self, wallet_file=None): self.rpc.loadwallet("lightningd-tests") def stop(self): - for p in self.proxies: - p.stop() + stop_threads = [threading.Thread(target=p.stop) for p in self.proxies] + for t in stop_threads: + t.start() self.rpc.stop() - return TailableProc.stop(self) + rc = TailableProc.stop(self) + for t in stop_threads: + t.join() + return rc def get_proxy(self): proxy = BitcoinRpcProxy(self, rpcport=reserve_unused_port()) @@ -863,6 +871,12 @@ def mnemonic_from_seed(seed): return mnem +@functools.lru_cache(maxsize=None) +def _cln_version(executable): + cln_version_proc = subprocess.check_output([executable, "--version"]) + return NodeVersion(cln_version_proc.decode('ascii').strip()) + + class LightningD(TailableProc): def __init__( self, @@ -886,9 +900,8 @@ def __init__( self.opts = LIGHTNINGD_CONFIG.copy() - # Query the version of the cln-binary - cln_version_proc = subprocess.check_output([self.executable, "--version"]) - self.cln_version = NodeVersion(cln_version_proc.decode('ascii').strip()) + # Query the version of the cln-binary (cached per executable path) + self.cln_version = _cln_version(self.executable) if self.cln_version <= "v24.02.2": self.opts['log-level'] = "debug" @@ -1105,9 +1118,11 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, may_fail=False, # Various developer options let us be more aggressive self.daemon.opts["dev-fail-on-subdaemon-fail"] = None - # Don't run --version on every subdaemon if we're valgrinding and slow. - if SLOW_MACHINE and VALGRIND: - self.daemon.opts["dev-no-version-checks"] = None + # Skip per-startup subdaemon --version spawns and full-binary plugin + # checksumming (~1 GB of debug binaries per node). Dedicated tests + # (test_version_reexec, test_restart_on_update) clear these options. + self.daemon.opts["dev-no-version-checks"] = None + self.daemon.opts["dev-no-plugin-checksum"] = None dbgvar = os.getenv("DEBUG_SUBD") if dbgvar and ':' in dbgvar: path = dbgvar.split(':')[0] @@ -1122,7 +1137,6 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, may_fail=False, self.daemon.opts["dev-debug-self"] = None if VALGRIND: self.daemon.env["LIGHTNINGD_DEV_NO_BACKTRACE"] = "1" - self.daemon.opts["dev-no-plugin-checksum"] = None else: # Under valgrind, scanning can access uninitialized mem. self.daemon.env["LIGHTNINGD_DEV_MEMLEAK"] = "1" @@ -1149,12 +1163,13 @@ def __init__(self, node_id, lightning_dir, bitcoind, executor, may_fail=False, if dsn is not None: self.daemon.opts['wallet'] = dsn if VALGRIND: - trace_skip_pattern = '*python*,*bitcoin-cli*,*elements-cli*,*cln-grpc*,*clnrest*,*wss-proxy*,*cln-bip353*,*reckless,*cln-currencyrate*' + trace_skip_pattern = '*python*,*bitcoin-cli*,*elements-cli*,*cln-grpc*,*clnrest*,*wss-proxy*,*cln-bip353*,*cln-lsps-client*,*cln-lsps-service*,*reckless,*cln-currencyrate*' if not valgrind_plugins: trace_skip_pattern += ',*plugins*' self.daemon.cmd_prefix = [ 'valgrind', '-q', + '--vgdb=no', '--trace-children=yes', '--trace-children-skip={}'.format(trace_skip_pattern), '--error-exitcode=7', @@ -1546,14 +1561,17 @@ def wait_for_channel_updates(self, scids): def wait_for_route(self, destination, timeout=TIMEOUT): """ Wait for a route to the destination to become available. """ - start_time = time.time() - while time.time() < start_time + timeout: + def has_route(): try: self.single_route(destination.info['id'], 1) return True except Exception: - time.sleep(1) - if time.time() > start_time + timeout: + return False + + try: + wait_for(has_route, timeout=timeout) + return True + except ValueError: raise ValueError("Error waiting for a route to destination {}".format(destination)) # This helper waits for all HTLCs to settle @@ -1901,6 +1919,7 @@ def __init__(self, request, testname, bitcoind, executor, directory, self.bitcoind = bitcoind self.directory = directory self.lock = threading.Lock() + self._valgrind_plugins_traced = False self.db_provider = db_provider self.node_cls = node_cls self.jsonschemas = jsonschemas @@ -1953,10 +1972,13 @@ def get_nodes(self, num_nodes, opts=None): assert len(opts) == num_nodes - # Only trace one random node's plugins, to avoid OOM. + # Only trace one random node's plugins per test on SLOW_MACHINE, to avoid OOM/CPU bloat. if SLOW_MACHINE: valgrind_plugins = [False] * num_nodes - valgrind_plugins[random.randint(0, num_nodes - 1)] = True + with self.lock: + if not self._valgrind_plugins_traced: + valgrind_plugins[random.randint(0, num_nodes - 1)] = True + self._valgrind_plugins_traced = True else: valgrind_plugins = [True] * num_nodes @@ -1990,6 +2012,14 @@ def get_node(self, node_id=None, options=None, dbfile=None, if cleandir and os.path.exists(lightning_dir): shutil.rmtree(lightning_dir) + if SLOW_MACHINE and 'valgrind_plugins' not in kwargs: + with self.lock: + if self._valgrind_plugins_traced: + kwargs['valgrind_plugins'] = False + else: + kwargs['valgrind_plugins'] = True + self._valgrind_plugins_traced = True + # Get the DB backend DSN we should be using for this test and this # node. db = self.db_provider.get_db(os.path.join(lightning_dir, TEST_NETWORK), self.testname, node_id) @@ -2091,10 +2121,13 @@ def join_nodes(self, nodes, fundchannel=True, fundamount=FUNDAMOUNT, wait_for_an n.wait_channel_active(scid) # Make sure we have all node announcements, too + expected_aliases = {n2.info['id']: n2.rpc.getinfo()['alias'] for n2 in nodes} for n in nodes: - for n2 in nodes: - alias = n2.rpc.getinfo()['alias'] - wait_for(lambda: [n.get('alias') for n in n.rpc.listnodes(n2.info['id'])['nodes']] == [alias]) + wait_for(lambda: { + x['nodeid']: x.get('alias') + for x in n.rpc.listnodes()['nodes'] + if x['nodeid'] in expected_aliases + } == expected_aliases) def line_graph(self, num_nodes, fundchannel=True, fundamount=FUNDAMOUNT, wait_for_announce=False, opts=None, announce_channels=True): """ Create nodes, connect them and optionally fund channels. @@ -2111,31 +2144,43 @@ def get_unused_port(self): def killall(self, expected_successes): """Returns true if every node we expected to succeed actually succeeded""" - unexpected_fail = False - err_msgs = [] - for i in range(len(self.nodes)): - leaks = None + def _check_memleak(node): # leak detection upsets VALGRIND by reading uninitialized mem, # and valgrind adds extra fds. # If it's dead, we'll catch it below. - if not VALGRIND: - try: - # This also puts leaks in log. - leaks = self.nodes[i].rpc.dev_memleak()['leaks'] - self.nodes[i].rpc.dev_report_fds() - except Exception: - pass + if VALGRIND: + return None + try: + # This also puts leaks in log. + leaks = node.rpc.dev_memleak()['leaks'] + node.rpc.dev_report_fds() + return leaks + except Exception: + return None + def _stop_node(node, expected_success): try: - self.nodes[i].stop() + node.stop() + return False except Exception: - if expected_successes[i]: - unexpected_fail = True + return expected_success + + leak_futs = [self.executor.submit(_check_memleak, n) for n in self.nodes] + all_leaks = [f.result() for f in leak_futs] + stop_futs = [ + self.executor.submit(_stop_node, n, exp) + for n, exp in zip(self.nodes, expected_successes) + ] + stop_fails = [f.result() for f in stop_futs] + + unexpected_fail = any(stop_fails) + err_msgs = [] + for node, leaks in zip(self.nodes, all_leaks): if leaks is not None and len(leaks) != 0: unexpected_fail = True err_msgs.append("Node {} has memory leaks: {}".format( - self.nodes[i].daemon.lightning_dir, + node.daemon.lightning_dir, json.dumps(leaks, sort_keys=True, indent=4) )) diff --git a/doc/schemas/listconfigs.json b/doc/schemas/listconfigs.json index 4e04e9cdadc1..2cabdfb8e33f 100644 --- a/doc/schemas/listconfigs.json +++ b/doc/schemas/listconfigs.json @@ -2399,6 +2399,11 @@ "source": "cmdline", "plugin": "/usr/local/libexec/plugins/bcli" }, + "dev-bkpr-currencyrate-tolerance": { + "value_int": 60, + "source": "default", + "plugin": "/usr/local/libexec/plugins/bookkeeper" + }, "askrene-max-threads": { "value_int": 4, "source": "default", diff --git a/lightningd/channel_gossip.c b/lightningd/channel_gossip.c index ef148942e5be..d07f0ce61444 100644 --- a/lightningd/channel_gossip.c +++ b/lightningd/channel_gossip.c @@ -1227,7 +1227,8 @@ void channel_gossip_channel_reestablished(struct channel *channel, channel->reestablished = true; tal_free(channel->stable_conn_timer); channel->stable_conn_timer = new_reltimer(channel->peer->ld->timers, - channel, time_from_sec(60), + channel, + time_from_sec(channel->peer->ld->dev_stable_connection_secs), channel_reestablished_stable, channel); diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index e59888e44df9..5d1906ce4339 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -140,6 +140,9 @@ static struct lightningd *new_lightningd(const tal_t *ctx) ld->dev_force_channel_secrets_shaseed = NULL; ld->dev_force_tmp_channel_id = NULL; ld->dev_no_htlc_timeout = false; + ld->dev_htlc_offer_timeout_secs = 30; + ld->dev_plugin_startup_timeout_secs = 120; + ld->dev_stable_connection_secs = 60; ld->dev_no_version_checks = false; ld->dev_max_funding_unconfirmed = 2016; ld->dev_max_dualopen_negotiation_secs = 600; diff --git a/lightningd/lightningd.h b/lightningd/lightningd.h index d52c743bd4c9..d310b05e5eea 100644 --- a/lightningd/lightningd.h +++ b/lightningd/lightningd.h @@ -341,6 +341,9 @@ struct lightningd { /* For slow tests (eg protocol tests) don't die if HTLC not * committed in 30 secs */ bool dev_no_htlc_timeout; + u32 dev_htlc_offer_timeout_secs; + u32 dev_plugin_startup_timeout_secs; + u32 dev_stable_connection_secs; bool dev_no_version_checks; diff --git a/lightningd/options.c b/lightningd/options.c index f276d4564646..dacab91bbf16 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -791,6 +791,10 @@ static void dev_register_opts(struct lightningd *ld) opt_set_bool, &ld->plugins->dev_builtin_plugins_unimportant, "Make builtin plugins unimportant so you can plugin stop them."); + clnopt_witharg("--dev-plugin-startup-timeout-secs", OPT_EARLY|OPT_DEV|OPT_SHOWINT, + opt_set_u32, opt_show_u32, + &ld->dev_plugin_startup_timeout_secs, + "Seconds a plugin has to respond to getmanifest/init"); clnopt_noarg("--dev-no-reconnect", OPT_DEV, opt_set_invbool, &ld->reconnect, @@ -860,6 +864,14 @@ static void dev_register_opts(struct lightningd *ld) opt_set_bool, &ld->dev_no_htlc_timeout, "Don't kill channeld if HTLCs not confirmed within 30 seconds"); + clnopt_witharg("--dev-htlc-offer-timeout-secs", OPT_DEV|OPT_SHOWINT, + opt_set_u32, opt_show_u32, + &ld->dev_htlc_offer_timeout_secs, + "Seconds to wait for channeld to commit an offered HTLC"); + clnopt_witharg("--dev-stable-connection-secs", OPT_DEV|OPT_SHOWINT, + opt_set_u32, opt_show_u32, + &ld->dev_stable_connection_secs, + "Seconds a reestablished channel must stay connected to be marked stable"); clnopt_noarg("--dev-fail-process-onionpacket", OPT_DEV, opt_set_bool, &dev_fail_process_onionpacket, diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index c14bff6435da..d24365acc888 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -811,10 +811,11 @@ const u8 *send_htlc_out(const tal_t *ctx, partid, groupid, in); tal_add_destructor(*houtp, destroy_hout_subd_died); - /* Give channel 30 seconds to commit this htlc. */ + /* Give channel dev_htlc_offer_timeout_secs (default 30s) to commit this htlc. */ if (!out->peer->ld->dev_no_htlc_timeout) { (*houtp)->timeout = new_reltimer(out->peer->ld->timers, - *houtp, time_from_sec(30), + *houtp, + time_from_sec(out->peer->ld->dev_htlc_offer_timeout_secs), htlc_offer_timeout, *houtp); } diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 5d4b0532b45c..eccdfbe1ff48 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -34,10 +34,6 @@ /* Only this file can include this generated header! */ # include -/* How many seconds may the plugin take frome the `getmanifest` - * call to replying to the init call? */ -#define PLUGIN_STARTUP_TIMEOUT 120 - static void memleak_help_pending_requests(struct htable *memtable, struct plugin *plugin) { @@ -1979,7 +1975,7 @@ static void plugin_set_timeout(struct plugin *p) else { p->timeout_timer = new_reltimer(p->plugins->ld->timers, p, - time_from_sec(PLUGIN_STARTUP_TIMEOUT), + time_from_sec(p->plugins->ld->dev_plugin_startup_timeout_secs), plugin_manifest_timeout, p); } diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 059f8451836b..a3e3f047a516 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -643,6 +643,8 @@ static bool is_dust(struct tx_state *tx_state, || amount_sat_less(amount, tx_state->remoteconf.dust_limit); } +static void handle_dev_memleak(struct state *state, const u8 *msg); + static char *validate_inputs(struct state *state, struct tx_state *tx_state, enum tx_role role_to_validate) @@ -662,6 +664,10 @@ static char *validate_inputs(struct state *state, role_to_validate); wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if (!fromwire_dualopend_validate_inputs_reply(msg)) { if (!fromwire_dualopend_fail(tmpctx, msg, &err_reason)) @@ -2392,6 +2398,10 @@ static u8 *accepter_commits(struct state *state, wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if (fromwire_peektype(msg) != WIRE_DUALOPEND_COMMIT_SEND_ACK) master_badmsg(WIRE_DUALOPEND_COMMIT_SEND_ACK, msg); @@ -2437,6 +2447,10 @@ static u8 *accepter_commits(struct state *state, tal_free(pbase); wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if (fromwire_peektype(msg) != WIRE_DUALOPEND_SEND_TX_SIGS) master_badmsg(WIRE_DUALOPEND_SEND_TX_SIGS, msg); @@ -2693,6 +2707,10 @@ static void accepter_start(struct state *state, const u8 *oc2_msg) wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if ((msg_type = fromwire_peektype(msg)) == WIRE_DUALOPEND_FAIL) { if (!fromwire_dualopend_fail(msg, msg, &err_reason)) @@ -3067,6 +3085,10 @@ static u8 *opener_commits(struct state *state, wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if (fromwire_peektype(msg) != WIRE_DUALOPEND_COMMIT_SEND_ACK) master_badmsg(WIRE_DUALOPEND_COMMIT_SEND_ACK, msg); @@ -3902,6 +3924,10 @@ static void rbf_remote_start(struct state *state, const u8 *rbf_msg) wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_dualopend_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } if ((msg_type = fromwire_peektype(msg)) == WIRE_DUALOPEND_FAIL) { if (!fromwire_dualopend_fail(msg, msg, &err_reason)) diff --git a/openingd/openingd.c b/openingd/openingd.c index 1fca1d067022..464312610c4c 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -106,6 +106,8 @@ struct state { bool dev_accept_any_channel_type; }; +static void handle_dev_memleak(struct state *state, const u8 *msg); + /*~ If we can't agree on parameters, we fail to open the channel. * Tell lightningd why. */ static void NORETURN negotiation_aborted(struct state *state, const char *why) @@ -1028,6 +1030,10 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg) state->channel_type); wire_sync_write(REQ_FD, take(msg)); msg = wire_sync_read(tmpctx, REQ_FD); + while (state->developer && fromwire_openingd_dev_memleak(msg)) { + handle_dev_memleak(state, msg); + msg = wire_sync_read(tmpctx, REQ_FD); + } /* We don't allocate off tmpctx, because that's freed inside * opening_negotiate_msg */ diff --git a/plugins/bcli.c b/plugins/bcli.c index 1f9658b8015f..f7d942d12a02 100644 --- a/plugins/bcli.c +++ b/plugins/bcli.c @@ -737,7 +737,7 @@ static struct command_result *getutxout(struct command *cmd, response = jsonrpc_stream_success(cmd); json_add_sats(response, "amount", output.amount); - json_add_string(response, "script", tal_hex(response, output.script)); + json_add_string(response, "script", tal_hex(tmpctx, output.script)); return command_finished(cmd, response); } diff --git a/plugins/bkpr/bookkeeper.c b/plugins/bkpr/bookkeeper.c index 7bcca23c4613..94d272e3c21f 100644 --- a/plugins/bkpr/bookkeeper.c +++ b/plugins/bkpr/bookkeeper.c @@ -1322,7 +1322,7 @@ static struct command_result *currency_done(struct command *cmd, * (Recent check avoid glossing over failures, if we * couldn't get reliable data). */ if (raw_rate == crate->raw_rate - && crate_end + CURRENCYRATE_TOLERANCE_SECONDS > ctime->timestamp) { + && crate_end + bkpr->currencyrate_tolerance > ctime->timestamp) { uintmap_del(bkpr->currency_rates, ts); crate->duration = ctime->timestamp - ts + 1; } else { @@ -1391,7 +1391,7 @@ static void lookup_currency(struct command *cmd, * conversion. This can definitely happen when we first turn on * currency conversion though, so don't print in that case. */ now = clock_time().ts.tv_sec; - if (now > timestamp + CURRENCYRATE_TOLERANCE_SECONDS) { + if (now > timestamp + bkpr->currencyrate_tolerance) { if (!uintmap_empty(bkpr->currency_rates) && !bkpr->warned_currency_fail) { plugin_log(cmd->plugin, LOG_BROKEN, @@ -2101,6 +2101,7 @@ int main(int argc, char *argv[]) /* No datadir is default */ bkpr = tal(NULL, struct bkpr); bkpr->currency = NULL; + bkpr->currencyrate_tolerance = CURRENCYRATE_TOLERANCE_SECONDS; bkpr->currency_rates = tal(bkpr, currencymap_t); bkpr->accounts = NULL; uintmap_init(bkpr->currency_rates); @@ -2114,6 +2115,11 @@ int main(int argc, char *argv[]) "string", "Look up and record this currency on each event", option_currency, currency_jsonfmt, bkpr), + plugin_option_dev("dev-bkpr-currencyrate-tolerance", + "int", + "Max age (seconds) for applying current currencyrate to an event", + u32_option, u32_jsonfmt, + &bkpr->currencyrate_tolerance), NULL); return 0; diff --git a/plugins/bkpr/bookkeeper.h b/plugins/bkpr/bookkeeper.h index dc0238588e79..3f8ed31cfe0a 100644 --- a/plugins/bkpr/bookkeeper.h +++ b/plugins/bkpr/bookkeeper.h @@ -37,6 +37,8 @@ struct bkpr { currencymap_t *currency_rates; /* True if we've warned about currency failures */ bool warned_currency_fail; + /* Max age (seconds) for applying current currencyrate to an event */ + u32 currencyrate_tolerance; /* aux_command and parent of currency queries */ struct command *currency_cmds; }; diff --git a/plugins/rest-plugin/src/main.rs b/plugins/rest-plugin/src/main.rs index 527fc0567489..b090d02097e3 100644 --- a/plugins/rest-plugin/src/main.rs +++ b/plugins/rest-plugin/src/main.rs @@ -1,5 +1,6 @@ use std::{ collections::HashMap, + env, net::SocketAddr, str::FromStr, sync::{Arc, Mutex}, @@ -165,12 +166,17 @@ async fn run_rest_server( match clnrest_options.protocol { ClnrestProtocol::Https => { - let max_retries = 10; - let mut retries = 0; - while retries < max_retries && !do_certificates_exist(&clnrest_options.certs) { - log::debug!("Certificates incomplete. Retrying..."); - time::sleep(Duration::from_millis(500)).await; - retries += 1; + // Only wait for cln-grpc to finish creating certificates when using + // the default lightning directory; a custom clnrest-certs directory + // is never populated by cln-grpc. + if clnrest_options.certs == env::current_dir()? { + let max_retries = 50; + let mut retries = 0; + while retries < max_retries && !do_certificates_exist(&clnrest_options.certs) { + log::debug!("Certificates incomplete. Retrying..."); + time::sleep(Duration::from_millis(100)).await; + retries += 1; + } } if !do_certificates_exist(&clnrest_options.certs) { diff --git a/tests/conftest.py b/tests/conftest.py index bd0b7a309275..74f6e035489e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,189 @@ -import pytest +import fcntl +import json import os +import pytest +import shutil +import tempfile +import time from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND, VALGRIND, SLOW_MACHINE +def pytest_addoption(parser): + parser.addoption( + "--balanced-group", + action="store", + default=None, + help="Run shard G of N using duration-balanced LPT bin-packing (format: G/N, 1-indexed)", + ) + + +def _will_be_skipped(item): + open_versions = [mark.args[0] for mark in item.iter_markers(name="openchannel")] + if open_versions: + if "v1" not in open_versions and not EXPERIMENTAL_DUAL_FUND: + return True + if "v2" not in open_versions and EXPERIMENTAL_DUAL_FUND: + return True + elif EXPERIMENTAL_DUAL_FUND: + return True + if "slow_test" in item.keywords and VALGRIND and SLOW_MACHINE: + return True + return False + + +def pytest_collection_modifyitems(config, items): + spec = config.getoption("--balanced-group") + if not spec: + return + try: + group_s, count_s = spec.split("/", 1) + group = int(group_s) + count = int(count_s) + if not (1 <= group <= count): + raise ValueError + except ValueError: + raise pytest.UsageError( + f"--balanced-group expects G/N with 1 <= G <= N, got {spec!r}" + ) + + if count == 1: + return + + dur_file = "test_durations_valgrind.json" if VALGRIND else "test_durations.json" + dur_path = os.path.join(os.path.dirname(__file__), dur_file) + try: + with open(dur_path, "r") as f: + durations = json.load(f) + except OSError: + durations = {} + + default_dur = 20.0 if VALGRIND else 3.0 + + def weight(item): + if _will_be_skipped(item): + return 0.001 + nid = item.nodeid + if nid.startswith("tests/"): + nid = nid[len("tests/"):] + return float(durations.get(nid, default_dur)) + + # Longest Processing Time first (LPT) greedy bin-packing across shards. + # Preserve original collection order within each shard so heavy/multi-node + # tests are spread naturally instead of all launching simultaneously at t=0. + orig_pos = {id(it): pos for pos, it in enumerate(items)} + weighted = sorted( + ((weight(it), it.nodeid, it) for it in items), + key=lambda t: (-t[0], t[1]), + ) + loads = [0.0] * count + buckets = [[] for _ in range(count)] + for w, _, it in weighted: + idx = min(range(count), key=lambda i: (loads[i], i)) + buckets[idx].append(it) + loads[idx] += w + + selected = buckets[group - 1] + selected.sort(key=lambda it: orig_pos[id(it)]) + items[:] = selected + + +def _mem_available_mb(): + try: + with open("/proc/meminfo", "r") as f: + for line in f: + if line.startswith("MemAvailable:"): + return int(line.split()[1]) // 1024 + except OSError: + return None + return None + + +def _other_workers_active(gate_dir, my_name): + try: + entries = os.listdir(gate_dir) + except OSError: + return False + for name in entries: + if not name.startswith("active.") or name == my_name: + continue + path = os.path.join(gate_dir, name) + try: + fd = os.open(path, os.O_RDWR) + except OSError: + continue + try: + fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB) + fcntl.flock(fd, fcntl.LOCK_UN) + except BlockingIOError: + return True + finally: + os.close(fd) + return False + + +def _acquire_mem_gate(worker_id, min_avail_mb, max_wait=120.0): + """Hold an active-worker lock while a test runs; pause admission under low RAM. + + When MemAvailable drops below min_avail_mb and at least one other xdist worker + is already running a test, wait until memory recovers or no other worker is + active (preventing deadlock). When memory is between min_avail_mb and + min_avail_mb + 2048 MB, stagger admissions slightly so newly started nodes + allocate before the next worker checks MemAvailable. + """ + gate_dir = os.path.join(tempfile.gettempdir(), f"cln-memgate-{os.getppid()}") + os.makedirs(gate_dir, exist_ok=True) + gate_path = os.path.join(gate_dir, "gate.lock") + my_name = f"active.{worker_id}" + my_path = os.path.join(gate_dir, my_name) + + deadline = time.monotonic() + max_wait + while True: + with open(gate_path, "a+") as gate_f: + fcntl.flock(gate_f, fcntl.LOCK_EX) + avail = _mem_available_mb() + now = time.monotonic() + should_wait = False + if avail is not None and now < deadline: + if avail < min_avail_mb and _other_workers_active(gate_dir, my_name): + should_wait = True + elif avail < min_avail_mb + 2048 and _other_workers_active(gate_dir, my_name): + gate_f.seek(0) + try: + last_admit = float(gate_f.read().strip() or "0") + except ValueError: + last_admit = 0.0 + if now - last_admit < 2.0: + should_wait = True + + if not should_wait: + active_fd = os.open(my_path, os.O_CREAT | os.O_RDWR, 0o600) + fcntl.flock(active_fd, fcntl.LOCK_EX) + gate_f.seek(0) + gate_f.truncate() + gate_f.write(f"{now:.3f}\n") + gate_f.flush() + return active_fd + time.sleep(0.5) + + +@pytest.hookimpl(hookwrapper=True) +def pytest_runtest_protocol(item, nextitem): + min_avail_mb = int(os.environ.get("PYTEST_MIN_AVAIL_MB", "0") or "0") + worker_id = getattr(item.config, "workerinput", {}).get("workerid") + active_fd = None + if min_avail_mb > 0 and worker_id and _mem_available_mb() is not None: + active_fd = _acquire_mem_gate(worker_id, min_avail_mb) + try: + yield + finally: + if active_fd is not None: + try: + fcntl.flock(active_fd, fcntl.LOCK_UN) + finally: + os.close(active_fd) + + # This function is based upon the example of how to # "[make] test result information available in fixtures" at: # https://pytest.org/latest/example/simple.html#making-test-result-information-available-in-fixtures @@ -59,6 +239,11 @@ def pytest_sessionfinish(session, exitstatus): if hasattr(session.config, "workeroutput"): return + shutil.rmtree( + os.path.join(tempfile.gettempdir(), f"cln-memgate-{os.getpid()}"), + ignore_errors=True, + ) + # Find the LogXML instance among registered plugins # We need to search through all plugins because it's not directly accessible xml = None diff --git a/tests/test_askrene.py b/tests/test_askrene.py index 1a0374cd4a78..ccbaf4549435 100644 --- a/tests/test_askrene.py +++ b/tests/test_askrene.py @@ -1,7 +1,7 @@ from fixtures import * # noqa: F401,F403 from hashlib import sha256 from pyln.client import RpcError -from pyln.testing.utils import SLOW_MACHINE +from pyln.testing.utils import SLOW_MACHINE, VALGRIND from utils import ( only_one, first_scid, first_scidd, GenChannel, generate_gossip_store, sync_blockheight, wait_for, TEST_NETWORK, TIMEOUT, mine_funding_to_announce @@ -2140,6 +2140,9 @@ def test_reservations_leak_under_load(node_factory, executor): # join_nodes([l1, l2, l4, l5]) creates channels: l1-l2, l2-l4, l4-l5 # join_nodes([l1, l3, l4, l6]) creates channels: l1-l3, l3-l4, l4-l6 zero_fee = {"fee-base": 0, "fee-per-satoshi": 0} + if VALGRIND: + # 300 concurrent HTLCs across 6 Valgrind nodes can exceed connectd's 5s wake-delay check. + zero_fee["broken_log"] = "connectd: wake delay for" l1, l2, l3, l4, l5, l6 = node_factory.get_nodes( 6, opts=[zero_fee] * 6, diff --git a/tests/test_cln_lsps.py b/tests/test_cln_lsps.py index c07593201bb5..287424c2b0cd 100644 --- a/tests/test_cln_lsps.py +++ b/tests/test_cln_lsps.py @@ -537,9 +537,8 @@ def test_lsps2_mock_jit_channel_var_invoice(node_factory): LIST_PROTOCOLS_RESULT = {"jsonrpc": "2.0", "result": {"protocols": [2]}, "id": "1"} -@pytest.mark.parametrize( - "transport,expected", - [ +def test_lsps2_mock_transport_behaviors(node_factory): + cases = [ ({"behavior": "honest"}, [LIST_PROTOCOLS_RESULT]), ({"behavior": "drop"}, []), ({"behavior": "wrong_id"}, [{**LIST_PROTOCOLS_RESULT, "id": "mock-wrong-id"}]), @@ -570,15 +569,13 @@ def test_lsps2_mock_jit_channel_var_invoice(node_factory): {"behavior": "drop", "methods": ["lsps2.buy"]}, [LIST_PROTOCOLS_RESULT], ), - ], -) -def test_lsps2_mock_transport_behaviors(node_factory, transport, expected): + ] l1, l2 = node_factory.line_graph( 2, fundchannel=False, opts=[{}, {"plugin": LSPS2_MOCK}] ) - l2.rpc.call("lsps2-mock-configure", {"config": {"transport": transport}}) - - assert lsps2_mock_request(l1, l2, "lsps0.list_protocols", {}) == expected + for transport, expected in cases: + l2.rpc.call("lsps2-mock-configure", {"config": {"transport": transport}}) + assert lsps2_mock_request(l1, l2, "lsps0.list_protocols", {}) == expected def test_lsps2_mock_rejects_missing_parameters(node_factory): diff --git a/tests/test_clnrest.py b/tests/test_clnrest.py index c52c5b315095..a0eb8b6276e8 100644 --- a/tests/test_clnrest.py +++ b/tests/test_clnrest.py @@ -266,7 +266,7 @@ def test_large_response(node_factory): # to complain with the errors F811 like this "F811 redefinition of # unused 'message'". -def notifications_received_via_websocket(l1, base_url, http_session, rpc_method='invoice', rpc_params=[100000, 'label', 'description'], expect_error=None): +def notifications_received_via_websocket(l1, base_url, http_session, rpc_method='invoice', rpc_params=[100000, 'label', 'description'], expect_error=None, expect_notification='invoice_creation'): """Return the list of notifications received by the websocket client. We try to connect to the websocket server running at `base_url` @@ -320,11 +320,10 @@ def connect_error(data): assert sio is not None if expect_error: raise Exception(f"did not raise expected error {expect_error}") - time.sleep(2) # trigger notification by calling method rpc_call = getattr(l1.rpc, rpc_method) rpc_call(*rpc_params) - time.sleep(2) + wait_for(lambda: any(isinstance(n, dict) and expect_notification in n for n in notifications)) sio.disconnect() return notifications @@ -440,8 +439,10 @@ def test_numeric_msat_notification(node_factory): # create rune authorizing listclnrest-notifications method rune_clnrest_notifications = l2.rpc.createrune(restrictions=[["method=listclnrest-notifications"]])['rune'] http_session.headers.update({"rune": rune_clnrest_notifications}) - notifications = notifications_received_via_websocket(l1, base_url, - http_session, 'xpay', [inv['bolt11']]) + notifications = notifications_received_via_websocket( + l1, base_url, http_session, 'xpay', [inv['bolt11']], + expect_notification='invoice_payment', + ) filtered_notifications = [n for n in notifications if 'invoice_payment' in n] assert isinstance(filtered_notifications[0]['invoice_payment']['msat'], int) @@ -544,13 +545,9 @@ def connect_error(data): sio.disconnect() raise Exception("did not raise expected error Missing rune") - time.sleep(2) + assert not sio.connected # trigger notification by calling method - rpc_method = 'invoice' - rpc_params = [100000, 'label', 'description'] - rpc_call = getattr(l1.rpc, rpc_method) - rpc_call(*rpc_params) - time.sleep(2) + l1.rpc.invoice(100000, 'label', 'description') sio.disconnect() assert len(notifications) == 0 diff --git a/tests/test_closing.py b/tests/test_closing.py index 3e7a9ef95956..de176e1540b2 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -220,14 +220,14 @@ def test_closing_different_fees(node_factory, bitcoind, executor): wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > numfunds) # Create them in a batch, for speed! - peers = [] - for feerate in feerates: - for b in balance: - p = node_factory.get_node(feerates=feerate) - p.feerate = feerate - p.balance = b - l1.rpc.connect(p.info['id'], 'localhost', p.port) - peers.append(p) + peer_configs = [(feerate, b) for feerate in feerates for b in balance] + peers = node_factory.get_nodes( + len(peer_configs), opts=[{'feerates': feerate, 'allow_bad_gossip': True} for feerate, _ in peer_configs] + ) + for p, (feerate, b) in zip(peers, peer_configs): + p.feerate = feerate + p.balance = b + l1.rpc.connect(p.info['id'], 'localhost', p.port) for p in peers: p.channel = l1.rpc.fundchannel(p.info['id'], 10**6, minconf=0)['channel_id'] @@ -3343,6 +3343,7 @@ def route_to_l1(src): @pytest.mark.slow_test +@pytest.mark.xdist_group("heavy") def test_onchain_multihtlc_our_unilateral(node_factory, bitcoind): """Node pushes a channel onchain with multiple HTLCs with same payment_hash """ h, l1, l2, l3, l4, l5, l6, l7 = setup_multihtlc_test(node_factory, bitcoind) @@ -3398,6 +3399,7 @@ def test_onchain_multihtlc_our_unilateral(node_factory, bitcoind): @pytest.mark.slow_test +@pytest.mark.xdist_group("heavy") def test_onchain_multihtlc_their_unilateral(node_factory, bitcoind): """Node pushes a channel onchain with multiple HTLCs with same payment_hash """ h, l1, l2, l3, l4, l5, l6, l7 = setup_multihtlc_test(node_factory, bitcoind) diff --git a/tests/test_coinmoves.py b/tests/test_coinmoves.py index bcaa226b65a8..c42513f78dec 100644 --- a/tests/test_coinmoves.py +++ b/tests/test_coinmoves.py @@ -8,7 +8,6 @@ import unittest import pytest import re -import time from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND @@ -690,13 +689,12 @@ def test_coinmoves_unilateral_htlc_before_included(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l1, l2]) - time.sleep(5) + l1.daemon.wait_for_log('onchaind complete, forgetting peer') + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l1, expected_channel1) check_chain_moves(l1, expected_chain1) check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l1.daemon.wait_for_log('onchaind complete, forgetting peer') - l2.daemon.wait_for_log('onchaind complete, forgetting peer') # We didn't send any HTLCs check_balances(l1, l2, fundchannel['channel_id'], 0) @@ -1007,13 +1005,12 @@ def test_coinmoves_unilateral_htlc_timeout(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l1, l2]) - time.sleep(5) + l1.daemon.wait_for_log('onchaind complete, forgetting peer') + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l1, expected_channel1) check_chain_moves(l1, expected_chain1) check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l1.daemon.wait_for_log('onchaind complete, forgetting peer') - l2.daemon.wait_for_log('onchaind complete, forgetting peer') # We didn't send any HTLCs check_balances(l1, l2, fundchannel['channel_id'], 0) @@ -1196,13 +1193,12 @@ def test_coinmoves_unilateral_htlc_dust(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l1, l2]) - time.sleep(5) + l1.daemon.wait_for_log('onchaind complete, forgetting peer') + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l1, expected_channel1) check_chain_moves(l1, expected_chain1) check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l1.daemon.wait_for_log('onchaind complete, forgetting peer') - l2.daemon.wait_for_log('onchaind complete, forgetting peer') # We send a HTLC but it didn't finalize. check_balances(l1, l2, fundchannel['channel_id'], 0) @@ -1469,13 +1465,12 @@ def test_coinmoves_unilateral_htlc_fulfill(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l1, l2]) - time.sleep(5) + l1.daemon.wait_for_log('onchaind complete, forgetting peer') + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l1, expected_channel1) check_chain_moves(l1, expected_chain1) check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l1.daemon.wait_for_log('onchaind complete, forgetting peer') - l2.daemon.wait_for_log('onchaind complete, forgetting peer') # We send an HTLC, but it's not accounted in channel. check_balances(l1, l2, fundchannel['channel_id'], 0) @@ -1688,13 +1683,12 @@ def test_coinmoves_unilateral_htlc_fulfilled_oneside(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l1, l2]) - time.sleep(5) + l1.daemon.wait_for_log('onchaind complete, forgetting peer') + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l1, expected_channel1) check_chain_moves(l1, expected_chain1) check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l1.daemon.wait_for_log('onchaind complete, forgetting peer') - l2.daemon.wait_for_log('onchaind complete, forgetting peer') # We send no in-channel HTLCs check_balances(l1, l2, fundchannel['channel_id'], 0) @@ -1905,10 +1899,9 @@ def test_coinmoves_unilateral_htlc_penalty(node_factory, bitcoind): # Make sure it's stable! bitcoind.generate_block(100) sync_blockheight(bitcoind, [l2]) - time.sleep(5) + l2.daemon.wait_for_log('onchaind complete, forgetting peer') check_channel_moves(l2, expected_channel2) check_chain_moves(l2, expected_chain2) - l2.daemon.wait_for_log('onchaind complete, forgetting peer') channel2 = account_balances(l2.rpc.listchannelmoves()['channelmoves']) chain2 = account_balances(l2.rpc.listchainmoves()['chainmoves']) diff --git a/tests/test_connection.py b/tests/test_connection.py index dd31c73e11a2..96d8917bcde2 100644 --- a/tests/test_connection.py +++ b/tests/test_connection.py @@ -1578,6 +1578,7 @@ def test_funding_cancel_race(node_factory, bitcoind, executor): @pytest.mark.slow_test @pytest.mark.openchannel('v2') +@pytest.mark.xdist_group("heavy") def test_funding_v2_cancel_race(node_factory, bitcoind, executor): l1 = node_factory.get_node() @@ -2932,11 +2933,13 @@ def test_fundee_node_unconfirmed(node_factory, bitcoind): start_amount = only_one(l1.rpc.listfunds()['outputs'])['amount_msat'] + fundchannel_failed = threading.Event() + def mock_sendrawtransaction(r): return {'id': r['id'], 'error': {'code': 100, 'message': 'sendrawtransaction disabled'}} def mock_donothing(r): - time.sleep(10) + fundchannel_failed.wait(timeout=TIMEOUT) return bitcoind.rpc.sendrawtransaction(r['params'][0]) # Prevent both from broadcasting funding tx (any tx really). @@ -2948,6 +2951,7 @@ def mock_donothing(r): # to broadcast and confirm funding tx. with pytest.raises(RpcError, match=r'sendrawtransaction disabled'): l1.rpc.fundchannel(l2.info['id'], 10**6) + fundchannel_failed.set() # Generate blocks until unconfirmed. bitcoind.generate_block(1, wait_for_mempool=1) @@ -4217,7 +4221,8 @@ def test_quiescence(node_factory, executor): def test_htlc_failed_noclose(node_factory): """Test a bug where the htlc timeout would kick in even if the HTLC failed""" - l1, l2 = node_factory.line_graph(2) + timeout_secs = 5 if VALGRIND or SLOW_MACHINE else 2 + l1, l2 = node_factory.line_graph(2, opts={'dev-htlc-offer-timeout-secs': timeout_secs}) inv = l2.rpc.invoice(1000, "test", "test") routestep = { @@ -4237,7 +4242,7 @@ def test_htlc_failed_noclose(node_factory): with pytest.raises(RpcError, match="Capacity exceeded"): l1.rpc.waitsendpay(inv['payment_hash']) - time.sleep(35) + time.sleep(timeout_secs + 1) assert l1.rpc.getpeer(l2.info['id'])['connected'] @@ -4756,10 +4761,10 @@ def test_offline(node_factory): def test_last_stable_connection(node_factory): - l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True}) + STABLE_TIME = 25 if VALGRIND else (10 if SLOW_MACHINE else 5) + l1, l2 = node_factory.line_graph(2, opts={'may_reconnect': True, + 'dev-stable-connection-secs': STABLE_TIME}) - # We wait a minute to be stable. - STABLE_TIME = 60 assert 'last_stable_connection' not in only_one(l1.rpc.listpeerchannels()['channels']) assert 'last_stable_connection' not in only_one(l2.rpc.listpeerchannels()['channels']) diff --git a/tests/test_currencyrate.py b/tests/test_currencyrate.py index 8b772ec8401c..9445a00a8de1 100644 --- a/tests/test_currencyrate.py +++ b/tests/test_currencyrate.py @@ -2,7 +2,7 @@ import pytest import threading import time -from utils import wait_for, only_one +from utils import wait_for, only_one, VALGRIND from pyln.client import RpcError from fixtures import * # noqa: F401,F403 from flask import Flask, jsonify, request @@ -131,7 +131,7 @@ def fake_rateserver(): state = { "fast": 100_000_000, "slow": 50_000_000, - "slow_delay": 1, + "slow_delay": 0.2, "too_high": 50_000.0116, "too_low": 50_000.0114, "midpoint": 50_000.0115, @@ -246,8 +246,9 @@ def test_bkpr_listaccountevents_realtime(node_factory, fake_rateserver): # We want this event in the list, so wait until it's totally closed. wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == []) - # We could put a log msg inside bookkeeper, but that's spammy. - time.sleep(10) + # Wait until bookkeeper finishes looking up and persisting the rate + # asynchronously, without calling any bkpr RPC command first. + wait_for(lambda: l1.rpc.listdatastore(['bookkeeper', 'currencyrate', 'USD'])['datastore'] != []) # Change rates. But old ones should be used! fake_rateserver["state"]["fast"] = 200_000_000 @@ -344,8 +345,8 @@ def test_bkpr_currencyrate_persisted(node_factory, fake_rateserver): fake_rateserver["state"]["slow"] = 150_000_000 new_median = (fake_rateserver["state"]["fast"] + fake_rateserver["state"]["slow"]) / 2 - # CLN caches rates for 60s - time.sleep(61) + # Restart cleared cln-currencyrate's cache; wait 1s so inv2 gets a new timestamp. + time.sleep(1) new_events = l1.rpc.bkpr_listaccountevents()["events"] assert new_events == events @@ -379,12 +380,14 @@ def test_bkpr_currencyrate_persisted(node_factory, fake_rateserver): def test_bkpr_currencyrate_warns_for_old_events(node_factory, fake_rateserver): + tolerance = 5 if VALGRIND else 2 opts = { "currencyrate-disable-source": ALL_RESOURCES, "currencyrate-add-source": [ f"fast,{fake_rateserver['url']}/fast,price", f"slow,{fake_rateserver['url']}/slow,price", ], + "dev-bkpr-currencyrate-tolerance": tolerance, 'may_reconnect': True, 'broken_log': "too old for current USD currencyrate", } @@ -397,7 +400,7 @@ def test_bkpr_currencyrate_warns_for_old_events(node_factory, fake_rateserver): events = l1.rpc.bkpr_listaccountevents()["events"] assert events assert all("currencyrate" not in e for e in events) - time.sleep(61) + time.sleep(tolerance + 1) # 2. Enable bkpr-currency. This historical backfill case should not warn (transient) l1.rpc.setconfig("bkpr-currency", "USD", True) @@ -415,18 +418,24 @@ def test_bkpr_currencyrate_warns_for_old_events(node_factory, fake_rateserver): # 3. Stop bookkeeper so new events will not be processed yet (not a dynamic plugin!) l1.daemon.opts['disable-plugin'] = "bookkeeper" + del l1.daemon.opts['dev-bkpr-currencyrate-tolerance'] l1.restart() l1.connect(l2) # 4. Create new events while bookkeeper is stopped, then let them go stale. + # Ensure inv3 lands in a strictly newer Unix second than inv2 so inv2's + # 1-second cached currencyrate entry doesn't cover it. + last_ts = new_events[-1]["timestamp"] + wait_for(lambda: int(time.time()) > last_ts) inv3 = l2.rpc.invoice(100000, "test_bkpr_currencyrate_warns_old_3", "desc") l1.rpc.xpay(inv3["bolt11"]) wait_for(lambda: only_one(l1.rpc.listpeerchannels(l2.info['id'])['channels'])['htlcs'] == []) - time.sleep(61) + time.sleep(tolerance + 1) # 5. Restart with bookkeeper (with currency) del l1.daemon.opts['disable-plugin'] l1.daemon.opts['bkpr-currency'] = "USD" + l1.daemon.opts['dev-bkpr-currencyrate-tolerance'] = tolerance l1.restart() # 6. It should now complain about processing stale events with conversion enabled. @@ -499,14 +508,16 @@ def test_currencyrate_rounding(node_factory, fake_rateserver): ("midpoint", f"{fake_rateserver['url']}/midpoint", 50_000.012), ] - for source_name, url, expected in cases: - opts = { - "currencyrate-disable-source": ALL_RESOURCES, - "currencyrate-add-source": [f"{source_name},{url},price"], - } - l1 = node_factory.get_node(options=opts) + opts = { + "currencyrate-disable-source": ALL_RESOURCES, + "currencyrate-add-source": [ + f"{source_name},{url},price" for source_name, url, _ in cases + ], + } + l1 = node_factory.get_node(options=opts) - result = l1.rpc.currencyrate("USD") + for source_name, _, expected in cases: + result = l1.rpc.call("currencyrate", ["USD", source_name]) LOGGER.info("currencyrate rounding [%s]: %s", source_name, result) rate = result["rate"] @@ -519,8 +530,6 @@ def test_currencyrate_rounding(node_factory, fake_rateserver): f"[{source_name}] Expected {expected} after rounding, got {rate!r}" ) - l1.stop() - def test_currencyrate_source(node_factory, fake_rateserver): """Test currencyrate with a source argument returns that source's rate.""" diff --git a/tests/test_durations.json b/tests/test_durations.json new file mode 100644 index 000000000000..e11e43747ee1 --- /dev/null +++ b/tests/test_durations.json @@ -0,0 +1,1255 @@ +{ + "test_askrene.py::test_askrene_channel_observation": 2.2, + "test_askrene.py::test_askrene_constrain_channel": 2.3, + "test_askrene.py::test_askrene_observation_age": 2.5, + "test_askrene.py::test_askrene_observation_persistence": 2.7, + "test_askrene.py::test_askrene_reserve_clash": 2.1, + "test_askrene.py::test_askrene_timeout": 4.3, + "test_askrene.py::test_bad_user_entries": 2.2, + "test_askrene.py::test_bias_aging": 4.3, + "test_askrene.py::test_excessive_fee_cost": 2.1, + "test_askrene.py::test_explain_source_dest_failures": 12.6, + "test_askrene.py::test_fees_dont_exceed_constraints": 2.7, + "test_askrene.py::test_flow_fee_adjustment_fallback": 2.1, + "test_askrene.py::test_flows_account_for_fees": 2.3, + "test_askrene.py::test_getroutes": 2.5, + "test_askrene.py::test_getroutes_auto_localchans": 7.4, + "test_askrene.py::test_getroutes_auto_sourcefree": 2.5, + "test_askrene.py::test_getroutes_fee_fallback": 2.8, + "test_askrene.py::test_getroutes_hop_probability": 2.0, + "test_askrene.py::test_getroutes_ignores_recovery_stubs": 11.0, + "test_askrene.py::test_getroutes_maxdelay": 2.9, + "test_askrene.py::test_getroutes_maxhops": 2.0, + "test_askrene.py::test_getroutes_maxhops_binding[100000000]": 8.0, + "test_askrene.py::test_getroutes_maxhops_binding[10000000]": 2.1, + "test_askrene.py::test_getroutes_maxhops_binding[1000000]": 2.5, + "test_askrene.py::test_getroutes_maxhops_mpp": 2.1, + "test_askrene.py::test_getroutes_single_path": 2.4, + "test_askrene.py::test_impossible_payment": 1.9, + "test_askrene.py::test_includefees": 1.9, + "test_askrene.py::test_layer_persistence": 12.0, + "test_askrene.py::test_layers": 11.3, + "test_askrene.py::test_limits_fake_gossmap": 2.8, + "test_askrene.py::test_live_spendable": 14.4, + "test_askrene.py::test_max_htlc": 2.6, + "test_askrene.py::test_maxparts_infloop": 12.1, + "test_askrene.py::test_min_htlc": 2.5, + "test_askrene.py::test_min_htlc_after_excess": 2.6, + "test_askrene.py::test_node_bias_persistence": 8.0, + "test_askrene.py::test_node_bias_routes": 4.3, + "test_askrene.py::test_node_bias_rpc": 9.7, + "test_askrene.py::test_observation_impression_ordering": 5.1, + "test_askrene.py::test_observations_relax_stale_lower_bound": 1.9, + "test_askrene.py::test_real_biases": 92.0, + "test_askrene.py::test_real_data": 84.9, + "test_askrene.py::test_real_data_maxhops": 120.2, + "test_askrene.py::test_reservations_leak": 32.5, + "test_askrene.py::test_reservations_leak_under_load": 28.3, + "test_askrene.py::test_reserve": 15.5, + "test_askrene.py::test_simple_dummy_channel": 2.3, + "test_askrene.py::test_sourcefree_on_mods": 3.1, + "test_askrene.py::test_splice_dying_channel": 13.7, + "test_askrene.py::test_unreserve_all": 8.5, + "test_bookkeeper.py::test_bkpr_parallel": 3.6, + "test_bookkeeper.py::test_bkpr_report_invoice": 5.0, + "test_bookkeeper.py::test_bkpr_report_lightning_cli_csv": 4.8, + "test_bookkeeper.py::test_bkpr_report_tags_and_fallback": 4.5, + "test_bookkeeper.py::test_bookkeeper_custom_notifs": 6.2, + "test_bookkeeper.py::test_bookkeeping_closing_subsat_htlcs": 10.2, + "test_bookkeeper.py::test_bookkeeping_closing_trimmed_htlcs": 7.5, + "test_bookkeeper.py::test_bookkeeping_descriptions": 9.5, + "test_bookkeeper.py::test_bookkeeping_external_withdraws": 5.3, + "test_bookkeeper.py::test_bookkeeping_inspect_multifundchannel": 10.2, + "test_bookkeeper.py::test_bookkeeping_listbalances_underflow": 6.3, + "test_bookkeeper.py::test_bookkeeping_missed_chans_pay_after": 6.9, + "test_bookkeeper.py::test_bookkeeping_missed_chans_pushed": 8.6, + "test_bookkeeper.py::test_bookkeeping_onchaind_txs": 15.2, + "test_bookkeeper.py::test_bookkeeping_rbf_withdraw": 4.3, + "test_bookkeeper.py::test_bookkeeping_splice_in": 7.9, + "test_bookkeeper.py::test_bookkeeping_splice_out": 9.2, + "test_bookkeeper.py::test_empty_node": 3.5, + "test_bookkeeper.py::test_listincome_and_report_timebox": 6.7, + "test_bookkeeper.py::test_migration": 3.0, + "test_bookkeeper.py::test_migration_no_bkpr": 3.1, + "test_bookkeeper.py::test_rebalance_tracking": 11.9, + "test_cln_lsps.py::test_lsps0_listprotocols[in-tree]": 2.9, + "test_cln_lsps.py::test_lsps0_listprotocols[mock]": 2.4, + "test_cln_lsps.py::test_lsps2_buy[in-tree]": 2.6, + "test_cln_lsps.py::test_lsps2_buy[mock]": 2.7, + "test_cln_lsps.py::test_lsps2_buyjitchannel_mpp_fixed_invoice": 11.1, + "test_cln_lsps.py::test_lsps2_buyjitchannel_no_mpp_var_invoice[in-tree]": 7.4, + "test_cln_lsps.py::test_lsps2_buyjitchannel_no_mpp_var_invoice[mock]": 11.7, + "test_cln_lsps.py::test_lsps2_enabled[in-tree]": 2.7, + "test_cln_lsps.py::test_lsps2_enabled[mock]": 8.0, + "test_cln_lsps.py::test_lsps2_getinfo[in-tree]": 2.2, + "test_cln_lsps.py::test_lsps2_getinfo[mock]": 2.7, + "test_cln_lsps.py::test_lsps2_mock_buy_fee_checks": 6.4, + "test_cln_lsps.py::test_lsps2_mock_buy_result": 2.6, + "test_cln_lsps.py::test_lsps2_mock_config_option": 2.8, + "test_cln_lsps.py::test_lsps2_mock_expired_held_parts": 9.7, + "test_cln_lsps.py::test_lsps2_mock_expired_session": 11.8, + "test_cln_lsps.py::test_lsps2_mock_fee": 0.0, + "test_cln_lsps.py::test_lsps2_mock_htlc_deduct": 8.7, + "test_cln_lsps.py::test_lsps2_mock_htlc_error": 7.1, + "test_cln_lsps.py::test_lsps2_mock_jit_channel_var_invoice": 8.2, + "test_cln_lsps.py::test_lsps2_mock_open_disconnect": 8.0, + "test_cln_lsps.py::test_lsps2_mock_open_failed": 13.3, + "test_cln_lsps.py::test_lsps2_mock_open_never": 8.8, + "test_cln_lsps.py::test_lsps2_mock_protocol": 3.1, + "test_cln_lsps.py::test_lsps2_mock_protocol_errors": 3.2, + "test_cln_lsps.py::test_lsps2_mock_rejects_missing_parameters": 3.2, + "test_cln_lsps.py::test_lsps2_mock_rejects_unknown_config": 2.8, + "test_cln_lsps.py::test_lsps2_mock_request_error": 2.3, + "test_cln_lsps.py::test_lsps2_mock_transport_behaviors": 2.5, + "test_cln_lsps.py::test_lsps2_mock_var_invoice_payment_size[10000001]": 8.3, + "test_cln_lsps.py::test_lsps2_mock_var_invoice_payment_size[1000]": 8.1, + "test_cln_lsps.py::test_lsps2_non_approved_zero_conf[in-tree]": 9.8, + "test_cln_lsps.py::test_lsps2_non_approved_zero_conf[mock]": 8.1, + "test_cln_lsps.py::test_lsps_service_disabled": 2.5, + "test_cln_rs.py::test_bip353": 9.3, + "test_cln_rs.py::test_cln_plugin_reentrant": 4.0, + "test_cln_rs.py::test_grpc_block_added_notifications": 4.0, + "test_cln_rs.py::test_grpc_connect": 2.5, + "test_cln_rs.py::test_grpc_connect_notification": 3.4, + "test_cln_rs.py::test_grpc_custommsg_notification": 3.7, + "test_cln_rs.py::test_grpc_decode": 2.1, + "test_cln_rs.py::test_grpc_default_port_auto_starts": 1.1, + "test_cln_rs.py::test_grpc_generate_certificate": 8.8, + "test_cln_rs.py::test_grpc_keysend_routehint": 5.9, + "test_cln_rs.py::test_grpc_legacy_sat_fields": 4.7, + "test_cln_rs.py::test_grpc_listpeerchannels": 6.6, + "test_cln_rs.py::test_grpc_request_validation": 2.5, + "test_cln_rs.py::test_grpc_sat_amounts_on_the_wire": 7.1, + "test_cln_rs.py::test_grpc_wrong_auth": 3.0, + "test_cln_rs.py::test_plugin_bad_json": 2.7, + "test_cln_rs.py::test_plugin_log_levels": 3.0, + "test_cln_rs.py::test_plugin_options_handle_defaults": 3.1, + "test_cln_rs.py::test_plugin_start": 2.6, + "test_cln_rs.py::test_rpc_client[False-038194b5f32bdf0aa59812c86c4ef7ad2f294104fa027d1ace9b469bb6f88cf37b]": 3.0, + "test_cln_rs.py::test_rpc_client[True-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518]": 2.4, + "test_cln_rs.py::test_rust_plugin_subscribe_wildcard": 6.0, + "test_clnrest.py::test_accept_header_types": 3.2, + "test_clnrest.py::test_content_type_header_types": 3.2, + "test_clnrest.py::test_dynamic_path_conflicts": 2.9, + "test_clnrest.py::test_dynamic_path_matching": 3.7, + "test_clnrest.py::test_dynamic_path_rune": 3.0, + "test_clnrest.py::test_generate_certificate": 5.2, + "test_clnrest.py::test_http_headers": 6.8, + "test_clnrest.py::test_large_request_body": 2.2, + "test_clnrest.py::test_large_response": 4.6, + "test_clnrest.py::test_list_methods": 3.0, + "test_clnrest.py::test_matching_accept_and_content_types": 3.0, + "test_clnrest.py::test_no_auto_start": 3.0, + "test_clnrest.py::test_numeric_msat_notification": 6.7, + "test_clnrest.py::test_options": 4.2, + "test_clnrest.py::test_rpc_method": 2.6, + "test_clnrest.py::test_self_signed_certificates": 6.5, + "test_clnrest.py::test_unknown_method": 2.6, + "test_clnrest.py::test_uses_grpc_plugin_certificates": 2.5, + "test_clnrest.py::test_websocket_no_rune": 7.7, + "test_clnrest.py::test_websocket_rune_listnotifications": 2.8, + "test_clnrest.py::test_websocket_rune_no_listnotifications": 2.9, + "test_clnrest.py::test_websocket_rune_readonly": 2.0, + "test_clnrest.py::test_websocket_unrestricted_rune": 2.1, + "test_clnrest.py::test_websocket_upgrade_header": 3.7, + "test_clnrest.py::test_websocket_wrong_rune": 1.9, + "test_closing.py::test_anchorspend_ignores_immature_coinbase": 10.2, + "test_closing.py::test_anchorspend_using_to_remote[False]": 27.6, + "test_closing.py::test_anchorspend_using_to_remote[True]": 24.9, + "test_closing.py::test_anysegwit_close_needs_feature": 7.7, + "test_closing.py::test_close_feerate_range": 5.4, + "test_closing.py::test_close_twice": 5.2, + "test_closing.py::test_close_weight_estimate": 6.5, + "test_closing.py::test_closing_anchorspend_htlc_tx_rbf": 65.6, + "test_closing.py::test_closing_cpfp": 5.9, + "test_closing.py::test_closing_different_fees": 8.5, + "test_closing.py::test_closing_disconnected_notify": 9.6, + "test_closing.py::test_closing_fee_rounding_at_ceiling": 5.6, + "test_closing.py::test_closing_feerange_below_estimates": 6.9, + "test_closing.py::test_closing_higherfee[False]": 5.8, + "test_closing.py::test_closing_higherfee[True]": 5.5, + "test_closing.py::test_closing_id": 12.3, + "test_closing.py::test_closing_ignore_fee_limits": 8.6, + "test_closing.py::test_closing_minfee": 4.7, + "test_closing.py::test_closing_negotiation_reconnect": 9.6, + "test_closing.py::test_closing_negotiation_step_100pct": 8.1, + "test_closing.py::test_closing_negotiation_step_1sat": 8.8, + "test_closing.py::test_closing_negotiation_step_30pct": 8.5, + "test_closing.py::test_closing_negotiation_step_700sat": 8.8, + "test_closing.py::test_closing_no_anysegwit_retry": 6.1, + "test_closing.py::test_closing_rejected_fee_fails_negotiation": 14.1, + "test_closing.py::test_closing_simple": 16.0, + "test_closing.py::test_closing_specified_destination": 23.2, + "test_closing.py::test_closing_tx_valid": 6.3, + "test_closing.py::test_closing_while_disconnected": 6.2, + "test_closing.py::test_htlc_no_force_close[False]": 13.3, + "test_closing.py::test_htlc_no_force_close[True]": 15.0, + "test_closing.py::test_htlc_rexmit_while_closing": 4.6, + "test_closing.py::test_htlc_timeout_boost_large_utxo": 5.3, + "test_closing.py::test_htlc_timeout_during_stfu": 11.4, + "test_closing.py::test_invalid_upfront_shutdown_script": 4.2, + "test_closing.py::test_listfunds_after_their_unilateral": 13.2, + "test_closing.py::test_onchain_all_dust": 22.5, + "test_closing.py::test_onchain_close_no_p2tr": 6.3, + "test_closing.py::test_onchain_close_upstream": 41.7, + "test_closing.py::test_onchain_different_fees": 27.5, + "test_closing.py::test_onchain_dust_out": 10.9, + "test_closing.py::test_onchain_feechange": 13.5, + "test_closing.py::test_onchain_first_commit": 10.3, + "test_closing.py::test_onchain_middleman_fulfill_after_fail": 15.6, + "test_closing.py::test_onchain_middleman_simple[False]": 18.0, + "test_closing.py::test_onchain_middleman_simple[True]": 17.3, + "test_closing.py::test_onchain_middleman_their_unilateral_in[False]": 16.0, + "test_closing.py::test_onchain_middleman_their_unilateral_in[True]": 16.1, + "test_closing.py::test_onchain_middleman_trimmed_same_hash": 11.5, + "test_closing.py::test_onchain_multihtlc_our_unilateral": 39.2, + "test_closing.py::test_onchain_multihtlc_their_unilateral": 37.4, + "test_closing.py::test_onchain_rbf_stops_after_confirmation": 12.5, + "test_closing.py::test_onchain_reestablish_reply": 10.5, + "test_closing.py::test_onchain_rexmit_tx": 6.6, + "test_closing.py::test_onchain_slow_anchor": 13.5, + "test_closing.py::test_onchain_their_unilateral_out[False]": 8.9, + "test_closing.py::test_onchain_their_unilateral_out[True]": 8.7, + "test_closing.py::test_onchain_timeout[False]": 14.9, + "test_closing.py::test_onchain_timeout[True]": 14.8, + "test_closing.py::test_onchain_unwatch": 14.9, + "test_closing.py::test_onchaind_reorg_child_tx": 14.7, + "test_closing.py::test_onchaind_reorg_commitment_tx": 11.3, + "test_closing.py::test_onchaind_replay": 15.4, + "test_closing.py::test_option_upfront_shutdown_script[False]": 9.4, + "test_closing.py::test_option_upfront_shutdown_script[True]": 9.7, + "test_closing.py::test_peer_anchor_push": 26.0, + "test_closing.py::test_penalty_htlc_tx_fulfill[False]": 23.0, + "test_closing.py::test_penalty_htlc_tx_fulfill[True]": 23.9, + "test_closing.py::test_penalty_htlc_tx_timeout[False]": 27.0, + "test_closing.py::test_penalty_htlc_tx_timeout[True]": 33.8, + "test_closing.py::test_penalty_inhtlc[False]": 8.6, + "test_closing.py::test_penalty_inhtlc[True]": 9.0, + "test_closing.py::test_penalty_outhtlc[False]": 8.9, + "test_closing.py::test_penalty_outhtlc[True]": 8.4, + "test_closing.py::test_penalty_rbf_normal[False]": 21.1, + "test_closing.py::test_penalty_rbf_normal[True]": 16.9, + "test_closing.py::test_permfail": 9.8, + "test_closing.py::test_permfail_htlc_in": 10.9, + "test_closing.py::test_permfail_htlc_out": 15.0, + "test_closing.py::test_permfail_new_commit": 11.7, + "test_closing.py::test_reestablish_closed_channels": 8.7, + "test_closing.py::test_segwit_anyshutdown": 29.1, + "test_closing.py::test_segwit_shutdown_script": 54.2, + "test_closing.py::test_shutdown": 2.9, + "test_closing.py::test_simple_close_basic": 5.8, + "test_closing.py::test_simple_close_closee_path": 6.2, + "test_closing.py::test_simple_close_closer_pays_fee": 4.7, + "test_closing.py::test_simple_close_delay_broadcast": 5.8, + "test_closing.py::test_simple_close_dust_output_omitted": 10.1, + "test_closing.py::test_simple_close_no_feature_fallback": 5.4, + "test_closing.py::test_simple_close_restart": 6.9, + "test_closing.py::test_you_forgot_closed_channel": 4.5, + "test_closing.py::test_you_forgot_closed_channel_onchain": 5.5, + "test_coinmoves.py::test_coinmoves": 11.4, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_before_included": 10.7, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_dust": 10.7, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_fulfill": 17.8, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_fulfilled_oneside": 12.0, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_penalty": 16.1, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_timeout": 14.8, + "test_coinmoves.py::test_migration": 3.6, + "test_coinmoves.py::test_migration_no_bkpr": 3.1, + "test_coinmoves.py::test_wait": 5.9, + "test_connection.py::test_balance": 4.5, + "test_connection.py::test_change_chaining": 3.4, + "test_connection.py::test_channel_abandon": 3.1, + "test_connection.py::test_channel_features[False]": 4.2, + "test_connection.py::test_channel_features[True]": 5.0, + "test_connection.py::test_channel_persistence": 8.5, + "test_connection.py::test_channel_reenable": 7.5, + "test_connection.py::test_connect_basic": 6.9, + "test_connection.py::test_connect_proxy_maxlen_hostname": 4.2, + "test_connection.py::test_connect_ratelimit": 17.3, + "test_connection.py::test_connect_standard_addr": 3.3, + "test_connection.py::test_connect_transient": 6.6, + "test_connection.py::test_connect_transient_pending": 3.2, + "test_connection.py::test_connection_moved": 5.8, + "test_connection.py::test_dataloss_protection": 13.7, + "test_connection.py::test_dataloss_protection_hsmtool_recoverhtlc[False]": 10.8, + "test_connection.py::test_dataloss_protection_hsmtool_recoverhtlc[True]": 10.1, + "test_connection.py::test_dataloss_protection_no_broadcast": 12.3, + "test_connection.py::test_dataloss_protection_reconnect": 8.8, + "test_connection.py::test_disconnect": 2.6, + "test_connection.py::test_disconnect_fundee": 3.1, + "test_connection.py::test_disconnect_half_signed": 3.2, + "test_connection.py::test_disconnect_opener": 3.1, + "test_connection.py::test_disconnectpeer": 6.7, + "test_connection.py::test_fee_limits": 19.2, + "test_connection.py::test_feerate_spam": 10.6, + "test_connection.py::test_feerate_stress": 80.6, + "test_connection.py::test_forget_channel": 4.6, + "test_connection.py::test_fulfill_incoming_first": 14.0, + "test_connection.py::test_fundchannel_complete_rejects_nonsegwit_unsigned": 2.7, + "test_connection.py::test_fundee_forget_funding_tx_unconfirmed": 6.5, + "test_connection.py::test_funding_all": 4.3, + "test_connection.py::test_funding_all_too_much": 3.3, + "test_connection.py::test_funding_by_utxos": 7.1, + "test_connection.py::test_funding_cancel_race": 48.8, + "test_connection.py::test_funding_change": 5.8, + "test_connection.py::test_funding_close_upfront": 18.8, + "test_connection.py::test_funding_external_wallet": 5.3, + "test_connection.py::test_funding_external_wallet_corners": 3.9, + "test_connection.py::test_funding_fail": 9.5, + "test_connection.py::test_funding_push": 4.3, + "test_connection.py::test_funding_toolarge": 3.1, + "test_connection.py::test_funding_while_offline": 3.9, + "test_connection.py::test_htlc_failed_noclose": 7.6, + "test_connection.py::test_htlc_retransmit_order": 4.7, + "test_connection.py::test_injectonionmessage": 4.7, + "test_connection.py::test_last_stable_connection": 25.0, + "test_connection.py::test_listpeerchannels_by_channel_id": 4.2, + "test_connection.py::test_listpeerchannels_by_scid": 5.3, + "test_connection.py::test_listpeers_crash": 3.4, + "test_connection.py::test_lockin_between_restart": 8.9, + "test_connection.py::test_multichan": 11.3, + "test_connection.py::test_multichan_stress": 15.2, + "test_connection.py::test_multifunding_best_effort": 13.3, + "test_connection.py::test_multifunding_disconnect": 3.5, + "test_connection.py::test_multifunding_feerates[False]": 3.4, + "test_connection.py::test_multifunding_feerates[True]": 3.9, + "test_connection.py::test_multifunding_one": 4.8, + "test_connection.py::test_multifunding_param_failures": 3.5, + "test_connection.py::test_multifunding_simple": 5.3, + "test_connection.py::test_multifunding_v1_v2_mixed": 7.5, + "test_connection.py::test_multifunding_wumbo": 4.0, + "test_connection.py::test_multiple_channels": 8.5, + "test_connection.py::test_mutual_reconnect_race": 15.0, + "test_connection.py::test_networkevents": 233.5, + "test_connection.py::test_no_delay": 26.8, + "test_connection.py::test_no_fee_estimate": 17.2, + "test_connection.py::test_no_reconnect_awating_unilateral": 15.3, + "test_connection.py::test_nonstatic_channel": 5.7, + "test_connection.py::test_offline": 3.2, + "test_connection.py::test_old_feerate": 9.0, + "test_connection.py::test_onionmessage_forward_fail": 9.7, + "test_connection.py::test_onionmessage_reply_path_no_hops": 4.5, + "test_connection.py::test_onionmessage_reply_path_zero_scid": 3.0, + "test_connection.py::test_onionmessage_unknown_invoice_no_leak": 2.3, + "test_connection.py::test_open_channel_funding_above_max_supply": 2.4, + "test_connection.py::test_opener_feerate_reconnect": 7.2, + "test_connection.py::test_opener_simple_reconnect": 6.9, + "test_connection.py::test_opening_tiny_channel[False]": 15.8, + "test_connection.py::test_opening_tiny_channel[True]": 14.7, + "test_connection.py::test_parallel_opens": 13.1, + "test_connection.py::test_pay_disconnect_stress": 28.2, + "test_connection.py::test_peer_disconnected_has_featurebits": 5.9, + "test_connection.py::test_peer_disconnected_reflected_in_channel_state": 5.2, + "test_connection.py::test_peer_reuses_htlc_id": 8.9, + "test_connection.py::test_peerinfo": 8.5, + "test_connection.py::test_ping_timeout": 107.3, + "test_connection.py::test_private_channel": 10.0, + "test_connection.py::test_private_channel_no_reconnect": 10.4, + "test_connection.py::test_quiescence": 9.8, + "test_connection.py::test_reconnect_channel_peers": 6.8, + "test_connection.py::test_reconnect_no_additional_transient_failure": 11.3, + "test_connection.py::test_reconnect_no_update": 7.2, + "test_connection.py::test_reconnect_normal": 10.1, + "test_connection.py::test_reconnect_receiver_add": 22.6, + "test_connection.py::test_reconnect_receiver_fulfill": 72.5, + "test_connection.py::test_reconnect_remote_sends_no_sigs": 12.4, + "test_connection.py::test_reconnect_sender_add": 26.0, + "test_connection.py::test_reconnect_sender_add1": 11.2, + "test_connection.py::test_reconnect_signed": 4.8, + "test_connection.py::test_reestablish_zero_commitment_number": 4.4, + "test_connection.py::test_remote_addr": 9.0, + "test_connection.py::test_remote_addr_disabled": 9.3, + "test_connection.py::test_remote_addr_port": 10.3, + "test_connection.py::test_remote_disconnect": 7.9, + "test_connection.py::test_restart_multi_htlc_rexmit": 9.0, + "test_connection.py::test_second_channel": 6.4, + "test_connection.py::test_shutdown_awaiting_lockin": 6.8, + "test_connection.py::test_shutdown_reconnect": 8.3, + "test_connection.py::test_update_fee": 8.8, + "test_connection.py::test_update_fee_dynamic": 10.9, + "test_connection.py::test_update_fee_reconnect": 10.9, + "test_connection.py::test_websocket": 5.4, + "test_connection.py::test_wss_proxy": 11.8, + "test_connection.py::test_wumbo_channels": 10.2, + "test_currencyrate.py::test_apis": 2.9, + "test_currencyrate.py::test_bkpr_currency_dynamic": 5.8, + "test_currencyrate.py::test_bkpr_currencyrate_persisted": 6.9, + "test_currencyrate.py::test_bkpr_currencyrate_ranges": 7.7, + "test_currencyrate.py::test_bkpr_currencyrate_warns_for_old_events": 13.1, + "test_currencyrate.py::test_bkpr_listaccountevents_currencyrate": 5.8, + "test_currencyrate.py::test_bkpr_listaccountevents_realtime": 4.7, + "test_currencyrate.py::test_cached_median": 2.4, + "test_currencyrate.py::test_currencyrate_rounding": 2.4, + "test_currencyrate.py::test_currencyrate_source": 1.9, + "test_currencyrate.py::test_currencyrate_too_many_args": 2.1, + "test_currencyrate.py::test_currencyrate_unknown_source": 2.1, + "test_currencyrate.py::test_invalid_currency": 2.5, + "test_currencyrate.py::test_no_sources": 3.2, + "test_db.py::test_backfill_scriptpubkeys": 8.7, + "test_db.py::test_block_backfill": 18.3, + "test_db.py::test_channel_htlcs_id_change": 10.3, + "test_db.py::test_db_dangling_peer_fix": 5.7, + "test_db.py::test_db_forward_migrate": 4.2, + "test_db.py::test_db_sanity_checks": 2.3, + "test_db.py::test_last_tx_inflight_psbt_upgrade": 2.1, + "test_db.py::test_last_tx_psbt_upgrade": 3.8, + "test_db.py::test_local_basepoints_cache": 6.3, + "test_db.py::test_max_channel_id": 9.3, + "test_db.py::test_optimistic_locking": 2.7, + "test_db.py::test_our_tables_backfill_upgrade": 4.4, + "test_db.py::test_scid_upgrade": 2.0, + "test_db.py::test_sqlite3_builtin_backup": 4.5, + "test_db.py::test_sqlite_strict_mode": 2.6, + "test_db.py::test_strict_mode_with_old_database": 3.1, + "test_downgrade.py::test_downgrade": 7.2, + "test_downgrade.py::test_downgrade_bias": 6.8, + "test_gossip.py::test_addgossip": 6.6, + "test_gossip.py::test_announce_address": 6.1, + "test_gossip.py::test_announce_and_connect_via_dns": 9.8, + "test_gossip.py::test_announce_dns_suppressed": 7.9, + "test_gossip.py::test_announce_dns_without_port": 2.0, + "test_gossip.py::test_close_72_block_delay": 19.9, + "test_gossip.py::test_connect_by_gossip": 6.7, + "test_gossip.py::test_dump_own_gossip": 20.1, + "test_gossip.py::test_generate_gossip_store": 2.3, + "test_gossip.py::test_getroute_exclude": 25.0, + "test_gossip.py::test_getroute_exclude_duplicate": 6.3, + "test_gossip.py::test_gossip_addresses": 5.2, + "test_gossip.py::test_gossip_announce_invalid_block": 36.1, + "test_gossip.py::test_gossip_announce_unknown_block": 35.9, + "test_gossip.py::test_gossip_badsig": 10.6, + "test_gossip.py::test_gossip_cpu_throttle_only_queries": 2.4, + "test_gossip.py::test_gossip_disable_channels": 5.8, + "test_gossip.py::test_gossip_dying_when_compact": 9.9, + "test_gossip.py::test_gossip_force_broadcast_channel_msgs": 96.9, + "test_gossip.py::test_gossip_jsonrpc": 5.5, + "test_gossip.py::test_gossip_no_backtalk": 7.6, + "test_gossip.py::test_gossip_no_empty_announcements": 25.1, + "test_gossip.py::test_gossip_not_dying": 15.7, + "test_gossip.py::test_gossip_notices_close": 12.1, + "test_gossip.py::test_gossip_persistence": 14.8, + "test_gossip.py::test_gossip_pruning": 242.3, + "test_gossip.py::test_gossip_query_channel_range": 100.2, + "test_gossip.py::test_gossip_query_channel_range_cpu_throttle": 25.8, + "test_gossip.py::test_gossip_seeker_autoconnect": 62.9, + "test_gossip.py::test_gossip_store_compact": 12.2, + "test_gossip.py::test_gossip_store_compact_miss_update": 11.6, + "test_gossip.py::test_gossip_store_compact_restart": 12.5, + "test_gossip.py::test_gossip_store_compact_while_extending": 20.7, + "test_gossip.py::test_gossip_store_corrupt": 12.3, + "test_gossip.py::test_gossip_store_load": 2.1, + "test_gossip.py::test_gossip_store_load_amount_truncated": 3.2, + "test_gossip.py::test_gossip_store_load_announce_before_update": 2.7, + "test_gossip.py::test_gossip_store_load_complex": 12.0, + "test_gossip.py::test_gossip_store_load_no_channel_update": 2.5, + "test_gossip.py::test_gossip_store_load_uncompacted": 12.9, + "test_gossip.py::test_gossip_store_v10_upgrade": 2.8, + "test_gossip.py::test_gossip_throttle": 23.0, + "test_gossip.py::test_gossip_timestamp_filter": 51.8, + "test_gossip.py::test_gossip_weirdalias": 5.3, + "test_gossip.py::test_gossipwith": 19.9, + "test_gossip.py::test_gossmap_lost_node": 16.7, + "test_gossip.py::test_incoming_unreasonable": 16.0, + "test_gossip.py::test_node_reannounce": 45.6, + "test_gossip.py::test_only_announce_one_dns": 1.0, + "test_gossip.py::test_parms_listforwards": 4.9, + "test_gossip.py::test_query_short_channel_id": 39.0, + "test_gossip.py::test_report_routing_failure": 16.2, + "test_gossip.py::test_routetool": 6.2, + "test_gossip.py::test_routing_gossip": 13.9, + "test_gossip.py::test_routing_gossip_reconnect": 8.0, + "test_gossip.py::test_seeker_first_peer": 22.7, + "test_gossip.py::test_static_tor_onions": 0.7, + "test_gossip.py::test_topology_leak": 9.4, + "test_gossip.py::test_tor_port_onions": 0.8, + "test_invoices.py::test_amountless_invoice": 4.2, + "test_invoices.py::test_createinvoice_expiry_too_large": 2.5, + "test_invoices.py::test_decode_unknown": 2.4, + "test_invoices.py::test_expiry_startup_crash": 4.6, + "test_invoices.py::test_invoice": 2.1, + "test_invoices.py::test_invoice_botched_migration": 2.0, + "test_invoices.py::test_invoice_deschash": 4.3, + "test_invoices.py::test_invoice_expiry": 13.5, + "test_invoices.py::test_invoice_expiry_too_large": 1.9, + "test_invoices.py::test_invoice_maxdesc": 5.0, + "test_invoices.py::test_invoice_preimage": 6.4, + "test_invoices.py::test_invoice_routeboost": 9.5, + "test_invoices.py::test_invoice_routeboost_private": 19.9, + "test_invoices.py::test_invoice_weirdstring": 2.3, + "test_invoices.py::test_invoice_zeroval": 2.0, + "test_invoices.py::test_invoices_wait_db_migration": 1.4, + "test_invoices.py::test_listinvoices_filter": 2.6, + "test_invoices.py::test_listinvoices_index": 5.4, + "test_invoices.py::test_offer_fronting": 17.9, + "test_invoices.py::test_onchain_invoice_delinvoice_during_payment_hook": 0.6, + "test_invoices.py::test_payment_fronting": 16.8, + "test_invoices.py::test_signinvoice": 4.5, + "test_invoices.py::test_unified_invoices": 5.5, + "test_invoices.py::test_unified_invoices_any_amount": 4.3, + "test_invoices.py::test_wait_invoices": 7.5, + "test_invoices.py::test_waitanyinvoice": 6.4, + "test_invoices.py::test_waitanyinvoice_reversed": 3.8, + "test_invoices.py::test_waitinvoice": 7.7, + "test_lsps2_oracles.py::test_lsps2_oracles_amount": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_balance": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_buy_params": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_extra_fee": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_forward_status": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_honest_run": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_invoice": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_robustness": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_route_hint": 0.0, + "test_lsps2_oracles.py::test_lsps2_oracles_zero_conf_channel": 0.0, + "test_misc.py::test_address": 3.6, + "test_misc.py::test_bad_onion": 14.5, + "test_misc.py::test_bad_onion_immediate_peer": 4.7, + "test_misc.py::test_badparam_discretion": 1.5, + "test_misc.py::test_bitcoin_failure": 3.5, + "test_misc.py::test_bitcoin_ibd": 2.7, + "test_misc.py::test_bitcoin_pruned": 18.7, + "test_misc.py::test_bitcoind_fail_first": 1.3, + "test_misc.py::test_bitcoind_feerate_floor[False]": 3.3, + "test_misc.py::test_bitcoind_feerate_floor[True]": 3.4, + "test_misc.py::test_bitcoind_goes_backwards": 14.9, + "test_misc.py::test_blockchaintrack": 5.7, + "test_misc.py::test_bolt12_invoice_decode": 2.1, + "test_misc.py::test_check_command": 2.4, + "test_misc.py::test_checkmessage_pubkey_not_found": 2.1, + "test_misc.py::test_cli": 2.3, + "test_misc.py::test_cli_commando": 2.3, + "test_misc.py::test_cli_multiline_help": 2.1, + "test_misc.py::test_cli_no_argument": 0.0, + "test_misc.py::test_commitfee_option": 2.9, + "test_misc.py::test_config_in_subdir": 4.5, + "test_misc.py::test_config_whitespace": 2.5, + "test_misc.py::test_configfile_before_chdir": 3.0, + "test_misc.py::test_crashlog": 1.5, + "test_misc.py::test_custommsg_triggers_notification": 3.2, + "test_misc.py::test_daemon_option": 1.5, + "test_misc.py::test_datastore": 2.6, + "test_misc.py::test_datastore_escapeing": 2.1, + "test_misc.py::test_datastore_keylist": 2.4, + "test_misc.py::test_datastoreusage": 2.1, + "test_misc.py::test_db_upgrade": 3.0, + "test_misc.py::test_decode": 2.6, + "test_misc.py::test_dev_demux": 1.8, + "test_misc.py::test_dev_force_bip32_seed": 2.4, + "test_misc.py::test_emergencyrecover": 6.2, + "test_misc.py::test_emergencyrecover_old_format_handling": 1.4, + "test_misc.py::test_emergencyrecoverpenaltytxn": 9.5, + "test_misc.py::test_even_sendcustommsg": 2.1, + "test_misc.py::test_fast_shutdown": 1.1, + "test_misc.py::test_feerate_arg": 2.1, + "test_misc.py::test_feerate_ceiling": 3.0, + "test_misc.py::test_feerates[False]": 6.3, + "test_misc.py::test_feerates[True]": 6.1, + "test_misc.py::test_field_filter": 2.1, + "test_misc.py::test_filter_with_invalid_json": 1.4, + "test_misc.py::test_force_feerates": 3.0, + "test_misc.py::test_funding_reorg_get_upset": 5.7, + "test_misc.py::test_funding_reorg_private": 8.7, + "test_misc.py::test_funding_reorg_remote_lags": 11.6, + "test_misc.py::test_getemergencyrecoverdata": 2.4, + "test_misc.py::test_getlog": 2.2, + "test_misc.py::test_getlog_no_io": 2.2, + "test_misc.py::test_graceful_htlc": 9.6, + "test_misc.py::test_graceful_idle_peer": 4.4, + "test_misc.py::test_graceful_no_peers": 2.0, + "test_misc.py::test_hsm_capabilities": 2.5, + "test_misc.py::test_htlc_in_timeout": 9.9, + "test_misc.py::test_htlc_out_timeout": 13.9, + "test_misc.py::test_htlc_sig_persistence": 7.1, + "test_misc.py::test_include": 2.7, + "test_misc.py::test_io_logging": 4.6, + "test_misc.py::test_ipv4_and_ipv6": 2.5, + "test_misc.py::test_json_error": 2.2, + "test_misc.py::test_lightningd_still_loading": 27.3, + "test_misc.py::test_list_features_only": 1.0, + "test_misc.py::test_listaddresses": 2.2, + "test_misc.py::test_listconfigs": 2.9, + "test_misc.py::test_listconfigs_plugins": 2.4, + "test_misc.py::test_listforwards_ancient": 8.8, + "test_misc.py::test_listforwards_and_listhtlcs": 18.4, + "test_misc.py::test_listforwards_wait": 10.1, + "test_misc.py::test_listfunds": 4.3, + "test_misc.py::test_listhtlcs_wait": 9.5, + "test_misc.py::test_listtransactions": 5.4, + "test_misc.py::test_log_filter": 5.1, + "test_misc.py::test_log_filter_bug": 2.4, + "test_misc.py::test_logging": 2.7, + "test_misc.py::test_long_logs": 2.5, + "test_misc.py::test_low_fd_limit": 6.0, + "test_misc.py::test_makesecret": 2.5, + "test_misc.py::test_malformed_rpc": 2.3, + "test_misc.py::test_multiplexed_rpc": 3.4, + "test_misc.py::test_multirpc": 2.5, + "test_misc.py::test_names[False]": 3.1, + "test_misc.py::test_names[True]": 3.1, + "test_misc.py::test_new_node_is_mainnet": 1.1, + "test_misc.py::test_newaddr": 2.5, + "test_misc.py::test_notimestamp_logging": 2.3, + "test_misc.py::test_p2tr_funding": 4.7, + "test_misc.py::test_ping": 4.4, + "test_misc.py::test_preapprove[False]": 4.8, + "test_misc.py::test_preapprove[True]": 4.4, + "test_misc.py::test_preapprove_use[False]": 4.4, + "test_misc.py::test_preapprove_use[True]": 4.2, + "test_misc.py::test_recover[False]": 3.5, + "test_misc.py::test_recover[True]": 3.4, + "test_misc.py::test_recover_command[False]": 13.6, + "test_misc.py::test_recover_command[True]": 13.4, + "test_misc.py::test_recover_plugin": 9.9, + "test_misc.py::test_recoverchannel": 2.3, + "test_misc.py::test_recoverchannel_closed_sibling": 8.3, + "test_misc.py::test_relative_config_dir": 1.2, + "test_misc.py::test_rescan": 7.3, + "test_misc.py::test_reserve_enforcement": 5.6, + "test_misc.py::test_restorefrompeer": 7.9, + "test_misc.py::test_sendcustommsg": 5.0, + "test_misc.py::test_set_feerate_offset": 5.1, + "test_misc.py::test_setconfig": 10.3, + "test_misc.py::test_setconfig_access": 3.3, + "test_misc.py::test_setconfig_access_explicit_conf": 2.2, + "test_misc.py::test_setconfig_changed": 2.1, + "test_misc.py::test_setconfig_dynamic_multi_option": 2.8, + "test_misc.py::test_signmessage": 7.2, + "test_misc.py::test_signmessagewithkey": 2.4, + "test_misc.py::test_staticbackup": 6.2, + "test_misc.py::test_torv2_in_db": 6.6, + "test_misc.py::test_tracing": 1.5, + "test_misc.py::test_tracing_socket": 6.3, + "test_misc.py::test_unicode_rpc": 2.5, + "test_misc.py::test_unix_socket_path_length": 1.2, + "test_misc.py::test_valid_json_cli": 2.2, + "test_misc.py::test_version_reexec": 10.1, + "test_misc.py::test_waitblockheight": 5.5, + "test_misc.py::test_withdraw_misc": 9.7, + "test_misc.py::test_zero_locktime_blocks": 10.4, + "test_mkfunding.py::test_mkfunding_bad_cantaffordfee": 0.0, + "test_mkfunding.py::test_mkfunding_bad_input_amount": 0.0, + "test_mkfunding.py::test_mkfunding_bad_input_privkey": 0.0, + "test_mkfunding.py::test_mkfunding_bad_input_txid": 0.0, + "test_mkfunding.py::test_mkfunding_bad_local_funding_privkey": 0.0, + "test_mkfunding.py::test_mkfunding_bad_privkeys": 0.0, + "test_mkfunding.py::test_mkfunding_bad_remote_funding_privkey": 0.0, + "test_mkfunding.py::test_mkfunding_bad_usage": 0.0, + "test_mkfunding.py::test_mkfunding_good_noabort": 0.0, + "test_onion.py::test_onion": 0.1, + "test_onion.py::test_rendezvous_onion": 0.1, + "test_opening.py::test_anchor_min_emergency": 9.2, + "test_opening.py::test_buy_liquidity_ad_no_v2": 3.4, + "test_opening.py::test_coinbase_unspendable": 6.4, + "test_opening.py::test_commitment_feerate[False]": 4.9, + "test_opening.py::test_commitment_feerate[True]": 4.2, + "test_opening.py::test_duplicate_channel_id_in_db": 5.5, + "test_opening.py::test_fundchannel_utxo_too_small": 3.2, + "test_opening.py::test_funder_contribution_limits": 7.7, + "test_opening.py::test_multifunding_all_amount": 4.5, + "test_opening.py::test_multifunding_v2_best_effort": 11.3, + "test_opening.py::test_no_retransmit_confirmed_funding": 7.1, + "test_opening.py::test_opening_below_min_capacity_sat": 3.7, + "test_opening.py::test_opening_crash": 5.0, + "test_opening.py::test_opening_explicit_channel_type": 5.3, + "test_opening.py::test_opening_incoming_unknown_feerates": 3.1, + "test_opening.py::test_scid_alias_private": 7.9, + "test_opening.py::test_sendpsbt_crash": 5.4, + "test_opening.py::test_zero_length_upfront_shutdown_script": 7.5, + "test_opening.py::test_zeroconf_forget[False]": 8.3, + "test_opening.py::test_zeroconf_forget[True]": 13.0, + "test_opening.py::test_zeroconf_forward": 6.3, + "test_opening.py::test_zeroconf_mindepth": 5.2, + "test_opening.py::test_zeroconf_multichan_forward": 9.7, + "test_opening.py::test_zeroconf_open": 8.0, + "test_opening.py::test_zeroconf_public": 11.1, + "test_opening.py::test_zeroconf_refusal": 3.0, + "test_opening.py::test_zeroconf_withhold[False-False]": 5.9, + "test_opening.py::test_zeroconf_withhold[False-True]": 7.6, + "test_opening.py::test_zeroconf_withhold[True-False]": 6.3, + "test_opening.py::test_zeroconf_withhold[True-True]": 6.3, + "test_opening.py::test_zeroconf_withhold_htlc_failback": 8.3, + "test_opening.py::test_zeroreserve": 6.6, + "test_opening.py::test_zeroreserve_alldust": 3.3, + "test_opening.py::test_zeroreserve_mixed": 4.7, + "test_p2tr_change_dust.py::test_p2tr_change_dust_limit": 3.2, + "test_pay.py::test_blinded_forward_policy": 10.4, + "test_pay.py::test_blinded_path_max": 7.4, + "test_pay.py::test_blinded_reply_path_scid[False]": 5.5, + "test_pay.py::test_blinded_reply_path_scid[True]": 5.7, + "test_pay.py::test_blindedpath_noaddr": 11.4, + "test_pay.py::test_blindedpath_privchan[False]": 9.2, + "test_pay.py::test_blindedpath_privchan[True]": 10.6, + "test_pay.py::test_bolt11_null_after_pay[False]": 3.7, + "test_pay.py::test_bolt11_null_after_pay[True]": 3.5, + "test_pay.py::test_cancel_recurrence": 4.6, + "test_pay.py::test_channel_receivable": 7.0, + "test_pay.py::test_channel_spendable[False]": 5.6, + "test_pay.py::test_channel_spendable[True]": 6.0, + "test_pay.py::test_channel_spendable_large": 6.7, + "test_pay.py::test_channel_spendable_receivable_capped": 4.1, + "test_pay.py::test_createonion_limits": 1.9, + "test_pay.py::test_createonion_rpc": 2.4, + "test_pay.py::test_createproof": 7.7, + "test_pay.py::test_createproof_include": 8.4, + "test_pay.py::test_createproof_note": 7.4, + "test_pay.py::test_decode": 2.4, + "test_pay.py::test_decode_expired_bolt12": 1.9, + "test_pay.py::test_decryptencrypteddata": 8.5, + "test_pay.py::test_delpay_argument_invalid[False]": 6.5, + "test_pay.py::test_delpay_argument_invalid[True]": 6.3, + "test_pay.py::test_delpay_mixed_status[False]": 12.7, + "test_pay.py::test_delpay_mixed_status[True]": 14.0, + "test_pay.py::test_delpay_works[False]": 13.9, + "test_pay.py::test_delpay_works[True]": 13.7, + "test_pay.py::test_dev_rawrequest": 2.2, + "test_pay.py::test_enableoffer": 4.3, + "test_pay.py::test_error_returns_blockheight": 4.4, + "test_pay.py::test_excluded_adjacent_routehint[False]": 4.2, + "test_pay.py::test_excluded_adjacent_routehint[True]": 5.4, + "test_pay.py::test_failinfo_per_groupid": 5.3, + "test_pay.py::test_fetch_no_description_offer": 4.2, + "test_pay.py::test_fetch_no_description_with_amount": 4.3, + "test_pay.py::test_fetchinvoice": 16.4, + "test_pay.py::test_fetchinvoice_3hop": 13.7, + "test_pay.py::test_fetchinvoice_autoconnect": 12.0, + "test_pay.py::test_fetchinvoice_autoconnect_if_disconnected": 7.3, + "test_pay.py::test_fetchinvoice_disconnected_reply": 7.9, + "test_pay.py::test_fetchinvoice_invoice_expiry": 4.4, + "test_pay.py::test_fetchinvoice_recurrence": 24.0, + "test_pay.py::test_fetchinvoice_with_no_quantity": 6.3, + "test_pay.py::test_fetchinvoice_with_payer_metadata": 7.3, + "test_pay.py::test_forward": 7.5, + "test_pay.py::test_forward_different_fees_and_cltv": 10.4, + "test_pay.py::test_forward_local_failed_peer_cannot_afford_fee": 6.8, + "test_pay.py::test_forward_local_failed_reason": 9.5, + "test_pay.py::test_forward_local_failed_stats": 23.3, + "test_pay.py::test_forward_pad_fees_and_cltv": 10.5, + "test_pay.py::test_forward_stats": 10.6, + "test_pay.py::test_htlc_set_part_during_invoice_hook": 6.1, + "test_pay.py::test_htlc_tlv_crash": 37.5, + "test_pay.py::test_htlc_too_dusty_incoming": 8.4, + "test_pay.py::test_htlc_too_dusty_outgoing": 4.2, + "test_pay.py::test_htlcs_cltv_only_difference": 16.2, + "test_pay.py::test_injectpaymentonion_3hop": 6.8, + "test_pay.py::test_injectpaymentonion_blindedpath": 10.3, + "test_pay.py::test_injectpaymentonion_failures": 6.4, + "test_pay.py::test_injectpaymentonion_mpp": 3.9, + "test_pay.py::test_injectpaymentonion_peerfail": 4.6, + "test_pay.py::test_injectpaymentonion_selfpay": 4.1, + "test_pay.py::test_injectpaymentonion_simple": 4.5, + "test_pay.py::test_invalid_onion_channel_update[False]": 8.2, + "test_pay.py::test_invalid_onion_channel_update[True]": 8.7, + "test_pay.py::test_invoice_amount_override": 3.6, + "test_pay.py::test_invoice_pay_desc_with_quotes[False]": 3.9, + "test_pay.py::test_invoice_pay_desc_with_quotes[True]": 4.2, + "test_pay.py::test_keysend[keysend]": 13.4, + "test_pay.py::test_keysend[xkeysend]": 14.3, + "test_pay.py::test_keysend_description_size_limit[keysend]": 6.5, + "test_pay.py::test_keysend_description_size_limit[xkeysend]": 6.4, + "test_pay.py::test_keysend_maxfee[keysend]": 7.5, + "test_pay.py::test_keysend_maxfee[xkeysend]": 7.2, + "test_pay.py::test_keysend_routehint": 8.2, + "test_pay.py::test_keysend_strip_tlvs[keysend]": 5.7, + "test_pay.py::test_keysend_strip_tlvs[xkeysend]": 7.2, + "test_pay.py::test_listpay_result_with_paymod[keysend]": 7.2, + "test_pay.py::test_listpay_result_with_paymod[xkeysend]": 7.3, + "test_pay.py::test_listpays_with_filter_by_status[False]": 6.7, + "test_pay.py::test_listpays_with_filter_by_status[True]": 5.5, + "test_pay.py::test_listsendpays_and_listpays_order[False]": 4.3, + "test_pay.py::test_listsendpays_and_listpays_order[True]": 4.4, + "test_pay.py::test_listsendpays_crash": 2.1, + "test_pay.py::test_mpp_adaptive[False]": 14.5, + "test_pay.py::test_mpp_adaptive[True]": 14.8, + "test_pay.py::test_mpp_overload_payee[False]": 16.2, + "test_pay.py::test_mpp_overload_payee[True]": 16.9, + "test_pay.py::test_mpp_waitblockheight_routehint_conflict[False]": 8.2, + "test_pay.py::test_mpp_waitblockheight_routehint_conflict[True]": 10.9, + "test_pay.py::test_offer": 2.3, + "test_pay.py::test_offer_currency_no_amount": 1.9, + "test_pay.py::test_offer_deprecated_api": 3.8, + "test_pay.py::test_offer_experimental_fields": 4.2, + "test_pay.py::test_offer_path_self": 9.3, + "test_pay.py::test_offer_paths": 17.7, + "test_pay.py::test_offer_selfpay": 2.1, + "test_pay.py::test_offer_with_private_channels_multyhop2": 16.8, + "test_pay.py::test_onionmessage_ratelimit": 12.5, + "test_pay.py::test_parallel_channels_reserve": 7.3, + "test_pay.py::test_partial_payment": 15.4, + "test_pay.py::test_partial_payment_htlc_loss": 8.7, + "test_pay.py::test_partial_payment_restart": 7.9, + "test_pay.py::test_partial_payment_timeout": 73.8, + "test_pay.py::test_pay0": 4.3, + "test_pay.py::test_pay[False]": 4.6, + "test_pay.py::test_pay[True]": 4.4, + "test_pay.py::test_pay_amounts[False]": 3.8, + "test_pay.py::test_pay_amounts[True]": 3.7, + "test_pay.py::test_pay_avoid_low_fee_chan": 14.0, + "test_pay.py::test_pay_blockheight_mismatch[False]": 10.9, + "test_pay.py::test_pay_blockheight_mismatch[True]": 10.2, + "test_pay.py::test_pay_bolt11_metadata": 4.1, + "test_pay.py::test_pay_disconnect": 8.2, + "test_pay.py::test_pay_error_update_fees": 8.4, + "test_pay.py::test_pay_exclude_node": 15.7, + "test_pay.py::test_pay_exemptfee[False]": 7.2, + "test_pay.py::test_pay_exemptfee[True]": 7.2, + "test_pay.py::test_pay_fail_unconfirmed_channel[False]": 3.7, + "test_pay.py::test_pay_fail_unconfirmed_channel[True]": 3.8, + "test_pay.py::test_pay_invstring[False]": 3.8, + "test_pay.py::test_pay_invstring[True]": 4.4, + "test_pay.py::test_pay_limits": 7.5, + "test_pay.py::test_pay_manual_exclude": 7.3, + "test_pay.py::test_pay_maxdelay_direct_channel": 6.3, + "test_pay.py::test_pay_maxfee_shadow[False]": 8.0, + "test_pay.py::test_pay_maxfee_shadow[True]": 8.1, + "test_pay.py::test_pay_middle_fail": 10.4, + "test_pay.py::test_pay_multichannel_use_zeroconf[False]": 5.1, + "test_pay.py::test_pay_multichannel_use_zeroconf[True]": 5.1, + "test_pay.py::test_pay_no_secret": 6.5, + "test_pay.py::test_pay_optional_args[False]": 3.7, + "test_pay.py::test_pay_optional_args[True]": 3.6, + "test_pay.py::test_pay_partial_msat": 73.6, + "test_pay.py::test_pay_peer[False]": 9.8, + "test_pay.py::test_pay_peer[True]": 9.9, + "test_pay.py::test_pay_remember_hint[False]": 17.7, + "test_pay.py::test_pay_retry[False]": 13.9, + "test_pay.py::test_pay_retry[True]": 15.9, + "test_pay.py::test_pay_routeboost": 20.1, + "test_pay.py::test_pay_routehint_minhtlc[False]": 12.2, + "test_pay.py::test_pay_routehint_minhtlc[True]": 12.2, + "test_pay.py::test_pay_unannounced_routehint[False]": 7.2, + "test_pay.py::test_pay_unannounced_routehint[True]": 7.3, + "test_pay.py::test_pay_variants[False]": 4.3, + "test_pay.py::test_pay_variants[True]": 3.8, + "test_pay.py::test_pay_waitblockheight_timeout": 62.8, + "test_pay.py::test_pay_while_opening_channel[False]": 16.3, + "test_pay.py::test_pay_while_opening_channel[True]": 16.1, + "test_pay.py::test_payerkey[False]": 2.8, + "test_pay.py::test_payerkey[True]": 2.6, + "test_pay.py::test_payment_duplicate_uncommitted": 4.1, + "test_pay.py::test_payment_failed_persistence[False]": 18.3, + "test_pay.py::test_payment_failed_persistence[True]": 17.8, + "test_pay.py::test_payment_success_persistence[False]": 4.5, + "test_pay.py::test_payment_success_persistence[True]": 5.1, + "test_pay.py::test_recurrence_escaped_label": 4.2, + "test_pay.py::test_recurrence_expired_offer": 8.6, + "test_pay.py::test_recurring_currency_invoice_refresh": 8.7, + "test_pay.py::test_reject_invalid_payload[False]": 4.3, + "test_pay.py::test_reject_invalid_payload[True]": 4.2, + "test_pay.py::test_repay": 4.2, + "test_pay.py::test_retry_after_success_pending_straggler": 14.3, + "test_pay.py::test_routehint_tous": 9.3, + "test_pay.py::test_self_pay[False]": 5.4, + "test_pay.py::test_self_pay[True]": 5.4, + "test_pay.py::test_self_sendpay": 4.1, + "test_pay.py::test_sendinvoice": 5.4, + "test_pay.py::test_sendinvoice_blindedpath": 9.8, + "test_pay.py::test_sendonion_rpc": 14.5, + "test_pay.py::test_sendonion_sendpay": 7.6, + "test_pay.py::test_sendpay": 4.8, + "test_pay.py::test_sendpay_cant_afford[False]": 4.2, + "test_pay.py::test_sendpay_cant_afford[True]": 4.3, + "test_pay.py::test_sendpay_grouping": 9.4, + "test_pay.py::test_sendpay_msatoshi_arg": 3.8, + "test_pay.py::test_sendpay_onion_overflow": 4.5, + "test_pay.py::test_sendpays_wait": 4.7, + "test_pay.py::test_setchannel_all": 6.7, + "test_pay.py::test_setchannel_enforcement_delay": 12.5, + "test_pay.py::test_setchannel_restart[False]": 8.5, + "test_pay.py::test_setchannel_restart[True]": 8.1, + "test_pay.py::test_setchannel_routing": 7.5, + "test_pay.py::test_setchannel_startup_opts": 6.3, + "test_pay.py::test_setchannel_state": 8.5, + "test_pay.py::test_setchannel_usage": 6.4, + "test_pay.py::test_setchannel_zero[False]": 8.5, + "test_pay.py::test_setchannel_zero[True]": 9.3, + "test_pay.py::test_shadow_routing": 8.3, + "test_pay.py::test_strip_lightning_suffix_from_inv[False]": 3.7, + "test_pay.py::test_strip_lightning_suffix_from_inv[True]": 3.7, + "test_pay.py::test_unreachable_routehint": 13.0, + "test_pay.py::test_wait_sendpay": 3.8, + "test_pay.py::test_xkeysend_layer": 9.4, + "test_plugin.py::test_all_subscription": 3.6, + "test_plugin.py::test_async_rpcmethod": 4.1, + "test_plugin.py::test_autoclean": 41.4, + "test_plugin.py::test_autoclean_batch": 9.4, + "test_plugin.py::test_autoclean_once": 13.7, + "test_plugin.py::test_autoclean_timer_crash": 5.4, + "test_plugin.py::test_bcli": 3.1, + "test_plugin.py::test_bcli_concurrent": 6.9, + "test_plugin.py::test_bcli_getutxout_failure": 11.0, + "test_plugin.py::test_bcli_getutxout_failure_fundchannel_cancel": 5.8, + "test_plugin.py::test_bcli_retry_timeout": 5.5, + "test_plugin.py::test_bitcoin_backend": 3.6, + "test_plugin.py::test_bitcoin_backend_gianttx": 9.6, + "test_plugin.py::test_bitcoin_bad_estimatefee": 3.3, + "test_plugin.py::test_block_added_notifications": 5.0, + "test_plugin.py::test_bwatch_add_watch_creates_datastore_entry": 1.3, + "test_plugin.py::test_bwatch_block_history_rollback": 2.8, + "test_plugin.py::test_bwatch_blockdepth_watch_creates_datastore_entry": 1.6, + "test_plugin.py::test_bwatch_blockdepth_watch_fires_each_block": 2.0, + "test_plugin.py::test_bwatch_blockdepth_watch_multiple_owners": 1.6, + "test_plugin.py::test_bwatch_blockdepth_watch_no_fire_before_start_block": 2.8, + "test_plugin.py::test_bwatch_blockdepth_watch_persists_across_restart": 2.1, + "test_plugin.py::test_bwatch_blockdepth_watch_remove": 1.5, + "test_plugin.py::test_bwatch_listwatch": 1.8, + "test_plugin.py::test_bwatch_multiple_owners_same_watch": 1.4, + "test_plugin.py::test_bwatch_no_rescan_for_future_start_block": 2.0, + "test_plugin.py::test_bwatch_outpoint_watch": 0.9, + "test_plugin.py::test_bwatch_outpoint_watch_notifies_lightningd": 4.2, + "test_plugin.py::test_bwatch_remove_last_owner_deletes_watch": 1.5, + "test_plugin.py::test_bwatch_remove_one_owner_keeps_watch": 1.6, + "test_plugin.py::test_bwatch_reorg_1_block": 2.9, + "test_plugin.py::test_bwatch_reorg_2_blocks": 4.1, + "test_plugin.py::test_bwatch_reorg_at_startup": 2.8, + "test_plugin.py::test_bwatch_reorg_long_chain": 5.1, + "test_plugin.py::test_bwatch_rescan_notifies_lightningd": 3.1, + "test_plugin.py::test_bwatch_rescan_scriptpubkey": 1.8, + "test_plugin.py::test_bwatch_rescan_triggered_for_past_start_block": 1.5, + "test_plugin.py::test_bwatch_same_owner_adds_twice": 1.6, + "test_plugin.py::test_bwatch_scriptpubkey_watch": 1.8, + "test_plugin.py::test_bwatch_scriptpubkey_watch_notifies_lightningd": 1.9, + "test_plugin.py::test_bwatch_spk_watch_reorg_demotes_outputs": 3.2, + "test_plugin.py::test_bwatch_watches_persist_across_restart": 1.4, + "test_plugin.py::test_channel_opened_notification": 5.0, + "test_plugin.py::test_channel_state_change_history": 4.2, + "test_plugin.py::test_channel_state_changed_bilateral": 7.0, + "test_plugin.py::test_channel_state_changed_unilateral": 9.6, + "test_plugin.py::test_coin_movement_notices": 13.4, + "test_plugin.py::test_command_collision": 2.2, + "test_plugin.py::test_commando": 2.7, + "test_plugin.py::test_commando_stress": 85.5, + "test_plugin.py::test_db_hook": 1.6, + "test_plugin.py::test_db_hook_multiple": 1.4, + "test_plugin.py::test_dev_builtin_plugins_unimportant": 2.1, + "test_plugin.py::test_dynamic_args": 2.1, + "test_plugin.py::test_dynamic_args_options_array": 2.2, + "test_plugin.py::test_dynamic_option_python_plugin": 2.0, + "test_plugin.py::test_exposesecret[False]": 3.0, + "test_plugin.py::test_exposesecret[True]": 4.3, + "test_plugin.py::test_exposesecret_with_hsm_passphrase": 1.4, + "test_plugin.py::test_exposesecret_with_mnemonic_no_passphrase": 2.1, + "test_plugin.py::test_failing_plugins": 10.3, + "test_plugin.py::test_feature_set": 2.2, + "test_plugin.py::test_forward_event_notification": 16.8, + "test_plugin.py::test_hook_chaining": 4.7, + "test_plugin.py::test_hook_crash": 8.2, + "test_plugin.py::test_hook_dep": 6.6, + "test_plugin.py::test_hook_dep_stable": 5.4, + "test_plugin.py::test_hook_in_use": 14.1, + "test_plugin.py::test_htlc_accepted_hook_crash": 3.9, + "test_plugin.py::test_htlc_accepted_hook_customtlvs": 7.3, + "test_plugin.py::test_htlc_accepted_hook_direct_restart": 15.0, + "test_plugin.py::test_htlc_accepted_hook_direct_restart_blinded": 16.8, + "test_plugin.py::test_htlc_accepted_hook_fail": 7.6, + "test_plugin.py::test_htlc_accepted_hook_failmsg": 4.2, + "test_plugin.py::test_htlc_accepted_hook_failonion": 4.2, + "test_plugin.py::test_htlc_accepted_hook_forward_restart": 17.7, + "test_plugin.py::test_htlc_accepted_hook_fwdto": 8.3, + "test_plugin.py::test_htlc_accepted_hook_malformedtlvs": 7.0, + "test_plugin.py::test_htlc_accepted_hook_resolve": 7.4, + "test_plugin.py::test_htlc_accepted_hook_restart_after_force_close": 7.7, + "test_plugin.py::test_htlc_accepted_hook_restart_during_shutdown": 5.9, + "test_plugin.py::test_huge_log_entry": 2.2, + "test_plugin.py::test_important_plugin": 3.3, + "test_plugin.py::test_important_plugin_shutdown": 2.1, + "test_plugin.py::test_inline_plugin_wait_for_log_no_selfmatch": 6.0, + "test_plugin.py::test_invoice_creation_notification": 4.6, + "test_plugin.py::test_invoice_payment_hook": 5.6, + "test_plugin.py::test_invoice_payment_hook_hold": 8.9, + "test_plugin.py::test_invoice_payment_notification": 23.9, + "test_plugin.py::test_keysend_plugin": 4.0, + "test_plugin.py::test_libplugin": 3.8, + "test_plugin.py::test_libplugin_deprecated": 2.4, + "test_plugin.py::test_listchannels_broken_message": 2.4, + "test_plugin.py::test_millisatoshi_passthrough": 2.0, + "test_plugin.py::test_notify": 11.2, + "test_plugin.py::test_openchannel_hook": 4.2, + "test_plugin.py::test_openchannel_hook_chaining": 3.2, + "test_plugin.py::test_openchannel_hook_channel_type": 4.2, + "test_plugin.py::test_openchannel_hook_error_handling": 2.8, + "test_plugin.py::test_option_passthrough": 2.7, + "test_plugin.py::test_option_types": 4.0, + "test_plugin.py::test_pay_plugin": 3.1, + "test_plugin.py::test_pay_plugin_notifications": 8.3, + "test_plugin.py::test_peer_connected_remote_addr": 2.0, + "test_plugin.py::test_peer_storage": 19.1, + "test_plugin.py::test_peer_storage_refresh_three_peers": 6.4, + "test_plugin.py::test_plugin_command": 11.8, + "test_plugin.py::test_plugin_connect_notifications": 2.1, + "test_plugin.py::test_plugin_connected_hook_chaining": 2.1, + "test_plugin.py::test_plugin_connected_hook_disconnect_crash": 2.0, + "test_plugin.py::test_plugin_dir": 1.9, + "test_plugin.py::test_plugin_disable": 6.6, + "test_plugin.py::test_plugin_fail": 6.3, + "test_plugin.py::test_plugin_fail_on_startup": 32.9, + "test_plugin.py::test_plugin_feature_announce": 5.7, + "test_plugin.py::test_plugin_feature_remove": 2.1, + "test_plugin.py::test_plugin_hook": 24.6, + "test_plugin.py::test_plugin_nostart": 2.0, + "test_plugin.py::test_plugin_persist_option": 2.2, + "test_plugin.py::test_plugin_shutdown": 61.2, + "test_plugin.py::test_plugin_slowinit": 11.3, + "test_plugin.py::test_plugin_startdir_lol": 21.6, + "test_plugin.py::test_pyln_request_notify": 4.1, + "test_plugin.py::test_renepay_not_important": 2.2, + "test_plugin.py::test_replacement_payload": 6.3, + "test_plugin.py::test_restart_on_update": 1.0, + "test_plugin.py::test_rpc_command_hook": 2.2, + "test_plugin.py::test_rpc_passthrough": 2.2, + "test_plugin.py::test_self_disable": 2.3, + "test_plugin.py::test_sendpay_failure_status": 4.8, + "test_plugin.py::test_sendpay_notifications": 11.7, + "test_plugin.py::test_sendpay_notifications_nowaiter": 9.2, + "test_plugin.py::test_shutdown_peer_reconnect": 7.2, + "test_plugin.py::test_sql": 23.2, + "test_plugin.py::test_sql_crash": 23.1, + "test_plugin.py::test_sql_deprecated": 4.4, + "test_plugin.py::test_sql_during_change": 11.0, + "test_plugin.py::test_sql_limit_per_list": 9.5, + "test_plugin.py::test_sql_parallel": 5.0, + "test_plugin.py::test_utf8_passthrough": 2.1, + "test_plugin.py::test_warning_notification": 2.3, + "test_plugin.py::test_watchtower": 7.4, + "test_reckless.py::test_basic_help": 0.4, + "test_reckless.py::test_contextual_help": 1.4, + "test_reckless.py::test_disable_enable": 3.8, + "test_reckless.py::test_install": 1.8, + "test_reckless.py::test_local_dir_install": 3.2, + "test_reckless.py::test_poetry_install": 3.2, + "test_reckless.py::test_reckless_uv_install": 2.2, + "test_reckless.py::test_search": 0.9, + "test_reckless.py::test_search_partial_match": 1.1, + "test_reckless.py::test_sources": 1.8, + "test_reckless.py::test_tag_install": 3.2, + "test_renepay.py::test_amounts": 4.2, + "test_renepay.py::test_cltv_value": 8.0, + "test_renepay.py::test_concurrency": 8.3, + "test_renepay.py::test_description": 4.3, + "test_renepay.py::test_direction_matters": 7.3, + "test_renepay.py::test_errors": 22.9, + "test_renepay.py::test_fee_allocation": 8.8, + "test_renepay.py::test_fees": 17.7, + "test_renepay.py::test_hardmpp": 15.6, + "test_renepay.py::test_hardmpp2": 9.4, + "test_renepay.py::test_htlc_max": 15.4, + "test_renepay.py::test_htlcmax0": 14.1, + "test_renepay.py::test_limits": 14.7, + "test_renepay.py::test_local_htlcmax0": 9.2, + "test_renepay.py::test_mpp": 12.9, + "test_renepay.py::test_offer_selfpay": 2.0, + "test_renepay.py::test_offers": 9.6, + "test_renepay.py::test_pay": 4.3, + "test_renepay.py::test_privatechan": 15.1, + "test_renepay.py::test_self_pay": 7.3, + "test_renepay.py::test_shadow_routing": 10.7, + "test_renepay.py::test_simple": 4.2, + "test_renepay.py::test_unannounced": 5.1, + "test_restart.py::test_agressive_restart": 6.5, + "test_runes.py::test_badrune": 19.8, + "test_runes.py::test_blacklistrune": 2.7, + "test_runes.py::test_blacklistrune_out_of_range": 2.9, + "test_runes.py::test_checkrune": 2.2, + "test_runes.py::test_createrune": 13.7, + "test_runes.py::test_createrune_per_restriction": 4.2, + "test_runes.py::test_id_migration": 2.0, + "test_runes.py::test_invalid_restrictions": 2.1, + "test_runes.py::test_makesecret_rune_master_secret": 2.9, + "test_runes.py::test_missing_method_or_nodeid": 1.9, + "test_runes.py::test_nonnumeric_uniqueid": 2.2, + "test_runes.py::test_rune_bolt11_parse": 2.2, + "test_runes.py::test_rune_bolt12_parse": 4.4, + "test_runes.py::test_rune_error_messages": 2.4, + "test_runes.py::test_rune_method_missing": 2.3, + "test_runes.py::test_rune_pay_amount": 4.2, + "test_runes.py::test_showrune_id": 2.1, + "test_runes.py::test_showrunes[False]": 1.9, + "test_runes.py::test_showrunes[True]": 1.9, + "test_splice.py::test_easy_splice_in": 8.5, + "test_splice.py::test_easy_splice_out": 7.2, + "test_splice.py::test_easy_splice_out_into_channel": 8.1, + "test_splice.py::test_script_splice_in": 7.3, + "test_splice.py::test_script_splice_msat": 7.3, + "test_splice.py::test_script_splice_msat_roundup": 7.7, + "test_splice.py::test_script_splice_out": 8.5, + "test_splice.py::test_script_two_chan_splice_b": 5.3, + "test_splice.py::test_script_two_chan_splice_c": 5.6, + "test_splice.py::test_script_two_chan_splice_d": 5.4, + "test_splice.py::test_script_two_chan_splice_e": 5.8, + "test_splice.py::test_script_two_chan_splice_f": 5.2, + "test_splice.py::test_script_two_chan_splice_g": 5.9, + "test_splice.py::test_script_two_chan_splice_h": 5.8, + "test_splice.py::test_script_two_chan_splice_ii": 6.0, + "test_splice.py::test_script_two_chan_splice_in": 9.3, + "test_splice.py::test_script_two_chan_splice_inout": 8.4, + "test_splice.py::test_script_two_chan_splice_j": 5.6, + "test_splice.py::test_script_two_chan_splice_k": 5.8, + "test_splice.py::test_script_two_chan_splice_l": 7.3, + "test_splice.py::test_script_two_chan_splice_m": 5.3, + "test_splice.py::test_script_two_chan_splice_n": 5.9, + "test_splice.py::test_script_two_chan_splice_oo": 6.0, + "test_splice.py::test_script_two_chan_splice_out": 8.7, + "test_splice.py::test_script_two_chan_splice_p": 7.1, + "test_splice.py::test_script_two_chan_splice_q": 5.1, + "test_splice.py::test_script_two_chan_splice_r": 5.5, + "test_splice.py::test_script_two_chan_splice_s": 6.8, + "test_splice.py::test_script_two_chan_splice_t": 5.5, + "test_splice.py::test_script_two_chan_splice_u": 5.3, + "test_splice.py::test_script_two_chan_splice_v": 5.9, + "test_splice.py::test_script_two_chan_splice_x": 8.3, + "test_splice.py::test_script_two_chan_splice_y": 5.3, + "test_splice.py::test_script_two_chan_splice_z": 5.3, + "test_splice.py::test_splice_aggravated_close[False]": 8.2, + "test_splice.py::test_splice_aggravated_close[True]": 8.8, + "test_splicing.py::test_commit_crash_splice": 8.2, + "test_splicing.py::test_invalid_splice": 6.6, + "test_splicing.py::test_route_by_old_scid": 12.5, + "test_splicing.py::test_splice": 6.4, + "test_splicing.py::test_splice_abort_after_sigs_sent": 6.1, + "test_splicing.py::test_splice_candidate_spent_before_lock": 6.0, + "test_splicing.py::test_splice_feerate_too_high": 6.1, + "test_splicing.py::test_splice_gossip": 14.5, + "test_splicing.py::test_splice_listnodes": 7.4, + "test_splicing.py::test_splice_locked_then_force_close[accepter]": 8.2, + "test_splicing.py::test_splice_locked_then_force_close[initiator]": 8.4, + "test_splicing.py::test_splice_nosign": 25.3, + "test_splicing.py::test_splice_out": 6.2, + "test_splicing.py::test_splice_rbf": 6.1, + "test_splicing.py::test_splice_rbf_htlc_sigs": 8.2, + "test_splicing.py::test_splice_sent_sigs_flag": 25.2, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[-1-1000000]": 6.6, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[0-253]": 7.5, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[2000000-1000000]": 6.8, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[4294967295-1000000]": 6.6, + "test_splicing.py::test_splice_stuck_htlc": 9.6, + "test_splicing.py::test_splice_tx_add_output_sum_above_max_supply": 6.4, + "test_splicing.py::test_splice_unannounced": 6.6, + "test_splicing.py::test_splice_unconfirmed_force_close_publishes_current": 6.0, + "test_splicing.py::test_two_chan_splice_in": 9.2, + "test_splicing_disconnect.py::test_splice_disconnect_commit": 5.2, + "test_splicing_disconnect.py::test_splice_disconnect_sig": 5.8, + "test_splicing_disconnect.py::test_splice_funding_tx_index_increments": 6.2, + "test_splicing_disconnect.py::test_splice_inflight_funding_tx_index": 6.1, + "test_splicing_disconnect.py::test_splice_locked_one_side_no_channel_ready": 4.9, + "test_splicing_disconnect.py::test_splice_reconnect_after_lock_no_channel_ready": 5.8, + "test_splicing_disconnect.py::test_splice_upgrade_with_pending_splice": 6.4, + "test_splicing_insane.py::test_splice_insane_a": 8.5, + "test_splicing_insane.py::test_splice_insane_b": 7.9, + "test_splicing_insane.py::test_splice_insane_c": 8.1, + "test_splicing_insane.py::test_splice_insane_d": 8.9, + "test_splicing_insane.py::test_splice_insane_e": 8.0, + "test_splicing_insane.py::test_splice_insane_f": 8.5, + "test_wallet.py::test_addfunds_from_block": 4.1, + "test_wallet.py::test_addpsbt_unmodifiable": 3.3, + "test_wallet.py::test_addpsbtoutput": 2.1, + "test_wallet.py::test_bip86_address_type_validation": 2.1, + "test_wallet.py::test_bip86_deterministic_addresses": 2.8, + "test_wallet.py::test_bip86_full_bitcoin_integration": 4.2, + "test_wallet.py::test_bip86_index_boundaries": 2.6, + "test_wallet.py::test_bip86_listaddresses": 2.3, + "test_wallet.py::test_bip86_mnemonic_recovery": 4.9, + "test_wallet.py::test_bip86_newaddr_rpc": 2.1, + "test_wallet.py::test_bip86_psbt_integration": 4.2, + "test_wallet.py::test_bip86_vs_regular_p2tr": 2.2, + "test_wallet.py::test_fundchannel_listtransaction": 3.3, + "test_wallet.py::test_fundpsbt": 3.0, + "test_wallet.py::test_fundpsbt_feerates[bech32]": 7.6, + "test_wallet.py::test_fundpsbt_feerates[p2tr]": 7.1, + "test_wallet.py::test_hsm_wrong_passphrase_crash": 0.9, + "test_wallet.py::test_hsmtool_all_commands_work_with_mnemonic_formats[no_passphrase]": 0.7, + "test_wallet.py::test_hsmtool_all_commands_work_with_mnemonic_formats[with_passphrase]": 0.8, + "test_wallet.py::test_hsmtool_checkhsm_legacy_encrypted_with_mnemonic_no_passphrase": 2.0, + "test_wallet.py::test_hsmtool_checkhsm_legacy_encrypted_with_mnemonic_passphrase": 1.9, + "test_wallet.py::test_hsmtool_checkhsm_variants[correct_mnemonic_no_passphrase]": 0.8, + "test_wallet.py::test_hsmtool_checkhsm_variants[correct_mnemonic_with_passphrase]": 0.8, + "test_wallet.py::test_hsmtool_checkhsm_variants[wrong_mnemonic_should_fail]": 0.8, + "test_wallet.py::test_hsmtool_checkhsm_variants[wrong_passphrase_should_fail]": 0.6, + "test_wallet.py::test_hsmtool_deterministic_node_ids": 0.9, + "test_wallet.py::test_hsmtool_dump_descriptors": 4.2, + "test_wallet.py::test_hsmtool_generatehsm_file_exists_error": 0.8, + "test_wallet.py::test_hsmtool_generatehsm_variants[abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about--mnemonic without passphrase]": 2.4, + "test_wallet.py::test_hsmtool_generatehsm_variants[ritual idle hat sunny universe pluck key alpha wing cake have wedding-test_passphrase-mnemonic with passphrase]": 1.2, + "test_wallet.py::test_hsmtool_getnodeid": 2.4, + "test_wallet.py::test_hsmtool_secret_decryption": 1.8, + "test_wallet.py::test_minconf_withdraw": 3.2, + "test_wallet.py::test_multiwithdraw_simple": 4.5, + "test_wallet.py::test_old_htlcs_cleanup": 10.2, + "test_wallet.py::test_p2tr_deposit_withdrawal": 4.5, + "test_wallet.py::test_p2tr_deposit_withdrawal_with_bip86": 4.2, + "test_wallet.py::test_pending_payments_cleanup": 2.0, + "test_wallet.py::test_psbt_version": 3.1, + "test_wallet.py::test_repro_4258": 2.9, + "test_wallet.py::test_reserveinputs": 4.8, + "test_wallet.py::test_sendpsbt_confirm[False]": 4.2, + "test_wallet.py::test_sendpsbt_confirm[True]": 5.4, + "test_wallet.py::test_sign_and_send_psbt": 3.6, + "test_wallet.py::test_sign_external_psbt": 3.0, + "test_wallet.py::test_sign_signed_psbt": 3.4, + "test_wallet.py::test_txprepare": 3.1, + "test_wallet.py::test_txprepare_feerate": 9.6, + "test_wallet.py::test_txprepare_multi": 3.5, + "test_wallet.py::test_txsend": 4.3, + "test_wallet.py::test_unspend_during_reorg": 14.9, + "test_wallet.py::test_upgradewallet": 6.0, + "test_wallet.py::test_utxopsbt": 3.3, + "test_wallet.py::test_withdraw": 8.2, + "test_wallet.py::test_withdraw_bech32m": 11.8, + "test_wallet.py::test_withdraw_close_output_signed": 9.4, + "test_wallet.py::test_withdraw_nlocktime": 4.1, + "test_wallet.py::test_withdraw_nlocktime_fuzz": 4.1, + "test_wallet.py::test_withdraw_returns_signed_tx": 3.0, + "test_wallet.py::test_withdraw_unreserves_inputs_on_send_failure": 3.0, + "test_wallet.py::test_withdraw_unreserves_on_broadcast_failure": 4.3, + "test_xpay.py::test_attempt_notifications": 9.4, + "test_xpay.py::test_blinded_path_fees": 6.6, + "test_xpay.py::test_error_messages": 7.9, + "test_xpay.py::test_fail_after_success[False]": 15.5, + "test_xpay.py::test_fail_after_success[True]": 12.9, + "test_xpay.py::test_pay_fakenet": 64.4, + "test_xpay.py::test_sendamount": 17.7, + "test_xpay.py::test_sendamount_bip353": 5.4, + "test_xpay.py::test_sendamount_maxparts": 16.0, + "test_xpay.py::test_xpay_bip353": 4.8, + "test_xpay.py::test_xpay_blockheight_mismatch": 9.6, + "test_xpay.py::test_xpay_bolt12_no_mpp": 13.9, + "test_xpay.py::test_xpay_circular_routehint": 3.9, + "test_xpay.py::test_xpay_currency_offer": 6.2, + "test_xpay.py::test_xpay_error_update_fees": 9.7, + "test_xpay.py::test_xpay_error_update_wrong_channel": 13.8, + "test_xpay.py::test_xpay_failing_node_nonfinal": 17.6, + "test_xpay.py::test_xpay_failing_node_tolerance": 19.5, + "test_xpay.py::test_xpay_fee_insufficient_bias": 15.4, + "test_xpay.py::test_xpay_fee_insufficient_disable": 15.6, + "test_xpay.py::test_xpay_get_error_with_update": 17.5, + "test_xpay.py::test_xpay_informs_askrene_on_success": 6.0, + "test_xpay.py::test_xpay_limited_max_accepted_htlcs": 16.0, + "test_xpay.py::test_xpay_maxdelay": 6.7, + "test_xpay.py::test_xpay_maxhops": 20.5, + "test_xpay.py::test_xpay_maxhops_bolt11": 39.8, + "test_xpay.py::test_xpay_maxparts": 22.9, + "test_xpay.py::test_xpay_maxparts_bip353": 8.4, + "test_xpay.py::test_xpay_maxparts_no_mpp_bolt11": 12.8, + "test_xpay.py::test_xpay_maxparts_no_mpp_bolt12": 16.7, + "test_xpay.py::test_xpay_maxparts_offer": 6.7, + "test_xpay.py::test_xpay_maxparts_receiver_limit": 24.6, + "test_xpay.py::test_xpay_maxparts_unannounced_retry": 15.7, + "test_xpay.py::test_xpay_no_mpp": 13.2, + "test_xpay.py::test_xpay_offer": 7.9, + "test_xpay.py::test_xpay_offer_invoice_amount_mismatch": 7.0, + "test_xpay.py::test_xpay_onion_budget_blinded": 11.8, + "test_xpay.py::test_xpay_onion_budget_blinded_introduction": 8.8, + "test_xpay.py::test_xpay_onion_budget_bolt11_metadata": 8.2, + "test_xpay.py::test_xpay_onion_budget_keysend": 8.8, + "test_xpay.py::test_xpay_partial_msat": 74.4, + "test_xpay.py::test_xpay_preapprove": 4.5, + "test_xpay.py::test_xpay_selfpay": 2.1, + "test_xpay.py::test_xpay_shadow_cltv": 12.1, + "test_xpay.py::test_xpay_simple": 12.5, + "test_xpay.py::test_xpay_slow_mode": 13.5, + "test_xpay.py::test_xpay_takeover": 8.2, + "test_xpay.py::test_xpay_takeover_null_parms": 6.3, + "test_xpay.py::test_xpay_timeout": 20.5, + "test_xpay.py::test_xpay_twohop_bug": 15.1, + "test_xpay.py::test_xpay_unannounced": 4.5, + "test_xpay.py::test_xpay_unknown_next_peer_excludes_node": 14.7, + "test_xpay.py::test_xpay_user_layers": 14.1, + "test_xpay.py::test_xpay_zeroconf": 4.5 +} diff --git a/tests/test_durations_valgrind.json b/tests/test_durations_valgrind.json new file mode 100644 index 000000000000..d65c628f1665 --- /dev/null +++ b/tests/test_durations_valgrind.json @@ -0,0 +1,1332 @@ +{ + "test_askrene.py::test_askrene_channel_observation": 21.4, + "test_askrene.py::test_askrene_constrain_channel": 40.0, + "test_askrene.py::test_askrene_fake_channeld": 0.1, + "test_askrene.py::test_askrene_observation_age": 43.5, + "test_askrene.py::test_askrene_observation_persistence": 73.2, + "test_askrene.py::test_askrene_reserve_clash": 44.5, + "test_askrene.py::test_askrene_timeout": 51.8, + "test_askrene.py::test_bad_user_entries": 27.7, + "test_askrene.py::test_bias_aging": 39.7, + "test_askrene.py::test_excessive_fee_cost": 56.5, + "test_askrene.py::test_explain_source_dest_failures": 122.3, + "test_askrene.py::test_fees_dont_exceed_constraints": 27.6, + "test_askrene.py::test_flow_fee_adjustment_fallback": 41.3, + "test_askrene.py::test_flows_account_for_fees": 34.1, + "test_askrene.py::test_getroutes": 40.1, + "test_askrene.py::test_getroutes_auto_localchans": 98.8, + "test_askrene.py::test_getroutes_auto_sourcefree": 31.0, + "test_askrene.py::test_getroutes_fee_fallback": 47.7, + "test_askrene.py::test_getroutes_hop_probability": 39.5, + "test_askrene.py::test_getroutes_ignores_recovery_stubs": 159.0, + "test_askrene.py::test_getroutes_maxdelay": 40.4, + "test_askrene.py::test_getroutes_maxhops": 57.7, + "test_askrene.py::test_getroutes_maxhops_binding[100000000]": 46.7, + "test_askrene.py::test_getroutes_maxhops_binding[10000000]": 54.5, + "test_askrene.py::test_getroutes_maxhops_binding[1000000]": 49.5, + "test_askrene.py::test_getroutes_maxhops_mpp": 33.6, + "test_askrene.py::test_getroutes_single_path": 35.7, + "test_askrene.py::test_impossible_payment": 28.4, + "test_askrene.py::test_includefees": 50.0, + "test_askrene.py::test_layer_persistence": 129.6, + "test_askrene.py::test_layers": 76.1, + "test_askrene.py::test_limits_fake_gossmap": 37.3, + "test_askrene.py::test_live_spendable": 142.2, + "test_askrene.py::test_max_htlc": 54.0, + "test_askrene.py::test_maxparts_infloop": 189.0, + "test_askrene.py::test_min_htlc": 46.1, + "test_askrene.py::test_min_htlc_after_excess": 37.6, + "test_askrene.py::test_node_bias_persistence": 149.7, + "test_askrene.py::test_node_bias_routes": 40.8, + "test_askrene.py::test_node_bias_rpc": 72.9, + "test_askrene.py::test_observation_impression_ordering": 33.3, + "test_askrene.py::test_observations_relax_stale_lower_bound": 40.1, + "test_askrene.py::test_real_biases": 0.1, + "test_askrene.py::test_real_data": 0.1, + "test_askrene.py::test_real_data_maxhops": 0.1, + "test_askrene.py::test_reservations_leak": 189.1, + "test_askrene.py::test_reservations_leak_under_load": 567.4, + "test_askrene.py::test_reserve": 86.8, + "test_askrene.py::test_simple_dummy_channel": 43.4, + "test_askrene.py::test_sourcefree_on_mods": 40.7, + "test_askrene.py::test_splice_dying_channel": 71.9, + "test_askrene.py::test_unreserve_all": 81.9, + "test_bookkeeper.py::test_bkpr_parallel": 67.6, + "test_bookkeeper.py::test_bkpr_report_invoice": 63.9, + "test_bookkeeper.py::test_bkpr_report_lightning_cli_csv": 63.4, + "test_bookkeeper.py::test_bkpr_report_tags_and_fallback": 63.4, + "test_bookkeeper.py::test_bookkeeper_custom_notifs": 74.6, + "test_bookkeeper.py::test_bookkeeping_closing_subsat_htlcs": 117.6, + "test_bookkeeper.py::test_bookkeeping_closing_trimmed_htlcs": 63.0, + "test_bookkeeper.py::test_bookkeeping_descriptions": 96.7, + "test_bookkeeper.py::test_bookkeeping_external_withdraws": 75.9, + "test_bookkeeper.py::test_bookkeeping_inspect_mfc_dual_funded": 0.1, + "test_bookkeeper.py::test_bookkeeping_inspect_multifundchannel": 94.2, + "test_bookkeeper.py::test_bookkeeping_listbalances_underflow": 88.1, + "test_bookkeeper.py::test_bookkeeping_missed_chans_leases": 0.1, + "test_bookkeeper.py::test_bookkeeping_missed_chans_pay_after": 120.1, + "test_bookkeeper.py::test_bookkeeping_missed_chans_pushed": 115.3, + "test_bookkeeper.py::test_bookkeeping_onchaind_txs": 121.1, + "test_bookkeeper.py::test_bookkeeping_rbf_withdraw": 51.6, + "test_bookkeeper.py::test_bookkeeping_splice_in": 100.6, + "test_bookkeeper.py::test_bookkeeping_splice_out": 105.4, + "test_bookkeeper.py::test_empty_node": 26.3, + "test_bookkeeper.py::test_listincome_and_report_timebox": 49.6, + "test_bookkeeper.py::test_migration": 68.8, + "test_bookkeeper.py::test_migration_no_bkpr": 73.5, + "test_bookkeeper.py::test_rebalance_tracking": 110.1, + "test_cln_lsps.py::test_lsps0_listprotocols[in-tree]": 51.5, + "test_cln_lsps.py::test_lsps0_listprotocols[mock]": 30.2, + "test_cln_lsps.py::test_lsps2_buy[in-tree]": 45.7, + "test_cln_lsps.py::test_lsps2_buy[mock]": 83.0, + "test_cln_lsps.py::test_lsps2_buyjitchannel_mpp_fixed_invoice": 83.8, + "test_cln_lsps.py::test_lsps2_buyjitchannel_no_mpp_var_invoice[in-tree]": 117.8, + "test_cln_lsps.py::test_lsps2_buyjitchannel_no_mpp_var_invoice[mock]": 74.5, + "test_cln_lsps.py::test_lsps2_enabled[in-tree]": 31.3, + "test_cln_lsps.py::test_lsps2_enabled[mock]": 46.8, + "test_cln_lsps.py::test_lsps2_getinfo[in-tree]": 53.0, + "test_cln_lsps.py::test_lsps2_getinfo[mock]": 23.2, + "test_cln_lsps.py::test_lsps2_mock_buy_fee_checks": 52.4, + "test_cln_lsps.py::test_lsps2_mock_buy_result": 58.5, + "test_cln_lsps.py::test_lsps2_mock_config_option": 24.7, + "test_cln_lsps.py::test_lsps2_mock_expired_held_parts": 72.4, + "test_cln_lsps.py::test_lsps2_mock_expired_session": 87.4, + "test_cln_lsps.py::test_lsps2_mock_fee": 0.1, + "test_cln_lsps.py::test_lsps2_mock_htlc_deduct": 93.7, + "test_cln_lsps.py::test_lsps2_mock_htlc_error": 75.5, + "test_cln_lsps.py::test_lsps2_mock_jit_channel_var_invoice": 98.5, + "test_cln_lsps.py::test_lsps2_mock_open_disconnect": 107.6, + "test_cln_lsps.py::test_lsps2_mock_open_failed": 75.2, + "test_cln_lsps.py::test_lsps2_mock_open_never": 84.5, + "test_cln_lsps.py::test_lsps2_mock_protocol": 36.0, + "test_cln_lsps.py::test_lsps2_mock_protocol_errors": 37.0, + "test_cln_lsps.py::test_lsps2_mock_rejects_missing_parameters": 26.7, + "test_cln_lsps.py::test_lsps2_mock_rejects_unknown_config": 35.1, + "test_cln_lsps.py::test_lsps2_mock_request_error": 46.7, + "test_cln_lsps.py::test_lsps2_mock_transport_behaviors": 41.2, + "test_cln_lsps.py::test_lsps2_mock_var_invoice_payment_size[10000001]": 78.6, + "test_cln_lsps.py::test_lsps2_mock_var_invoice_payment_size[1000]": 62.3, + "test_cln_lsps.py::test_lsps2_non_approved_zero_conf[in-tree]": 77.3, + "test_cln_lsps.py::test_lsps2_non_approved_zero_conf[mock]": 71.1, + "test_cln_lsps.py::test_lsps_service_disabled": 32.1, + "test_cln_rs.py::test_bip353": 40.0, + "test_cln_rs.py::test_cln_plugin_reentrant": 58.1, + "test_cln_rs.py::test_grpc_block_added_notifications": 37.4, + "test_cln_rs.py::test_grpc_connect": 34.2, + "test_cln_rs.py::test_grpc_connect_notification": 48.5, + "test_cln_rs.py::test_grpc_custommsg_notification": 56.9, + "test_cln_rs.py::test_grpc_decode": 34.9, + "test_cln_rs.py::test_grpc_default_port_auto_starts": 67.1, + "test_cln_rs.py::test_grpc_generate_certificate": 93.3, + "test_cln_rs.py::test_grpc_keysend_routehint": 106.7, + "test_cln_rs.py::test_grpc_legacy_sat_fields": 78.6, + "test_cln_rs.py::test_grpc_listpeerchannels": 111.8, + "test_cln_rs.py::test_grpc_request_validation": 36.0, + "test_cln_rs.py::test_grpc_sat_amounts_on_the_wire": 74.6, + "test_cln_rs.py::test_grpc_wrong_auth": 78.4, + "test_cln_rs.py::test_plugin_bad_json": 62.6, + "test_cln_rs.py::test_plugin_log_levels": 27.7, + "test_cln_rs.py::test_plugin_options_handle_defaults": 96.8, + "test_cln_rs.py::test_plugin_start": 41.9, + "test_cln_rs.py::test_rpc_client[False-038194b5f32bdf0aa59812c86c4ef7ad2f294104fa027d1ace9b469bb6f88cf37b]": 52.5, + "test_cln_rs.py::test_rpc_client[True-0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518]": 50.9, + "test_cln_rs.py::test_rust_plugin_subscribe_wildcard": 77.8, + "test_clnrest.py::test_accept_header_types": 35.7, + "test_clnrest.py::test_content_type_header_types": 40.9, + "test_clnrest.py::test_dynamic_path_conflicts": 42.7, + "test_clnrest.py::test_dynamic_path_matching": 41.1, + "test_clnrest.py::test_dynamic_path_rune": 33.0, + "test_clnrest.py::test_generate_certificate": 118.9, + "test_clnrest.py::test_http_headers": 89.5, + "test_clnrest.py::test_large_request_body": 35.8, + "test_clnrest.py::test_large_response": 80.7, + "test_clnrest.py::test_list_methods": 19.0, + "test_clnrest.py::test_matching_accept_and_content_types": 41.3, + "test_clnrest.py::test_no_auto_start": 44.1, + "test_clnrest.py::test_numeric_msat_notification": 87.0, + "test_clnrest.py::test_options": 56.5, + "test_clnrest.py::test_rpc_method": 35.8, + "test_clnrest.py::test_self_signed_certificates": 61.1, + "test_clnrest.py::test_unknown_method": 29.4, + "test_clnrest.py::test_uses_grpc_plugin_certificates": 48.6, + "test_clnrest.py::test_websocket_no_rune": 44.2, + "test_clnrest.py::test_websocket_rune_listnotifications": 38.1, + "test_clnrest.py::test_websocket_rune_no_listnotifications": 28.3, + "test_clnrest.py::test_websocket_rune_readonly": 36.6, + "test_clnrest.py::test_websocket_unrestricted_rune": 55.5, + "test_clnrest.py::test_websocket_upgrade_header": 27.1, + "test_clnrest.py::test_websocket_wrong_rune": 22.4, + "test_closing.py::test_anchorspend_ignores_immature_coinbase": 94.8, + "test_closing.py::test_anchorspend_using_to_remote[False]": 121.0, + "test_closing.py::test_anchorspend_using_to_remote[True]": 211.8, + "test_closing.py::test_anysegwit_close_needs_feature": 121.6, + "test_closing.py::test_channel_lease_falls_behind": 0.1, + "test_closing.py::test_channel_lease_lessee_cheat": 0.1, + "test_closing.py::test_channel_lease_lessor_cheat": 0.1, + "test_closing.py::test_channel_lease_post_expiry": 0.1, + "test_closing.py::test_channel_lease_unilat_closes": 0.1, + "test_closing.py::test_close_feerate_range": 51.1, + "test_closing.py::test_close_twice": 65.7, + "test_closing.py::test_close_weight_estimate": 73.1, + "test_closing.py::test_closing_anchorspend_htlc_tx_rbf": 120.1, + "test_closing.py::test_closing_cpfp": 94.3, + "test_closing.py::test_closing_different_fees": 0.2, + "test_closing.py::test_closing_disconnected_notify": 60.7, + "test_closing.py::test_closing_fee_rounding_at_ceiling": 89.4, + "test_closing.py::test_closing_feerange_below_estimates": 89.2, + "test_closing.py::test_closing_higherfee[False]": 112.9, + "test_closing.py::test_closing_higherfee[True]": 88.1, + "test_closing.py::test_closing_id": 81.6, + "test_closing.py::test_closing_ignore_fee_limits": 91.2, + "test_closing.py::test_closing_minfee": 58.1, + "test_closing.py::test_closing_negotiation_reconnect": 67.7, + "test_closing.py::test_closing_negotiation_step_100pct": 149.4, + "test_closing.py::test_closing_negotiation_step_1sat": 79.0, + "test_closing.py::test_closing_negotiation_step_30pct": 139.1, + "test_closing.py::test_closing_negotiation_step_700sat": 112.1, + "test_closing.py::test_closing_no_anysegwit_retry": 69.2, + "test_closing.py::test_closing_rejected_fee_fails_negotiation": 80.4, + "test_closing.py::test_closing_simple": 159.9, + "test_closing.py::test_closing_specified_destination": 98.9, + "test_closing.py::test_closing_tx_valid": 50.3, + "test_closing.py::test_closing_while_disconnected": 99.5, + "test_closing.py::test_htlc_no_force_close[False]": 101.8, + "test_closing.py::test_htlc_no_force_close[True]": 157.8, + "test_closing.py::test_htlc_rexmit_while_closing": 57.8, + "test_closing.py::test_htlc_timeout_boost_large_utxo": 58.3, + "test_closing.py::test_htlc_timeout_during_stfu": 92.9, + "test_closing.py::test_invalid_upfront_shutdown_script": 105.7, + "test_closing.py::test_listfunds_after_their_unilateral": 137.6, + "test_closing.py::test_onchain_all_dust": 144.3, + "test_closing.py::test_onchain_close_no_p2tr": 134.8, + "test_closing.py::test_onchain_close_upstream": 138.4, + "test_closing.py::test_onchain_different_fees": 113.0, + "test_closing.py::test_onchain_dust_out": 125.2, + "test_closing.py::test_onchain_feechange": 108.8, + "test_closing.py::test_onchain_first_commit": 86.1, + "test_closing.py::test_onchain_middleman_fulfill_after_fail": 104.2, + "test_closing.py::test_onchain_middleman_simple[False]": 97.6, + "test_closing.py::test_onchain_middleman_simple[True]": 149.8, + "test_closing.py::test_onchain_middleman_their_unilateral_in[False]": 116.9, + "test_closing.py::test_onchain_middleman_their_unilateral_in[True]": 111.6, + "test_closing.py::test_onchain_middleman_trimmed_same_hash": 164.9, + "test_closing.py::test_onchain_multihtlc_our_unilateral": 0.1, + "test_closing.py::test_onchain_multihtlc_their_unilateral": 0.1, + "test_closing.py::test_onchain_p2tr_missed_txs": 0.1, + "test_closing.py::test_onchain_rbf_stops_after_confirmation": 71.6, + "test_closing.py::test_onchain_reestablish_reply": 121.9, + "test_closing.py::test_onchain_rexmit_tx": 106.7, + "test_closing.py::test_onchain_slow_anchor": 142.6, + "test_closing.py::test_onchain_their_unilateral_out[False]": 86.4, + "test_closing.py::test_onchain_their_unilateral_out[True]": 91.0, + "test_closing.py::test_onchain_timeout[False]": 94.9, + "test_closing.py::test_onchain_timeout[True]": 85.1, + "test_closing.py::test_onchain_unwatch": 65.4, + "test_closing.py::test_onchaind_reorg_child_tx": 99.9, + "test_closing.py::test_onchaind_reorg_commitment_tx": 63.8, + "test_closing.py::test_onchaind_replay": 104.9, + "test_closing.py::test_option_upfront_shutdown_script[False]": 156.8, + "test_closing.py::test_option_upfront_shutdown_script[True]": 131.2, + "test_closing.py::test_peer_anchor_push": 128.1, + "test_closing.py::test_penalty_htlc_tx_fulfill[False]": 0.1, + "test_closing.py::test_penalty_htlc_tx_fulfill[True]": 0.1, + "test_closing.py::test_penalty_htlc_tx_timeout[False]": 0.1, + "test_closing.py::test_penalty_htlc_tx_timeout[True]": 0.1, + "test_closing.py::test_penalty_inhtlc[False]": 127.4, + "test_closing.py::test_penalty_inhtlc[True]": 103.7, + "test_closing.py::test_penalty_outhtlc[False]": 57.9, + "test_closing.py::test_penalty_outhtlc[True]": 86.8, + "test_closing.py::test_penalty_rbf_normal[False]": 86.2, + "test_closing.py::test_penalty_rbf_normal[True]": 101.0, + "test_closing.py::test_permfail": 142.5, + "test_closing.py::test_permfail_htlc_in": 90.2, + "test_closing.py::test_permfail_htlc_out": 104.8, + "test_closing.py::test_permfail_new_commit": 92.9, + "test_closing.py::test_reestablish_closed_channels": 83.0, + "test_closing.py::test_segwit_anyshutdown": 206.5, + "test_closing.py::test_segwit_shutdown_script": 0.1, + "test_closing.py::test_shutdown": 31.4, + "test_closing.py::test_simple_close_basic": 77.0, + "test_closing.py::test_simple_close_closee_path": 73.0, + "test_closing.py::test_simple_close_closer_pays_fee": 54.4, + "test_closing.py::test_simple_close_delay_broadcast": 72.5, + "test_closing.py::test_simple_close_dust_output_omitted": 83.2, + "test_closing.py::test_simple_close_no_feature_fallback": 45.7, + "test_closing.py::test_simple_close_restart": 119.0, + "test_closing.py::test_you_forgot_closed_channel": 68.3, + "test_closing.py::test_you_forgot_closed_channel_onchain": 115.9, + "test_coinmoves.py::test_coinmoves": 105.3, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_before_included": 78.0, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_dust": 107.6, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_fulfill": 106.5, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_fulfilled_oneside": 101.3, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_penalty": 126.1, + "test_coinmoves.py::test_coinmoves_unilateral_htlc_timeout": 144.7, + "test_coinmoves.py::test_migration": 55.9, + "test_coinmoves.py::test_migration_no_bkpr": 47.9, + "test_coinmoves.py::test_wait": 61.9, + "test_connection.py::test_balance": 109.5, + "test_connection.py::test_change_chaining": 77.9, + "test_connection.py::test_channel_abandon": 30.3, + "test_connection.py::test_channel_features[False]": 41.9, + "test_connection.py::test_channel_features[True]": 46.0, + "test_connection.py::test_channel_persistence": 140.3, + "test_connection.py::test_channel_reenable": 130.9, + "test_connection.py::test_connect_basic": 69.6, + "test_connection.py::test_connect_proxy_maxlen_hostname": 29.2, + "test_connection.py::test_connect_ratelimit": 179.0, + "test_connection.py::test_connect_standard_addr": 45.8, + "test_connection.py::test_connect_transient": 61.6, + "test_connection.py::test_connect_transient_pending": 48.0, + "test_connection.py::test_connection_moved": 63.3, + "test_connection.py::test_connection_timeout": 0.1, + "test_connection.py::test_constant_packet_size": 112.4, + "test_connection.py::test_dataloss_protection": 229.0, + "test_connection.py::test_dataloss_protection_hsmtool_recoverhtlc[False]": 163.0, + "test_connection.py::test_dataloss_protection_hsmtool_recoverhtlc[True]": 149.2, + "test_connection.py::test_dataloss_protection_no_broadcast": 173.1, + "test_connection.py::test_dataloss_protection_reconnect": 149.6, + "test_connection.py::test_disconnect": 89.7, + "test_connection.py::test_disconnect_fundee": 89.7, + "test_connection.py::test_disconnect_fundee_v2": 0.1, + "test_connection.py::test_disconnect_half_signed": 49.1, + "test_connection.py::test_disconnect_half_signed_v2": 0.1, + "test_connection.py::test_disconnect_opener": 76.1, + "test_connection.py::test_disconnectpeer": 64.2, + "test_connection.py::test_fail_unconfirmed": 0.1, + "test_connection.py::test_fail_unconfirmed_openchannel2": 1.3, + "test_connection.py::test_fee_limits": 250.3, + "test_connection.py::test_feerate_spam": 63.5, + "test_connection.py::test_feerate_stress": 107.1, + "test_connection.py::test_forget_channel": 90.8, + "test_connection.py::test_fulfill_incoming_first": 193.9, + "test_connection.py::test_fundchannel_complete_rejects_nonsegwit_unsigned": 60.4, + "test_connection.py::test_fundchannel_start_alternate": 0.9, + "test_connection.py::test_fundee_forget_funding_tx_unconfirmed": 96.7, + "test_connection.py::test_fundee_node_unconfirmed": 0.1, + "test_connection.py::test_funding_all": 82.0, + "test_connection.py::test_funding_all_too_much": 33.4, + "test_connection.py::test_funding_by_utxos": 72.4, + "test_connection.py::test_funding_cancel_race": 0.1, + "test_connection.py::test_funding_change": 51.9, + "test_connection.py::test_funding_close_upfront": 215.0, + "test_connection.py::test_funding_external_wallet": 43.0, + "test_connection.py::test_funding_external_wallet_corners": 53.8, + "test_connection.py::test_funding_fail": 101.3, + "test_connection.py::test_funding_push": 68.1, + "test_connection.py::test_funding_toolarge": 74.7, + "test_connection.py::test_funding_v2_cancel_race": 0.1, + "test_connection.py::test_funding_v2_corners": 0.1, + "test_connection.py::test_funding_while_offline": 73.6, + "test_connection.py::test_htlc_failed_noclose": 52.9, + "test_connection.py::test_htlc_retransmit_order": 101.6, + "test_connection.py::test_injectonionmessage": 42.6, + "test_connection.py::test_last_stable_connection": 55.0, + "test_connection.py::test_listpeerchannels_by_channel_id": 80.1, + "test_connection.py::test_listpeerchannels_by_scid": 105.2, + "test_connection.py::test_listpeers_crash": 49.6, + "test_connection.py::test_lockin_between_restart": 123.7, + "test_connection.py::test_multichan": 159.3, + "test_connection.py::test_multichan_stress": 216.5, + "test_connection.py::test_multifunding_best_effort": 253.9, + "test_connection.py::test_multifunding_disconnect": 52.9, + "test_connection.py::test_multifunding_feerates[False]": 47.3, + "test_connection.py::test_multifunding_feerates[True]": 43.0, + "test_connection.py::test_multifunding_one": 103.8, + "test_connection.py::test_multifunding_param_failures": 51.5, + "test_connection.py::test_multifunding_simple": 78.0, + "test_connection.py::test_multifunding_v1_v2_mixed": 112.2, + "test_connection.py::test_multifunding_v2_exclusive": 0.1, + "test_connection.py::test_multifunding_wumbo": 50.5, + "test_connection.py::test_multiple_channels": 93.2, + "test_connection.py::test_mutual_reconnect_race": 83.8, + "test_connection.py::test_networkevents": 337.4, + "test_connection.py::test_no_delay": 0.1, + "test_connection.py::test_no_fee_estimate": 206.1, + "test_connection.py::test_no_reconnect_awating_unilateral": 85.1, + "test_connection.py::test_nonstatic_channel": 57.7, + "test_connection.py::test_offline": 60.9, + "test_connection.py::test_old_feerate": 160.5, + "test_connection.py::test_onionmessage_forward_fail": 107.3, + "test_connection.py::test_onionmessage_reply_path_no_hops": 50.6, + "test_connection.py::test_onionmessage_reply_path_zero_scid": 66.9, + "test_connection.py::test_onionmessage_unknown_invoice_no_leak": 50.3, + "test_connection.py::test_open_channel2_tx_add_output_above_max_supply": 0.1, + "test_connection.py::test_open_channel2_tx_add_output_sum_above_max_supply": 0.1, + "test_connection.py::test_open_channel_funding_above_max_supply": 35.1, + "test_connection.py::test_openchannel_init_alternate": 0.1, + "test_connection.py::test_opener_feerate_reconnect": 141.4, + "test_connection.py::test_opener_simple_reconnect": 76.6, + "test_connection.py::test_opening_tiny_channel[False]": 0.1, + "test_connection.py::test_opening_tiny_channel[True]": 0.1, + "test_connection.py::test_parallel_opens": 0.1, + "test_connection.py::test_pay_disconnect_stress": 0.1, + "test_connection.py::test_peer_disconnected_has_featurebits": 95.5, + "test_connection.py::test_peer_disconnected_reflected_in_channel_state": 60.7, + "test_connection.py::test_peer_reuses_htlc_id": 157.7, + "test_connection.py::test_peerinfo": 104.6, + "test_connection.py::test_ping_timeout": 116.6, + "test_connection.py::test_private_channel": 106.4, + "test_connection.py::test_private_channel_no_reconnect": 147.2, + "test_connection.py::test_quiescence": 55.6, + "test_connection.py::test_reconnect_channel_peers": 143.5, + "test_connection.py::test_reconnect_gossiping": 0.1, + "test_connection.py::test_reconnect_no_additional_transient_failure": 135.8, + "test_connection.py::test_reconnect_no_update": 114.2, + "test_connection.py::test_reconnect_normal": 117.3, + "test_connection.py::test_reconnect_openingd": 0.1, + "test_connection.py::test_reconnect_receiver_add": 106.2, + "test_connection.py::test_reconnect_receiver_fulfill": 177.2, + "test_connection.py::test_reconnect_remote_sends_no_sigs": 108.8, + "test_connection.py::test_reconnect_sender_add": 101.7, + "test_connection.py::test_reconnect_sender_add1": 67.6, + "test_connection.py::test_reconnect_signed": 59.3, + "test_connection.py::test_reestablish_zero_commitment_number": 62.3, + "test_connection.py::test_remote_addr": 128.2, + "test_connection.py::test_remote_addr_disabled": 121.8, + "test_connection.py::test_remote_addr_port": 255.0, + "test_connection.py::test_remote_disconnect": 46.5, + "test_connection.py::test_restart_multi_htlc_rexmit": 84.9, + "test_connection.py::test_second_channel": 85.3, + "test_connection.py::test_shutdown_awaiting_lockin": 75.5, + "test_connection.py::test_shutdown_reconnect": 100.5, + "test_connection.py::test_update_fee": 109.5, + "test_connection.py::test_update_fee_dynamic": 113.0, + "test_connection.py::test_update_fee_reconnect": 120.2, + "test_connection.py::test_v2_open": 1.4, + "test_connection.py::test_websocket": 69.4, + "test_connection.py::test_wss_proxy": 47.0, + "test_connection.py::test_wumbo_channels": 139.2, + "test_currencyrate.py::test_apis": 43.5, + "test_currencyrate.py::test_bkpr_currency_dynamic": 68.3, + "test_currencyrate.py::test_bkpr_currencyrate_persisted": 123.0, + "test_currencyrate.py::test_bkpr_currencyrate_ranges": 120.6, + "test_currencyrate.py::test_bkpr_currencyrate_warns_for_old_events": 122.5, + "test_currencyrate.py::test_bkpr_listaccountevents_currencyrate": 45.9, + "test_currencyrate.py::test_bkpr_listaccountevents_realtime": 83.1, + "test_currencyrate.py::test_cached_median": 43.8, + "test_currencyrate.py::test_currencyrate_rounding": 28.9, + "test_currencyrate.py::test_currencyrate_source": 33.1, + "test_currencyrate.py::test_currencyrate_too_many_args": 36.2, + "test_currencyrate.py::test_currencyrate_unknown_source": 53.3, + "test_currencyrate.py::test_invalid_currency": 32.1, + "test_currencyrate.py::test_no_sources": 52.0, + "test_db.py::test_backfill_scriptpubkeys": 0.1, + "test_db.py::test_block_backfill": 157.1, + "test_db.py::test_channel_htlcs_id_change": 109.1, + "test_db.py::test_db_dangling_peer_fix": 65.7, + "test_db.py::test_db_forward_migrate": 55.9, + "test_db.py::test_db_sanity_checks": 78.8, + "test_db.py::test_last_tx_inflight_psbt_upgrade": 34.4, + "test_db.py::test_last_tx_psbt_upgrade": 74.3, + "test_db.py::test_local_basepoints_cache": 124.9, + "test_db.py::test_max_channel_id": 93.8, + "test_db.py::test_optimistic_locking": 31.1, + "test_db.py::test_our_tables_backfill_upgrade": 39.0, + "test_db.py::test_psql_key_value_dsn": 1.3, + "test_db.py::test_scid_upgrade": 103.2, + "test_db.py::test_sqlite3_builtin_backup": 65.7, + "test_db.py::test_sqlite_strict_mode": 25.9, + "test_db.py::test_strict_mode_with_old_database": 23.3, + "test_downgrade.py::test_downgrade": 178.7, + "test_downgrade.py::test_downgrade_bias": 95.9, + "test_downgrade.py::test_downgrade_impressions_and_observations": 0.9, + "test_gossip.py::test_addgossip": 79.7, + "test_gossip.py::test_announce_address": 52.5, + "test_gossip.py::test_announce_and_connect_via_dns": 139.4, + "test_gossip.py::test_announce_dns_suppressed": 79.2, + "test_gossip.py::test_announce_dns_without_port": 31.3, + "test_gossip.py::test_close_72_block_delay": 141.8, + "test_gossip.py::test_connect_by_gossip": 76.2, + "test_gossip.py::test_dump_own_gossip": 83.7, + "test_gossip.py::test_generate_gossip_store": 39.0, + "test_gossip.py::test_getroute_exclude": 162.3, + "test_gossip.py::test_getroute_exclude_duplicate": 54.5, + "test_gossip.py::test_gossip_addresses": 85.7, + "test_gossip.py::test_gossip_announce_invalid_block": 119.7, + "test_gossip.py::test_gossip_announce_unknown_block": 115.3, + "test_gossip.py::test_gossip_badsig": 73.5, + "test_gossip.py::test_gossip_cpu_throttle_only_queries": 37.6, + "test_gossip.py::test_gossip_disable_channels": 114.0, + "test_gossip.py::test_gossip_dying_when_compact": 89.6, + "test_gossip.py::test_gossip_force_broadcast_channel_msgs": 137.3, + "test_gossip.py::test_gossip_jsonrpc": 32.2, + "test_gossip.py::test_gossip_lease_rates": 0.1, + "test_gossip.py::test_gossip_no_backtalk": 98.9, + "test_gossip.py::test_gossip_no_empty_announcements": 96.0, + "test_gossip.py::test_gossip_not_dying": 91.7, + "test_gossip.py::test_gossip_notices_close": 102.0, + "test_gossip.py::test_gossip_persistence": 201.1, + "test_gossip.py::test_gossip_pruning": 294.0, + "test_gossip.py::test_gossip_query_channel_range": 220.4, + "test_gossip.py::test_gossip_query_channel_range_cpu_throttle": 77.8, + "test_gossip.py::test_gossip_seeker_autoconnect": 136.3, + "test_gossip.py::test_gossip_store_compact": 82.1, + "test_gossip.py::test_gossip_store_compact_miss_update": 115.8, + "test_gossip.py::test_gossip_store_compact_restart": 99.3, + "test_gossip.py::test_gossip_store_compact_while_extending": 128.7, + "test_gossip.py::test_gossip_store_corrupt": 97.1, + "test_gossip.py::test_gossip_store_load": 20.8, + "test_gossip.py::test_gossip_store_load_amount_truncated": 57.6, + "test_gossip.py::test_gossip_store_load_announce_before_update": 28.8, + "test_gossip.py::test_gossip_store_load_complex": 94.1, + "test_gossip.py::test_gossip_store_load_no_channel_update": 27.6, + "test_gossip.py::test_gossip_store_load_uncompacted": 93.2, + "test_gossip.py::test_gossip_store_v10_upgrade": 30.6, + "test_gossip.py::test_gossip_throttle": 180.3, + "test_gossip.py::test_gossip_timestamp_filter": 205.7, + "test_gossip.py::test_gossip_weirdalias": 60.7, + "test_gossip.py::test_gossipwith": 78.4, + "test_gossip.py::test_gossmap_lost_node": 136.3, + "test_gossip.py::test_incoming_unreasonable": 169.4, + "test_gossip.py::test_node_reannounce": 155.0, + "test_gossip.py::test_only_announce_one_dns": 28.3, + "test_gossip.py::test_parms_listforwards": 84.7, + "test_gossip.py::test_query_short_channel_id": 162.3, + "test_gossip.py::test_report_routing_failure": 125.5, + "test_gossip.py::test_routetool": 57.3, + "test_gossip.py::test_routing_gossip": 122.3, + "test_gossip.py::test_routing_gossip_reconnect": 81.6, + "test_gossip.py::test_seeker_first_peer": 144.2, + "test_gossip.py::test_static_tor_onions": 1.2, + "test_gossip.py::test_topology_leak": 71.0, + "test_gossip.py::test_tor_port_onions": 1.7, + "test_invoices.py::test_amountless_invoice": 54.1, + "test_invoices.py::test_createinvoice_expiry_too_large": 32.8, + "test_invoices.py::test_decode_unknown": 40.6, + "test_invoices.py::test_expiry_startup_crash": 63.5, + "test_invoices.py::test_invoice": 44.0, + "test_invoices.py::test_invoice_botched_migration": 20.9, + "test_invoices.py::test_invoice_deschash": 48.8, + "test_invoices.py::test_invoice_expiry": 76.7, + "test_invoices.py::test_invoice_expiry_too_large": 62.0, + "test_invoices.py::test_invoice_maxdesc": 77.0, + "test_invoices.py::test_invoice_preimage": 57.8, + "test_invoices.py::test_invoice_routeboost": 75.6, + "test_invoices.py::test_invoice_routeboost_private": 102.1, + "test_invoices.py::test_invoice_weirdstring": 30.3, + "test_invoices.py::test_invoice_zeroval": 30.1, + "test_invoices.py::test_invoices_wait_db_migration": 30.6, + "test_invoices.py::test_listinvoices_filter": 41.6, + "test_invoices.py::test_listinvoices_index": 70.2, + "test_invoices.py::test_offer_fronting": 173.8, + "test_invoices.py::test_onchain_invoice_delinvoice_during_payment_hook": 41.9, + "test_invoices.py::test_payment_fronting": 143.1, + "test_invoices.py::test_signinvoice": 37.7, + "test_invoices.py::test_unified_invoices": 63.3, + "test_invoices.py::test_unified_invoices_any_amount": 76.0, + "test_invoices.py::test_wait_invoices": 75.2, + "test_invoices.py::test_waitanyinvoice": 124.7, + "test_invoices.py::test_waitanyinvoice_reversed": 57.5, + "test_invoices.py::test_waitinvoice": 94.4, + "test_lsps2_oracles.py::test_lsps2_oracles_amount": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_balance": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_buy_params": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_extra_fee": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_forward_status": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_honest_run": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_invoice": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_robustness": 1.2, + "test_lsps2_oracles.py::test_lsps2_oracles_route_hint": 0.1, + "test_lsps2_oracles.py::test_lsps2_oracles_zero_conf_channel": 0.1, + "test_misc.py::test_address": 87.6, + "test_misc.py::test_bad_onion": 128.2, + "test_misc.py::test_bad_onion_immediate_peer": 54.5, + "test_misc.py::test_badparam_discretion": 56.4, + "test_misc.py::test_bitcoin_failure": 52.2, + "test_misc.py::test_bitcoin_ibd": 37.7, + "test_misc.py::test_bitcoin_pruned": 67.4, + "test_misc.py::test_bitcoind_fail_first": 24.5, + "test_misc.py::test_bitcoind_feerate_floor[False]": 133.4, + "test_misc.py::test_bitcoind_feerate_floor[True]": 134.0, + "test_misc.py::test_bitcoind_goes_backwards": 122.9, + "test_misc.py::test_blockchaintrack": 62.7, + "test_misc.py::test_bolt12_invoice_decode": 46.4, + "test_misc.py::test_check_command": 42.8, + "test_misc.py::test_checkmessage_pubkey_not_found": 30.2, + "test_misc.py::test_cli": 36.1, + "test_misc.py::test_cli_commando": 39.1, + "test_misc.py::test_cli_multiline_help": 38.6, + "test_misc.py::test_cli_no_argument": 0.1, + "test_misc.py::test_commitfee_option": 55.4, + "test_misc.py::test_config_in_subdir": 123.4, + "test_misc.py::test_config_whitespace": 87.6, + "test_misc.py::test_configfile_before_chdir": 53.7, + "test_misc.py::test_crashlog": 0.6, + "test_misc.py::test_create_gossip_mesh": 0.1, + "test_misc.py::test_custommsg_triggers_notification": 36.9, + "test_misc.py::test_daemon_option": 63.8, + "test_misc.py::test_datastore": 51.4, + "test_misc.py::test_datastore_escapeing": 23.5, + "test_misc.py::test_datastore_keylist": 32.8, + "test_misc.py::test_datastoreusage": 34.6, + "test_misc.py::test_db_upgrade": 52.9, + "test_misc.py::test_decode": 43.1, + "test_misc.py::test_dev_demux": 27.8, + "test_misc.py::test_dev_force_bip32_seed": 20.2, + "test_misc.py::test_emergencyrecover": 71.1, + "test_misc.py::test_emergencyrecover_old_format_handling": 32.9, + "test_misc.py::test_emergencyrecoverpenaltytxn": 111.3, + "test_misc.py::test_even_sendcustommsg": 53.7, + "test_misc.py::test_fast_shutdown": 45.4, + "test_misc.py::test_feerate_arg": 33.4, + "test_misc.py::test_feerate_ceiling": 43.8, + "test_misc.py::test_feerates[False]": 32.3, + "test_misc.py::test_feerates[True]": 62.5, + "test_misc.py::test_field_filter": 33.2, + "test_misc.py::test_filter_with_invalid_json": 61.3, + "test_misc.py::test_force_feerates": 91.0, + "test_misc.py::test_funding_reorg_get_upset": 75.5, + "test_misc.py::test_funding_reorg_private": 182.1, + "test_misc.py::test_funding_reorg_remote_lags": 102.5, + "test_misc.py::test_getemergencyrecoverdata": 24.5, + "test_misc.py::test_getlog": 34.7, + "test_misc.py::test_getlog_no_io": 34.7, + "test_misc.py::test_graceful_htlc": 85.4, + "test_misc.py::test_graceful_idle_peer": 79.7, + "test_misc.py::test_graceful_no_peers": 45.6, + "test_misc.py::test_hsm_capabilities": 23.0, + "test_misc.py::test_htlc_in_timeout": 103.9, + "test_misc.py::test_htlc_out_timeout": 117.1, + "test_misc.py::test_htlc_sig_persistence": 106.7, + "test_misc.py::test_include": 52.4, + "test_misc.py::test_io_logging": 88.5, + "test_misc.py::test_ipv4_and_ipv6": 34.5, + "test_misc.py::test_json_error": 43.1, + "test_misc.py::test_lightningd_still_loading": 85.5, + "test_misc.py::test_list_features_only": 1.2, + "test_misc.py::test_listaddresses": 35.9, + "test_misc.py::test_listconfigs": 60.9, + "test_misc.py::test_listconfigs_plugins": 33.8, + "test_misc.py::test_listforwards_ancient": 169.7, + "test_misc.py::test_listforwards_and_listhtlcs": 156.5, + "test_misc.py::test_listforwards_wait": 74.8, + "test_misc.py::test_listfunds": 69.5, + "test_misc.py::test_listhtlcs_wait": 113.9, + "test_misc.py::test_listtransactions": 69.2, + "test_misc.py::test_log_filter": 98.1, + "test_misc.py::test_log_filter_bug": 22.5, + "test_misc.py::test_logging": 52.8, + "test_misc.py::test_long_logs": 30.0, + "test_misc.py::test_low_fd_limit": 124.2, + "test_misc.py::test_makesecret": 63.9, + "test_misc.py::test_malformed_rpc": 47.0, + "test_misc.py::test_multiplexed_rpc": 36.9, + "test_misc.py::test_multirpc": 32.2, + "test_misc.py::test_names[False]": 62.6, + "test_misc.py::test_names[True]": 65.2, + "test_misc.py::test_new_node_is_mainnet": 0.9, + "test_misc.py::test_newaddr": 35.0, + "test_misc.py::test_notimestamp_logging": 33.5, + "test_misc.py::test_p2tr_funding": 50.6, + "test_misc.py::test_ping": 40.8, + "test_misc.py::test_preapprove[False]": 63.6, + "test_misc.py::test_preapprove[True]": 56.9, + "test_misc.py::test_preapprove_use[False]": 55.1, + "test_misc.py::test_preapprove_use[True]": 64.1, + "test_misc.py::test_recover[False]": 150.6, + "test_misc.py::test_recover[True]": 104.6, + "test_misc.py::test_recover_command[False]": 126.2, + "test_misc.py::test_recover_command[True]": 87.9, + "test_misc.py::test_recover_plugin": 90.7, + "test_misc.py::test_recoverchannel": 37.9, + "test_misc.py::test_recoverchannel_closed_sibling": 135.7, + "test_misc.py::test_regtest_upgrade": 1.8, + "test_misc.py::test_relative_config_dir": 29.2, + "test_misc.py::test_rescan": 211.5, + "test_misc.py::test_reserve_enforcement": 97.4, + "test_misc.py::test_restorefrompeer": 90.0, + "test_misc.py::test_sendcustommsg": 54.3, + "test_misc.py::test_set_feerate_offset": 72.8, + "test_misc.py::test_setconfig": 133.2, + "test_misc.py::test_setconfig_access": 95.7, + "test_misc.py::test_setconfig_access_explicit_conf": 26.8, + "test_misc.py::test_setconfig_changed": 45.0, + "test_misc.py::test_setconfig_dynamic_multi_option": 54.9, + "test_misc.py::test_signmessage": 58.2, + "test_misc.py::test_signmessagewithkey": 39.8, + "test_misc.py::test_staticbackup": 71.5, + "test_misc.py::test_testnet_upgrade": 0.8, + "test_misc.py::test_torv2_in_db": 76.2, + "test_misc.py::test_tracing": 69.2, + "test_misc.py::test_tracing_socket": 52.0, + "test_misc.py::test_unicode_rpc": 32.4, + "test_misc.py::test_unix_socket_path_length": 1.3, + "test_misc.py::test_valid_json_cli": 31.3, + "test_misc.py::test_version_reexec": 129.8, + "test_misc.py::test_waitblockheight": 39.4, + "test_misc.py::test_withdraw_misc": 64.3, + "test_misc.py::test_zero_locktime_blocks": 94.7, + "test_mkfunding.py::test_mkfunding_bad_cantaffordfee": 0.1, + "test_mkfunding.py::test_mkfunding_bad_input_amount": 0.1, + "test_mkfunding.py::test_mkfunding_bad_input_privkey": 0.1, + "test_mkfunding.py::test_mkfunding_bad_input_txid": 0.1, + "test_mkfunding.py::test_mkfunding_bad_local_funding_privkey": 0.1, + "test_mkfunding.py::test_mkfunding_bad_privkeys": 0.1, + "test_mkfunding.py::test_mkfunding_bad_remote_funding_privkey": 0.1, + "test_mkfunding.py::test_mkfunding_bad_usage": 0.1, + "test_mkfunding.py::test_mkfunding_good_noabort": 0.1, + "test_onion.py::test_onion": 0.1, + "test_onion.py::test_rendezvous_onion": 0.1, + "test_opening.py::test_anchor_min_emergency": 69.9, + "test_opening.py::test_buy_liquidity_ad_check_bookkeeping": 1.1, + "test_opening.py::test_buy_liquidity_ad_no_v2": 37.8, + "test_opening.py::test_coinbase_unspendable": 42.5, + "test_opening.py::test_commitment_feerate[False]": 58.2, + "test_opening.py::test_commitment_feerate[True]": 82.9, + "test_opening.py::test_duplicate_channel_id_in_db": 95.7, + "test_opening.py::test_fundchannel_utxo_too_small": 68.2, + "test_opening.py::test_funder_contribution_limits": 64.2, + "test_opening.py::test_funder_options": 0.1, + "test_opening.py::test_lockin_reorg_after_promotion": 0.1, + "test_opening.py::test_lockin_restart_rescan_race": 0.1, + "test_opening.py::test_multifunding_all_amount": 59.3, + "test_opening.py::test_multifunding_v2_best_effort": 253.7, + "test_opening.py::test_no_anchor_liquidity_ads": 0.1, + "test_opening.py::test_no_retransmit_confirmed_funding": 53.9, + "test_opening.py::test_openchannel2_inflight_limit": 0.1, + "test_opening.py::test_openchannel_no_confirmed_inputs_opener": 0.1, + "test_opening.py::test_openchannel_no_unconfirmed_inputs_accepter": 0.1, + "test_opening.py::test_opening_below_min_capacity_sat": 28.4, + "test_opening.py::test_opening_crash": 137.6, + "test_opening.py::test_opening_explicit_channel_type": 197.7, + "test_opening.py::test_opening_incoming_unknown_feerates": 38.1, + "test_opening.py::test_queryrates": 0.1, + "test_opening.py::test_rbf_broadcast_close_inflights": 0.1, + "test_opening.py::test_rbf_fails_to_broadcast": 0.1, + "test_opening.py::test_rbf_no_overlap": 0.1, + "test_opening.py::test_rbf_non_last_mined": 0.1, + "test_opening.py::test_rbf_reconnect_ack": 0.1, + "test_opening.py::test_rbf_reconnect_init": 0.1, + "test_opening.py::test_rbf_reconnect_non_last_mined": 0.1, + "test_opening.py::test_rbf_reconnect_tx_construct": 0.1, + "test_opening.py::test_rbf_reconnect_tx_sigs": 0.1, + "test_opening.py::test_rbf_refused_once_funding_confirmed": 0.1, + "test_opening.py::test_rbf_to_chain_before_commit": 0.1, + "test_opening.py::test_scid_alias_private": 53.3, + "test_opening.py::test_sendpsbt_crash": 106.7, + "test_opening.py::test_v2_abort_after_accepter_tx_sigs": 0.1, + "test_opening.py::test_v2_fail_second": 0.1, + "test_opening.py::test_v2_funding_spent_before_lockin": 0.1, + "test_opening.py::test_v2_lockin_single_spend_watch": 0.1, + "test_opening.py::test_v2_open_feerate_out_of_range": 0.1, + "test_opening.py::test_v2_open_reconnect_next_funding_mismatch": 0.1, + "test_opening.py::test_v2_open_sigs_out_of_order": 0.1, + "test_opening.py::test_v2_open_sigs_reconnect_1": 0.1, + "test_opening.py::test_v2_open_sigs_reconnect_2": 0.3, + "test_opening.py::test_v2_open_sigs_restart_while_dead": 0.1, + "test_opening.py::test_v2_rbf_abort_channel_opens": 0.1, + "test_opening.py::test_v2_rbf_abort_retry": 0.1, + "test_opening.py::test_v2_rbf_liquidity_ad": 0.1, + "test_opening.py::test_v2_rbf_multi": 0.1, + "test_opening.py::test_v2_rbf_single": 0.1, + "test_opening.py::test_v2_replay_bookkeeping": 0.1, + "test_opening.py::test_zero_length_upfront_shutdown_script": 56.8, + "test_opening.py::test_zeroconf_forget[False]": 108.0, + "test_opening.py::test_zeroconf_forget[True]": 79.7, + "test_opening.py::test_zeroconf_forward": 97.6, + "test_opening.py::test_zeroconf_mindepth": 67.4, + "test_opening.py::test_zeroconf_multichan_forward": 95.8, + "test_opening.py::test_zeroconf_open": 91.6, + "test_opening.py::test_zeroconf_public": 103.8, + "test_opening.py::test_zeroconf_refusal": 32.0, + "test_opening.py::test_zeroconf_withhold[False-False]": 72.2, + "test_opening.py::test_zeroconf_withhold[False-True]": 94.1, + "test_opening.py::test_zeroconf_withhold[True-False]": 98.0, + "test_opening.py::test_zeroconf_withhold[True-True]": 69.3, + "test_opening.py::test_zeroconf_withhold_htlc_failback": 58.0, + "test_opening.py::test_zeroreserve": 94.2, + "test_opening.py::test_zeroreserve_alldust": 57.0, + "test_opening.py::test_zeroreserve_mixed": 91.1, + "test_p2tr_change_dust.py::test_p2tr_change_dust_limit": 51.9, + "test_pay.py::test_blinded_forward_policy": 84.8, + "test_pay.py::test_blinded_path_max": 80.1, + "test_pay.py::test_blinded_reply_path_scid[False]": 64.8, + "test_pay.py::test_blinded_reply_path_scid[True]": 64.6, + "test_pay.py::test_blindedpath_noaddr": 90.8, + "test_pay.py::test_blindedpath_privchan[False]": 104.1, + "test_pay.py::test_blindedpath_privchan[True]": 188.9, + "test_pay.py::test_bolt11_null_after_pay[False]": 91.4, + "test_pay.py::test_bolt11_null_after_pay[True]": 74.8, + "test_pay.py::test_cancel_recurrence": 71.2, + "test_pay.py::test_channel_receivable": 69.4, + "test_pay.py::test_channel_spendable[False]": 97.8, + "test_pay.py::test_channel_spendable[True]": 69.7, + "test_pay.py::test_channel_spendable_large": 102.2, + "test_pay.py::test_channel_spendable_receivable_capped": 64.0, + "test_pay.py::test_createonion_limits": 42.6, + "test_pay.py::test_createonion_rpc": 28.7, + "test_pay.py::test_createproof": 94.5, + "test_pay.py::test_createproof_include": 83.4, + "test_pay.py::test_createproof_note": 61.4, + "test_pay.py::test_decode": 60.7, + "test_pay.py::test_decode_expired_bolt12": 28.9, + "test_pay.py::test_decryptencrypteddata": 114.7, + "test_pay.py::test_delpay_argument_invalid[False]": 64.8, + "test_pay.py::test_delpay_argument_invalid[True]": 60.0, + "test_pay.py::test_delpay_mixed_status[False]": 163.6, + "test_pay.py::test_delpay_mixed_status[True]": 175.4, + "test_pay.py::test_delpay_works[False]": 143.9, + "test_pay.py::test_delpay_works[True]": 108.7, + "test_pay.py::test_dev_rawrequest": 51.4, + "test_pay.py::test_enableoffer": 41.1, + "test_pay.py::test_error_returns_blockheight": 92.7, + "test_pay.py::test_excluded_adjacent_routehint[False]": 79.8, + "test_pay.py::test_excluded_adjacent_routehint[True]": 71.2, + "test_pay.py::test_failinfo_per_groupid": 88.6, + "test_pay.py::test_fetch_no_description_offer": 68.8, + "test_pay.py::test_fetch_no_description_with_amount": 52.3, + "test_pay.py::test_fetchinvoice": 163.2, + "test_pay.py::test_fetchinvoice_3hop": 95.9, + "test_pay.py::test_fetchinvoice_autoconnect": 173.4, + "test_pay.py::test_fetchinvoice_autoconnect_if_disconnected": 70.3, + "test_pay.py::test_fetchinvoice_disconnected_reply": 78.0, + "test_pay.py::test_fetchinvoice_invoice_expiry": 45.5, + "test_pay.py::test_fetchinvoice_recurrence": 136.2, + "test_pay.py::test_fetchinvoice_with_no_quantity": 61.9, + "test_pay.py::test_fetchinvoice_with_payer_metadata": 65.4, + "test_pay.py::test_forward": 107.5, + "test_pay.py::test_forward_different_fees_and_cltv": 97.2, + "test_pay.py::test_forward_local_failed_peer_cannot_afford_fee": 74.0, + "test_pay.py::test_forward_local_failed_reason": 98.5, + "test_pay.py::test_forward_local_failed_stats": 0.1, + "test_pay.py::test_forward_pad_fees_and_cltv": 121.3, + "test_pay.py::test_forward_stats": 130.4, + "test_pay.py::test_htlc_set_part_during_invoice_hook": 115.1, + "test_pay.py::test_htlc_tlv_crash": 108.6, + "test_pay.py::test_htlc_too_dusty_incoming": 123.0, + "test_pay.py::test_htlc_too_dusty_outgoing": 64.1, + "test_pay.py::test_htlcs_cltv_only_difference": 0.1, + "test_pay.py::test_injectpaymentonion_3hop": 65.5, + "test_pay.py::test_injectpaymentonion_blindedpath": 75.2, + "test_pay.py::test_injectpaymentonion_failures": 57.2, + "test_pay.py::test_injectpaymentonion_mpp": 37.9, + "test_pay.py::test_injectpaymentonion_peerfail": 64.0, + "test_pay.py::test_injectpaymentonion_selfpay": 51.5, + "test_pay.py::test_injectpaymentonion_simple": 65.3, + "test_pay.py::test_injectpaymentonion_zero_partid": 31.6, + "test_pay.py::test_invalid_onion_channel_update[False]": 148.3, + "test_pay.py::test_invalid_onion_channel_update[True]": 138.7, + "test_pay.py::test_invoice_amount_override": 55.9, + "test_pay.py::test_invoice_pay_desc_with_quotes[False]": 64.6, + "test_pay.py::test_invoice_pay_desc_with_quotes[True]": 47.7, + "test_pay.py::test_keysend[keysend]": 104.7, + "test_pay.py::test_keysend[xkeysend]": 91.3, + "test_pay.py::test_keysend_description_size_limit[keysend]": 61.8, + "test_pay.py::test_keysend_description_size_limit[xkeysend]": 63.5, + "test_pay.py::test_keysend_maxfee[keysend]": 100.8, + "test_pay.py::test_keysend_maxfee[xkeysend]": 87.4, + "test_pay.py::test_keysend_routehint": 151.2, + "test_pay.py::test_keysend_strip_tlvs[keysend]": 74.5, + "test_pay.py::test_keysend_strip_tlvs[xkeysend]": 56.4, + "test_pay.py::test_listpay_result_with_paymod[keysend]": 85.0, + "test_pay.py::test_listpay_result_with_paymod[xkeysend]": 63.6, + "test_pay.py::test_listpays_with_filter_by_status[False]": 69.3, + "test_pay.py::test_listpays_with_filter_by_status[True]": 61.1, + "test_pay.py::test_listsendpays_and_listpays_order[False]": 91.8, + "test_pay.py::test_listsendpays_and_listpays_order[True]": 40.0, + "test_pay.py::test_listsendpays_crash": 26.9, + "test_pay.py::test_mpp_adaptive[False]": 171.0, + "test_pay.py::test_mpp_adaptive[True]": 185.5, + "test_pay.py::test_mpp_interference_2": 0.1, + "test_pay.py::test_mpp_overload_payee[False]": 0.1, + "test_pay.py::test_mpp_overload_payee[True]": 0.1, + "test_pay.py::test_mpp_waitblockheight_routehint_conflict[False]": 134.0, + "test_pay.py::test_mpp_waitblockheight_routehint_conflict[True]": 100.3, + "test_pay.py::test_offer": 48.3, + "test_pay.py::test_offer_currency_no_amount": 32.4, + "test_pay.py::test_offer_deprecated_api": 51.4, + "test_pay.py::test_offer_experimental_fields": 84.5, + "test_pay.py::test_offer_path_self": 126.9, + "test_pay.py::test_offer_paths": 171.2, + "test_pay.py::test_offer_selfpay": 59.2, + "test_pay.py::test_offer_with_private_channels_multyhop2": 139.0, + "test_pay.py::test_onionmessage_ratelimit": 0.1, + "test_pay.py::test_parallel_channels_reserve": 67.1, + "test_pay.py::test_partial_payment": 165.3, + "test_pay.py::test_partial_payment_htlc_loss": 109.1, + "test_pay.py::test_partial_payment_restart": 0.9, + "test_pay.py::test_partial_payment_timeout": 130.3, + "test_pay.py::test_pay0": 72.8, + "test_pay.py::test_pay[False]": 71.8, + "test_pay.py::test_pay[True]": 53.4, + "test_pay.py::test_pay_amounts[False]": 99.6, + "test_pay.py::test_pay_amounts[True]": 44.4, + "test_pay.py::test_pay_avoid_low_fee_chan": 161.2, + "test_pay.py::test_pay_blockheight_mismatch[False]": 167.6, + "test_pay.py::test_pay_blockheight_mismatch[True]": 127.3, + "test_pay.py::test_pay_bolt11_metadata": 76.5, + "test_pay.py::test_pay_disconnect": 117.0, + "test_pay.py::test_pay_error_update_fees": 111.5, + "test_pay.py::test_pay_exclude_node": 132.6, + "test_pay.py::test_pay_exemptfee[False]": 85.2, + "test_pay.py::test_pay_exemptfee[True]": 82.6, + "test_pay.py::test_pay_fail_unconfirmed_channel[False]": 52.0, + "test_pay.py::test_pay_fail_unconfirmed_channel[True]": 71.4, + "test_pay.py::test_pay_invstring[False]": 51.1, + "test_pay.py::test_pay_invstring[True]": 84.3, + "test_pay.py::test_pay_limits": 87.4, + "test_pay.py::test_pay_manual_exclude": 76.7, + "test_pay.py::test_pay_maxdelay_direct_channel": 66.1, + "test_pay.py::test_pay_maxfee_shadow[False]": 78.4, + "test_pay.py::test_pay_maxfee_shadow[True]": 92.3, + "test_pay.py::test_pay_middle_fail": 88.7, + "test_pay.py::test_pay_multichannel_use_zeroconf[False]": 76.4, + "test_pay.py::test_pay_multichannel_use_zeroconf[True]": 82.7, + "test_pay.py::test_pay_no_secret": 40.6, + "test_pay.py::test_pay_optional_args[False]": 105.8, + "test_pay.py::test_pay_optional_args[True]": 60.2, + "test_pay.py::test_pay_partial_msat": 137.0, + "test_pay.py::test_pay_peer[False]": 111.9, + "test_pay.py::test_pay_peer[True]": 120.4, + "test_pay.py::test_pay_remember_hint[False]": 114.9, + "test_pay.py::test_pay_retry[False]": 0.1, + "test_pay.py::test_pay_retry[True]": 0.1, + "test_pay.py::test_pay_routeboost": 0.1, + "test_pay.py::test_pay_routehint_minhtlc[False]": 117.7, + "test_pay.py::test_pay_routehint_minhtlc[True]": 159.0, + "test_pay.py::test_pay_unannounced_routehint[False]": 95.1, + "test_pay.py::test_pay_unannounced_routehint[True]": 86.9, + "test_pay.py::test_pay_variants[False]": 66.2, + "test_pay.py::test_pay_variants[True]": 91.5, + "test_pay.py::test_pay_waitblockheight_timeout": 108.0, + "test_pay.py::test_pay_while_opening_channel[False]": 76.2, + "test_pay.py::test_pay_while_opening_channel[True]": 114.9, + "test_pay.py::test_payerkey[False]": 0.1, + "test_pay.py::test_payerkey[True]": 0.1, + "test_pay.py::test_payment_duplicate_uncommitted": 88.5, + "test_pay.py::test_payment_failed_persistence[False]": 183.3, + "test_pay.py::test_payment_failed_persistence[True]": 162.0, + "test_pay.py::test_payment_success_persistence[False]": 124.3, + "test_pay.py::test_payment_success_persistence[True]": 117.9, + "test_pay.py::test_recurrence_escaped_label": 75.2, + "test_pay.py::test_recurrence_expired_offer": 99.4, + "test_pay.py::test_recurring_currency_invoice_refresh": 62.0, + "test_pay.py::test_reject_invalid_payload[False]": 68.9, + "test_pay.py::test_reject_invalid_payload[True]": 41.6, + "test_pay.py::test_repay": 57.0, + "test_pay.py::test_retry_after_success_pending_straggler": 124.6, + "test_pay.py::test_routehint_tous": 109.6, + "test_pay.py::test_self_pay[False]": 64.2, + "test_pay.py::test_self_pay[True]": 55.5, + "test_pay.py::test_self_sendpay": 39.2, + "test_pay.py::test_sendinvoice": 75.8, + "test_pay.py::test_sendinvoice_blindedpath": 107.6, + "test_pay.py::test_sendonion_rpc": 116.8, + "test_pay.py::test_sendonion_sendpay": 63.3, + "test_pay.py::test_sendpay": 83.8, + "test_pay.py::test_sendpay_cant_afford[False]": 74.3, + "test_pay.py::test_sendpay_cant_afford[True]": 56.8, + "test_pay.py::test_sendpay_grouping": 117.0, + "test_pay.py::test_sendpay_msatoshi_arg": 62.9, + "test_pay.py::test_sendpay_onion_overflow": 75.7, + "test_pay.py::test_sendpays_wait": 76.3, + "test_pay.py::test_setchannel_all": 73.2, + "test_pay.py::test_setchannel_enforcement_delay": 89.7, + "test_pay.py::test_setchannel_restart[False]": 129.5, + "test_pay.py::test_setchannel_restart[True]": 75.4, + "test_pay.py::test_setchannel_routing": 100.4, + "test_pay.py::test_setchannel_startup_opts": 35.3, + "test_pay.py::test_setchannel_state": 91.8, + "test_pay.py::test_setchannel_usage": 50.8, + "test_pay.py::test_setchannel_zero[False]": 74.0, + "test_pay.py::test_setchannel_zero[True]": 89.7, + "test_pay.py::test_shadow_routing": 86.3, + "test_pay.py::test_strip_lightning_suffix_from_inv[False]": 51.6, + "test_pay.py::test_strip_lightning_suffix_from_inv[True]": 76.9, + "test_pay.py::test_unreachable_routehint": 93.8, + "test_pay.py::test_wait_sendpay": 58.3, + "test_pay.py::test_xkeysend_layer": 116.2, + "test_plugin.py::test_all_subscription": 51.4, + "test_plugin.py::test_async_rpcmethod": 42.9, + "test_plugin.py::test_autoclean": 273.9, + "test_plugin.py::test_autoclean_batch": 115.8, + "test_plugin.py::test_autoclean_once": 94.2, + "test_plugin.py::test_autoclean_once_zero_age": 34.3, + "test_plugin.py::test_autoclean_timer_crash": 41.4, + "test_plugin.py::test_bcli": 67.2, + "test_plugin.py::test_bcli_concurrent": 38.6, + "test_plugin.py::test_bcli_getutxout_failure": 44.6, + "test_plugin.py::test_bcli_getutxout_failure_fundchannel_cancel": 70.1, + "test_plugin.py::test_bcli_retry_timeout": 49.7, + "test_plugin.py::test_bcli_sendrawtransaction_already_in_chain": 33.4, + "test_plugin.py::test_bitcoin_backend": 99.6, + "test_plugin.py::test_bitcoin_backend_gianttx": 639.8, + "test_plugin.py::test_bitcoin_bad_estimatefee": 90.5, + "test_plugin.py::test_block_added_notifications": 90.7, + "test_plugin.py::test_bwatch_add_watch_creates_datastore_entry": 46.0, + "test_plugin.py::test_bwatch_block_history_rollback": 0.1, + "test_plugin.py::test_bwatch_blockdepth_watch_creates_datastore_entry": 40.1, + "test_plugin.py::test_bwatch_blockdepth_watch_fires_each_block": 0.1, + "test_plugin.py::test_bwatch_blockdepth_watch_multiple_owners": 31.7, + "test_plugin.py::test_bwatch_blockdepth_watch_no_fire_before_start_block": 41.9, + "test_plugin.py::test_bwatch_blockdepth_watch_persists_across_restart": 0.1, + "test_plugin.py::test_bwatch_blockdepth_watch_remove": 50.8, + "test_plugin.py::test_bwatch_listwatch": 0.6, + "test_plugin.py::test_bwatch_multiple_owners_same_watch": 33.4, + "test_plugin.py::test_bwatch_no_rescan_for_future_start_block": 37.6, + "test_plugin.py::test_bwatch_outpoint_watch": 41.9, + "test_plugin.py::test_bwatch_outpoint_watch_notifies_lightningd": 50.2, + "test_plugin.py::test_bwatch_remove_last_owner_deletes_watch": 33.5, + "test_plugin.py::test_bwatch_remove_one_owner_keeps_watch": 35.0, + "test_plugin.py::test_bwatch_reorg_1_block": 42.4, + "test_plugin.py::test_bwatch_reorg_2_blocks": 0.1, + "test_plugin.py::test_bwatch_reorg_at_startup": 0.1, + "test_plugin.py::test_bwatch_reorg_long_chain": 53.3, + "test_plugin.py::test_bwatch_rescan_notifies_lightningd": 0.1, + "test_plugin.py::test_bwatch_rescan_scriptpubkey": 62.7, + "test_plugin.py::test_bwatch_rescan_triggered_for_past_start_block": 37.5, + "test_plugin.py::test_bwatch_same_owner_adds_twice": 50.5, + "test_plugin.py::test_bwatch_scriptpubkey_watch": 27.6, + "test_plugin.py::test_bwatch_scriptpubkey_watch_notifies_lightningd": 0.1, + "test_plugin.py::test_bwatch_spk_watch_reorg_demotes_outputs": 37.6, + "test_plugin.py::test_bwatch_watches_persist_across_restart": 90.3, + "test_plugin.py::test_channel_opened_notification": 42.0, + "test_plugin.py::test_channel_state_change_history": 69.5, + "test_plugin.py::test_channel_state_changed_bilateral": 77.3, + "test_plugin.py::test_channel_state_changed_unilateral": 118.6, + "test_plugin.py::test_coin_movement_notices": 186.2, + "test_plugin.py::test_command_collision": 28.8, + "test_plugin.py::test_commando": 55.2, + "test_plugin.py::test_commando_stress": 0.1, + "test_plugin.py::test_db_hook": 35.3, + "test_plugin.py::test_db_hook_multiple": 32.4, + "test_plugin.py::test_dev_builtin_plugins_unimportant": 28.9, + "test_plugin.py::test_dynamic_args": 40.8, + "test_plugin.py::test_dynamic_args_options_array": 28.2, + "test_plugin.py::test_dynamic_option_python_plugin": 52.6, + "test_plugin.py::test_exposesecret[False]": 2.9, + "test_plugin.py::test_exposesecret[True]": 1.1, + "test_plugin.py::test_exposesecret_with_hsm_passphrase": 1.1, + "test_plugin.py::test_exposesecret_with_mnemonic_no_passphrase": 0.8, + "test_plugin.py::test_failing_plugins": 11.0, + "test_plugin.py::test_feature_set": 22.5, + "test_plugin.py::test_forward_event_notification": 104.8, + "test_plugin.py::test_hook_chaining": 41.3, + "test_plugin.py::test_hook_crash": 205.9, + "test_plugin.py::test_hook_dep": 83.0, + "test_plugin.py::test_hook_dep_stable": 55.1, + "test_plugin.py::test_hook_in_use": 0.1, + "test_plugin.py::test_htlc_accepted_hook_crash": 100.7, + "test_plugin.py::test_htlc_accepted_hook_customtlvs": 98.1, + "test_plugin.py::test_htlc_accepted_hook_direct_restart": 82.6, + "test_plugin.py::test_htlc_accepted_hook_direct_restart_blinded": 113.3, + "test_plugin.py::test_htlc_accepted_hook_fail": 101.3, + "test_plugin.py::test_htlc_accepted_hook_failmsg": 70.5, + "test_plugin.py::test_htlc_accepted_hook_failonion": 77.1, + "test_plugin.py::test_htlc_accepted_hook_forward_restart": 95.8, + "test_plugin.py::test_htlc_accepted_hook_fwdto": 77.6, + "test_plugin.py::test_htlc_accepted_hook_malformedtlvs": 64.9, + "test_plugin.py::test_htlc_accepted_hook_resolve": 157.3, + "test_plugin.py::test_htlc_accepted_hook_restart_after_force_close": 83.6, + "test_plugin.py::test_htlc_accepted_hook_restart_during_shutdown": 105.0, + "test_plugin.py::test_huge_log_entry": 104.9, + "test_plugin.py::test_important_plugin": 115.0, + "test_plugin.py::test_important_plugin_shutdown": 24.7, + "test_plugin.py::test_inline_plugin_wait_for_log_no_selfmatch": 53.1, + "test_plugin.py::test_invoice_creation_notification": 39.0, + "test_plugin.py::test_invoice_payment_hook": 109.7, + "test_plugin.py::test_invoice_payment_hook_hold": 58.7, + "test_plugin.py::test_invoice_payment_notification": 84.3, + "test_plugin.py::test_keysend_plugin": 77.7, + "test_plugin.py::test_libplugin": 182.6, + "test_plugin.py::test_libplugin_deprecated": 32.9, + "test_plugin.py::test_listchannels_broken_message": 38.1, + "test_plugin.py::test_millisatoshi_passthrough": 25.2, + "test_plugin.py::test_notify": 47.0, + "test_plugin.py::test_openchannel_hook": 82.6, + "test_plugin.py::test_openchannel_hook_chaining": 58.5, + "test_plugin.py::test_openchannel_hook_channel_type": 63.3, + "test_plugin.py::test_openchannel_hook_error_handling": 83.6, + "test_plugin.py::test_option_passthrough": 25.1, + "test_plugin.py::test_option_types": 145.2, + "test_plugin.py::test_pay_plugin": 54.5, + "test_plugin.py::test_pay_plugin_notifications": 72.4, + "test_plugin.py::test_peer_connected_remote_addr": 60.7, + "test_plugin.py::test_peer_storage": 206.4, + "test_plugin.py::test_peer_storage_refresh_three_peers": 192.2, + "test_plugin.py::test_plugin_command": 98.3, + "test_plugin.py::test_plugin_connect_notifications": 45.7, + "test_plugin.py::test_plugin_connected_hook_chaining": 53.5, + "test_plugin.py::test_plugin_connected_hook_disconnect_crash": 43.6, + "test_plugin.py::test_plugin_dir": 47.9, + "test_plugin.py::test_plugin_disable": 216.7, + "test_plugin.py::test_plugin_fail": 33.0, + "test_plugin.py::test_plugin_fail_on_startup": 111.5, + "test_plugin.py::test_plugin_feature_announce": 31.4, + "test_plugin.py::test_plugin_feature_remove": 31.7, + "test_plugin.py::test_plugin_hook": 85.2, + "test_plugin.py::test_plugin_nostart": 0.9, + "test_plugin.py::test_plugin_persist_option": 31.3, + "test_plugin.py::test_plugin_shutdown": 109.9, + "test_plugin.py::test_plugin_slowinit": 64.6, + "test_plugin.py::test_plugin_startdir_lol": 60.9, + "test_plugin.py::test_pyln_request_notify": 29.7, + "test_plugin.py::test_renepay_not_important": 51.9, + "test_plugin.py::test_replacement_payload": 67.0, + "test_plugin.py::test_restart_on_update": 28.5, + "test_plugin.py::test_rpc_command_hook": 23.8, + "test_plugin.py::test_rpc_passthrough": 39.8, + "test_plugin.py::test_self_disable": 55.7, + "test_plugin.py::test_sendpay_failure_status": 86.6, + "test_plugin.py::test_sendpay_notifications": 191.0, + "test_plugin.py::test_sendpay_notifications_nowaiter": 124.5, + "test_plugin.py::test_shutdown_peer_reconnect": 0.6, + "test_plugin.py::test_sql": 223.5, + "test_plugin.py::test_sql_crash": 20.1, + "test_plugin.py::test_sql_deprecated": 49.9, + "test_plugin.py::test_sql_during_change": 56.4, + "test_plugin.py::test_sql_limit_per_list": 133.7, + "test_plugin.py::test_sql_parallel": 56.3, + "test_plugin.py::test_utf8_passthrough": 31.1, + "test_plugin.py::test_warning_notification": 25.0, + "test_plugin.py::test_watchtower": 105.2, + "test_reckless.py::test_basic_help": 0.9, + "test_reckless.py::test_contextual_help": 2.9, + "test_reckless.py::test_disable_enable": 2.5, + "test_reckless.py::test_install": 3.9, + "test_reckless.py::test_local_dir_install": 1.2, + "test_reckless.py::test_poetry_install": 1.2, + "test_reckless.py::test_reckless_uv_install": 0.1, + "test_reckless.py::test_search": 1.9, + "test_reckless.py::test_search_partial_match": 1.8, + "test_reckless.py::test_sources": 2.8, + "test_reckless.py::test_tag_install": 3.5, + "test_renepay.py::test_amounts": 64.4, + "test_renepay.py::test_cltv_value": 89.4, + "test_renepay.py::test_concurrency": 68.7, + "test_renepay.py::test_description": 62.9, + "test_renepay.py::test_direction_matters": 107.1, + "test_renepay.py::test_errors": 229.6, + "test_renepay.py::test_fee_allocation": 108.6, + "test_renepay.py::test_fees": 156.2, + "test_renepay.py::test_hardmpp": 161.8, + "test_renepay.py::test_hardmpp2": 179.4, + "test_renepay.py::test_htlc_max": 198.0, + "test_renepay.py::test_htlcmax0": 143.2, + "test_renepay.py::test_limits": 144.7, + "test_renepay.py::test_local_htlcmax0": 84.1, + "test_renepay.py::test_mpp": 139.4, + "test_renepay.py::test_offer_selfpay": 40.8, + "test_renepay.py::test_offers": 125.8, + "test_renepay.py::test_pay": 62.1, + "test_renepay.py::test_previous_sendpays": 1.3, + "test_renepay.py::test_privatechan": 123.8, + "test_renepay.py::test_self_pay": 77.9, + "test_renepay.py::test_shadow_routing": 86.9, + "test_renepay.py::test_simple": 55.0, + "test_renepay.py::test_unannounced": 59.5, + "test_restart.py::test_agressive_restart": 98.8, + "test_runes.py::test_badrune": 547.1, + "test_runes.py::test_blacklistrune": 72.9, + "test_runes.py::test_blacklistrune_out_of_range": 75.5, + "test_runes.py::test_checkrune": 15.7, + "test_runes.py::test_createrune": 45.6, + "test_runes.py::test_createrune_per_restriction": 47.5, + "test_runes.py::test_id_migration": 24.2, + "test_runes.py::test_invalid_restrictions": 31.0, + "test_runes.py::test_makesecret_rune_master_secret": 31.1, + "test_runes.py::test_missing_method_or_nodeid": 28.4, + "test_runes.py::test_nonnumeric_uniqueid": 38.5, + "test_runes.py::test_rune_bolt11_parse": 36.3, + "test_runes.py::test_rune_bolt12_parse": 63.6, + "test_runes.py::test_rune_error_messages": 34.0, + "test_runes.py::test_rune_method_missing": 35.8, + "test_runes.py::test_rune_pay_amount": 56.4, + "test_runes.py::test_showrune_id": 71.9, + "test_runes.py::test_showrunes[False]": 32.2, + "test_runes.py::test_showrunes[True]": 31.5, + "test_splice.py::test_easy_splice_in": 67.1, + "test_splice.py::test_easy_splice_out": 82.2, + "test_splice.py::test_easy_splice_out_into_channel": 142.5, + "test_splice.py::test_script_splice_in": 92.8, + "test_splice.py::test_script_splice_msat": 68.5, + "test_splice.py::test_script_splice_msat_roundup": 75.7, + "test_splice.py::test_script_splice_out": 74.7, + "test_splice.py::test_script_two_chan_splice_b": 84.6, + "test_splice.py::test_script_two_chan_splice_c": 95.7, + "test_splice.py::test_script_two_chan_splice_d": 91.0, + "test_splice.py::test_script_two_chan_splice_e": 97.9, + "test_splice.py::test_script_two_chan_splice_f": 67.1, + "test_splice.py::test_script_two_chan_splice_g": 70.7, + "test_splice.py::test_script_two_chan_splice_h": 99.6, + "test_splice.py::test_script_two_chan_splice_ii": 93.0, + "test_splice.py::test_script_two_chan_splice_in": 104.8, + "test_splice.py::test_script_two_chan_splice_inout": 121.1, + "test_splice.py::test_script_two_chan_splice_j": 77.7, + "test_splice.py::test_script_two_chan_splice_k": 72.2, + "test_splice.py::test_script_two_chan_splice_l": 115.4, + "test_splice.py::test_script_two_chan_splice_m": 63.4, + "test_splice.py::test_script_two_chan_splice_n": 100.4, + "test_splice.py::test_script_two_chan_splice_oo": 86.4, + "test_splice.py::test_script_two_chan_splice_out": 80.6, + "test_splice.py::test_script_two_chan_splice_p": 124.7, + "test_splice.py::test_script_two_chan_splice_q": 85.5, + "test_splice.py::test_script_two_chan_splice_r": 87.7, + "test_splice.py::test_script_two_chan_splice_s": 70.5, + "test_splice.py::test_script_two_chan_splice_t": 90.3, + "test_splice.py::test_script_two_chan_splice_u": 92.8, + "test_splice.py::test_script_two_chan_splice_v": 95.2, + "test_splice.py::test_script_two_chan_splice_x": 67.4, + "test_splice.py::test_script_two_chan_splice_y": 90.7, + "test_splice.py::test_script_two_chan_splice_z": 97.0, + "test_splice.py::test_splice_aggravated_close[False]": 54.5, + "test_splice.py::test_splice_aggravated_close[True]": 131.7, + "test_splicing.py::test_commit_crash_splice": 99.5, + "test_splicing.py::test_invalid_splice": 74.6, + "test_splicing.py::test_route_by_old_scid": 152.9, + "test_splicing.py::test_splice": 57.9, + "test_splicing.py::test_splice_abort_after_sigs_sent": 58.1, + "test_splicing.py::test_splice_candidate_spent_before_lock": 85.2, + "test_splicing.py::test_splice_feerate_too_high": 52.0, + "test_splicing.py::test_splice_gossip": 87.5, + "test_splicing.py::test_splice_listnodes": 58.6, + "test_splicing.py::test_splice_locked_then_force_close[accepter]": 80.1, + "test_splicing.py::test_splice_locked_then_force_close[initiator]": 76.9, + "test_splicing.py::test_splice_nosign": 65.6, + "test_splicing.py::test_splice_out": 69.6, + "test_splicing.py::test_splice_rbf": 101.3, + "test_splicing.py::test_splice_rbf_htlc_sigs": 66.8, + "test_splicing.py::test_splice_sent_sigs_flag": 48.0, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[-1-1000000]": 96.8, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[0-253]": 77.3, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[2000000-1000000]": 98.2, + "test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade[4294967295-1000000]": 81.9, + "test_splicing.py::test_splice_stuck_htlc": 119.2, + "test_splicing.py::test_splice_tx_add_output_sum_above_max_supply": 79.6, + "test_splicing.py::test_splice_unannounced": 73.8, + "test_splicing.py::test_splice_unconfirmed_force_close_publishes_current": 62.6, + "test_splicing.py::test_two_chan_splice_in": 114.1, + "test_splicing_disconnect.py::test_splice_disconnect_commit": 136.0, + "test_splicing_disconnect.py::test_splice_disconnect_sig": 152.2, + "test_splicing_disconnect.py::test_splice_funding_tx_index_increments": 108.0, + "test_splicing_disconnect.py::test_splice_inflight_funding_tx_index": 100.5, + "test_splicing_disconnect.py::test_splice_locked_one_side_no_channel_ready": 117.1, + "test_splicing_disconnect.py::test_splice_reconnect_after_lock_no_channel_ready": 99.3, + "test_splicing_disconnect.py::test_splice_upgrade_with_pending_splice": 149.4, + "test_splicing_insane.py::test_splice_insane_a": 73.5, + "test_splicing_insane.py::test_splice_insane_b": 117.3, + "test_splicing_insane.py::test_splice_insane_c": 118.9, + "test_splicing_insane.py::test_splice_insane_d": 121.4, + "test_splicing_insane.py::test_splice_insane_e": 107.2, + "test_splicing_insane.py::test_splice_insane_f": 65.3, + "test_wallet.py::test_addfunds_from_block": 35.7, + "test_wallet.py::test_addpsbt_unmodifiable": 39.8, + "test_wallet.py::test_addpsbtoutput": 27.5, + "test_wallet.py::test_bip86_address_type_validation": 24.3, + "test_wallet.py::test_bip86_deterministic_addresses": 73.8, + "test_wallet.py::test_bip86_full_bitcoin_integration": 39.3, + "test_wallet.py::test_bip86_index_boundaries": 51.9, + "test_wallet.py::test_bip86_listaddresses": 28.2, + "test_wallet.py::test_bip86_mnemonic_recovery": 99.1, + "test_wallet.py::test_bip86_newaddr_rpc": 36.3, + "test_wallet.py::test_bip86_psbt_integration": 70.3, + "test_wallet.py::test_bip86_vs_regular_p2tr": 45.5, + "test_wallet.py::test_fundchannel_listtransaction": 42.7, + "test_wallet.py::test_fundpsbt": 31.6, + "test_wallet.py::test_fundpsbt_feerates[bech32]": 68.3, + "test_wallet.py::test_fundpsbt_feerates[p2tr]": 65.7, + "test_wallet.py::test_hsm_wrong_passphrase_crash": 1.8, + "test_wallet.py::test_hsmtool_all_commands_work_with_mnemonic_formats[no_passphrase]": 5.7, + "test_wallet.py::test_hsmtool_all_commands_work_with_mnemonic_formats[with_passphrase]": 1.3, + "test_wallet.py::test_hsmtool_checkhsm_legacy_encrypted_with_mnemonic_no_passphrase": 3.0, + "test_wallet.py::test_hsmtool_checkhsm_legacy_encrypted_with_mnemonic_passphrase": 3.5, + "test_wallet.py::test_hsmtool_checkhsm_variants[correct_mnemonic_no_passphrase]": 0.8, + "test_wallet.py::test_hsmtool_checkhsm_variants[correct_mnemonic_with_passphrase]": 14.9, + "test_wallet.py::test_hsmtool_checkhsm_variants[wrong_mnemonic_should_fail]": 1.2, + "test_wallet.py::test_hsmtool_checkhsm_variants[wrong_passphrase_should_fail]": 15.3, + "test_wallet.py::test_hsmtool_deterministic_node_ids": 18.0, + "test_wallet.py::test_hsmtool_dump_descriptors": 41.8, + "test_wallet.py::test_hsmtool_generatehsm_file_exists_error": 3.5, + "test_wallet.py::test_hsmtool_generatehsm_variants[abandon": 32.4, + "test_wallet.py::test_hsmtool_generatehsm_variants[ritual": 33.0, + "test_wallet.py::test_hsmtool_getnodeid": 45.3, + "test_wallet.py::test_hsmtool_secret_decryption": 2.1, + "test_wallet.py::test_minconf_withdraw": 39.6, + "test_wallet.py::test_multiwithdraw_simple": 41.9, + "test_wallet.py::test_old_htlcs_cleanup": 124.1, + "test_wallet.py::test_onchain_missing_no_p2tr_migrate": 1.0, + "test_wallet.py::test_p2tr_deposit_withdrawal": 38.5, + "test_wallet.py::test_p2tr_deposit_withdrawal_with_bip86": 28.9, + "test_wallet.py::test_pending_payments_cleanup": 53.7, + "test_wallet.py::test_psbt_version": 115.7, + "test_wallet.py::test_repro_4258": 42.1, + "test_wallet.py::test_rescan_missing_utxo": 7.9, + "test_wallet.py::test_reserveinputs": 75.7, + "test_wallet.py::test_sendpsbt_confirm[False]": 53.3, + "test_wallet.py::test_sendpsbt_confirm[True]": 75.8, + "test_wallet.py::test_sign_and_send_psbt": 60.4, + "test_wallet.py::test_sign_external_psbt": 71.1, + "test_wallet.py::test_sign_signed_psbt": 39.9, + "test_wallet.py::test_txprepare": 46.1, + "test_wallet.py::test_txprepare_feerate": 51.7, + "test_wallet.py::test_txprepare_multi": 31.8, + "test_wallet.py::test_txsend": 44.3, + "test_wallet.py::test_unspend_during_reorg": 123.3, + "test_wallet.py::test_upgradewallet": 48.8, + "test_wallet.py::test_utxopsbt": 41.2, + "test_wallet.py::test_withdraw": 75.2, + "test_wallet.py::test_withdraw_bech32m": 52.8, + "test_wallet.py::test_withdraw_close_output_signed": 144.6, + "test_wallet.py::test_withdraw_nlocktime": 54.2, + "test_wallet.py::test_withdraw_nlocktime_fuzz": 0.9, + "test_wallet.py::test_withdraw_returns_signed_tx": 41.2, + "test_wallet.py::test_withdraw_unreserves_inputs_on_send_failure": 27.4, + "test_wallet.py::test_withdraw_unreserves_on_broadcast_failure": 80.3, + "test_xpay.py::test_attempt_notifications": 108.0, + "test_xpay.py::test_blinded_path_fees": 108.8, + "test_xpay.py::test_error_messages": 63.3, + "test_xpay.py::test_fail_after_success[False]": 83.3, + "test_xpay.py::test_fail_after_success[True]": 147.9, + "test_xpay.py::test_pay_fakenet": 131.0, + "test_xpay.py::test_sendamount": 127.9, + "test_xpay.py::test_sendamount_bip353": 67.0, + "test_xpay.py::test_sendamount_maxparts": 56.3, + "test_xpay.py::test_xpay_bip353": 76.1, + "test_xpay.py::test_xpay_blockheight_mismatch": 115.6, + "test_xpay.py::test_xpay_bolt12_no_mpp": 65.7, + "test_xpay.py::test_xpay_circular_routehint": 57.5, + "test_xpay.py::test_xpay_currency_offer": 63.9, + "test_xpay.py::test_xpay_error_update_fees": 92.6, + "test_xpay.py::test_xpay_error_update_wrong_channel": 96.8, + "test_xpay.py::test_xpay_failing_node_nonfinal": 147.2, + "test_xpay.py::test_xpay_failing_node_tolerance": 191.2, + "test_xpay.py::test_xpay_fake_channeld[False]": 3.2, + "test_xpay.py::test_xpay_fake_channeld[True]": 8.9, + "test_xpay.py::test_xpay_fee_insufficient_bias": 204.4, + "test_xpay.py::test_xpay_fee_insufficient_disable": 170.4, + "test_xpay.py::test_xpay_get_error_with_update": 91.5, + "test_xpay.py::test_xpay_informs_askrene_on_success": 47.7, + "test_xpay.py::test_xpay_limited_max_accepted_htlcs": 131.9, + "test_xpay.py::test_xpay_maxdelay": 56.6, + "test_xpay.py::test_xpay_maxhops": 136.3, + "test_xpay.py::test_xpay_maxhops_bolt11": 7.0, + "test_xpay.py::test_xpay_maxparts": 0.5, + "test_xpay.py::test_xpay_maxparts_bip353": 35.0, + "test_xpay.py::test_xpay_maxparts_no_mpp_bolt11": 120.8, + "test_xpay.py::test_xpay_maxparts_no_mpp_bolt12": 108.7, + "test_xpay.py::test_xpay_maxparts_offer": 37.6, + "test_xpay.py::test_xpay_maxparts_receiver_limit": 6.1, + "test_xpay.py::test_xpay_maxparts_unannounced_retry": 15.2, + "test_xpay.py::test_xpay_no_mpp": 70.2, + "test_xpay.py::test_xpay_offer": 67.9, + "test_xpay.py::test_xpay_offer_invoice_amount_mismatch": 50.4, + "test_xpay.py::test_xpay_onion_budget_blinded": 42.2, + "test_xpay.py::test_xpay_onion_budget_blinded_introduction": 44.5, + "test_xpay.py::test_xpay_onion_budget_bolt11_metadata": 110.1, + "test_xpay.py::test_xpay_onion_budget_keysend": 29.6, + "test_xpay.py::test_xpay_partial_msat": 149.3, + "test_xpay.py::test_xpay_preapprove": 100.8, + "test_xpay.py::test_xpay_selfpay": 46.3, + "test_xpay.py::test_xpay_shadow_cltv": 61.6, + "test_xpay.py::test_xpay_simple": 116.9, + "test_xpay.py::test_xpay_slow_mode": 210.8, + "test_xpay.py::test_xpay_takeover": 94.0, + "test_xpay.py::test_xpay_takeover_null_parms": 135.0, + "test_xpay.py::test_xpay_timeout": 136.4, + "test_xpay.py::test_xpay_twohop_bug": 106.3, + "test_xpay.py::test_xpay_unannounced": 39.6, + "test_xpay.py::test_xpay_unknown_next_peer_excludes_node": 86.7, + "test_xpay.py::test_xpay_user_layers": 137.4, + "test_xpay.py::test_xpay_zeroconf": 78.8 +} diff --git a/tests/test_gossip.py b/tests/test_gossip.py index 45e1fea9beca..ebee8a193baf 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -2,7 +2,7 @@ from fixtures import * # noqa: F401,F403 from fixtures import TEST_NETWORK from pyln.client import RpcError, Millisatoshi -from pyln.testing.utils import reserve_unused_port, drop_unused_port +from pyln.testing.utils import reserve_unused_port, drop_unused_port, VALGRIND from utils import ( wait_for, TIMEOUT, only_one, sync_blockheight, expected_node_features, @@ -342,8 +342,9 @@ def test_gossip_timestamp_filter(node_factory, bitcoind, chainparams): l3.wait_for_channel_updates([chan12]) after_12 = int(time.time()) - # Make another one, different timestamp. - time.sleep(10) + # Make another one, strictly after the first filter's upper bound (after_12 + 1). + while int(time.time()) <= after_12 + 1: + time.sleep(0.2) before_23 = int(time.time()) chan23, _ = l2.fundchannel(l3, 10**5) bitcoind.generate_block(5) @@ -2221,10 +2222,17 @@ def test_dump_own_gossip(node_factory): def test_gossip_throttle(node_factory, bitcoind, chainparams): """Make some gossip, test it gets throttled""" + l4_opts = { + 'broken_log': 'Throttling (incoming|outgoing) peer', + 'dev-throttle-gossip': None, + } + if VALGRIND: + # Keep the 1000-byte/s traffic throttle active without letting + # Valgrind's ~20x CPU overhead blow the 1500usec dev CPU budget + # and stall until connectd's ping timeout hangs up on gossipwith. + l4_opts['dev-gossip-cpu-budget'] = 500000 l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True, - opts=[{}, {}, {}, - {'broken_log': 'Throttling (incoming|outgoing) peer', - 'dev-throttle-gossip': None}]) + opts=[{}, {}, {}, l4_opts]) # We expect: self-advertizement (3 messages for l1 and l4) plus # 4 node announcements, 3 channel announcements and 6 channel updates. diff --git a/tests/test_invoices.py b/tests/test_invoices.py index cb71b8e1a7de..cb60d3b2c8a1 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -1,6 +1,7 @@ from fixtures import * # noqa: F401,F403 from fixtures import TEST_NETWORK from pyln.client import RpcError, Millisatoshi +from pyln.testing.utils import SLOW_MACHINE, VALGRIND from utils import only_one, wait_for, wait_channel_quiescent, mine_funding_to_announce, TIMEOUT @@ -407,28 +408,26 @@ def test_invoice_expiry(node_factory, executor): # Test expiration waiting. # The second invoice created expires first. - # Times should be long enough even for our terrible CI runners! - l2.rpc.invoice('any', 'inv1', 'description', 16) - l2.rpc.invoice('any', 'inv2', 'description', 10) - l2.rpc.invoice('any', 'inv3', 'description', 22) + unit = 5 if VALGRIND or SLOW_MACHINE else 2 + l2.rpc.invoice('any', 'inv1', 'description', unit * 3) + l2.rpc.invoice('any', 'inv2', 'description', unit * 2) + l2.rpc.invoice('any', 'inv3', 'description', unit * 4) # Check waitinvoice correctly waits w1 = executor.submit(l2.rpc.waitinvoice, 'inv1') w2 = executor.submit(l2.rpc.waitinvoice, 'inv2') w3 = executor.submit(l2.rpc.waitinvoice, 'inv3') - time.sleep(2) # total 2 + time.sleep(unit) assert not w1.done() assert not w2.done() assert not w3.done() - time.sleep(7) # total 9 - assert not w1.done() - with pytest.raises(RpcError): # total 10 + with pytest.raises(RpcError): w2.result() + assert not w1.done() assert not w3.done() - time.sleep(5) # total 15 - with pytest.raises(RpcError): # total 16 + with pytest.raises(RpcError): w1.result() assert not w3.done() @@ -996,10 +995,11 @@ def test_expiry_startup_crash(node_factory, bitcoind): """We crash trying to expire invoice on startup""" l1 = node_factory.get_node() - l1.rpc.invoice(42, 'invlabel', 'invdesc', expiry=10) + expiry = 10 if VALGRIND or SLOW_MACHINE else 2 + inv = l1.rpc.invoice(42, 'invlabel', 'invdesc', expiry=expiry) l1.stop() - time.sleep(12) + time.sleep(max(0, inv['expires_at'] + 1 - time.time())) # Boom!: # 0x55eddb820d30 wait_index_increment # lightningd/wait.c:112 @@ -1016,6 +1016,7 @@ def test_expiry_startup_crash(node_factory, bitcoind): # 0x55eddb7dca6f main # lightningd/lightningd.c:1082 l1.start() + assert only_one(l1.rpc.listinvoices('invlabel')['invoices'])['status'] == 'expired' @unittest.skipIf(TEST_NETWORK != 'regtest', "The DB migration is network specific due to the chain var.") diff --git a/tests/test_misc.py b/tests/test_misc.py index a6ce184a9fbc..c1662be11a64 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -2939,6 +2939,7 @@ def test_unix_socket_path_length(node_factory, bitcoind, directory, executor, db # Let's just call it again to make sure it really works. l1.rpc.listconfigs() l1.stop() + db.stop() def test_waitblockheight(node_factory, executor, bitcoind): @@ -3904,6 +3905,7 @@ def test_version_reexec(node_factory, bitcoind): # We use a file to tell our openingd wrapper where the real one is with open(os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "openingd-real"), 'w') as f: f.write(os.path.abspath('lightningd/lightning_openingd')) + l1.daemon.opts.pop('dev-no-version-checks', None) l1.start() # This is a "version" message verfile = os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "openingd-version") diff --git a/tests/test_pay.py b/tests/test_pay.py index 7e990cd37f57..5b54ca1b726f 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -1734,8 +1734,8 @@ def test_forward_local_failed_stats(node_factory, bitcoind, executor): bitcoind.generate_block(100) sync_blockheight(bitcoind, [l2]) - # give time to let l2 store the local_failed stats - time.sleep(5) + # Wait for l2 to store all 5 local_failed stats + wait_for(lambda: len(l2.rpc.listforwards()['forwards']) == 5) # Select all forwardings, and check the status stats = l2.rpc.listforwards() @@ -1862,8 +1862,8 @@ def test_htlcs_cltv_only_difference(node_factory, bitcoind): r = l3.single_route(l4.info['id'], 10**8) l3.rpc.sendpay(r, h, payment_secret=inv['payment_secret']) - # Give them time to go through. - time.sleep(5) + # Wait for all three HTLCs to reach l4. + l4.daemon.wait_for_logs(['their htlc [0-9]+ dev_ignore_htlcs'] * 3) # Will all be connected OK. assert only_one(l1.rpc.listpeers(l2.info['id'])['peers'])['connected'] @@ -5148,7 +5148,7 @@ def test_fetchinvoice(node_factory, bitcoind): # Test timeout. l3.stop() with pytest.raises(RpcError, match='Timeout waiting for response'): - l1.rpc.call('fetchinvoice', {'offer': offer1['bolt12'], 'timeout': 10}) + l1.rpc.call('fetchinvoice', {'offer': offer1['bolt12'], 'timeout': 2}) def test_fetchinvoice_invoice_expiry(node_factory, bitcoind): @@ -5158,7 +5158,8 @@ def test_fetchinvoice_invoice_expiry(node_factory, bitcoind): # l2 is the offer node; dev-currency-expiry=2 makes the currency window short. l1, l2 = node_factory.line_graph(2, opts=[{}, - {'plugin': plugin, + {'disable-plugin': 'cln-currencyrate', + 'plugin': plugin, 'dev-currency-expiry': 10}]) # Plain msat offer: no currency, no absolute expiry → default expiry (7200). @@ -5184,10 +5185,11 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, opts=[{}, {'dev-allow-localhost': None}, {}]) - # Recurring offer. + # Recurring offer with a short period so we can test crossing period boundaries quickly. + period_secs = 45 if VALGRIND else (35 if SLOW_MACHINE else 8) offer3 = l2.rpc.call('offer', {'amount': '1msat', 'description': 'recurring test', - 'recurrence': '1minutes'}) + 'recurrence': f'{period_secs}seconds'}) assert only_one(l2.rpc.call('listoffers', [offer3['offer_id']])['offers'])['used'] is False ret = l1.rpc.call('fetchinvoice', {'offer': offer3['bolt12'], @@ -5195,8 +5197,8 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): 'recurrence_label': 'test recurrence'}) period1 = ret['next_period'] assert period1['counter'] == 1 - assert period1['endtime'] == period1['starttime'] + 59 - assert period1['paywindow_start'] == period1['starttime'] - 60 + assert period1['endtime'] == period1['starttime'] + period_secs - 1 + assert period1['paywindow_start'] == period1['starttime'] - period_secs assert period1['paywindow_end'] == period1['endtime'] assert only_one(l2.rpc.call('listoffers', [offer3['offer_id']])['offers'])['used'] is False @@ -5209,8 +5211,8 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): period2 = ret['next_period'] assert period2['counter'] == 2 assert period2['starttime'] == period1['endtime'] + 1 - assert period2['endtime'] == period2['starttime'] + 59 - assert period2['paywindow_start'] == period2['starttime'] - 60 + assert period2['endtime'] == period2['starttime'] + period_secs - 1 + assert period2['paywindow_start'] == period2['starttime'] - period_secs assert period2['paywindow_end'] == period2['endtime'] # Can't request 2 before paying 1. @@ -5229,32 +5231,34 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): # Wait until the correct moment. while time.time() < period1['starttime']: - time.sleep(1) + time.sleep(0.2) l1.rpc.call('fetchinvoice', {'offer': offer3['bolt12'], 'recurrence_counter': 2, 'recurrence_label': 'test recurrence'}) - # Now try an offer with a more complex paywindow (only 10 seconds before) + # Now try an offer with a more complex paywindow (half a period before) + pw_period = 20 if VALGRIND or SLOW_MACHINE else 8 + pw_before = pw_period // 2 offer = l2.rpc.call('offer', {'amount': '1msat', 'description': 'paywindow test', - 'recurrence': '20seconds', - 'recurrence_paywindow': '-10+0'})['bolt12'] + 'recurrence': f'{pw_period}seconds', + 'recurrence_paywindow': f'-{pw_before}+0'})['bolt12'] ret = l1.rpc.call('fetchinvoice', {'offer': offer, 'recurrence_counter': 0, 'recurrence_label': 'test paywindow'}) period3 = ret['next_period'] assert period3['counter'] == 1 - assert period3['endtime'] == period3['starttime'] + 19 - assert period3['paywindow_start'] == period3['starttime'] - 10 + assert period3['endtime'] == period3['starttime'] + pw_period - 1 + assert period3['paywindow_start'] == period3['starttime'] - pw_before assert period3['paywindow_end'] == period3['starttime'] l1.rpc.xpay(ret['invoice'], label='test paywindow') # We can get another invoice, as many times as we want. # (It may return the same one!). while int(time.time()) <= period3['paywindow_start']: - time.sleep(1) + time.sleep(0.2) l1.rpc.call('fetchinvoice', {'offer': offer, 'recurrence_counter': 1, @@ -5265,28 +5269,44 @@ def test_fetchinvoice_recurrence(node_factory, bitcoind): # Wait until too late! while int(time.time()) <= period3['paywindow_end']: - time.sleep(1) + time.sleep(0.2) with pytest.raises(RpcError, match=fr"Remote node sent failure message.*period_index 1 too late \(ended {period3['paywindow_end']}\)"): l1.rpc.call('fetchinvoice', {'offer': offer, 'recurrence_counter': 1, 'recurrence_label': 'test paywindow'}) + # Also check minute-unit recurrence parsing and next_period calculation + # without waiting a full minute. + offer_min = l2.rpc.call('offer', {'amount': '1msat', + 'description': 'recurring minutes test', + 'recurrence': '1minutes'}) + ret_min = l1.rpc.call('fetchinvoice', {'offer': offer_min['bolt12'], + 'recurrence_counter': 0, + 'recurrence_label': 'test recurrence min'}) + period_min = ret_min['next_period'] + assert period_min['counter'] == 1 + assert period_min['endtime'] == period_min['starttime'] + 59 + assert period_min['paywindow_start'] == period_min['starttime'] - 60 + assert period_min['paywindow_end'] == period_min['endtime'] + def test_recurrence_expired_offer(node_factory, bitcoind): """We *can* use an expired offer for successive recurrences""" l1, l2 = node_factory.line_graph(2) + expiry = 15 if VALGRIND or SLOW_MACHINE else 4 + abs_expiry = int(time.time()) + expiry offer = l2.rpc.offer(amount='1msat', description='paywindow test', - recurrence='20seconds', - absolute_expiry=int(time.time()) + 15) + recurrence=f'{expiry + 5}seconds', + absolute_expiry=abs_expiry) ret = l1.rpc.fetchinvoice(offer=offer['bolt12'], recurrence_counter=0, recurrence_label='test_recurrence_expired_offer') l1.rpc.xpay(ret['invoice'], label='test_recurrence_expired_offer') - time.sleep(16) + time.sleep(max(0, abs_expiry + 1 - time.time())) ret = l1.rpc.fetchinvoice(offer=offer['bolt12'], recurrence_counter=1, recurrence_label='test_recurrence_expired_offer') @@ -5300,11 +5320,12 @@ def test_recurring_currency_invoice_refresh(node_factory): """ plugin = os.path.join(os.path.dirname(__file__), 'plugins/currencyUSDAUD5000.py') - # l2 hosts the offer with a 10-second currency expiry (normally 600s) + currency_expiry = 10 if VALGRIND or SLOW_MACHINE else 3 + # l2 hosts the offer with a short currency expiry (normally 600s) l1, l2 = node_factory.line_graph(2, opts={'disable-plugin': 'cln-currencyrate', 'plugin': plugin, - 'dev-currency-expiry': 10}) + 'dev-currency-expiry': currency_expiry}) # Period is much longer than the currency expiry so we stay in period 0. offer = l2.rpc.call('offer', {'amount': '1USD', @@ -5316,7 +5337,7 @@ def test_recurring_currency_invoice_refresh(node_factory): 'recurrence_counter': 0, 'recurrence_label': 'refresh'})['invoice'] - # Second fetch within the 10-second window: server returns the same invoice. + # Second fetch within the currency-expiry window: server returns the same invoice. inv2 = l1.rpc.call('fetchinvoice', {'offer': offer, 'recurrence_counter': 0, 'recurrence_label': 'refresh'})['invoice'] @@ -5325,8 +5346,8 @@ def test_recurring_currency_invoice_refresh(node_factory): # Change the rate on l2 before the window expires (1 USD = 2500 msat now). l2.rpc.call('setcurrencyrate', {'msat_per_unit': 2500}) - # Wait for the 10-second currency expiry to lapse. - time.sleep(11) + # Wait for the currency expiry to lapse. + time.sleep(currency_expiry + 1) # Third fetch after expiry: server issues a fresh invoice at the new rate. inv3 = l1.rpc.call('fetchinvoice', {'offer': offer, @@ -5724,8 +5745,9 @@ def test_setchannel_enforcement_delay(node_factory, bitcoind): payment_secret=inv['payment_secret']) l1.rpc.waitsendpay(inv['payment_hash']) - # Now, give us 30 seconds please. - l2.rpc.setchannel("all", 3, 10000, enforcedelay=30) + # Now, give us a short grace period before enforcing the new fee. + delay = 15 if VALGRIND or SLOW_MACHINE else 3 + l2.rpc.setchannel("all", 3, 10000, enforcedelay=delay) inv = l3.rpc.invoice(1000, "test4", "test4") l1.rpc.sendpay(route, payment_hash=inv['payment_hash'], @@ -5733,7 +5755,7 @@ def test_setchannel_enforcement_delay(node_factory, bitcoind): l1.rpc.waitsendpay(inv['payment_hash']) l2.daemon.wait_for_log("Allowing payment using older feerate") - time.sleep(30) + time.sleep(delay + 1) inv = l3.rpc.invoice(1000, "test5", "test5") l1.rpc.sendpay(route, payment_hash=inv['payment_hash'], @@ -5947,6 +5969,7 @@ def test_pay_middle_fail(node_factory, bitcoind, executor): @unittest.skipIf(TEST_NETWORK != 'regtest', "Invoice is network specific") @pytest.mark.parametrize("old_hsmsecret", [True, False]) @pytest.mark.slow_test +@pytest.mark.xdist_group("heavy") def test_payerkey(node_factory, old_hsmsecret): """payerkey calculation should not change across releases!""" nodes = node_factory.get_nodes(7, opts={'old_hsmsecret': old_hsmsecret}) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index de74649e4221..8f30fa3b4c88 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -245,8 +245,9 @@ def test_plugin_dir(node_factory): def test_plugin_slowinit(node_factory): """Tests that the 'plugin' RPC command times out if plugin doesnt respond""" - os.environ['SLOWINIT_TIME'] = '121' - l1 = node_factory.get_node() + timeout_secs = 30 if VALGRIND else 10 + os.environ['SLOWINIT_TIME'] = str(timeout_secs + 5) + l1 = node_factory.get_node(options={'dev-plugin-startup-timeout-secs': timeout_secs}) with pytest.raises(RpcError, match=': timed out before replying to init'): l1.rpc.plugin_start(os.path.join(os.getcwd(), "tests/plugins/slow_init.py")) @@ -302,7 +303,8 @@ def test_plugin_command(node_factory): # Test that we cannot stop a started plugin with 'dynamic' flag set to # False l2 = node_factory.get_node(options={ - "plugin": os.path.join(os.getcwd(), "tests/plugins/static.py") + "plugin": os.path.join(os.getcwd(), "tests/plugins/static.py"), + "dev-plugin-startup-timeout-secs": 30 if VALGRIND else 10, }) with pytest.raises(RpcError, match=r"static.py cannot be managed when lightningd is up"): l2.rpc.plugin_stop(plugin="static.py") @@ -444,6 +446,8 @@ def test_failing_plugins(directory): with pytest.raises(subprocess.CalledProcessError): subprocess.check_output([ 'lightningd/lightningd', + '--developer', + '--dev-plugin-startup-timeout-secs=10', '--lightning-dir={}'.format(directory), '--plugin={}'.format(p), '--help', @@ -3670,6 +3674,7 @@ def test_commando(node_factory, executor): @pytest.mark.slow_test +@pytest.mark.xdist_group("heavy") def test_commando_stress(node_factory, executor): """Stress test to slam commando with many large queries""" nodes = node_factory.get_nodes(5, opts=[{'broken_log': 'Throttling incoming peer'}, {}, {}, {}, {}]) @@ -3715,9 +3720,11 @@ def test_autoclean(node_factory): if VALGRIND: short_timeout = 10 longer_timeout = 60 + cycle = 10 else: - short_timeout = 5 - longer_timeout = 20 + short_timeout = 3 + longer_timeout = 12 + cycle = 2 assert l3.rpc.autoclean_status('expiredinvoices')['autoclean']['expiredinvoices']['enabled'] is False l3.rpc.invoice(amount_msat=12300, label='inv1', description='description1', expiry=short_timeout) @@ -3748,7 +3755,7 @@ def test_autoclean(node_factory): assert len(l3.rpc.listinvoices('inv2')['invoices']) == 1 assert l3.rpc.listinvoices('inv1')['invoices'][0]['description'] == 'description1' - l3.rpc.setconfig('autoclean-cycle', 10) + l3.rpc.setconfig('autoclean-cycle', cycle) # It will always go unpaid->expired->deleted, but we might miss it! was_expired = False @@ -3764,7 +3771,7 @@ def test_autoclean(node_factory): was_expired = True else: assert only_one(invs)['status'] == 'unpaid' - time.sleep(1) + time.sleep(0.2) # We can actually race between the delete and this being updated! wait_for(lambda: l3.rpc.autoclean_status()['autoclean']['expiredinvoices']['cleaned'] == 1) @@ -3785,8 +3792,8 @@ def test_autoclean(node_factory): wait_for(lambda: only_one(l3.rpc.listinvoices('inv2')['invoices'])['status'] == 'expired') wait_for(lambda: only_one(l3.rpc.listinvoices('inv3')['invoices'])['status'] == 'expired') - # Give it time to notice (runs every 10 seconds, give it 15) - time.sleep(15) + # Give it time to notice (wait more than two autoclean cycles) + time.sleep(cycle * 2 + 1) # They're still there! assert l3.rpc.listinvoices('inv2')['invoices'] != [] @@ -3823,7 +3830,7 @@ def test_autoclean(node_factory): assert only_one(l1.rpc.listpays(inv5['bolt11'])['pays'])['status'] == 'failed' assert only_one(l1.rpc.listpays(inv4['bolt11'])['pays'])['status'] == 'complete' l1.rpc.setconfig('autoclean-failedpays-age', 1) - l1.rpc.setconfig('autoclean-cycle', 5) + l1.rpc.setconfig('autoclean-cycle', cycle) wait_for(lambda: l1.rpc.listpays(inv5['bolt11'])['pays'] == []) wait_for(lambda: l1.rpc.autoclean_status()['autoclean']['failedpays']['cleaned'] == 1) @@ -3839,7 +3846,7 @@ def test_autoclean(node_factory): assert len(l2.rpc.listforwards()['forwards']) == 2 # Clean failed ones. - l2.rpc.setconfig('autoclean-cycle', 5) + l2.rpc.setconfig('autoclean-cycle', cycle) l2.rpc.setconfig('autoclean-failedforwards-age', 2) wait_for(lambda: l2.rpc.listforwards(status='failed')['forwards'] == []) @@ -3871,10 +3878,11 @@ def test_autoclean(node_factory): def test_autoclean_timer_crash(node_factory): """Running two autocleans at once crashed timer code""" - node_factory.get_node(options={'autoclean-cycle': 1, - 'autoclean-failedforwards-age': 31536000, - 'autoclean-expiredinvoices-age': 31536000}) - time.sleep(20) + l1 = node_factory.get_node(options={'autoclean-cycle': 1, + 'autoclean-failedforwards-age': 31536000, + 'autoclean-expiredinvoices-age': 31536000}) + time.sleep(4) + l1.rpc.getinfo() def test_autoclean_once(node_factory): @@ -5080,7 +5088,10 @@ def test_plugin_nostart(node_factory): def test_plugin_startdir_lol(node_factory): """Though we fail to start many of them, we don't crash!""" - l1 = node_factory.get_node(broken_log='.*') + l1 = node_factory.get_node( + broken_log='.*', + options={'dev-plugin-startup-timeout-secs': 30 if VALGRIND else 10}, + ) l1.rpc.plugin_startdir(os.path.join(os.getcwd(), 'tests/plugins')) @@ -5111,7 +5122,7 @@ def test_autoclean_batch(node_factory): assert (l1.rpc.autoclean_status('expiredinvoices') == {'autoclean': {'expiredinvoices': {'enabled': True, 'cleaned': 100, 'age': 2}}}) - l1.rpc.setconfig('autoclean-cycle', 5) + l1.rpc.setconfig('autoclean-cycle', 1) wait_for(lambda: l1.rpc.autoclean_status('expiredinvoices') == {'autoclean': {'expiredinvoices': {'enabled': True, 'cleaned': 200, 'age': 2}}}) diff --git a/tests/test_renepay.py b/tests/test_renepay.py index 52d4b951ac47..bf8a5ebbe90e 100644 --- a/tests/test_renepay.py +++ b/tests/test_renepay.py @@ -81,11 +81,15 @@ def test_mpp(node_factory): {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'dev-allow-localhost': None, 'allow-deprecated-apis': True}, ] l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6) - node_factory.join_nodes( - [l1, l2, l4, l6], wait_for_announce=True, fundamount=1000000 - ) - node_factory.join_nodes( - [l1, l3, l5, l6], wait_for_announce=True, fundamount=1000000 + start_channels( + [ + (l1, l2, 1000000), + (l2, l4, 1000000), + (l4, l6, 1000000), + (l1, l3, 1000000), + (l3, l5, 1000000), + (l5, l6, 1000000), + ] ) send_amount = Millisatoshi("1200000sat") @@ -109,8 +113,14 @@ def test_errors(node_factory, bitcoind): failmsg = r"We don\'t have any channels" with pytest.raises(RpcError, match=failmsg): l1.rpc.call("renepay", {"invstring": inv}) - node_factory.join_nodes([l1, l2, l4], wait_for_announce=True, fundamount=1000000) - node_factory.join_nodes([l1, l3, l5], wait_for_announce=True, fundamount=1000000) + start_channels( + [ + (l1, l2, 1000000), + (l2, l4, 1000000), + (l1, l3, 1000000), + (l3, l5, 1000000), + ] + ) failmsg = r"failed to find a feasible flow" with pytest.raises(RpcError, match=failmsg): @@ -261,11 +271,15 @@ def test_limits(node_factory): {"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 100, 'allow-deprecated-apis': True}, ] l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6) - node_factory.join_nodes( - [l1, l2, l4, l6], wait_for_announce=True, fundamount=1000000 - ) - node_factory.join_nodes( - [l1, l3, l5, l6], wait_for_announce=True, fundamount=1000000 + start_channels( + [ + (l1, l2, 1000000), + (l2, l4, 1000000), + (l4, l6, 1000000), + (l1, l3, 1000000), + (l3, l5, 1000000), + (l5, l6, 1000000), + ] ) inv = l4.rpc.invoice("any", "any", "description") @@ -312,6 +326,7 @@ def start_channels(connections): nodes.append(src) nodes.append(dst) src.rpc.connect(dst.info["id"], "localhost", dst.port) + nodes = list(dict.fromkeys(nodes)) bitcoind = nodes[0].bitcoin # If we got here, we want to fund channels diff --git a/tests/test_runes.py b/tests/test_runes.py index 12d246866bc9..721d06a4bb29 100644 --- a/tests/test_runes.py +++ b/tests/test_runes.py @@ -1,6 +1,7 @@ from fixtures import * # noqa: F401,F403 -from fixtures import TEST_NETWORK +from fixtures import TEST_NETWORK, VALGRIND from pyln.client import RpcError +from pyln.testing.utils import SLOW_MACHINE from utils import only_one import base64 import hashlib @@ -37,11 +38,11 @@ def test_createrune(node_factory): rune7 = l1.rpc.createrune(restrictions=[["pnum=0"]]) assert rune7['rune'] == 'k6kQt9dkGMaz75f51-PEkPk8Qovbiqz2HXconizqa-w9NCZwbnVtPTA=' assert rune7['unique_id'] == '4' - rune8 = l1.rpc.createrune(rune7['rune'], [["rate=3"]]) - assert rune8['rune'] == 'jHidm2_terhiOytrn8xgEWR1pvFkKuoIvKgvcEeLLQQ9NCZwbnVtPTAmcmF0ZT0z' + rune8 = l1.rpc.createrune(rune7['rune'], [["rate=30"]]) + assert rune8['rune'] == 'QrXSbft4I7_d6ZZXrbO58zT-ykMJhPNcRraX-ieXB4A9NCZwbnVtPTAmcmF0ZT0zMA==' assert rune8['unique_id'] == '4' - rune9 = l1.rpc.createrune(rune8['rune'], [["rate=1"]]) - assert rune9['rune'] == 'AWO9sW94iv7Y99h0b6kyQO5yePUXQOSIpSuTRp8XFTM9NCZwbnVtPTAmcmF0ZT0zJnJhdGU9MQ==' + rune9 = l1.rpc.createrune(rune8['rune'], [["rate=15"]]) + assert rune9['rune'] == 'py2coR7oL7gSHpen_JahtjaIOgpZajy5hZfh276MJZA9NCZwbnVtPTAmcmF0ZT0zMCZyYXRlPTE1' assert rune9['unique_id'] == '4' # Test rune with \|. @@ -91,14 +92,14 @@ def test_createrune(node_factory): 'summary': "pnum (number of command parameters) equal to 0"}]), (rune8, [{'alternatives': ['pnum=0'], 'summary': "pnum (number of command parameters) equal to 0"}, - {'alternatives': ['rate=3'], - 'summary': "rate (max per minute) equal to 3"}]), + {'alternatives': ['rate=30'], + 'summary': "rate (max per minute) equal to 30"}]), (rune9, [{'alternatives': ['pnum=0'], 'summary': "pnum (number of command parameters) equal to 0"}, - {'alternatives': ['rate=3'], - 'summary': "rate (max per minute) equal to 3"}, - {'alternatives': ['rate=1'], - 'summary': "rate (max per minute) equal to 1"}])) + {'alternatives': ['rate=30'], + 'summary': "rate (max per minute) equal to 30"}, + {'alternatives': ['rate=15'], + 'summary': "rate (max per minute) equal to 15"}])) for decode in runedecodes: rune = decode[0] restrictions = decode[1] @@ -118,16 +119,14 @@ def test_createrune(node_factory): assert decoded['restrictions'][0]['summary'].startswith("time (in seconds since 1970) greater than 1656675211 (") # Replace rune3 with a more useful timestamp! - expiry = int(time.time()) + 15 + expiry = int(time.time()) + (8 if VALGRIND or SLOW_MACHINE else 3) rune3 = l1.rpc.createrune(restrictions=[["time<{}".format(expiry)]]) successes = ((rune1, "listpeers", {}), (rune2, "listpeers", {}), (rune2, "getinfo", {}), (rune2, "getinfo", {}), - (rune3, "getinfo", {}), - (rune7, "listpeers", []), - (rune7, "getinfo", {})) + (rune3, "getinfo", {})) failures = ((rune2, "withdraw", {}), (rune2, "plugin", {'subcommand': 'list'}), @@ -142,13 +141,21 @@ def test_createrune(node_factory): (rune9, "getinfo", {})) for rune, cmd, params in successes: - l1.rpc.checkrune(nodeid=l1.info['id'], - rune=rune['rune'], - method=cmd, - params=params)['valid'] is True + assert l1.rpc.checkrune(nodeid=l1.info['id'], + rune=rune['rune'], + method=cmd, + params=params)['valid'] is True while time.time() < expiry: - time.sleep(1) + time.sleep(0.2) + + # Use rune7 right before checking rune8/rune9 rate limits below. + for rune, cmd, params in ((rune7, "listpeers", []), + (rune7, "getinfo", {})): + assert l1.rpc.checkrune(nodeid=l1.info['id'], + rune=rune['rune'], + method=cmd, + params=params)['valid'] is True for rune, cmd, params in failures: print("{} {}".format(cmd, params)) @@ -159,8 +166,8 @@ def test_createrune(node_factory): params=params) assert exc_info.value.error['code'] == 0x5de - # Rune 7 succeeded, so we need to wait for 20 seconds - time.sleep(21) + # Rune 7 succeeded, so we need to wait for 2 seconds (rate=30 per minute) + time.sleep(2.2) l1.rpc.checkrune(nodeid=l1.info['id'], rune=rune8['rune'], method='getinfo')['valid'] is True @@ -181,8 +188,8 @@ def test_createrune(node_factory): params={}) assert exc_info.value.error['code'] == 0x5de - # Rune8 has rate 3 per minute (20 seconds) and rune9 has rate 1 per minute (60 seconds) - time.sleep(21) + # Rune8 has rate 30 per minute (2 seconds) and rune9 has rate 15 per minute (4 seconds) + time.sleep(2.2) with pytest.raises(RpcError, match='Not permitted: too soon'): l1.rpc.checkrune(nodeid=l1.info['id'], rune=rune9['rune'], @@ -192,14 +199,15 @@ def test_createrune(node_factory): rune=rune8['rune'], method="getinfo")['valid'] is True - # Rune8 uses the same unique_id as rune9, so we need to wait for full 1 minute - time.sleep(61) + # Rune8 uses the same unique_id as rune9, so we need to wait for full 4 seconds + time.sleep(4.2) assert l1.rpc.checkrune(nodeid=l1.info['id'], rune=rune9['rune'], method="getinfo")['valid'] is True -def do_test_rune_per_restriction(l1, rune_to_test, per_sec): +def check_rune_per_initial(l1, rune_to_test): + """Use a per-restricted rune once and confirm an immediate retry is rejected.""" assert 'last_used' not in l1.rpc.showrunes(rune=rune_to_test)['runes'][0] before = time.time() @@ -214,7 +222,7 @@ def do_test_rune_per_restriction(l1, rune_to_test, per_sec): assert checkrune_result_1['valid'] is True assert before < show_rune['last_used'] < after - # cannot use same rune till 'per_sec' seconds + # cannot use same rune immediately with pytest.raises(RpcError, match='Not permitted:') as exc_info: l1.rpc.checkrune(nodeid=l1.info['id'], rune=rune_to_test, @@ -224,21 +232,7 @@ def do_test_rune_per_restriction(l1, rune_to_test, per_sec): assert exc_info.value.error['code'] == 0x5de assert exc_info.value.error['message'] == 'Not permitted: too soon' assert l1.rpc.showrunes(rune=rune_to_test)['runes'][0]['last_used'] == show_rune['last_used'] - - print(f'PER SEC VALUE: {per_sec}') - print(show_rune['last_used']) - print(time.time()) - time.sleep(per_sec + 1) - print(time.time()) - - # rune should again be valid after 'per_sec' seconds - checkrune_result_3 = l1.rpc.checkrune(nodeid=l1.info['id'], - rune=rune_to_test, - method='listinvoices', - params={}) - - assert checkrune_result_3['valid'] is True - assert show_rune['last_used'] <= l1.rpc.showrunes(rune=rune_to_test)['runes'][0]['last_used'] <= time.time() + return show_rune['last_used'] def test_createrune_per_restriction(node_factory): @@ -247,32 +241,56 @@ def test_createrune_per_restriction(node_factory): # 1 sec = 1,000,000,000 nanoseconds (nsec) rune_per_nano_sec = l1.rpc.createrune(restrictions=[["per=2000000000nsec"]])['rune'] assert rune_per_nano_sec == 'IUhHCEYyQOTSbBjJ09MNiPZMrV_tHFX0JG2U5yCUmIU9MCZwZXI9MjAwMDAwMDAwMG5zZWM=' - do_test_rune_per_restriction(l1, rune_per_nano_sec, 2) # 1 sec = 1,000,000 microseconds (usec) rune_per_micro_sec = l1.rpc.createrune(restrictions=[["per=2000000usec"]])['rune'] assert rune_per_micro_sec == '7ugvfMdjxoW6rKq__8d2gB7me5PL2KZOttq83mGuPvU9MSZwZXI9MjAwMDAwMHVzZWM=' - do_test_rune_per_restriction(l1, rune_per_micro_sec, 2) # 1 sec = 1,000 milliseconds (msec) rune_per_milli_sec = l1.rpc.createrune(restrictions=[["per=2000msec"]])['rune'] assert rune_per_milli_sec == 'uC5mTQfEmhbcFiUDMYIErTJcmaKZYMCUogncByZhMbk9MiZwZXI9MjAwMG1zZWM=' - do_test_rune_per_restriction(l1, rune_per_milli_sec, 2) # 1 sec rune_per_sec = l1.rpc.createrune(restrictions=[["per=2sec"]])['rune'] assert rune_per_sec == 'jjk21GQ-MeO2FWD0uo6lYplwadKHe3q9q38FP_ol3_M9MyZwZXI9MnNlYw==' - do_test_rune_per_restriction(l1, rune_per_sec, 2) # default (sec) rune_per_default = l1.rpc.createrune(restrictions=[["per=2"]])['rune'] assert rune_per_default == 'RQwZdN5OeWxIR2zPJ55mOkJ8s0SPmdFmwuNAp8TATlI9NCZwZXI9Mg==' - do_test_rune_per_restriction(l1, rune_per_default, 2) # 1 minute rune_per_min = l1.rpc.createrune(restrictions=[["per=1min"]])['rune'] assert rune_per_min == 'gDyB_VRT5IKmpmjr4GnplGMlp-7_g8VVCR2KCjcC0Gk9NSZwZXI9MW1pbg==' - do_test_rune_per_restriction(l1, rune_per_min, 60) + + two_sec_runes = [ + rune_per_nano_sec, + rune_per_micro_sec, + rune_per_milli_sec, + rune_per_sec, + rune_per_default, + ] + last_used = {r: check_rune_per_initial(l1, r) for r in two_sec_runes} + min_last_used = check_rune_per_initial(l1, rune_per_min) + + # Sleep once for all five 2-second runes (instead of 5 sequential sleeps + 61s). + time.sleep(2.2) + + for r in two_sec_runes: + res = l1.rpc.checkrune(nodeid=l1.info['id'], + rune=r, + method='listinvoices', + params={}) + assert res['valid'] is True + assert last_used[r] <= l1.rpc.showrunes(rune=r)['runes'][0]['last_used'] <= time.time() + + # The 1-minute rune must still be rate-limited after 2.2s. + with pytest.raises(RpcError, match='Not permitted: too soon') as exc_info: + l1.rpc.checkrune(nodeid=l1.info['id'], + rune=rune_per_min, + method='listinvoices', + params={}) + assert exc_info.value.error['code'] == 0x5de + assert l1.rpc.showrunes(rune=rune_per_min)['runes'][0]['last_used'] == min_last_used @pytest.mark.parametrize("old_hsmsecret", [True, False]) diff --git a/tests/test_splicing.py b/tests/test_splicing.py index 681ce7bcc5aa..7605faec8794 100644 --- a/tests/test_splicing.py +++ b/tests/test_splicing.py @@ -4,7 +4,6 @@ import pytest import threading import unittest -import time from utils import ( sync_blockheight, wait_for, TEST_NETWORK, first_scid, only_one ) @@ -49,7 +48,7 @@ def test_splice(node_factory, bitcoind): l1.rpc.xpay(inv['bolt11']) # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -295,7 +294,7 @@ def test_splice_rbf(node_factory, bitcoind): l1.rpc.xpay(inv['bolt11']) # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -436,7 +435,7 @@ def test_splice_gossip(node_factory, bitcoind): assert len(l3.rpc.listchannels(short_channel_id=post_splice_scid)['channels']) == 2 # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 # Still looks normal from both sides @@ -521,7 +520,7 @@ def test_splice_out(node_factory, bitcoind): l1.rpc.xpay(inv['bolt11']) # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -578,7 +577,7 @@ def test_invalid_splice(node_factory, bitcoind): l1.rpc.xpay(inv['bolt11']) # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -621,15 +620,13 @@ def test_commit_crash_splice(node_factory, bitcoind): l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') - time.sleep(5) - - assert l1.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 0 + wait_for(lambda: l1.db_query("SELECT count(*) as c FROM channel_funding_inflights;")[0]['c'] == 0) inv = l2.rpc.invoice(10**2, '3', 'no_3') l1.rpc.xpay(inv['bolt11']) # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -676,7 +673,7 @@ def test_splice_stuck_htlc(node_factory, bitcoind, executor): l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 diff --git a/tests/test_splicing_disconnect.py b/tests/test_splicing_disconnect.py index 6e93bf1f6d82..c0878c878214 100644 --- a/tests/test_splicing_disconnect.py +++ b/tests/test_splicing_disconnect.py @@ -5,7 +5,7 @@ import time from pyln.testing.utils import EXPERIMENTAL_DUAL_FUND from utils import ( - TEST_NETWORK, wait_for, only_one + TEST_NETWORK, sync_blockheight, wait_for, only_one ) # The DB version right before the funding_tx_index migrations in @@ -73,7 +73,7 @@ def test_splice_disconnect_sig(node_factory, bitcoind): assert not l2.daemon.is_in_log(r'Retransmitting channel_ready') # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -175,7 +175,7 @@ def test_splice_disconnect_commit(node_factory, bitcoind, executor): l2.daemon.wait_for_log(r'billboard: Channel ready for use.') # Check that the splice doesn't generate a unilateral close transaction - time.sleep(5) + sync_blockheight(bitcoind, [l1, l2]) assert l1.db_query("SELECT count(*) as c FROM channeltxs;")[0]['c'] == 0 @@ -308,6 +308,12 @@ def test_splice_upgrade_with_pending_splice(node_factory, bitcoind): assert [r['funding_tx_index'] for r in l1.db_query("SELECT funding_tx_index FROM channel_funding_inflights;")] == [1] + # Ensure l1 and l2 reconnect and reestablish before confirming the splice, + # otherwise l2 can process all 6 blocks while channeld is detached. + l1.rpc.connect(l2.info['id'], 'localhost', l2.port) + l1.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_REESTABLISH') + l2.daemon.wait_for_log(r'peer_in WIRE_CHANNEL_REESTABLISH') + bitcoind.generate_block(6) l1.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') l2.daemon.wait_for_log(r'CHANNELD_AWAITING_SPLICE to CHANNELD_NORMAL') diff --git a/tests/test_xpay.py b/tests/test_xpay.py index ea31df79dbc9..87e163f6eb8f 100644 --- a/tests/test_xpay.py +++ b/tests/test_xpay.py @@ -1105,7 +1105,8 @@ def test_xpay_currency_offer(node_factory): """Test that xpay and sendamount correctly report the currency name when rejecting non-msat offers.""" plugin = Path(__file__).parent / "plugins" / "currencyUSDAUD5000.py" l1, l2 = node_factory.line_graph(2, wait_for_announce=True, - opts=[{}, {'plugin': str(plugin)}]) + opts=[{}, {'disable-plugin': 'cln-currencyrate', + 'plugin': str(plugin)}]) offerusd = l2.rpc.offer('10USD', 'USD test')['bolt12'] @@ -1156,20 +1157,86 @@ def test_xpay_shadow_cltv(node_factory, bitcoind): assert l2.daemon.is_in_log(f"Adding HTLC .* amount=10000msat cltv={expected_cltv} gave CHANNEL_ERR_ADD_OK") +def open_channels(connections, fundamount=FUNDAMOUNT, wait_for_announce=False, announce_channels=True): + """Connect peers and open all channels in a single batched funding/confirm cycle.""" + assert not (wait_for_announce and not announce_channels) + nodes = list(dict.fromkeys(n for pair in connections for n in pair)) + bitcoind = nodes[0].bitcoin + + seen_pairs = set() + for src, dst in connections: + pair_key = (min(src.info['id'], dst.info['id']), max(src.info['id'], dst.info['id'])) + if pair_key not in seen_pairs: + src.rpc.connect(dst.info['id'], 'localhost', dst.port) + seen_pairs.add(pair_key) + + # Give each funder one confirmed UTXO per outgoing channel in a single tx. + outputs = {} + amount_btc = round((fundamount + 1000000) / 10**8, 8) + for src, _ in connections: + addr = src.rpc.newaddr('bech32')['bech32'] + outputs[addr] = amount_btc + bitcoind.rpc.sendmany("", outputs) + + bitcoind.generate_block(1) + sync_blockheight(bitcoind, nodes) + + txids = [] + channel_ids = [] + for src, dst in connections: + fc = src.rpc.fundchannel(dst.info['id'], fundamount, announce=announce_channels) + txids.append(fc['txid']) + channel_ids.append(fc['channel_id']) + + bitcoind.generate_block(1, wait_for_mempool=txids) + scids = [] + for (src, dst), cid in zip(connections, channel_ids): + wait_for(lambda: only_one([c for c in src.rpc.listpeerchannels(dst.info['id'])['channels'] + if c['channel_id'] == cid])['state'] == 'CHANNELD_NORMAL') + scid = only_one([c for c in src.rpc.listpeerchannels(dst.info['id'])['channels'] + if c['channel_id'] == cid])['short_channel_id'] + scids.append((src, dst, scid)) + + for src, dst, scid in scids: + src.wait_local_channel_active(scid) + dst.wait_local_channel_active(scid) + + if not wait_for_announce: + return + + bitcoind.generate_block(5) + sync_blockheight(bitcoind, nodes) + + scid_set = {scid for _, _, scid in scids} + for n in nodes: + wait_for(lambda: sum( + 1 for c in n.rpc.listchannels()['channels'] + if c['short_channel_id'] in scid_set and c['active'] + ) == len(scid_set) * 2) + + node_ids = {n.info['id'] for n in nodes} + for n in nodes: + wait_for(lambda: sum( + 1 for x in n.rpc.listnodes()['nodes'] + if x['nodeid'] in node_ids and 'alias' in x + ) == len(node_ids)) + + @pytest.mark.xdist_group("heavy") def test_xpay_limited_max_accepted_htlcs(node_factory): """xpay should try to reduce flows to 6 if there is an unannounced channel, and only try more if that fails""" CHANNEL_SIZE_SATS = 10**6 - l1, l2 = node_factory.line_graph(2, - fundamount=CHANNEL_SIZE_SATS * 20, - opts=[{}, {'max-concurrent-htlcs': 6}], - announce_channels=False) + l1, l2, l3, *nodes = node_factory.get_nodes( + 10, opts=[{}, {'max-concurrent-htlcs': 6}] + [{}] * 8 + ) + node_factory.join_nodes([l1, l2], + fundamount=CHANNEL_SIZE_SATS * 20, + announce_channels=False) - # We want 10 paths between l3 and l1. - l3 = node_factory.get_node() - nodes = node_factory.get_nodes(10) - for n in nodes: - node_factory.join_nodes([l3, n, l1], fundamount=CHANNEL_SIZE_SATS) + # We want 7 announced paths between l3 and l1 (exceeding l2's 6 HTLC limit). + open_channels([(l3, n) for n in nodes] + [(n, l1) for n in nodes], + fundamount=CHANNEL_SIZE_SATS, + wait_for_announce=True) # We don't want to use up capacity, so we make payment fail. inv1 = l1.rpc.invoice(f"{CHANNEL_SIZE_SATS * 5}sat", @@ -1236,7 +1303,7 @@ def mock_getblockhash(req): # This will wait, then fail. with pytest.raises(RpcError, match=f'Timed out waiting for blockheight {l3_height}'): - l1.rpc.xpay(invstring=inv, retry_for=10, dev_use_shadow=False) + l1.rpc.xpay(invstring=inv, retry_for=2, dev_use_shadow=False) # This will succeed, because we wait for the blocks. fut = executor.submit(l1.rpc.xpay, invstring=inv, retry_for=60, dev_use_shadow=False) @@ -1746,6 +1813,7 @@ def fetch(padding): @pytest.mark.slow_test @unittest.skipIf(TEST_NETWORK != "regtest", "Invoice is network specific") +@pytest.mark.xdist_group("heavy") def test_xpay_maxhops_bolt11(node_factory, chainparams): """A bolt11 final payload that no longer fits the cheap route forces the short one. @@ -1841,6 +1909,7 @@ def pay(label, preimage, metadata=None): assert ret["amount_sent_msat"] - amount > 1000 +@pytest.mark.xdist_group("heavy") def test_xpay_unknown_next_peer_excludes_node(node_factory, bitcoind): """Issue 9590: repeated unknown_next_peer must exclude the next node. @@ -1861,9 +1930,13 @@ def test_xpay_unknown_next_peer_excludes_node(node_factory, bitcoind): {}, {}, {}]) - node_factory.join_nodes([payer, hub], fundamount=10**6, wait_for_announce=True) - for spoke in (a, b, c, d): - node_factory.join_nodes([hub, spoke, dest], fundamount=10**6, wait_for_announce=True) + open_channels( + [(payer, hub)] + + [(hub, spoke) for spoke in (a, b, c, d)] + + [(spoke, dest) for spoke in (a, b, c, d)], + fundamount=10**6, + wait_for_announce=True, + ) wait_for(lambda: len(payer.rpc.listchannels()['channels']) >= 9 * 2) @@ -1900,16 +1973,14 @@ def on_htlc_accepted(onion, plugin, **kwargs): return {"result": "continue"} return {"result": "fail", "failure_message": failure_message} - payer = node_factory.get_node() hub = node_factory.get_node(inline_plugin=setup) - alt, altspoke, dest, *spokes = node_factory.get_nodes(3 + num_spokes) - node_factory.join_nodes([payer, hub], fundamount=10**6, wait_for_announce=True) - for spoke in spokes: - node_factory.join_nodes( - [hub, spoke, dest], fundamount=10**6, wait_for_announce=True - ) - node_factory.join_nodes( - [payer, alt, altspoke, dest], fundamount=10**6, wait_for_announce=True + payer, alt, altspoke, dest, *spokes = node_factory.get_nodes(4 + num_spokes) + open_channels( + [(payer, hub), (payer, alt), (alt, altspoke), (altspoke, dest)] + + [(hub, spoke) for spoke in spokes] + + [(spoke, dest) for spoke in spokes], + fundamount=10**6, + wait_for_announce=True, ) alt.rpc.setchannel(altspoke.info["id"], feebase=1, feeppm=alt_ppm) @@ -1928,6 +1999,7 @@ def on_htlc_accepted(onion, plugin, **kwargs): return payer, hub, alt, dest +@pytest.mark.xdist_group("heavy") def test_xpay_fee_insufficient_bias(node_factory, bitcoind): """A hub repeatedly returning fee_insufficient gets a node bias. @@ -1954,6 +2026,7 @@ def test_xpay_fee_insufficient_bias(node_factory, bitcoind): assert "fee_insufficient" in node_bias["description"] +@pytest.mark.xdist_group("heavy") def test_xpay_fee_insufficient_disable(node_factory, bitcoind): """A hub repeatedly returning fee_insufficient gets disabled. @@ -1981,6 +2054,7 @@ def test_xpay_fee_insufficient_disable(node_factory, bitcoind): assert line.count("fee_insufficient on") == 4, line +@pytest.mark.xdist_group("heavy") def test_xpay_failing_node_tolerance(node_factory, bitcoind): """xpay-failing-node-tolerance controls when a failing node is disabled.""" payer, hub, alt, dest = setup_failing_hub(node_factory, num_spokes=5, alt_ppm=5000) @@ -2018,6 +2092,7 @@ def test_xpay_failing_node_tolerance(node_factory, bitcoind): assert not payer.daemon.is_in_log(disabled, start=start) +@pytest.mark.xdist_group("heavy") def test_xpay_failing_node_nonfinal(node_factory, bitcoind): """If an intermediate node returns an error that is meant for the final, then we disable that node right away regardless of the value of @@ -2052,15 +2127,17 @@ def test_xpay_failing_node_nonfinal(node_factory, bitcoind): def test_xpay_maxparts(node_factory): """xpay's maxparts option limits the number of parts""" CHANNEL_SIZE_SATS = 10**6 - l1, l2 = node_factory.line_graph( - 2, fundamount=CHANNEL_SIZE_SATS * 20, announce_channels=False + l1, l2, l3, *nodes = node_factory.get_nodes(13) + node_factory.join_nodes( + [l1, l2], fundamount=CHANNEL_SIZE_SATS * 20, announce_channels=False ) # We want 10 paths between l3 and l1. - l3 = node_factory.get_node() - nodes = node_factory.get_nodes(10) - for n in nodes: - node_factory.join_nodes([l3, n, l1], fundamount=CHANNEL_SIZE_SATS) + open_channels( + [(l3, n) for n in nodes] + [(n, l1) for n in nodes], + fundamount=CHANNEL_SIZE_SATS, + wait_for_announce=True, + ) def failing_invoice(node, amount_sat, label): """Invoice which fails at the destination, so we don't use up capacity""" @@ -2212,7 +2289,7 @@ def on_htlc_accepted(htlc, onion, request, plugin, **kwargs): parts = held.setdefault(phash, []) parts.append((htlc, request)) - maxparts = plugin.get_option("receive_maxparts") + maxparts = int(plugin.get_option("receive_maxparts")) if maxparts and len(parts) > maxparts: plugin.log( f"Rejecting {phash}: {len(parts)} parts exceeds receive_maxparts={maxparts}" @@ -2231,9 +2308,12 @@ def on_htlc_accepted(htlc, onion, request, plugin, **kwargs): @pytest.mark.slow_test @pytest.mark.xdist_group("heavy") -@pytest.mark.parametrize( - "receive_maxparts,amount_sat", - [ +def test_xpay_maxparts_receiver_limit(node_factory): + """Destination refuses payments in more than receive_maxparts parts: + without maxparts xpay fails, with maxparts it succeeds""" + NUM_PATHS = 12 + CHANNEL_SIZE_SATS = 10**6 + cases = [ (7, 5_000_000), (6, 5_000_000), (5, 4_000_000), @@ -2241,45 +2321,76 @@ def on_htlc_accepted(htlc, onion, request, plugin, **kwargs): (3, 2_000_000), (2, 1_500_000), (1, 900_000), - ], -) -def test_xpay_maxparts_receiver_limit(node_factory, receive_maxparts, amount_sat): - """Destination refuses payments in more than receive_maxparts parts: - without maxparts xpay fails, with maxparts it succeeds""" - NUM_PATHS = 12 - CHANNEL_SIZE_SATS = 10**6 - l1 = node_factory.get_node() + ] l2 = node_factory.get_node( inline_plugin=receive_maxparts_plugin, - options={"receive_maxparts": receive_maxparts}, + options={"receive_maxparts": cases[0][0]}, ) + l1, *nodes = node_factory.get_nodes(1 + NUM_PATHS) # NUM_PATHS disjoint paths between l1 and l2. - for n in node_factory.get_nodes(NUM_PATHS): - node_factory.join_nodes( - [l1, n, l2], fundamount=CHANNEL_SIZE_SATS, wait_for_announce=True - ) + open_channels( + [(l1, n) for n in nodes] + [(n, l2) for n in nodes], + fundamount=CHANNEL_SIZE_SATS, + wait_for_announce=True, + ) def num_flows(): line = l1.daemon.wait_for_log(r"Final answer has [0-9]+ flows") return int(re.search(r"Final answer has ([0-9]+) flows", line).group(1)) - # Unconstrained, xpay splits into more parts than the destination accepts. - inv = l2.rpc.invoice(f"{amount_sat}sat", "unconstrained", "unconstrained")["bolt11"] - with pytest.raises(RpcError, match="Destination said it doesn't know invoice"): - l1.rpc.xpay(invstring=inv, maxparts=0) - assert num_flows() > receive_maxparts - l2.daemon.wait_for_log(f"exceeds receive_maxparts={receive_maxparts}") - wait_for(lambda: l1.rpc.askrene_listreservations() == {"reservations": []}) - - # Respecting the destination's limit, it succeeds. - inv = l2.rpc.invoice(f"{amount_sat}sat", "constrained", "constrained")["bolt11"] - ret = l1.rpc.xpay(invstring=inv, maxparts=receive_maxparts) - assert ret["amount_msat"] == amount_sat * 1000 - assert ret["failed_parts"] == 0 - assert ret["successful_parts"] <= receive_maxparts - assert num_flows() <= receive_maxparts - l2.daemon.wait_for_log("Accepting .* in [0-9]+ parts") - assert only_one(l2.rpc.listinvoices("constrained")["invoices"])["status"] == "paid" + for receive_maxparts, amount_sat in cases: + l2.rpc.setconfig("receive_maxparts", receive_maxparts) + l1.rpc.askrene_age("xpay", int(time.time())) + + # Unconstrained, xpay splits into more parts than the destination accepts. + unconstrained_lbl = f"unconstrained-{receive_maxparts}" + inv = l2.rpc.invoice(f"{amount_sat}sat", unconstrained_lbl, unconstrained_lbl)["bolt11"] + with pytest.raises(RpcError, match="Destination said it doesn't know invoice"): + l1.rpc.xpay(invstring=inv, maxparts=0) + assert num_flows() > receive_maxparts + l2.daemon.wait_for_log(f"exceeds receive_maxparts={receive_maxparts}") + wait_for(lambda: l1.rpc.askrene_listreservations() == {"reservations": []}) + + # Respecting the destination's limit, it succeeds. + constrained_lbl = f"constrained-{receive_maxparts}" + inv = l2.rpc.invoice(f"{amount_sat}sat", constrained_lbl, constrained_lbl)["bolt11"] + ret = l1.rpc.xpay(invstring=inv, maxparts=receive_maxparts) + assert ret["amount_msat"] == amount_sat * 1000 + assert ret["failed_parts"] == 0 + assert ret["successful_parts"] <= receive_maxparts + assert num_flows() <= receive_maxparts + l2.daemon.wait_for_log("Accepting .* in [0-9]+ parts") + assert only_one(l2.rpc.listinvoices(constrained_lbl)["invoices"])["status"] == "paid" + + # Rebalance used paths back to l1 so the next case sees fresh capacity. + for i, n in enumerate(nodes): + chan_l2_n = only_one(l2.rpc.listpeerchannels(n.info["id"])["channels"]) + send_back_msat = int(Millisatoshi(chan_l2_n["spendable_msat"])) - 10_000_000 + if send_back_msat > 10_000_000: + chan_n_l1 = only_one(n.rpc.listpeerchannels(l1.info["id"])["channels"]) + rebal_inv = l1.rpc.invoice( + send_back_msat, f"rebal-{receive_maxparts}-{i}", "rebal" + ) + route = [ + { + "id": n.info["id"], + "channel": chan_l2_n["short_channel_id"], + "amount_msat": send_back_msat + 1_000_000, + "delay": 30, + }, + { + "id": l1.info["id"], + "channel": chan_n_l1["short_channel_id"], + "amount_msat": send_back_msat, + "delay": 15, + }, + ] + l2.rpc.sendpay( + route, + rebal_inv["payment_hash"], + payment_secret=rebal_inv["payment_secret"], + ) + l2.rpc.waitsendpay(rebal_inv["payment_hash"]) @pytest.mark.slow_test @@ -2289,14 +2400,22 @@ def test_xpay_maxparts_unannounced_retry(node_factory): retries with the user's larger maxparts.""" NUM_PATHS = 12 CHANNEL_SIZE_SATS = 10**6 - l1, l2 = node_factory.line_graph( - 2, fundamount=CHANNEL_SIZE_SATS * 20, announce_channels=False + l1, l2, l3, *nodes = node_factory.get_nodes(3 + NUM_PATHS) + node_factory.join_nodes( + [l1, l2], fundamount=CHANNEL_SIZE_SATS * 20, announce_channels=False + ) + open_channels( + [(l3, n) for n in nodes] + [(n, l1) for n in nodes], + fundamount=CHANNEL_SIZE_SATS, + wait_for_announce=True, + ) + + # Wait for l2 to learn l1's public channels via gossip so listincoming + # reports incoming capacity and invoice() includes the l1->l2 routehint. + wait_for( + lambda: len(l2.rpc.listchannels(source=l1.info["id"])["channels"]) + == NUM_PATHS ) - l3 = node_factory.get_node() - for n in node_factory.get_nodes(NUM_PATHS): - node_factory.join_nodes( - [l3, n, l1], fundamount=CHANNEL_SIZE_SATS, wait_for_announce=True - ) # 7M sat needs more than 6 of the one-million-sat paths, but fits in the # 10 parts the user allows. diff --git a/tests/utils.py b/tests/utils.py index 8647c16e6436..e1a7b5f70a72 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -117,22 +117,23 @@ def check_balance_snaps(n, expected_bals): def check_coin_moves(n, account_id, expected_moves, chainparams): - moves = n.rpc.call('listcoinmoves_plugin')['coin_moves'] - # moves can lag; wait for a few seconds if we don't have correct number. - # then move on: we'll get details below. - expected_count = 0 - for m in enumerate(expected_moves): - if isinstance(m, list): - expected_count += len(m) - else: - expected_count += 1 + # moves can lag; wait briefly if we don't have the expected count yet, + # then move on so we get detailed mismatch output below. + expected_count = sum(len(m) if isinstance(m, list) else 1 for m in expected_moves) - if len(moves) != expected_count: - time.sleep(5) + def get_acct_moves(): moves = n.rpc.call('listcoinmoves_plugin')['coin_moves'] + return [m for m in moves if m['account_id'] == account_id] + + acct_moves = get_acct_moves() + if len(acct_moves) < expected_count: + try: + wait_for(lambda: len(get_acct_moves()) >= expected_count, timeout=10) + except ValueError: + pass + acct_moves = get_acct_moves() node_id = n.info['id'] - acct_moves = [m for m in moves if m['account_id'] == account_id] # Stash moves for errors, if needed _acct_moves = acct_moves for mv in acct_moves: