Commit Graph

9315 Commits

Author SHA1 Message Date
niftynei 96c42262ab df-tests: test_peerinfo 2021-01-10 13:44:04 +01:00
niftynei 135cd178f7 df-tests: test_channel_persistence 2021-01-10 13:44:04 +01:00
niftynei a82bfa83ff df-tests: have the df_accepter plugin keep track of attempts
Test connection/reconnection handling for v2 opens. We needed to fixup
the accepter plugin so that we were freeing up inputs on
disconnect/failure.
2021-01-10 13:44:04 +01:00
niftynei 88b4b5b2bb df-tests: test_disconnect_opener 2021-01-10 13:44:04 +01:00
niftynei 3e330d7186 df-tests: test_forward_local_failed_stats 2021-01-10 13:44:04 +01:00
niftynei 973224dd14 df-tests: if we're using fundbalancechannel, set up plugin
nodes need to be using the accepter plugin, so they'll match funding.
we used to use push_msat for this, but v2 gets rid of it.

*sad trombone*
2021-01-10 13:44:04 +01:00
niftynei f822a93cf4 df-tests: add `setacceptmaxfunding` to df_accepter plugin
Method for setting a ceiling on the fund matching capabilities of
df_accepter. Setting it to zero means we don't fund the channel anymore.
2021-01-10 13:44:04 +01:00
niftynei ea1895fc1e pyln-tests: tweak `fundbalancedchannel` to assume peer will match
we got rid of push_msats for dual funded channels. this assumes that hte
peer will match an equal amount of sats as ours (the df_accepter.py
plugin will do this)
2021-01-10 13:44:04 +01:00
niftynei e964c31369 df-tests: test_payment_success|failed_persistence 2021-01-10 13:44:04 +01:00
niftynei fa539d3281 df-tests: make memleak happy by cleaning up `psbt`
We don't need it anymore. Normally it gets cleaned up by `cmd` but we're
done with it here.
2021-01-10 13:44:04 +01:00
niftynei 09da171381 df-tests: test_io_logging
Move pid collection down to when dualopend is definitely dead
2021-01-10 13:44:04 +01:00
niftynei 609d509ca5 df-tests: test_channel_state_changed_unilateral 2021-01-10 13:44:04 +01:00
niftynei ac88c72f1e df-tests: test_channel_state_changed_bilateral 2021-01-10 13:44:04 +01:00
niftynei 450a094d26 df-tests: test_coin_movement_notices 2021-01-10 13:44:04 +01:00
niftynei ff0e2dbd28 df-tests: test_channel_opened_notification
We weren't sending a channel_open notification for dual-funded channels.

This is only sent for the 'accepter' side. We send it as soon as both
funding_tx sigs have been exchanged, even though it's possible the
funding transaction might be published without this having been the case.

Since we fail the channel if this happens, only notifying for good/valid
channels reaching the broadcast state is the right way to handle this.
2021-01-10 13:44:04 +01:00
niftynei 923e1f5c80 df-tests: test_feature_set 2021-01-10 13:44:04 +01:00
niftynei db65771f38 df-tests: test_plugin_feature_announce 2021-01-10 13:44:04 +01:00
niftynei 21b9bec93b df-tests: test_channel_state_change_history 2021-01-10 13:44:04 +01:00
niftynei 959ca793b0 df-tests: test_openchannel_hook_error_handling 2021-01-10 13:44:04 +01:00
niftynei 803d9701d3 df-tests: test_openchannel_hook_chaining 2021-01-10 13:44:04 +01:00
niftynei b0a8b10b41 df-tests: test_openchannel_hook
Have it check both openchannel + openchannel2
2021-01-10 13:44:04 +01:00
niftynei 0d45823b82 df-tests: test_funding_reorg_private 2021-01-10 13:44:04 +01:00
niftynei 09834bbc8d df-tests: test_node_reannounce correct features 2021-01-10 13:44:04 +01:00
niftynei c055198869 df-tests: test_fail_unconfirmed, duplicate with correct wires 2021-01-10 13:44:04 +01:00
niftynei dfa0eb0f2f df-tests: test_shutdown_awaiting_lockin check correct state 2021-01-10 13:44:04 +01:00
niftynei 5c7cc15a75 df-tests: adjust logsearch/features for test_dataloss_protection 2021-01-10 13:44:04 +01:00
niftynei e661d87440 df-tests: fixup expected features for dual-funding channels 2021-01-10 13:44:04 +01:00
niftynei 08200f03a7 df-tests: test_multifunding_v2_v1_mixed update to use flag
Now that we've got a fancy flag to enable dual funding, let's use it
2021-01-10 13:44:04 +01:00
niftynei 8fb97fd7e1 df-tests: updates for plugin hook_accepter helper
Fixes so that test_funding_close_upfront works with v2 opens
2021-01-10 13:44:04 +01:00
niftynei f4b7904ce5 tests: don't enforce daemon name on opening logline 2021-01-10 13:44:04 +01:00
niftynei 9951638d5f df: add flag to signal to run v2 channel open tests 2021-01-10 13:44:04 +01:00
niftynei 3c1d90086f pyln-testing: add 'config' method to a node
Query for a config's value. If not set, returns 'none'
2021-01-10 13:44:04 +01:00
niftynei 327d9a3ff6 experimental-dual-fund: add config level option for enabling dual-fund
Allow a user to switch on dual-funding without needing to compile
as EXPERIMENTAL_FEATURES.

Doesn't work yet, since everything is still behind
'EXPERIMENTAL_FEATURES' compile time flags... but useful for testing
2021-01-10 13:44:04 +01:00
niftynei 205a7057c9 df: use dev-env flagged upfront shutdown script
This lets the test_option_upfront_shutdown_script test pass
2021-01-10 13:44:04 +01:00
niftynei 5387f6736c df: free psbt on negotiation failed 2021-01-10 13:44:04 +01:00
niftynei 2cd95aa806 df: add a new 'channel_open_failed' notification
Let plugins know when a channel open has failed.

We need to notify accepters now too, so we remove the check on who's
funding the channel before sending the 'failed' message from
dualopend->master.
2021-01-10 13:44:04 +01:00
niftynei d4ec052668 df: include channel_id in openchannel2 hook
We already know what the channel id is, we should go ahead and pass it
on to any listening plugins -- this makes clean up easier/possible
if a open fails early on and we've got reserved utxos.
2021-01-10 13:44:04 +01:00
niftynei 1393e187f9 df: don't update local shutdown scriptpubkey from dualopend
When we're the opener, we get the upfront shutdown scriptpubkey (if
there is one) from the `close_to` param of `openchannel_init`.

We were passing it through dualopend, but we need to break the update
chain so that our test_option_upfront_shutdown_script test works (same
as on the openingd flow.)
2021-01-10 13:44:04 +01:00
niftynei 52da9be598 df: if 'openchannel2' is "rejected" we should send that error
We weren't really handling 'rejected' channel open requests very
elegantly, now we do.
2021-01-10 13:44:04 +01:00
niftynei 857ff561bc df: move callback up
We're going to call it from the deserialization method here soon
2021-01-10 13:44:04 +01:00
niftynei 99a621dd99 df-reconnects: allow tx-sigs in channeld iff we're reconnecting
There's a case where a dropped funding_locked will result in the peer
moving onto channeld, while we stay in dualopend. As we haven't
received their funding_locked, we retransmit tx_sigs, which channeld
will need to handle.

With the patch the peer drops it on the floor; the peer will resend
funding_locked on reconnect, which will correctly advance us to
channeld and CHANNELD_NORMAL
2021-01-10 13:44:04 +01:00
niftynei 0a9c562664 df: state, clean more things up 2021-01-10 13:44:04 +01:00
niftynei 2f3acb91fc df: actually send a temp-id to the peer in open_channel2 WIP
We actually need a channel_id in openchannel so we can properly
attribute any errors that we get back
2021-01-10 13:44:04 +01:00
niftynei f62f8b9c6b df: assume this is a 'negotiation failure'
The most likely reason this failed is that we didn't like parameters the
peer sent us.
2021-01-10 13:44:04 +01:00
niftynei 9cffa769b8 df: actually run 'reconnect' code 2021-01-10 13:44:04 +01:00
niftynei 9984c34f14 df: handle locked in etc in dualopend 2021-01-10 13:44:04 +01:00
niftynei 9fdf1ea32a df: reinitialize dual-funding
Prior to this, all reconnect logic lived in channeld. If you
disconnected before we finished building a funding transaction, that was
no big deal. Now, however, we're waiting for the funding to lock in in
dualopend, instead of handing straight to channeld to wait.

So we need a way to restart dualopend.
2021-01-10 13:44:04 +01:00
niftynei 1b6deaffc8 df: bunch of driveby formatting fixes 2021-01-10 13:44:04 +01:00
niftynei 85ecef2849 df-feerates: mimic old behavior if there's no plugin handling
We delegate the decision about what to do about 'out of bound' feerates
to the plugin (if one exists), however in the case that the plugin
doesnt exist or doesnt want to figure it out, we default to using the
'best' as their intended feerate, and rejecting if it's out of bounds.
2021-01-10 13:44:04 +01:00
niftynei 5d388b3128 df: there's only one state that we should be in for a `dualopend`
and that's DUALOPEND_AWAITING_LOCKIN; we'll have moved over to
subd type 'channeld' if we're in CHANNELD_NORMAL
2021-01-10 13:44:04 +01:00