Commit graph

3811 commits

Author SHA1 Message Date
Matt Corallo
abf6564a44
Merge pull request #1532 from ariard/2022-06-scaleup-far-away
Scale up CLTV_FAR_FAR_AWAY to 2 weeks of blocks
2022-06-16 17:27:27 -07:00
Antoine Riard
c989ce189c Scale up CLTV_FAR_FAR_AWAY to 2 weeks of blocks 2022-06-16 16:33:57 -04:00
Matt Corallo
d2a7ee2c71
Merge pull request #1544 from jkczyz/2022-06-node-alias
Define `NodeAlias` struct and `Display` impl
2022-06-16 06:34:08 -07:00
Matt Corallo
e53344663c
Merge pull request #1531 from ariard/2022-06-fee-sniping
Funding_tx: add anti-fee sniping recommendation and check if final
2022-06-16 06:12:29 -07:00
Jeffrey Czyz
21aff6f701
Define NodeAlias struct and Display impl
Provide a wrapper struct for 32-byte node aliases, which implements
Display for printing. Support the UTF-8 character encoding, but replace
control characters and terminate at the first null character. Fall back
to ASCII if the byte sequence is an invalid encoding.
2022-06-15 16:20:07 -05:00
Matt Corallo
44d1dfa23d Correct handling of reorg'd-out revoked counterparty transactions
Previously, while processing a confirmed revoked counterparty
commitment transaction, we'd populate `OnchainEvent`s for live
HTLCs with a `txid` source of the txid of the latest counterparty
commitment transactions, not the confirmed revoked one. This meant
that, if the user is using `transaction_unconfirmed` to notify us
of reorg information, we'd end up not removing the entry if the
revoked commitment transaction was reorg'd out. This would
ultimately cause us to spuriously resolve the HTLC(s) as the chain
advanced, even though we were doing so based on a now-reorged-out
transaction.

Luckily the fix is simple - set the correct txid in the
`OnchainEventEntry`. We also take this opportunity to update
logging in a few places with the txid of the transaction causing an
event.
2022-06-15 14:21:35 +00:00
Matt Corallo
c180ddd57a
Merge pull request #1541 from jkczyz/2022-06-nit-follow-ups 2022-06-15 02:52:35 -07:00
Antoine Riard
69344fab61 Recommend funding_tx to apply anti-fee sniping 2022-06-14 15:57:21 -04:00
Antoine Riard
2b7ef4762f Check if funding transaction is final for propagation
If the funding transaction is timelocked beyond the next block of
our best known chain tip, return an APIError instead of silently
failing at broadcast attempt.
2022-06-14 15:57:11 -04:00
Matt Corallo
8fce6a197c
Merge pull request #1540 from wpaulino/rename-config-fields 2022-06-14 04:57:02 -07:00
Jeffrey Czyz
1aa1d69461
Remove unnecessary identifiers from match pattern 2022-06-13 18:28:01 -05:00
Jeffrey Czyz
cb66dcd3b4
Replace Arc with reference in some tests 2022-06-13 18:28:01 -05:00
Jeffrey Czyz
04a46829ac
Fix grammar in BackgroundProcessor::start docs 2022-06-13 18:28:01 -05:00
Wilmer Paulino
44fa3acae8
Rename UserConfig and LegacyChannelConfig fields
The current names aren't very clear to what each field represents, this
commit aims to improve that.
2022-06-13 13:57:00 -07:00
Matt Corallo
435680904a
Merge pull request #1526 from tnull/2022-06-fix-minimal-value-contrib
Fix per-path minimal value contribution during route finding
2022-06-13 10:50:19 -07:00
Elias Rohrer
1dfabcb91f Add failure test cases for max_mpp_path_count. 2022-06-13 18:25:19 +02:00
Elias Rohrer
13b7cd503b Fix min. contrib. depending on max_mpp_path_count 2022-06-13 18:24:17 +02:00
Matt Corallo
d6feb1c63b
Merge pull request #1514 from mattfaltyn/issue438 2022-06-13 04:19:02 -07:00
Matt Corallo
5421e1a6e7
Merge pull request #1529 from wpaulino/move-channel-config-static-fields
Move ChannelConfig static fields to ChannelHandshakeConfig
2022-06-13 04:04:23 -07:00
Matt
86299c53eb Document better optional features 2022-06-12 11:31:53 -07:00
Matt Corallo
716539e6c4
Merge pull request #1535 from TheBlueMatt/2022-06-108-ugh
Cut 0.0.108
2022-06-10 09:44:11 -07:00
Matt Corallo
deac430f17 Update crate versions to 0.0.108/invoice 0.16 2022-06-10 14:53:23 +00:00
Matt Corallo
2477c44151 Update CHANGELOG for 0.0.108 2022-06-10 14:53:23 +00:00
Matt Corallo
bfe4660caf
Merge pull request #1534 from tnull/2022-06-check-release-build
Check release build in CI
2022-06-10 07:51:41 -07:00
Elias Rohrer
c21593db99 Check release build profile in CI
So far, CI did not check the code in the `release` build profile, which
could result in some things not getting caught. To fix this, we now
implement a new CI job that runs checks in the `release` profile.

Switch to stable toolchain.
2022-06-10 15:22:31 +02:00
Matt Corallo
0fc2036f76
Merge pull request #1533 from lexe-tech/fix-release
Fix `lightning-background-processor` release build
2022-06-10 03:34:09 -07:00
Max Fang
e291fb6b41 Fix lightning-background-processor release build 2022-06-09 22:58:26 -07:00
Wilmer Paulino
ec7ccf0415
Introduce LegacyChannelConfig to remain backwards compatible
ChannelConfig now has its static fields removed. We introduce a new
LegacyChannelConfig struct that maintains the serialization as
previously defined by ChannelConfig to remain backwards compatible with
clients running 0.0.107 and earlier.
2022-06-09 16:18:15 -07:00
Wilmer Paulino
8027c2ff06
Move commit_upfront_shutdown_pubkey to ChannelHandshakeConfig
As like the previous commit, `commit_upfront_shutdown_pubkey` is another
static field that cannot change after the initial channel handshake. We
therefore move it out from its existing place in `ChannelConfig`.
2022-06-09 16:18:01 -07:00
Wilmer Paulino
850ca13fbc
Move announced_channel to ChannelHandshakeConfig
In the near future, we plan to allow users to update their
`ChannelConfig` after the initial channel handshake. In order to reuse
the same struct and expose it to users, we opt to move out all static
fields that cannot be updated after the initial channel handshake.
2022-06-09 16:11:15 -07:00
Arik Sosman
22dc96481b
Merge pull request #1496 from TheBlueMatt/2022-05-macro-function-bonus
Make `expect_payment_failed_conditions` a function
2022-06-09 12:10:27 -04:00
Matt Corallo
70acdf93d1 Make expect_payment_failed_conditions a function
This reduces macro generated code in tests a good bit, and moves us
one step further away from using macros everywhere when we don't
need to.
2022-06-09 11:35:41 +00:00
valentinewallace
6e00c28a55
Merge pull request #1513 from TheBlueMatt/2022-06-fix-fuzz-nonbug
Do not panic on early tx broadcasts in fuzzing
2022-06-08 18:32:22 -07:00
Matt Corallo
7adf2c7f5f
Merge pull request #1524 from ViktorTigerstrom/2022-06-update-fail-holding-cell-htlcs-args
Pass `counterparty_node_id` to `fail_holding_cell_htlcs`
2022-06-08 17:12:20 -07:00
Matt Corallo
5c788a09f8
Merge pull request #1525 from jkczyz/2022-05-release-0.0.107
Cut 0.0.107
2022-06-08 16:44:03 -07:00
Jeffrey Czyz
b2e635f619
Bump crate versions to 0.0.107/invoice 0.15 2022-06-08 18:16:48 -05:00
Jeffrey Czyz
e19024225a
Update CHANGELOG for 0.0.107 2022-06-08 18:16:48 -05:00
Viktor Tigerström
6032a56439 Pass peer_node_id to fail_holding_cell_htlcs 2022-06-08 11:00:11 +02:00
Jeffrey Czyz
aa1de2d9ef
Add lightning-rapid-gossip-sync to README 2022-06-07 23:50:48 -05:00
Matt Corallo
a551a6219c
Merge pull request #1517 from jkczyz/2022-06-gossip-sync-enum
Support only one `GossipSync` in `BackgroundProcessor`
2022-06-07 03:17:29 -07:00
Jeffrey Czyz
c032e2888b
Support only one GossipSync in BackgroundProcessor
BackgroundProcessor can take an optional P2PGossipSync and an optional
RapidGossipSync, but doing so may be easy to misuse. Each has a
reference to a NetworkGraph, which could be different between the two,
but only one is actually used.

Instead, allow passing one object wrapped in a GossipSync enum. Also,
fix a bug where the NetworkGraph is not persisted on shutdown if only a
RapidGossipSync is given.
2022-06-06 13:03:16 -05:00
Jeffrey Czyz
4ccf4451c2
Implement EventHandler for NetworkGraph
Instead of implementing EventHandler for P2PGossipSync, implement it on
NetworkGraph. This allows RapidGossipSync to handle events, too, by
delegating to its NetworkGraph.
2022-06-06 13:02:47 -05:00
Jeffrey Czyz
67736b7480
Parameterize NetworkGraph with Logger
P2PGossipSync logs before delegating to NetworkGraph in its
EventHandler. In order to share this handling with RapidGossipSync,
NetworkGraph needs to take a logger so that it can implement
EventHandler instead.
2022-06-06 13:02:43 -05:00
Matt Corallo
8e5cf75771
Merge pull request #1501 from tnull/2022-05-mention-compat-level
Mention backwards compatibility in CONTRIBUTING.
2022-06-03 17:14:01 -07:00
Jeffrey Czyz
0f73d6adcf
Move Secp256k1 context to NetworkGraph
P2PGossipSync has a Secp256k1 context field, which it only uses to pass
to NetworkGraph methods. Move the field to NetworkGraph so other callers
don't need to pass in a Secp256k1 context.
2022-06-02 23:08:57 -07:00
Matt Corallo
0017bc88a8
Merge pull request #1159 from jkczyz/2021-11-network-gossip
Rename network-related types
2022-06-02 16:53:32 -07:00
Jeffrey Czyz
574870e9f8
Move network_graph.rs to gossip.rs
The routing::network_graph module contains a few structs related to p2p
gossip. So renaming the module to 'gossip' seems more appropriate.
2022-06-02 15:15:30 -07:00
Jeffrey Czyz
ac35492877
Rename NetGraphMsgHandler to P2PGossipSync
NetGraphMsgHandler implements RoutingMessageHandler to handle gossip
messages defined in BOLT 7 and maintains a view of the network by
updating NetworkGraph. Rename it to P2PGossipSync, which better
describes its purpose, and to contrast with RapidGossipSync.
2022-06-02 15:15:30 -07:00
Jeffrey Czyz
3b3a4ba0a6
Rename ChannelClosed to ChannelFailure
A NetworkUpdate indicating ChannelClosed actually corresponds to a
channel failure as described in BOLT 4:

0x2000 (NODE): node failure (otherwise channel)

Rename the enum variant to ChannelFailure and rename NetworkGraph
methods close_channel_from_update and fail_node to channel_failed and
node_failed, respectively.
2022-06-02 15:15:29 -07:00
Jeffrey Czyz
dcffefae3d
Update missed references to get_route in docs 2022-06-02 13:15:15 -07:00