Commit graph

4059 commits

Author SHA1 Message Date
Matt Corallo
5fb2cc4699
Merge pull request #143 from TheBlueMatt/2018-08-announcement_sigs_erroraction
Ensure handle_announcement_signatures always has a ErrorAction
2018-09-03 17:44:57 -04:00
Matt Corallo
6dfec329ea Provide better get_chain_utxo return coverage in router_target 2018-09-03 17:40:12 -04:00
Matt Corallo
4ee011441b Ensure we aren't duplicatively reading things in router_target 2018-09-03 17:40:12 -04:00
Antoine Riard
88fac35cd4 Add DummyChainWatcher in route_target 2018-09-03 17:40:12 -04:00
Antoine Riard
4b4d8b6b9e Add test_invalid_channel_announcemnt + test utilities
Fix typo
2018-09-03 17:40:12 -04:00
Matt Corallo
187f28db03 Check script_pubkey against expected channel_announcement 2018-09-03 17:40:12 -04:00
Antoine Riard
07ac327f8b Implement get_chain_utxo and ChainError in
ChainWatchInterface to Router check on channel_announcement

Needed for BOLT 7
2018-09-03 17:40:12 -04:00
Antoine Riard
2079fe4ad2 Add ChainWatchInterface in Router 2018-09-03 17:40:05 -04:00
Matt Corallo
1992464316
Merge pull request #144 from yuntai/onion_call_back_simple
Remove code fragments with no effect
2018-09-03 16:51:32 -04:00
Yuntai Kyong
92274c8800 Remove code fragments with no effect 2018-09-02 21:45:44 +09:00
Matt Corallo
a9434db103 Check for misuse of funding_transaction_generated and panic 2018-08-31 17:00:44 -04:00
Matt Corallo
c531cb4faa Ensure handle_announcement_signatures always has a ErrorAction 2018-08-31 17:00:44 -04:00
Matt Corallo
1661d3c6cb Add ErrorAction in secp Error -> HandleError conv in ChannelManager 2018-08-31 17:00:43 -04:00
Matt Corallo
c91c4be6c5
Merge pull request #139 from TheBlueMatt/2018-08-fuzz-fixes-7
Fix crash that #127 intended to fix but did not completely fix
2018-08-30 16:02:38 -04:00
Matt Corallo
3fbbd9e8d2 Remove unused feeest field in ChannelManager tests 2018-08-30 15:11:16 -04:00
Matt Corallo
794212bb23 Fix crash that #127 intended to fix but did not completely fix
Introduced in #124, and found by fuzzer
2018-08-30 12:37:21 -04:00
Matt Corallo
a1aaea5dc2
Merge pull request #136 from TheBlueMatt/2018-08-excess-signed-data-bolt-7
Correctly verify and forward excess data post-signature in signed announcement messages
2018-08-29 18:43:19 -04:00
Matt Corallo
f78d7299d6 Also fwd channel_update and node_announcement immediately
Not really sure why the API was different for channel_announcement,
but this brings everything in sync.
2018-08-29 18:07:56 -04:00
Matt Corallo
faff5c2da3 Fail parsing node/channel announcements with unknown even features
This is required for BOLT 7 compliance
2018-08-29 18:06:06 -04:00
Matt Corallo
335012640a Update msg_targets with new, must-roundtrip, and hole messages 2018-08-29 18:04:55 -04:00
Matt Corallo
b9a793a0a0 Correct excess-data handling in NodeAnnouncement
Breaks parsing of padding within addresses, but nothing currently
generates such messages, and I'm proposing we remove it in the spec
2018-08-29 18:03:10 -04:00
Matt Corallo
9902fce585 Correct excess-data handling in ChannelUpdate 2018-08-29 18:01:15 -04:00
Matt Corallo
0881bf4b74 Correct excess-data handling in ChannelAnnouncement verif in Router 2018-08-29 17:59:25 -04:00
Matt Corallo
10bc7aa3df Ignore invalid lnd msgs by matching DecodeError instead of a macro 2018-08-29 17:57:40 -04:00
Matt Corallo
c1c7cc96ac Remove unused test variable left orphaned by 5d923e2a63 2018-08-29 17:54:57 -04:00
Matt Corallo
d2b44ca7a6
Merge pull request #133 from TheBlueMatt/2018-08-announcement_sigs
Clean up/clarify channel announcement_signatures handling
2018-08-29 13:49:52 -04:00
Matt Corallo
bec25955f1
Merge pull request #135 from yuntai/201808-channelreestablish
Make my_current_per_commitment_point in ChannelReestablish optional
2018-08-29 13:49:40 -04:00
Yuntai Kyong
9a28496388 Use Option<DataLossProtect> for ChannelReestablish
and fix test
2018-08-30 01:48:36 +09:00
Yuntai Kyong
5d923e2a63 Fix test for ChannelReestablish 2018-08-29 13:00:34 +09:00
Yuntai Kyong
7dc215edcb Make my_current_per_commitment_point Option
Per Bolt #2, both your_last_per_commitment_secret &
my_current_per_commitment_point are optional depending on
`data_loss_protect`
2018-08-29 12:55:11 +09:00
Matt Corallo
30b47bbb14 Clean up/clarify channel announcement_signatures handling 2018-08-28 12:56:29 -04:00
Matt Corallo
63bef2b44e Make note about complying with BOLT 7 announcement_signatures 2018-08-28 12:12:27 -04:00
Matt Corallo
765987759a
Merge pull request #132 from TheBlueMatt/2018-08-bolt-4-spec-return-fail
Return a malformed HTLC message when ephemeral pubkey is garbage
2018-08-27 12:44:13 -04:00
Matt Corallo
a34e80f4e9 Remove incorrect auto-generated header from error_message_target 2018-08-27 11:47:11 -04:00
Matt Corallo
42e908883f Return a malformed HTLC message when ephemeral pubkey is garbage
This resolves a spec-compliance bug with BOLT 4 where we simply
failed to deserialize the message and thus could never return an
HTLC failure message. However, note that BOLT 4 incorrectly hints
that a non-malformed message should be used ("...MUST report a
route failure to the origin node") which we cannot do as we cannot
derive a SharedSecret to encrypt a regular update_fail_htlc message
2018-08-27 11:47:11 -04:00
Matt Corallo
4ca5bcf8cf Update PendingHTLCStatus to hold malformed HTLC error messages 2018-08-26 16:39:21 -04:00
Matt Corallo
7d6aab7f22 Add update_fail_malformed_htlcs vec to CommitmentUpdate
Not sure why this wasn't there to begin with
2018-08-26 16:39:21 -04:00
Matt Corallo
b83443f0cc
Merge pull request #131 from TheBlueMatt/2018-08-bolt-1-compliance
update Error/Init handling to be BOLT 1 compliant
2018-08-26 15:37:05 -04:00
Matt Corallo
a33b3a2695
Merge pull request #130 from TheBlueMatt/2018-08-fuzz-fixes-6
Fix crash introduced in #124
2018-08-26 15:36:58 -04:00
Matt Corallo
755b76bf83 Update error deserialization in compliance with BOLT #1 2018-08-25 17:21:09 -04:00
Matt Corallo
a3247abb4e Handle Error messages by closing channels as required by BOLT 1 2018-08-25 17:20:58 -04:00
Matt Corallo
8f36386bee Ensure we never send messages prior to Init for BOLT 1 compliance 2018-08-25 14:49:18 -04:00
Matt Corallo
32e2f7eef5 Remove unused node_id tracking in ChannelManager tests 2018-08-24 16:58:27 -04:00
Matt Corallo
4f77c812a4 Fix crash introduced in #124
I'm rapidly starting to regret holding failed HTLCs in Channel,
given we allow them to violate the no-duplicate-hashes
precondition.

Found by fuzzer
2018-08-24 16:58:27 -04:00
Matt Corallo
a66e597e95
Merge pull request #127 from TheBlueMatt/2018-08-fuzz-fixes-5
Fix several panics introduced by #125 (#114) and #124
2018-08-23 18:19:40 -04:00
Matt Corallo
7ce13da728 Fix integer overflow panic in new HTLC-forwarding fee checks
Found by fuzzer
2018-08-23 17:23:46 -04:00
Matt Corallo
dfc04ad0b4 Fix duplicate payment_hashes one immediately failed, one fail crash
Found by fuzzer
2018-08-23 17:04:31 -04:00
Matt Corallo
dbff6010c7
Merge pull request #124 from TheBlueMatt/2018-08-htlc-fail-spec
Do not return UpdateFailHTLC updates until the HTLC is committed
2018-08-23 16:44:34 -04:00
Matt Corallo
f5b4759208
Merge pull request #126 from TheBlueMatt/2018-08-restore-full-fuzz
Restore full_stack_target fuzzer
2018-08-23 16:41:53 -04:00
Matt Corallo
ab00e4ccff Merge HTLC-update events, remove FailHTLC ErrorAction
UpdateFailHTLC isn't really an error anymore now that its handled
async after channel commitment (as required by BOLT 2), and since
its unused this is free. To resolve the TODO which intended to use
it for HTLC failure when trying to route forwards, we instead opt
to merge all the HTLC update events into one UpdateHTLCs event
which just contains a CommitmentUpdate object.
2018-08-23 16:11:20 -04:00