Commit graph

3543 commits

Author SHA1 Message Date
Matt Corallo
3baaebe7dd
Merge pull request #1251 from lightning-signer/2022-01-signer-preimages
Provide payment preimages to signer on HTLC success
2022-01-25 17:12:05 +00:00
Jeffrey Czyz
d924c5d6ed
Benchmark zero-penalty scorer 2022-01-24 19:32:53 -06:00
Jeffrey Czyz
4512fd3685
Benchmark router using a scorer seeded with data
Scorers may have different performance characteristics after seeing
failed and successful paths. Seed the scorer with some random data
before executing the benchmark in order to exercise such behavior.
2022-01-24 19:32:47 -06:00
Jeffrey Czyz
486df783e9
Add first_hops to generate_routes benchmarks
Passing first_hops to get_route increases the coverage of the benchmark
test. For scorers needing the sending node, it allows for using a single
scorer in the benchmark rather than re-initializing on each iteration.
As a consequence, the scorer can be seeded with success and failure
data.
2022-01-24 19:05:49 -06:00
Jeffrey Czyz
06053fc21c
Remove duplicate generate_routes benchmark code
Refactor generate_routes and generate_mpp_routes into a single utility
for benchmarking. The utility is parameterized with features in order to
test both single path and multi-path routing. Additionally, it is
parameterized with a Score to be used with other scorers.
2022-01-24 18:52:36 -06:00
Devrandom
6e19d1f523 Provide preimages to signer 2022-01-24 21:53:03 +01:00
Devrandom
9aa786cfbb Keep track of preimage in OutboundHTLCState on success 2022-01-24 21:53:03 +01:00
valentinewallace
35d4ebb208
Merge pull request #1272 from lightning-signer/2022-01-sign-invoice-api
Improve KeysInterface::sign_invoice API
2022-01-24 11:39:58 -05:00
valentinewallace
b19c56b78a
Merge pull request #1271 from tnull/rename_payee_struct
Rename `Payee` to `PaymentParameters`
2022-01-24 11:34:48 -05:00
valentinewallace
07776d3dab
Merge pull request #1253 from TheBlueMatt/2022-01-background-persist-exit
Persist `ChannelManager` before `BackgroundProcessor` exits
2022-01-24 11:23:12 -05:00
Devrandom
803d6b6e2f Improve KeysInterface::sign_invoice API
split hrp from invoice data, to allow parsing, since there is no delimiter between the two parts
2022-01-24 09:48:56 +01:00
Matt Corallo
19fdde26d7
Merge pull request #1250 from vss96/sanity_check
Sanity check for ChannelManager and KeysInterface
2022-01-22 18:19:35 +00:00
vss96
2f01d68148 Sanity check for ChannelManager and KeysInterface
Fix build errors

Create script using p2wsh for comparison

Using p2wpkh for generating the payment script

spendable_outputs sanity check

Return err in spendable_outputs

Doc updates in keysinterface
2022-01-22 10:12:42 +05:30
valentinewallace
b1bdba5265
Merge pull request #1269 from TheBlueMatt/022-01-no-disconnect-on-slow-persist
Avoid disconnecting all peers if user code is slow
2022-01-21 11:52:05 -05:00
Elias Rohrer
808477a5ce Rename Payee to PaymentParameters 2022-01-21 10:39:01 +01:00
Matt Corallo
2d3a210897 Increase our PING_TIMER to ten seconds, from five.
Because many lightning nodes can take quite some time to respond to
pings, the five second ping timer can sometimes cause spurious
disconnects even though a peer is online. However, in part as a
response to mobile users where a connection may be lost as result
of only a short time with the app in a "paused" state, we had a
rather aggressive ping time to ensure we would disconnect quickly.

However, since we now just used a fixed time for the "went to
sleep" detection, we can somewhat increase the ping timer. We still
want to be fairly aggressive to avoid sending HTLCs to a peer that
is offline, but the tradeoff between spurious disconnections and
stuck payments is likely doesn't need to be quite as aggressive.
2022-01-21 00:36:59 +00:00
Matt Corallo
8f5023a006 Avoid disconnecting all peers if user code is slow
In the sample client (and likely other downstream users), event
processing may block on slow operations (e.g. Bitcoin Core RPCs)
and ChannelManager persistence may take some time. This should be
fine, except that we consider this a case of possible backgrounding
and disconnect all of our peers when it happens.

Instead, we here avoid considering event processing time in the
time between PeerManager events.
2022-01-21 00:36:59 +00:00
Jeffrey Czyz
d741fb14fa
Merge pull request #1234 from tnull/limit_max_cltv_delta
Limit maximum CLTV delta during routing
2022-01-20 10:36:22 -06:00
Matt Corallo
581a800ce2
Merge pull request #1248 from naveensrinivasan/naveen/feat/update-readme
Docs: Updated README to include crates information
2022-01-20 16:34:01 +00:00
Elias Rohrer
367ed31dc9 Limit maximum total CLTV expiry delta during routing. 2022-01-20 16:00:00 +01:00
naveen
f29e4855f3 Docs: Updated README to include crates information
Included crates information into README.
2022-01-19 19:27:11 +00:00
valentinewallace
e4387fa8af
Merge pull request #1258 from lightningdevkit/dependabot/cargo/hex-0.4
Update hex requirement from 0.3 to 0.4
2022-01-19 13:19:59 -05:00
Elias Rohrer
689518520e Fixed some typos 2022-01-19 18:15:47 +01:00
Matt Corallo
ce82a33186 Persist ChannelManager before BackgroundProcessor exits
Fixes #1237.
2022-01-18 22:07:15 +00:00
dependabot[bot]
f39fa69b68
Update hex requirement from 0.3 to 0.4
Updates the requirements on [hex](https://github.com/KokaKiwi/rust-hex) to permit the latest version.
- [Release notes](https://github.com/KokaKiwi/rust-hex/releases)
- [Commits](https://github.com/KokaKiwi/rust-hex/compare/v0.3...v0.4.3)

---
updated-dependencies:
- dependency-name: hex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 22:05:49 +00:00
Arik Sosman
10204f706f
Merge pull request #1243 from naveensrinivasan/naveensrinivasan/dependabot
Enable Dependabot
2022-01-18 14:04:38 -08:00
Naveen
126771daf8 Create dependabot.yml
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
2022-01-18 19:39:53 +00:00
valentinewallace
7b6a7bbc72
Merge pull request #1249 from tnull/fix_compile_warnings
Fix compiler warning during building/testing.
2022-01-18 11:18:05 -05:00
Elias Rohrer
5490366a95 Fix unused return warning for 'transmute_copy'. 2022-01-18 14:45:43 +01:00
Matt Corallo
34cdca91ba
Merge pull request #1238 from TheBlueMatt/2022-01-lockorder-checks
Fix and test lockorder
2022-01-14 16:59:42 +00:00
Matt Corallo
8f007c7dbb Check lockorders in tests with a trivial lockorder tracker 2022-01-14 15:35:58 +00:00
Matt Corallo
89cbb6d74b
Merge pull request #1229 from lightning-signer/2021-12-htlc-anchor-sighashtype
anchors: Fix SigHashType and weight calculations for anchors
2022-01-14 04:10:14 +00:00
Ken Sedgwick
9c2270c722
Fixed comment on weight_received_htlc 2022-01-13 15:01:32 -08:00
Ken Sedgwick
bee00124d2
Set opt_anchors for calls to CommitmentTransaction::new_with_auxiliary_htlc_data 2022-01-13 15:01:31 -08:00
Ken Sedgwick
299b6657d5
Add anchor tests to outbound_commitment_test 2022-01-13 15:01:30 -08:00
Ken Sedgwick
35a6e00b03
Debit funder's output to cover anchors 2022-01-13 15:01:29 -08:00
Ken Sedgwick
557a83096f
Convert HTLC_{SUCCESS,TIMEOUT}_TX_WEIGHT to anchor-aware functions 2022-01-13 15:01:21 -08:00
Ken Sedgwick
9566795c97
Convert COMMITMENT_TX_BASE_WEIGHT to anchor-aware function 2022-01-13 14:59:28 -08:00
Ken Sedgwick
c47d014a8e
Add unit test coverage for package::weight_{offered,received}_htlc 2022-01-13 14:44:05 -08:00
Ken Sedgwick
37001b8b0e
make WEIGHT{_REVOKED,}_{OFFERED,RECEIVED}_HTLC functions with opt_anchors parameter 2022-01-13 14:37:18 -08:00
Ken Sedgwick
3a163d2c61
Isolated channelmonitor weight unit tests and added anchor loops 2022-01-13 14:37:17 -08:00
Ken Sedgwick
8f09e5a7ff
Set the SigHashType of remote htlc signatures w/ anchors to SinglePlusAnyoneCanPay 2022-01-13 14:37:03 -08:00
Matt Corallo
feb203d3b1 Fix some (non-bug) lock-order-inversions in tests 2022-01-13 01:51:51 +00:00
Matt Corallo
6ccd07bc2d Make lockorder consistent in channelmanager
This resolves a lockorder inversion in
`ChannelManager::finalize_claims` where `pending_outbound_payments`
is locked after `pending_events`, opposite of, for example, the
lockorder in `ChannelManager::fail_htlc_backwards_internal` where
`pending_outbound_payments` is locked at the top of the
`HTLCSource::OutboundRoute` handling and then `pending_events` is
locked at the end.
2022-01-12 21:17:49 +00:00
Matt Corallo
a82067d359
Merge pull request #1013 from TheBlueMatt/2021-07-warning-msgs 2022-01-11 22:52:44 +00:00
Matt Corallo
d786bfaef2 Rely on Error/Warning message data lengths being correct
In https://github.com/lightning/bolts/pull/950, the (somewhat
strange) requirement that error messages be handled even if the
length field is set larger than the size of the package was
removed. Here we change the code to drop the special handling for
this, opting to just fail to read the message if the length is
incorrect.
2022-01-11 20:25:24 +00:00
Matt Corallo
2d7b06e619 Send warning instead of error when we incounter bogus gossip 2022-01-11 19:48:20 +00:00
Matt Corallo
26fe0f753d Convert shutdown invalid script checks to warning messages
As required by the warning messages PR, we should simply warn our
counterparty in this case and let them try again, continuing to try
to use the channel until they tell us otherwise.
2022-01-11 19:48:20 +00:00
Matt Corallo
e137cfb3c4 Send warning messages when appropriate in gossip handling pipeline 2022-01-11 19:48:20 +00:00
Matt Corallo
1b3249a192 Handle sending and receiving warning messages 2022-01-11 19:48:20 +00:00