Commit graph

307 commits

Author SHA1 Message Date
Matt Corallo
a1bd563456 Restore full_stack_target fuzzer 2018-08-23 16:11:12 -04:00
Matt Corallo
7345c0b3ce Add trace logs for Errs when handling peer messages 2018-08-23 16:11:12 -04:00
Matt Corallo
4330ae5d4f
Merge pull request #123 from TheBlueMatt/2018-08-secp-0.10
Update to rust-secp256k1 v0.11 and rust-bitcoin v0.14
2018-08-23 15:29:21 -04:00
Matt Corallo
d0e1e7fead
Merge pull request #125 from TheBlueMatt/2018-08-114-rebase
Rebase of #114
2018-08-23 15:29:15 -04:00
Matt Corallo
11e5975523 Update to rust-secp256k1 v0.11 and rust-bitcoin v0.14 2018-08-23 14:52:43 -04:00
Matt Corallo
5ee88ad9f2 Clean up excess \ns in route debug, use all debug encoders 2018-08-23 14:52:43 -04:00
Matt Corallo
6ab31a0d50 Return channel_updates when failing a HTLC for fee/CLTV reasons 2018-08-23 14:52:43 -04:00
Antoine Riard
0523403887 Add Display trait on network structs for routing bug track 2018-08-23 14:52:42 -04:00
Antoine Riard
05552c0988 Check amt_to_forward and outgoing_cltv_value in add_update_htlc 2018-08-23 14:52:36 -04:00
Matt Corallo
1e118743bd
Merge pull request #111 from TheBlueMatt/2018-08-full-stack-target-upstream-1
Expand full_stack_target somewhat
2018-08-20 14:43:33 -04:00
Matt Corallo
06d3b4babe Add a full_stack_target sample test to avoid unintentional breakage 2018-08-20 13:58:31 -04:00
Matt Corallo
87aabff8ab Disable push_msat in full_stack_target temporarily 2018-08-20 13:58:31 -04:00
Matt Corallo
1b8f4acb27 Upgrade AFL to 0.4 with persistent mode fuzzing 2018-08-20 13:58:31 -04:00
Matt Corallo
9f2c67ae60 Expand full_stack_target somewhat 2018-08-20 13:58:31 -04:00
Matt Corallo
f476a19bde Add simple utility to ChannelManager to force close all channels 2018-08-20 13:58:31 -04:00
Matt Corallo
7a04595269 Only enforce no-dup-payment_hash precondition on non-removed HTLCs
This fixes a panic found by fuzzer.
2018-08-20 13:58:31 -04:00
Matt Corallo
7318a97b15
Merge pull request #122 from TheBlueMatt/2018-08-doc-usability-fixes
Simple log usability fix, add some missing docs
2018-08-20 13:57:35 -04:00
Matt Corallo
42086c94a0 Remove implicit Record import requirement in logging macros 2018-08-20 13:33:09 -04:00
Matt Corallo
7743cbdf14 Add APIError docs 2018-08-17 17:36:50 -04:00
Matt Corallo
0f24a67c82
Merge pull request #118 from TheBlueMatt/2018-08-103-rebased
Rebase of #103
2018-08-17 14:00:50 -04:00
Matt Corallo
93b470dbb4
Merge pull request #117 from TheBlueMatt/2018-08-no-claim-fuzz-bug
Don't HTLC claim with no-possible-preimage in full_stack_target
2018-08-17 13:25:57 -04:00
Matt Corallo
1360fccd71 Ignore unknown channel flags as required in BOLT 2 2018-08-17 13:22:44 -04:00
Yuntai Kyong
69624a8556 add 1% chnnel reserve while keeping min value
if 1000 is always used it will almost always fail test reserve < dust_limit check
2018-08-17 13:18:29 -04:00
Yuntai Kyong
1c839ff103 Add checking locally derived reserve and dust limit 2018-08-17 13:18:28 -04:00
Yuntai Kyong
716b37863a document optional channel constraints per spec 2018-08-17 13:18:28 -04:00
Yuntai Kyong
0fece38b19 Add various checking when handling open and accept
Add `derive_minimum_depth()` and `derive_maximum_minimum_depth()` and hide
CONF_TARGET constant behind these functions.

Replace `DisconnectPeer` error with `HandleError` with `ErrorAction::SendErrorMessage`
2018-08-17 13:18:28 -04:00
Yuntai Kyong
ada2154b40 Add push_msat to new outbound API
Also add APIMisuseError to be thrown to the API client
2018-08-17 13:18:28 -04:00
Yuntai Kyong
4553369d20 Add APIError enum
`APIMisuse` when paramters passed from the client is invalid
`FeeRateTooHigh` when a channel cannot be opened due to high feerate
2018-08-17 13:09:30 -04:00
Matt Corallo
faf9864d9d Don't HTLC claim with no-possible-preimage in full_stack_target 2018-08-17 12:34:09 -04:00
Matt Corallo
03c6f84aa8
Merge pull request #116 from TheBlueMatt/2018-08-peer_handler-trace
Add some trace logging in peer_handler
2018-08-16 23:35:09 -04:00
Matt Corallo
4291cb99d4 Add some trace logging in peer_handler 2018-08-16 23:11:22 -04:00
Matt Corallo
7ee8ec70ac Default test logger to Trace to make error debugging easier 2018-08-16 23:11:22 -04:00
Matt Corallo
dc4af28759 Add some useful delayed-formatting formatters to macro_logger 2018-08-16 23:11:22 -04:00
Matt Corallo
ebd3bbba0f Remove some dead Logger code 2018-08-16 23:11:15 -04:00
Matt Corallo
50668644cf
Merge pull request #115 from TheBlueMatt/2018-08-channel-fuzz-fixes
Fixes from channelmanager fuzzing work
2018-08-16 23:04:12 -04:00
Matt Corallo
09583f3116 Fix PaymentReceived/sha256 handling in full_stack_target
Sha256 in fuzztarget was updated some time ago to use XOR instead
of the first byte of a real SHA256 run and somehow received and
sent payments got crossed in full_stack_target.
2018-08-16 22:37:44 -04:00
Matt Corallo
609054eae0 Handle duplicate funding transaction gracefully.
This can otherwise cause strange behavior, including a panic on
force_close_all_channels found by full_stack_target fuzzing.
2018-08-16 22:37:44 -04:00
Matt Corallo
b4078d992d Fix handle_funding_created bug/TODO
The fuzzer was able to tickle this
2018-08-16 22:37:41 -04:00
Matt Corallo
0f965d319f Fix bug in early-HTLC-fulfill handling
Caught by fuzzer. See new comments for more
2018-08-16 22:31:14 -04:00
Matt Corallo
b46878740c
Merge pull request #110 from TheBlueMatt/2018-08-router-crashes-2
Fix several fuzzer-found bugs
2018-08-16 22:07:47 -04:00
Matt Corallo
9362450c61 [Router] Remove channels from nodes when the channel is failed
Found by fuzzer
2018-08-16 20:51:50 -04:00
Matt Corallo
7c24fea4fe Handle only-path-overflows-fee in get_route and avoid PubKey::new()
Found by fuzzer
2018-08-16 20:51:50 -04:00
Matt Corallo
dde0ac4c29 Fix fee_base_msat overflowing entire fee range in RouteHint 2018-08-16 20:51:50 -04:00
Matt Corallo
0e6f028c3b Err from get_route if the requested value is more than 21m BTC
This fixes a potential overflow panic.
2018-08-16 20:51:50 -04:00
Matt Corallo
2a0ae96fdf Correct lowest_inbound_proportional_fee deduction in route finding
Found cause fuzzer was able to crash us if we don't
2018-08-16 20:51:50 -04:00
Matt Corallo
feb3db5ac8 Fix multiply-with-overflow panic in router
Found by fuzzer
2018-08-16 20:51:50 -04:00
Matt Corallo
1a9ef40203
Merge pull request #91 from ariard/logging_interface
Logging interface
2018-08-16 20:24:49 -04:00
Antoine Riard
0029f04fce Logging interface
Implement error, warn, info, debug and trace macros, internally calling
an instance of Logger, and passing it to every main structures
Build-time or client-side filtering.
Issue #54
2018-08-17 00:01:15 +00:00
Matt Corallo
587f2b39fc
Merge pull request #107 from ariard/event_handle_error
Implement HandleError event with ErrorAction field
2018-08-16 16:26:00 -04:00
Antoine Riard
e752611247 Implement HandleError event with ErrorAction field 2018-08-12 00:36:48 +00:00