Conversation
a2b10ef to
d9cc69a
Compare
|
Now rebased on #365 after we bumped to 0.0.125, i.e., also dropped the commit copy/pasting |
d9cc69a to
6e6e9b7
Compare
|
Alright, rebased on main after #365 landed. Also addressed (or postponed) the remaining TODOs, should be ready for review. |
f68adfc to
7c1ad82
Compare
| #[test] | ||
| fn channel_full_cycle_bitcoind() { | ||
| let (bitcoind, electrsd) = setup_bitcoind_and_electrsd(); | ||
| premine_dummy_blocks(&bitcoind.client, &electrsd.client); | ||
| let chain_source = TestChainSource::BitcoinRpc(&bitcoind); | ||
| let (node_a, node_b) = setup_two_nodes(&chain_source, false, true, false); | ||
| do_channel_full_cycle(node_a, node_b, &bitcoind.client, &electrsd.client, false, true, false); | ||
| } |
There was a problem hiding this comment.
Why not expand the other tests for BitcoinRpc?
There was a problem hiding this comment.
Generally sounds good, I mostly started off with this as I didn't simply want to double our test surface. Do you have any specific test cases in mind that would lend themselves to also be run on a BitcoindRpc backend?
There was a problem hiding this comment.
Hmm... probably only tests where non-setup code depends on block (dis)connection notification (e.g., onchain_spend_receive). Though, I also wonder if we should use BitcoinRpc normally just to remove one moving part from the tests assuming that would lead to less flakiness.
There was a problem hiding this comment.
Though, I also wonder if we should use BitcoinRpc normally just to remove one moving part from the tests assuming that would lead to less flakiness.
I generally agree this would be preferable but thought we might be limited by the additional overhead of the premining required to populate estimatesmartfee. As we now added fallbacks for regtest anyways we can however drop that premining again.
I now added a fixup switching it around: we now default to bitcoind RPC and only have a single Esplora-specific full-cycle test. It seemed a bit flaky when run concurrently locally, but let's see how it works out in CI. If it turns out to be flaky we can take additional mitigation steps in a follow up (e.g., reduce the number of threads used in tests, etc).
There was a problem hiding this comment.
Right, if the extra part is actually removing the underlying flakiness, maybe we should keep it. 😛 Though perhaps we need to make sure the (non-test) code is robust enough to retry appropriately.
There was a problem hiding this comment.
Ugh, there we have the first CI failure due to flakiness. Mind if I revert and do the CI switch as a follow-up (possibly post-release)? I'd like to get main into a release-ready state ASAP.
There was a problem hiding this comment.
Now reverted, but still dropped the unnecessary premining.
83b0a4f to
c20359a
Compare
| #[test] | ||
| fn channel_full_cycle_bitcoind() { | ||
| let (bitcoind, electrsd) = setup_bitcoind_and_electrsd(); | ||
| premine_dummy_blocks(&bitcoind.client, &electrsd.client); | ||
| let chain_source = TestChainSource::BitcoinRpc(&bitcoind); | ||
| let (node_a, node_b) = setup_two_nodes(&chain_source, false, true, false); | ||
| do_channel_full_cycle(node_a, node_b, &bitcoind.client, &electrsd.client, false, true, false); | ||
| } |
There was a problem hiding this comment.
Hmm... probably only tests where non-setup code depends on block (dis)connection notification (e.g., onchain_spend_receive). Though, I also wonder if we should use BitcoinRpc normally just to remove one moving part from the tests assuming that would lead to less flakiness.
.. which we'll use to feed blocks to it in following commits.
c20359a to
a45c7a7
Compare
Cool, let me know if I can squash. |
4839e10 to
f4538a3
Compare
We first initialize by synchronizing all `Listen` implementations, and then head into a loop continuously polling our RPC `BlockSource`. We also implement a `BoundedHeaderCache` to limit in-memory footprint.
.. to allow the on-chain wallet to detect what's inflight.
This behavior mirrors what we do in the Esplora case: we only enforce successful fee rate updates on mainnet. On regtest/signet/testnet we will just skip (i.e. return `Ok(())`) if we fail to retrieve the updates (e.g., when bitcoind's `estimatesmartfee` isn't sufficiently populated) and will either keep previously-retrieved values or worst case fallback to the fallback defaults.
.. as it regularly makes CI fail and doesn't provide us anything really.
.. to account for slight differences in fee rate estmations between chain sources.
f4538a3 to
7c629f2
Compare
|
Squashed fixups without further changes. |
| (sweeper_best_block_hash, &*output_sweeper as &(dyn Listen + Send + Sync)), | ||
| ]; | ||
|
|
||
| // TODO: Eventually we might want to see if we can synchronize `ChannelMonitor`s |
There was a problem hiding this comment.
Apologies for the question post-merge but what would be the benefit of syncing the ChannelMonitors before passing them to the ChainMonitor? There would still be a need to sync them via the monitor even if it was possible to sync before, right?
There was a problem hiding this comment.
post-merge questions are great!
ChannelMonitors can by sync'd by just syncing the ChainMonitor and it'll multiplex the events across all the ChannelMonitors for us (cleaning up the logic here quite a bit). Sadly, doing so requires that the ChannelMonitors be in sync with each other before we pass them to ChainMonitor on load (or we'll end up connecting blocks on different ChannelMonitors even though they have different ideas of the current chain tip).
Based on #365.
We add support for sourcing chain data from the
bitcoindRPC interface. Ready for review.TODO:
estimatesmartfeein tests. Probably just do a simliar carve-out for non-mainnet as for Esplora, i.e., default to 253?sync_walletcalls. No-op? Or still block until the next polling is finished?lightning-block-sync: Fixsynchronize_listenersalways calling default implementation rust-lightning#3354, so we might temporarily need to copy/pastsynchronize_listenersover here.- [ ] Implement UtxoSource / GossipVerifier (via(Bashing my head against the typechecker for a few hours is having me believe this is currently ~impossible with the upstream types, so moved to #377 / blocked on lightningdevkit/rust-lightning#3369)tokiofeature oflightning-block-sync)