lightning/tests
Vincenzo Palazzo 85992e6e48 feat(bitcoind): pass the current known block height
When core lightning is asking the information about
the blockchain with `getchaininfo` command lightningd
know already the information about the min and max block height.

the problem is when we have a smarter Bitcoin backend that is able
to switch between different clients in some cases is helpful
give the information about current known height by lightningd and
pass it down to the plugin.

In this way, the plugin knows what is the correct known height from lightnind, and can
try to fix some problems if any exit.

This is particularly useful when you are syncing a new backend from scratch
like https://github.com/cloudhead/nakamoto and we avoid returning the
lower height from the known, and avoid the crash of core lightning.

With this information, the plugin can start to sync the chain and return
the answer back only when the chain is in sync with the current status of
lightningd.

Another reason to add this field and not wait the correct block in core
lightning itself is because Bitcoin Core is extremely slow to sync up,
so the question here is, how long should we wait? The time depends
on various factors.

With this approach of informing the plugin about the height, in some cases,
you can start the syncing but move the execution to another backend until
the previous one is ready.

The problem I want to solve is that I don't want to be left in the dark when
we run `getchaininfo`, and I want to have the opportunity to wait for
the blockchain sync or decide to dispatch the request elsewhere.

Changelog-Added: Pass the current known block height down to the getchaininfo call.
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-06-13 16:27:10 +02:00
..
data pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
fuzz lightningd: switch parsing to common/configvar 2023-06-03 10:50:29 +09:30
plugins libplugin: don't spew datastore errors to LOG_DEBUG. 2023-02-11 12:22:40 -06:00
vectors pytest: Remove onion test vectors containing legacy onions. 2022-03-18 09:20:11 +10:30
benchmark.py pytest: always provide payment_secret when making payments. 2021-07-14 14:38:00 -05:00
conftest.py tests: add marker for v1/v2 channel opens 2021-05-12 11:25:41 +09:30
db.py test-db-provider: if postgres in tests, startup a bookkeeper db 2022-07-28 12:08:18 +09:30
fixtures.py pyln.testing: remove Throttler. 2023-04-06 09:10:53 +09:30
rkls_github_canned_server.py pytest: add blackbox tests for reckless 2023-04-09 12:41:11 +09:30
test_bookkeeper.py pytest: clean up wait_for_onchaind_tx interface, remove wait_for_onchaind_broadcast 2023-04-07 11:49:09 +09:30
test_cln_rs.py pytest: use modern listconfigs. 2023-06-03 10:50:29 +09:30
test_closing.py pytest: slow down for bitcoind. 2023-05-29 13:46:21 +09:30
test_connection.py lightningd: deprecated experimental-websocket-port now we can use bind=ws: 2023-06-01 09:28:39 +09:30
test_db.py wallet: fix up PSBTs as a migration. 2023-03-31 09:16:25 +10:30
test_gossip.py lightningd: deprecated --announce-addr-dns. 2023-06-01 09:28:39 +09:30
test_invoices.py lightningd: Add signinvoice to sign a BOLT11 invoice. 2023-02-06 15:54:32 -06:00
test_misc.py listconfigs: add plugin field if config is for a plugin. 2023-06-03 10:50:29 +09:30
test_mkfunding.py pytest: add tests for devtools/mkfunding 2023-01-09 14:50:30 -06:00
test_onion.py lightningd: remove support for legacy onion format. 2022-03-18 09:20:11 +10:30
test_opening.py pytest: use modern listconfigs. 2023-06-03 10:50:29 +09:30
test_pay.py config: replace accept-htlc-tlv-types with accept-htlc-tlv-type 2023-06-03 10:50:29 +09:30
test_plugin.py feat(bitcoind): pass the current known block height 2023-06-13 16:27:10 +02:00
test_reckless.py pytest: ignore pip warning 2023-04-24 13:08:15 -07:00
test_wallet.py test_withdraw_bech32m: test that expected outputs exist for bech32(m) withdrawals 2023-05-25 11:07:45 +09:30
utils.py pytest: remove EXPERIMENTAL_FEATURES as a consideration. 2023-05-23 09:34:08 +09:30
valgrind-suppressions.txt pytest: Use valgrind target suppressions instead of skipping tests 2022-03-10 10:21:41 +10:30