Matt Corallo
fbd58b400b
Merge pull request #351 from TheBlueMatt/2019-07-no-instant
...
Drop system clock calls for PendingHTLCsForwardable events.
2019-07-18 20:55:41 -04:00
Matt Corallo
e2a9ed7265
Drop system clock calls for PendingHTLCsForwardable events.
...
Instead, return a Duration and let the user do the work of waiting.
This is one of only a handful of steps to make us
mostly-syscall-free, at least enough to run in WASM according to
elichai.
2019-07-18 18:15:02 -04:00
Matt Corallo
0dfd20bf52
Drop time_created in HTLCAwaitingACK::AddHTLC (we can use the CLTV)
2019-07-18 18:15:02 -04:00
Matt Corallo
3d55d71fda
Add balance and is_live fields to ChannelDetails
2019-07-18 18:02:31 -04:00
Antoine Riard
041b04c318
Move htlc_updated_waiting_threshold_conf to an OnchainEvent model
...
We need also to track claim tx until their maturation to know
when we may safely remove them from could-be-bumped-txn buffer
2019-07-17 16:54:35 -04:00
Antoine Riard
c5ee360878
Add block_disconnecting tests to cancel HTLC failure updates
...
Add test_sweep_outbound_htlc_failure_update
2019-07-17 16:54:21 -04:00
Antoine Riard
273f2fc14a
Fail back dust HTLC of local commitment tx after enough confirmations
...
Add test_failure_delay_htlc_local_commitment and
test_no_failure_dust_htlc_local_commitment
Move some bits of check_spend_remote as we need to fail dust HTLCs
which can be spread on both prev/lastest local commitment tx
2019-07-17 15:26:33 -04:00
Antoine Riard
a2b6a76e59
Delay failure of non-dust HTLC-outputs until solving timeout tx matures
...
Fix tests broken by introduced change
2019-07-17 15:26:33 -04:00
Antoine Riard
587af43eca
Implement block_disconnect for pruning of waiting-conf HTLC updates
...
Modify ChainListener API by adding height field to block_disconnect
2019-07-17 15:26:33 -04:00
Antoine Riard
72c5423fd5
Track HTLC-failure trigger tx until anti-reorg delay reached
...
Broadcasting a commitment tx means that we have to fail
inbound HTLC in backward channel. Doing it prematurely would
put us at risk in case of reorg. So we delay passing failure
update upstream until solving tx mature to HTLC_FAIL_ANTI_
REORG_DELAY.
Requirements differ if HTLC is a revoked/non-revoked dust/
non-revoked non-dust one.
Add connect_blocks in test_utils to fix broken tests due to
anti-reorg delay enforcement
Remove anti-duplicate htlc update stuff in ManySimpleChannelMonitor
2019-07-17 15:26:33 -04:00
Antoine Riard
4b3afdd8d2
Add log_trace on to_remote/to_local inclusion in commitment tx
2019-07-17 15:26:33 -04:00
Matt Corallo
fb7fc699ee
Merge pull request #346 from ariard/log_trace_remote_local_outp
...
Add log_trace on to_remote/to_local inclusion in commitment tx
2019-07-03 18:18:18 -04:00
Antoine Riard
8e198bb719
Add log_trace on to_remote/to_local inclusion in commitment tx
2019-07-03 11:15:12 -04:00
Matt Corallo
a02d70d5f9
Merge pull request #341 from TheBlueMatt/2019-06-fuzz-crash-fee-sub
...
Gracefully handle fee-larger-than-claimed-value in ChannelMonitor
2019-07-01 16:05:47 -04:00
Matt Corallo
98134c891c
Gracefully handle fee-larger-than-claimed-value in ChannelMonitor
...
This resulted in a full_stack_target failure as we overflow during
subtraction otherwise.
Instead, we try lower and lower fee estimator confirmation targets
until we find one low enough, or discard the transaction. We should
be able to handle this much cleaner, but for now this at least gets
the fuzzer working again.
2019-06-14 18:50:55 -04:00
Matt Corallo
02feaebc3c
Merge pull request #339 from TheBlueMatt/2019-06-net-tokio-ver-bump
...
Add subcrate that implements network socket handling with Tokio, bump to 0.0.9
2019-06-01 09:06:39 -04:00
Matt Corallo
7118effbf2
Bump version to 0.0.9 to get current master fixes uploaded.
2019-06-01 07:48:33 -04:00
Matt Corallo
5dea30faee
Add subcrate that implements network socket handling with Tokio
...
This is still pretty raw and ist mostly just a straight move from
rust-lightning-bitcoinrpc, but first step is to get it there,
second is to actually make it actually safe to use.
2019-06-01 07:48:33 -04:00
Matt Corallo
882f7307c8
Bump rust-bitcoin dep to 0.18
2019-06-01 07:40:21 -04:00
Matt Corallo
06eddc3465
Merge pull request #320 from TheBlueMatt/2019-03-chan-send-rewrite
...
Rewrite Channel resend tracking to make it much more reliable
2019-04-22 17:32:24 -04:00
Matt Corallo
2811b07ede
Merge pull request #334 from ariard/2019-04-fee-estimation-monitor
...
Add Fee Estimation in ChannelMonitor
2019-04-21 19:44:58 -04:00
Matt Corallo
1c7ba90b09
Assert that our weight prediction can't result in unspendable txn
2019-04-18 20:08:50 -04:00
Antoine Riard
bca12ea48e
Add unit test for get_witnesses_weight
2019-04-16 18:55:11 -04:00
Antoine Riard
0843c22c67
Add fee estimation in check_spend_remote_htlc
2019-04-16 18:50:14 -04:00
Antoine Riard
50b6acb696
Add FeeEstimator in ChannelMonitor
2019-04-16 18:50:09 -04:00
Matt Corallo
9f53d5c859
Merge pull request #335 from TheBlueMatt/2019-04-330-nits
...
Make channel open confs configurable (and change from 12 to 6)
2019-04-10 13:19:42 -04:00
Sebastian Geisler
80aa4f20a9
Make channel open confs configurable (and change from 12 to 6)
...
This fixes compatibility with c-lightning etc as they won't accept
a minimum_depth of 12.
2019-04-10 12:03:10 -04:00
Matt Corallo
5bd8837ac3
Merge pull request #332 from ariard/2019-03-option-serialize-channel-monitor
...
Use more Writeable/Readable for Option<T> in ChannelMonitor serializer/deserializer
2019-04-10 12:00:59 -04:00
Antoine Riard
bcd7bae84c
Use more Writeable/Readable for Option<T> in ChannelMonitor
2019-04-09 20:01:18 -04:00
Matt Corallo
a383f64e86
Merge pull request #328 from dongcarl/fine
...
Add test for tie breaking when sorting outputs
2019-04-03 16:27:56 -04:00
Matt Corallo
f5a572926f
Merge pull request #329 from dongcarl/patch-1
...
Improve README usability
2019-03-26 11:58:55 -04:00
Matt Corallo
475bee2bb7
Merge pull request #326 from TheBlueMatt/2019-03-temp-failure-use-cases
...
Update docs for TemporaryFailure to note other use-cases
2019-03-25 18:36:25 -04:00
Carl Dong
a58e2ba098
Improve README usability
2019-03-25 18:03:06 -04:00
Carl Dong
4db0d6ed16
Add test for tie breaking when sorting outputs
2019-03-25 17:39:22 -04:00
Matt Corallo
b031bdf9d8
Update docs for TemporaryFailure to note other use-cases
2019-03-25 17:27:04 -04:00
Matt Corallo
91dc91f053
Merge pull request #325 from TheBlueMatt/2019-03-322-cleanup
...
Extract preimage from revoked HTLC-Success to claim backward
2019-03-25 17:12:00 -04:00
Matt Corallo
c2a3fc74dc
Fix crash in chanmon_fail_consistency due to fuzz hash collisions
2019-03-25 17:03:53 -04:00
Matt Corallo
50e16c9573
Rewrite Channel resend tracking to make it much more reliable
...
Resending revoke_and_ack and commitment_signed (+update) messages
after monitor-update-failure or disconnection has been a highly
unreliable part of our codebase for some time (as evidenced by the
number of bugs caught in the chanmon_fail_consistency fuzz target).
This is due to its rather ad-hoc nature and tracking/behavior which
consists of checking a number of different flags to try to deduce
which messages were/were not delivered and go from there. Instead,
this commit rewrites it to simply keep track of the order messages
were generated originally, as we always resend in the
originally-generated order.
I'm anticipating this will be way more robust than the old code, in
addition to its simplicity.
2019-03-25 17:03:53 -04:00
Matt Corallo
63ed8fe576
Add log_trace on completion of monitor update restoration in Chan
2019-03-25 16:43:26 -04:00
Antoine Riard
3cc7666c5a
Extract preimage from revoked HTLC-Success to claim backward
...
Tweaks by Matt Corallo <git@bluematt.me>
2019-03-25 16:39:48 -04:00
Matt Corallo
d22650c0cf
Merge pull request #319 from TheBlueMatt/2019-03-htlc-sorting
...
Fix HTLC-output-in-commitment sorting for duplicate-HTLCs
2019-03-25 13:26:31 -04:00
Matt Corallo
8b4cb9fadb
Merge pull request #316 from TheBlueMatt/2019-03-removed-reserve-check
...
Fix remote reserve check with inbound claims-in-flight
2019-03-25 12:47:42 -04:00
Matt Corallo
054530cfb9
Fix potential overflow bug introduced in channel reserve check fix
...
Found by chanmon_fail_consistency fuzz test.
2019-03-22 17:43:32 -04:00
Matt Corallo
c86657ea6c
Fix inbound channel reserve check for removed-outbound-HTLCs
...
Found by chanmon_fail_consistency fuzzer.
2019-03-22 17:43:32 -04:00
Matt Corallo
558f8da900
Add macro for PaymentSent event checking in test_utils
2019-03-22 17:19:38 -04:00
Matt Corallo
bb094f1e30
Merge pull request #314 from TheBlueMatt/2019-03-chan-cleanup
...
Two simple Channel cleanups
2019-03-22 17:16:08 -04:00
Matt Corallo
a0854884ca
Remove unused BIP69 input sorting
...
Lightning doesn't (currently) do any input sorting at the protocol
level, but if we ever need to re-add this its in git history.
2019-03-07 13:56:06 -05:00
Matt Corallo
d990f72f9a
Fix HTLC-output-in-commitment sorting for duplicate-HTLCs
...
This resolves both an issue that hits fuzzing due to hash
collisions as well as implements an update to the BOLT spec.
2019-03-07 13:56:01 -05:00
Matt Corallo
35853a607d
Merge pull request #318 from tamasblummer/rbitcoin017
...
migration to rust-bitcoin 0.17
2019-03-07 13:31:02 -05:00
Tamas Blummer
02b541607b
migration to rust-bitcoin 0.17
...
typedef Sha256dHash with bitcoin_hashes::sha256d::Hash
SecretKey -> PrivateKey.key
assume compressed public keys
2019-03-07 18:50:02 +01:00