Commit Graph

9358 Commits

Author SHA1 Message Date
Jon Griffiths 5bdad04976 tx: Remove wally workaround that is no longer needed
Signed-off-by: Jon Griffiths <jon_p_griffiths@yahoo.com>
2020-11-30 10:28:04 +10:30
Rusty Russell 70977a4fbd libwally: update to latest which uses libsecp-zkp submodule
And get rid of the now-obsolete PYTHON_VERSION hack.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-25 11:59:22 -06:00
niftynei 5e71de7819 df-spec: fail the open if they send us too many tx-collab msgs 2020-11-23 12:41:05 -06:00
niftynei 29c3532856 mfc-psbt: mark all of our inputs as "ours", then only sign those
we only want to sign the inputs that we've reserved via utxopsbt or
fundpsbt. we mark them with a flag (reusing the now defunct max-len
flag is fine), then look for inputs with that flag to pass to signonly
2020-11-23 12:41:05 -06:00
niftynei 6077eca660 df: pass back 'close_to' for completed/commitment secured channels
When commitments are secured, also return the 'close_to' script if we've
got a local_upfront_shutdown_script set.
2020-11-23 12:41:05 -06:00
niftynei 405453859c mfc-df: add 'happy path' tests for the v1+v2 things
We can't test disconnects et.al. quite yet because the 'cancel' flow for
openchannelv2 still needs to be resolved
2020-11-23 12:41:05 -06:00
niftynei da98a9d0af df-accepter plugin: temporarily dont pass in signpsbt 2020-11-23 12:41:05 -06:00
niftynei c6b45e052b mfc-df: after openchannel_signed is finished, we call finished
We done!?
2020-11-23 12:41:05 -06:00
niftynei 3e19b6c8f5 mfc-df: after psbt signed, send to openchannel_signed if v2s
If there's an v2 destinations, they'll broadcast the tx for us
2020-11-23 12:41:05 -06:00
niftynei a34425abd1 mfc-df: after sigs are collected, go sign the psbt 2020-11-23 12:41:05 -06:00
niftynei d7c06b5b0e mfc-df: once we've gotten the PSBT finalized, we wait for peer sigs
We need our peer's signatures to arrive before we sign/broadcast the
funding transaction (but only if there's v2 peers present)
2020-11-23 12:41:05 -06:00
niftynei c90a19f739 mfc-df: only add outputs for v1 outs; go to openchannel_update if v2s
We only have output scripts for v1 protocols after the
fundchannel_start/openchannel_init round. We need to add them before
we get into the openchannel_update rounds, however, so we do that here.
2020-11-23 12:41:05 -06:00
niftynei 3d2c0951d5 mfc-df: rework how openchannel_update works, callbacks 2020-11-23 12:41:05 -06:00
niftynei 381658dee6 mfc-df: merge openchannel_init/fundchannel_start results
These happen simultaneously, and should resolve to the same place when
they're finished.
2020-11-23 12:41:05 -06:00
niftynei 95de8b1174 mfc-df: have both paths use redo_multifundchannel
Still need handling of failure for v2 opens (no rpc exists?!)
2020-11-23 12:41:05 -06:00
niftynei a31b078721 mfc: consolidate to a single FAILED state 2020-11-23 12:41:05 -06:00
niftynei 991ae65e9e mfc-df: track destination's openchannel version
Plus method to help count/tabulate how many of each we've got
around still.
2020-11-23 12:41:05 -06:00
niftynei e0c4865eea mfc: add a 'fail_destination' helper
Caches state at which we failed + sets error
2020-11-23 12:41:05 -06:00
niftynei 5b6b012af9 mfc: add happy path-way for v2 in multifundchannel
Tested and works with both sides funding! Yay.

Doesn't do any amount of reasonable cleanup or handling of errors.
2020-11-23 12:41:05 -06:00
niftynei 78d32b12d0 nit,df test plugin: change up how feerate is formatted
Suggested-by: @cdecker
2020-11-23 12:41:05 -06:00
ZmnSCPxj jxPCSnmZ ff090ecfe6 doc/TOR.md: Add missing instructions to add user to Tor group.
Changelog-None

Fixes: #4208
2020-11-23 12:22:10 -06:00
niftynei e4cd5eac28 htlc.h: move NUM_SIDES to define, not enum member 2020-11-23 12:21:33 -06:00
YOSHIDA Masanori ff2535651e lightningd: remove unused pid_fd member in struct lightningd
Signed-off-by: YOSHIDA Masanori <masanori.yoshida@gmail.com>
Changelog-None
2020-11-23 12:13:28 -06:00
ZmnSCPxj jxPCSnmZ dc83862fc2 doc/PLUGINS.md: Fix typo. 2020-11-23 12:13:09 -06:00
niftynei 66b2bb9a90 Update to v0.9.2 2020-11-20 15:32:38 -06:00
niftynei ce0888d7d6 release: bump to v0.9.2rc2 2020-11-17 11:22:31 -06:00
Rusty Russell 5ae18ecb32 Revert accidental experimental libwally update from f56266c1c1
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-17 11:21:58 -06:00
Rusty Russell f56266c1c1 plugins: undeprecate old form of hooks.
This effectively reverts ac93b780d5.

Christian points out that plugins need time before we deprecate
the old options (probably 6 months) as they need to work with
both old and new.

Changelog-Deprecated: **UNDO** plugins: hooks should now be specified using objects, not raw names.
Suggested-by: @cdecker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-17 14:42:58 +10:30
Christian Decker 313976e2f4 pay: Cleanup the route applicability checks for channel hints
I previously mistyped the rather lengthy conditions for failures, so
let's dissect it into its smaller components and add rationale behind
the individual parts of the decision.
2020-11-17 14:04:19 +10:30
Christian Decker 4d6b4a0445 pay: Retry the route computation if we could not apply the chanhints
This adds a new state `PAYMENT_STEP_RETRY_GETROUTE` which is used to
retry just that one step, without spawning a completely new
attempt. It's a new state so that modifiers do not act on it twice.

Changelog-Fixed: pay: Improved the performance of the `pay` command considerably by avoiding conflicting changes to our local network view.
2020-11-17 14:04:19 +10:30
Christian Decker 544e110c96 pay: Add a pre-apply check to channel_hint updates
This allows us to atomically update all channel_hints and determine if
we had a collision and therefore should retry.
2020-11-17 14:04:19 +10:30
Christian Decker 83f57ac300 pay: Move the chanhint update up to payment_getroute
We were delaying the channel_hint update till after the `createonion`
call which gave us the same situation we had with concurrent
`getroute` calls. Now we update the hints as soon as the plugins have
had their say in the route construction. If we still fail, either
because a modifier changed the route causing the failure, or because
we interleaved the route computation for multiple parts, we reset the
attempt and retry inline (i.e., without creating a new sub-payment).

Notice that interleaved route computations now only happen if the
modifier makes an async call to some RPC or similar.
2020-11-17 14:04:19 +10:30
niftynei abad494fcf connectd: properly cleanup 'competing' outgoing connections
Coauthored-By: Rusty Russell @rustyrussell
2020-11-16 20:00:51 -06:00
niftynei 7e60ef6974 tests: make connection details correct 2020-11-16 20:00:51 -06:00
niftynei 4a3ee19a22 connectd: Update connection list with new address
If we're already attempting to connect to a peer, we would ignore
new connection requests. This is problematic if your node has bad
connection details for the node -- you can't update it while inflight.

This patch appends new connection suggestions to the list of connections
to try.

Fixes #4154
2020-11-16 20:00:51 -06:00
niftynei cd7d5cdff9 pytest: use the 'contrib' plugin set, not the 'test' set
They're clobbering each other, and the test hangs
2020-11-13 14:28:29 -06:00
Michael Schmoock 183f7698c3 chore: reduce CI load merging a testcase 2020-11-13 14:25:02 -06:00
Michael Schmoock 4134c24cc9 pytest: fix a probable flake on test_channel_opener 2020-11-13 14:25:02 -06:00
Michael Schmoock 90a4476f16 pytest: tests closer on unilateral close 2020-11-13 14:25:02 -06:00
Michael Schmoock 36499e6779 fix: closer set to remote for onchain settlement
Incase we have been offline while a channel was force closed on us we
now set the 'closer' to 'remote' instead of null because this is by far
the most probable reason.

Changelog-None
2020-11-13 14:25:02 -06:00
Michael Schmoock 3e42d08c89 fix: hangup in plugin rescan
This adds a missing plugins_send_getmanifest() call in the rescan function
that lead to a RPC hangup. Not sure though if this is the proper fix.

Changelog-None
2020-11-12 15:27:04 -06:00
niftynei 0f2b3c9179 v0.9.2rc1 - Changelog 2020-11-11 13:18:55 -06:00
niftynei cefb64cd68 htlc_accepted: log BROKEN if both 'failure_msg' + 'failure_onion'
Log an error for incorrect use of API

Suggested-By: @cdecker
2020-11-10 19:03:23 -06:00
fiatjaf 65cdb78bb4 refactor htlc_accepted_hook_deserialize. 2020-11-10 19:03:23 -06:00
fiatjaf c5aa2ea911 failure_onion: a test that only ensures lightningd doesn't crash. 2020-11-10 19:03:23 -06:00
fiatjaf 9e4bed73d9 optional "failure_onion" in reply to htlc_accepted hook.
Changelog-Added: `htlc_accepted` hook can now return custom `failure_onion`.
2020-11-10 19:03:23 -06:00
niftynei 72dc97c0c1 pytest: silence pytest warnings about unregistered 'slow_test' marker
We've been getting a bunch of 'warnings' about an unknown mark. This
silences the warning, by registering the mark as expected.

=========================================================== warnings summary ===========================================================
tests/test_closing.py:152
  /home/niftynei/dev/lightning/tests/test_closing.py:152: PytestUnknownMarkWarning: Unknown pytest.mark.slow_test - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.slow_test

tests/test_closing.py:214
  /home/niftynei/dev/lightning/tests/test_closing.py:214: PytestUnknownMarkWarning: Unknown pytest.mark.slow_test - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    @pytest.mark.slow_test

tests/test_closing.py:704
2020-11-10 16:17:04 -06:00
Rusty Russell 9f5f9e15d0 devtools/decodemsg: handle truncated TLVs properly.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-10 10:52:18 -06:00
Rusty Russell 50f8da85ac gossipd: fix response for large replies.
We tried to send an absurdly-long message, because our limit
was really large, as we were subtracting the tlv length, not
the tlv overhead.

In addition, we were treating the array as a tal object, which
it isn't if the offset is non-zero.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-11-10 10:52:18 -06:00
Antoine Poinsot 6b347e1895 doc: document output descriptors in hsmtool
Touch a bit about it as a backup/recovery mechanism in the FAQ

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
2020-11-10 10:34:13 -06:00