Matt Corallo
7fd294db3d
Merge pull request #285 from TheBlueMatt/2019-01-fuzz-cleanups
...
Trivial cleanups in full_stack_target/fuzztarget
2019-01-16 10:11:32 -05:00
Matt Corallo
90ce97198c
Simplify and expand logging in is_resolving_htlc_output
...
This clarifies all the conditions we can hit and also ensures they
are all logged in a clear and consistent manner.
2019-01-08 23:03:07 -05:00
Matt Corallo
5801d19a69
Switch to bitcoin_hashes Hash160 in full_stack_target
2019-01-08 14:04:06 -05:00
Matt Corallo
d8dcb1a9d3
Add doc to full_stack_target
2019-01-08 14:04:06 -05:00
Matt Corallo
cdf9b4f8ba
Add option to use libfuzzer sys in full_stack_target
...
Note that there doesn't appear to be a way to conditionally set
#[no_main] so that has to happen manually at compile-time.
2019-01-08 14:04:06 -05:00
Matt Corallo
044edd6e86
Fail HTLCs backwards asynchronously
2018-12-21 15:17:42 -05:00
Matt Corallo
8e07259326
Use bitcoin_hashes' Ripemd160/Hash160 from rust-crypto+rust-bitcoin
...
Note that this requires rewriting full_stack_target tests, which
sucks, but it does let the fuzzer hit more stuff since the real
ripemd160 isn't ever actually called anymore.
2018-12-19 20:02:36 -05:00
Matt Corallo
f1e400f142
Switch Sha256 to using bitcoin_hashes and our own HKDF
2018-12-19 17:13:25 -05:00
Matt Corallo
caeff85368
Update incorrect_payment_amount generation/handling for BOLT uptd
...
ie dont generate them as they're a really obvious privacy leak.
Luckily we were already handling them the same aside from log
printing so don't have to touch anything there. I was lazy in
updating tests but it only effects log printing, so whatever.
2018-12-17 22:57:47 -05:00
Matt Corallo
f5ccd4b4ef
Add additional log traces in channelmonitor/manager
2018-12-14 17:01:12 -05:00
Antoine Riard
7a483e597c
Typify payment_hash and payment_preimage
...
Fix variable name as payment_hash instead of txid for index
of remote_hash_commitment_number in ChannelMonitor reader
2018-12-14 17:00:50 -05:00
Matt Corallo
221bfa6bd4
Move monitor-generated HTLC event handling to manager event-getters
...
This is somewhat awkward, but prevents a slew of duplicate events.
Really this should probably be more explicit, but would be easy to
move that along with a slew of block_connected-event-processing
refactors, see-also GH #80 .
This affects full_stack_target only on accident cause the demo test
didn't continue onwards with another block connection.
2018-12-14 17:00:22 -05:00
Matt Corallo
7e94d3a617
Remove unused import in full_stack_target
2018-12-03 13:30:38 -05:00
Yuntai Kyong
7e59e1e392
Add a method to get session secret for onion packet to KeysInterface
2018-11-27 10:44:51 +09:00
Steven Roose
7ff7561f2d
Update to rust-bitcoin v0.15
2018-11-14 11:43:54 +00:00
Matt Corallo
38584e3efe
Avoid double-panic in full_stack_target to assist debugging
2018-11-02 10:54:25 -04:00
Schalk van Heerden
a0be4d1758
Added config interface to allow users to specify channel limits
2018-10-31 15:45:30 -04:00
Matt Corallo
9189d0e61d
Require at least 1k sat for outbound channels and meet BTC's dust
2018-10-31 15:45:30 -04:00
Matt Corallo
46f573b787
[full_stack_target] don't allow double-confirming txn
2018-10-29 17:16:29 -04:00
Matt Corallo
64bd2eaa7f
Give ManyChannelMonitor a logger and trace add_update events
2018-10-29 14:26:05 -04:00
Matt Corallo
4342114345
Send RAA/CS messages out-of-band to ensure ordered delivery
2018-10-27 09:42:04 -04:00
Matt Corallo
c962a27156
Send funding_signed messages out-of-band to ensure ordered delivery
2018-10-27 09:42:04 -04:00
Matt Corallo
608d517f92
Send AcceptChannel responses out-of-band to ensure ordered delivery
2018-10-27 09:42:04 -04:00
Matt Corallo
e397cb9960
Split Event, move MessageSendEvent push() inside channel_state lock
2018-10-27 09:42:04 -04:00
Antoine Riard
5180686b1d
Integrate destination_script from KeysInterface in ChannelManager/Channel
...
Drop channel_monitor_claim_key from ChannelKeys
2018-10-27 09:42:04 -04:00
Antoine Riard
32a9378909
Integrate shutdown_pubkey from KeysInterface in ChannelManager/Channel
...
Drop channel_close_key from ChannelKeys
2018-10-27 09:42:04 -04:00
Antoine Riard
e361fed0f1
Integrate KeysInterface to ChannelManager with Arc
2018-10-27 09:42:04 -04:00
Yuntai Kyong
f133554697
Add PaymentFailReason for fail_htlc_backwards
...
to indicate fail reason after a PaymentReceived event
2018-10-25 21:24:53 +09:00
Matt Corallo
aa17defa04
Tweak + extend full_stack_target sample to incl HTLC tx broadcasts
2018-09-14 15:27:54 -04:00
Matt Corallo
673912e769
Add force_close_channel call command to full_stack_target
2018-09-09 11:36:00 -04:00
Antoine Riard
2079fe4ad2
Add ChainWatchInterface in Router
2018-09-03 17:40:05 -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
Matt Corallo
0647cf4bf1
Restore push_msat in full_stack_target
2018-08-23 16:11:20 -04:00
Matt Corallo
a1bd563456
Restore full_stack_target fuzzer
2018-08-23 16:11:12 -04:00
Matt Corallo
11e5975523
Update to rust-secp256k1 v0.11 and rust-bitcoin v0.14
2018-08-23 14:52:43 -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
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
0f24a67c82
Merge pull request #118 from TheBlueMatt/2018-08-103-rebased
...
Rebase of #103
2018-08-17 14:00:50 -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
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
ebd3bbba0f
Remove some dead Logger code
2018-08-16 23:11:15 -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
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
Savil Srivastava
4c44b787f1
use hex::decode instead of extend_vec_from_hex
2018-07-28 10:09:29 -07:00
Matt Corallo
af5c6e8186
PendingHTLCsForwardable really should just be upstreamed.
...
This is just a comment/docs/function rename change
2018-07-24 22:33:10 -04:00
Matt Corallo
b8b7cb238d
Convert fee API to per_kw instead of per_vb
...
This (a) cuts down a bit on some conversions, reducing chances for
bugsand (b) provides greater accuracy for clients.
2018-07-24 20:34:56 -04:00