Commit graph

2119 commits

Author SHA1 Message Date
Matt Corallo
4ebfa1d7ac [functional tests] Drop unused disconnect_block utility
This also reduces some needless clones and indirections.
2021-03-19 23:32:38 -04:00
Matt Corallo
4fc05af870 Drop height parameter from [dis]connect_block in functional tests 2021-03-19 23:32:38 -04:00
Matt Corallo
580190f78a [tests] Demonstrate that the commit is trivially safe
See comment in the code, This commit exists only to aid reviewers.
2021-03-19 23:32:38 -04:00
Matt Corallo
f25a46cf42 [tests] Drop redundant parameters from connect_blocks 2021-03-19 23:32:38 -04:00
Matt Corallo
4266518d8d [test] Demonstrate that the next commit is trivially safe
See comment in the code. This commit exists only to aid reviewers.
2021-03-19 23:32:38 -04:00
Matt Corallo
561f0e22ac Enforce block connection ordering in unit and functional tests
This expands the assertions on block ordering to apply to
`#[cfg(test)]` builds in addition to normal builds, requiring that
unit and functional tests have syntactically-valid (ie the previous
block hash pointer and the heights match the blocks) blockchains.

This requires a reasonably nontrivial diff in the functional tests
however it is mostly straightforward changes.
2021-03-19 23:32:38 -04:00
Matt Corallo
e985334fd2 Fix block connection ordering in a number of functional tests
Many functional tests rely on being able to call block_connected
arbitrarily, jumping back in time to confirm a transaction at a
specific height. Instead, this takes us one step towards having a
well-formed blockchain in the functional tests.

We also take this opportunity to reduce the number of blocks
connected during tests, requiring a number of constant tweaks in
various functional tests.

Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
Co-authored-by: Matt Corallo <git@bluematt.me>
2021-03-19 23:32:38 -04:00
Matt Corallo
b2c5e3aedb Add assertions for in-order block [dis]connection in ChannelManager
Sadly the connected-in-order tests have to be skipped in our normal
test suite as many tests violate it. Luckily we can still enforce
it in the tests which run in other crates.

Co-authored-by: Matt Corallo <git@bluematt.me>
Co-authored-by: Jeffrey Czyz <jkczyz@gmail.com>
2021-03-19 23:32:38 -04:00
Matt Corallo
0ac839d8cd Add Debug to derive list in MessageSendEvent
It can be quite useful in debugging, and potentially also so for
users.
2021-03-19 22:57:31 -04:00
Matt Corallo
d7402b7360 Clean up log warning in the event ChannelMonitor force-closed 2021-03-19 22:57:31 -04:00
Matt Corallo
80ee1daf3e
Merge pull request #849 from TheBlueMatt/2021-03-config-cltv-delta
Make cltv_expiry_delta configurable and reduce the min/default some
2021-03-20 02:52:51 +00:00
Matt Corallo
e640b935f5 Ignore patch codecov as long as total coverage is within 1% of base
In some PRs, codecov gets mad that the coverage of the patch itself
is lower than the base. In most cases, we largely don't want a Big
Red X, at least as long as the total coverage has not gone down
substantially.
2021-03-19 20:49:14 -04:00
Matt Corallo
7503e2a43b Tweak our_to_self_delay documentation wording to make it flow better 2021-03-19 20:49:14 -04:00
Matt Corallo
c8d4536b3e Make cltv_expiry_delta configurable and reduce the min/default some
We allow users to configure the to_self_delay, which is analogous to
the cltv_expiry_delta in terms of its security context, so we should
allow users to specify both.

We similarly bound it on the lower end, but reduce that bound
somewhat now that it is configurable.
2021-03-19 20:49:14 -04:00
Matt Corallo
fba204b02e
Merge pull request #848 from TheBlueMatt/2021-03-doc-cleanups
Clean up doc links and enforce them in CI
2021-03-18 15:59:44 +00:00
Matt Corallo
e44713190a Also correct/check links in private item documentation 2021-03-18 11:28:23 -04:00
Matt Corallo
836985a5e5 Drop all HTML-relative links since rustdoc now supports resolution 2021-03-18 11:28:23 -04:00
Matt Corallo
2c7c1a6a7a Enforce no missing docs in all crates (+ add docs that were missing) 2021-03-18 11:28:23 -04:00
Matt Corallo
18a0967758 Enforce doc link correctness during cargo doc runs and in CI 2021-03-18 11:28:23 -04:00
Matt Corallo
98c6566b01 Clean up some doc links in lightning_block_sync.
Relative HTML doc paths in doc links works locally, but breaks on
crates.io. Luckily, we can now use explicit full paths and rustdoc
will resolve them for us.
2021-03-18 11:28:23 -04:00
Matt Corallo
c88e3eb452 Expose the constants mentioned in docs, and use doc links 2021-03-18 11:28:23 -04:00
Matt Corallo
32f6205848
Merge pull request #841 from valentinewallace/207-replacement
Expose counterparty forwarding info in ChannelDetails
2021-03-17 22:41:30 +00:00
Valentine Wallace
c318ad87e0
Expose counterparty forwarding info in ChannelDetails.
Useful for constructing route hints for private channels in invoices.

Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
Co-authored-by: Antoine Riard <ariard@student.42.fr>
2021-03-17 17:36:26 -04:00
Valentine Wallace
e8a0824dd4
Pass channel updates to ChannelManager and Channel.
This will be used to expose forwarding info for route hints in the next commit.

Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
Co-authored-by: Antoine Riard <ariard@student.42.fr>
2021-03-17 17:36:26 -04:00
Valentine Wallace
5b28744755
Add CounterpartyForwardingInfo field to channel.
This will be filled in in upcoming commits, then exposed in ChannelDetails
to allow constructing route hints for invoices.

Also update the cltv_expiry_deta comment in msgs::ChannelUpdate

Co-authored-by: Valentine Wallace <vwallace@protonmail.com>
Co-authored-by: Antoine Riard <ariard@student.42.fr>
2021-03-17 17:36:21 -04:00
Matt Corallo
8799a2a044
Merge pull request #828 from bmancini55/reply_channel_range
Handle query_channel_range gossip queries
2021-03-17 20:35:03 +00:00
bmancini55
7b842b61f8 Simplify sequencing of handle_query_channel_range
Modify NetGraphMsgHandler::handle_query_channel_range to always use
first_blocknum=0 in replies. This is spec compliant after changes to
make sequence completion explicity using sync_complete.
2021-03-16 19:36:38 -04:00
bmancini55
7815965bf7 Comment cleanup for handling query_channel_range
Cleans up NetGraphMsgHandler::handle_query_channel_range
2021-03-16 19:36:30 -04:00
bmancini55
f4adb9f013 Use constant MAX_REPLY_SCID
Modifies NetGraphMsgHandler::handle_query_channel_range to use a constant
max value in replies. Modifies tests to generate 8000 channels instead
of making this value configurable.
2021-03-13 14:51:36 -05:00
Matt Corallo
2cb5b1af99
Merge pull request #836 from valentinewallace/invoice-features-methods
Add methods to set invoice features in Features objects.
2021-03-12 23:19:17 +00:00
Valentine Wallace
e0c8ec56dc
Add methods to set features in Features objects. 2021-03-12 12:57:55 -05:00
Matt Corallo
52edab7055
Merge pull request #837 from TheBlueMatt/2021-03-0.0.13 2021-03-10 23:26:50 +00:00
bmancini55
1809ef199e Use constant in QueryChannelRange::end_blocknum
Clarifies u32 max value used as the default.
2021-03-10 06:46:44 -05:00
Matt Corallo
c9321c5ec0
Merge pull request #834 from TheBlueMatt/2021-03-no-pub-internals
Make `util::logger::macro_logger` pub(crate) not pub.
2021-03-10 01:54:55 +00:00
Matt Corallo
eeec6fac5c Update licenses and add missing fields in Cargo.toml files 2021-03-09 16:53:03 -05:00
Matt Corallo
49910a30ac Add missing feature to background-processor dev-dependencies 2021-03-09 16:48:20 -05:00
bmancini55
deffb4a3d8 Clean up iteration in handle_query_channel_range
Refactor to use an enumerator in NetGraphMsgHandler::handle_query_channel_range
2021-03-09 16:30:52 -05:00
Matt Corallo
8a91bd92e1
Merge pull request #835 from TheBlueMatt/2021-03-0.0.13
Bump Version to 0.0.13
2021-03-09 20:57:07 +00:00
bmancini55
dd0bb25694 Use scid_from_parts in Channel::block_connected
Refactors validation and short_channel_id construction to use
the new scid_from_parts function.
2021-03-09 15:42:45 -05:00
bmancini55
d5fd8d96e1 Improve short_channel_id utils
Modifies scid_from_parts to use u64 inputs allowing untruncated
validation. Adds public constants for limits.
2021-03-09 15:34:52 -05:00
Matt Corallo
d65d7e7257 Bump versions to 0.0.13 across the board
We also skip having different versions for different subcrates,
since that is confusing.
2021-03-09 14:11:11 -05:00
Matt Corallo
00550bac19 Rename background-processor to lightning-background-processor
This matches our naming scheme better and fits better on crates.io.
Also drop the version to 0.0.1 to match our versioning scheme
better.
2021-03-09 14:11:11 -05:00
Matt Corallo
c896461319
Merge pull request #827 from TheBlueMatt/2021-03-invoice-features
Disable MPP routing when the payee does not support it
2021-03-09 17:16:50 +00:00
Matt Corallo
2cb655b3b1
Merge pull request #826 from valentinewallace/raise-max-to-self-delay
Raise max to_self_delay.
2021-03-08 15:44:18 -08:00
Valentine Wallace
b75437dcb1
Raise max to_self_delay.
lnd requires this to_self_delay for the max channel size
(excluding wumbo).
2021-03-08 17:30:02 -05:00
Matt Corallo
b9fef85aa3 Split router benchmark into an MPP and a non-MPP route benchmark 2021-03-08 17:19:23 -05:00
Matt Corallo
ef0f249294 Disable MPP routing when the payee does not support it 2021-03-08 17:19:23 -05:00
Matt Corallo
9e57364a89 Add an Option<>al InvoiceFeatures object for the payee in get_route
We currently only use it to override the graph-specific features
returned in the route, though we should also use it to enable or
disable MPP.

Note that tests which relied on MPP behavior have had all of their
get_route calls upgraded to provide the MPP flag.
2021-03-08 17:19:23 -05:00
Matt Corallo
6b707c6f23
Merge pull request #833 from TheBlueMatt/2021-03-no-xs
Drop C bindings (which are now in a separate repo)
2021-03-08 13:37:27 -08:00
Matt Corallo
05ac59c42f
Merge pull request #830 from TheBlueMatt/2021-03-chanmon-deser-utils
Make chain::Filter slightly easier with some ChannelMonitor utilities.
2021-03-08 13:25:56 -08:00