Aleru [Mon, 30 Dec 2019 20:03:48 +0000 (15:03 -0500)]
Merge branch 'master' of https://github.com/rust-bitcoin/rust-lightning into new-api-ping
pulling in changes from master
Matt Corallo [Sat, 28 Dec 2019 17:50:09 +0000 (17:50 +0000)]
Merge pull request #420 from TheBlueMatt/2019-12-chan-ext-signer
Remove signing from Channel
Matt Corallo [Fri, 13 Dec 2019 19:56:57 +0000 (14:56 -0500)]
Sign local HTLC transactions at broadcast-time, instead of generate
Matt Corallo [Fri, 13 Dec 2019 06:58:08 +0000 (01:58 -0500)]
Make ChannelMonitor sign local transactions (at broadcast time)
Matt Corallo [Thu, 12 Dec 2019 19:56:28 +0000 (14:56 -0500)]
Set basic channel info in chanmon all at once, add a bit more info
Matt Corallo [Fri, 13 Dec 2019 03:42:08 +0000 (22:42 -0500)]
Drop duplicative current-local-tx storage in channel.
We now have current-local-tx broadcast ability in channel monitors
directly (for ChannelManager deserialization), so we can just use
that instead of always having the Channel store signed ready-to-go
copies of the latest local commitment transaction.
This is further kinda nice since ChannelMonitor is live and can, eg
broadcast HTLC-Success transactions immediately as they will be
generated at broadcast time instead of in advance.
Finally, this lets us clean up a tiny bit in Channel.
Matt Corallo [Tue, 24 Dec 2019 17:01:26 +0000 (12:01 -0500)]
Fix parameter name incorrectly changed in
4ebe64fafd2ca0e17aab31fb0
Aleru [Tue, 24 Dec 2019 09:21:50 +0000 (04:21 -0500)]
Merge branch 'master' of https://github.com/rust-bitcoin/rust-lightning into new-api-ping
adding in new changes
Aleru [Tue, 24 Dec 2019 09:14:31 +0000 (04:14 -0500)]
resolved issues
Matt Corallo [Sat, 21 Dec 2019 00:35:10 +0000 (00:35 +0000)]
Merge pull request #426 from TheBlueMatt/2019-12-bad-lifetimes
Remove unused lifetimes.
Matt Corallo [Fri, 20 Dec 2019 19:53:16 +0000 (14:53 -0500)]
Remove unused lifetimes.
f71518365f61a5fe2a0340953ad6592c0d2b72cc added a series of lifetimes
which were required for an earlier version of the patch but not the
final version. They can be freely removed.
Matt Corallo [Fri, 13 Dec 2019 22:04:53 +0000 (22:04 +0000)]
Merge pull request #419 from TheBlueMatt/2019-12-simple-signer-api-step
Few more simple signer API additions
Matt Corallo [Fri, 13 Dec 2019 06:57:45 +0000 (01:57 -0500)]
Use external key signer to generate closing transaction signatures
Matt Corallo [Sat, 7 Dec 2019 22:54:55 +0000 (17:54 -0500)]
Sign channel_announcements via a new ChannelKeys API
Matt Corallo [Fri, 6 Dec 2019 19:08:34 +0000 (14:08 -0500)]
Use EnforcingChannelKeys in fuzz targets to get more coverage
Matt Corallo [Thu, 12 Dec 2019 18:01:46 +0000 (18:01 +0000)]
Merge pull request #404 from TheBlueMatt/2019-11-signer-api
Replace keys API with Signer API to support hardware wallets eventually
Matt Corallo [Thu, 12 Dec 2019 16:45:18 +0000 (16:45 +0000)]
Merge pull request #417 from TheBlueMatt/2019-12-ver-bump
Bump to 0.0.10
Matt Corallo [Wed, 11 Dec 2019 20:41:39 +0000 (15:41 -0500)]
Bump versions to 0.0.10
Matt Corallo [Wed, 11 Dec 2019 20:41:24 +0000 (15:41 -0500)]
Bump bitcoin dep to 0.21
Matt Corallo [Wed, 11 Dec 2019 23:17:03 +0000 (18:17 -0500)]
Pre-build fuzz targets at once in travis instead of as we need them
Antoine Riard [Tue, 10 Dec 2019 20:04:53 +0000 (15:04 -0500)]
Document more current security assumption of KeysInterface
Improve some comments of interface methods.
Matt Corallo [Wed, 27 Nov 2019 21:08:48 +0000 (16:08 -0500)]
Make commitment transaction signing a part of ChannelKeys.
This adds a new fn to ChannelKeys which is called when we generte
a new remote commitment transaction for signing. While it may be
theoretically possible to unwind state updates by disconnecting and
reconnecting as well as making appropriate state machine changes,
the effort required to get it correct likely outweighs the UX cost
of "preflighting" the requests to hardwre wallets.
Matt Corallo [Tue, 26 Nov 2019 21:46:33 +0000 (16:46 -0500)]
Make ChannelKeys an API and template Channel with it.
Instead of having in-memory access to the list of private keys
associated with a channel, we should have a generic API which
allows us to request signing, allowing the user to store private
keys any way they like.
The first step is the (rather mechanical) process of templating
the entire tree of ChannelManager -> Channel impls by the
key-providing type. In a later commit we should expose only public
keys where possible.
Matt Corallo [Wed, 11 Dec 2019 20:41:39 +0000 (15:41 -0500)]
Bump versions to 0.0.10
Matt Corallo [Wed, 11 Dec 2019 20:41:24 +0000 (15:41 -0500)]
Bump bitcoin dep to 0.21
Matt Corallo [Wed, 11 Dec 2019 22:06:46 +0000 (22:06 +0000)]
Merge pull request #416 from TheBlueMatt/2019-12-fuzz-clib
Refactor fuzzing to be a C-callable library plus rust binaries
Matt Corallo [Wed, 11 Dec 2019 18:18:43 +0000 (13:18 -0500)]
Refactor fuzzing to be a C-callable library plus rust binaries
This should help us avoid rust's at-load syscalls by calling the
tests from a C program.
Matt Corallo [Wed, 11 Dec 2019 19:50:52 +0000 (19:50 +0000)]
Merge pull request #414 from TheBlueMatt/2019-12-347-nits
347 with travis fix and a few nits.
Aleru [Wed, 11 Dec 2019 10:07:29 +0000 (05:07 -0500)]
ping wont reset to 0
Aleru [Wed, 11 Dec 2019 06:19:42 +0000 (01:19 -0500)]
Merge branch 'master' of https://github.com/rust-bitcoin/rust-lightning into new-api-ping
get changes
Aleru [Wed, 11 Dec 2019 06:08:44 +0000 (01:08 -0500)]
changes
Matt Corallo [Tue, 10 Dec 2019 20:38:04 +0000 (15:38 -0500)]
Avoid cloning RBF state when we just want to modify fields.
Antoine Riard [Tue, 10 Dec 2019 22:25:27 +0000 (17:25 -0500)]
Add test_bump_txn_sanitize_tracking_maps
Extend test visibility of claim-tracking maps to do so.
Cover both "If 2 claimable-outpoint-spending txn are in 1 block,
clean up properly" and "Clean up claimable_outpoints when
pending_claim_requests is cleaned" fix commits in same patchset.
Antoine Riard [Tue, 10 Dec 2019 20:45:30 +0000 (15:45 -0500)]
Sanitize pending_claim_requests if no more outpoints to claim
Matt Corallo [Tue, 10 Dec 2019 17:06:50 +0000 (12:06 -0500)]
Dont RBF a tx twice if it hits RBF timer when one input is spent
Matt Corallo [Tue, 10 Dec 2019 03:51:36 +0000 (22:51 -0500)]
Clean up claimable_outpoints when pending_claim_requests is cleaned
When claimable_outpoints was introduced in "Move
our_claim_txn_waiting_first_conf to pending_claim_requests", removal
of elements from it (which are just pointers into
pending_claim_requests) was never added.
Matt Corallo [Tue, 10 Dec 2019 03:17:31 +0000 (22:17 -0500)]
If 2 claimable-outpoint-spending txn are in 1 block, clean up properly
This resolves an issue where we will never track 2 on-chain events
which are waiting for ANTI_REORG_DELAY at the same height.
This partially reverts and fixes "Move our_claim_txn_waiting_first_conf
to pending_claim_requests".
Antoine Riard [Tue, 10 Dec 2019 21:28:33 +0000 (16:28 -0500)]
Log block tick in ChannelMonitor
Matt Corallo [Tue, 10 Dec 2019 03:14:47 +0000 (22:14 -0500)]
Correct input comparison for input-subset RBF bump creation
This resolves a regression introduced in "Implement bumping engine in
ChannelMonitor::block_connected" in which not all inputs are checked.
Several opportunities to clarify and clean up comments are also taken.
Fix test_bump_penalty_txn_on_revoked_htlcs as now remote claim txn
build the same way than us are going to be register as cleaning
pending_claim_request after ANTI_REORG_DELAY. It means during this
delay we are going to generate invalid bumped claiming txn on
already claimed outpoints. Previously these txn weren't issued
because all their outpoints would have been removed.
Fix full_stack_target by adding more input for FuzzEstimator
Matt Corallo [Mon, 9 Dec 2019 22:22:02 +0000 (17:22 -0500)]
Dont forget RBF previous-feerate info if tx size changed.
While our fee may change wildly (or even go down), the previous
fee *rate* is still valid, and we should use that as the basis for
our RBF.
Antoine Riard [Fri, 6 Dec 2019 21:01:41 +0000 (16:01 -0500)]
Add test_set_outpoints_partial_claiming
Antoine Riard [Mon, 9 Dec 2019 21:59:08 +0000 (16:59 -0500)]
Track and react to remote partial-claiming of pending claim request
A pending claim request may contain a set of multiple outpoints.
If one or multiple of them get claimed by remote party, our in-flight
claiming transactions aren't valid anymore so we need to react
quickly and regenerate claiming transaction with accurate set.
However, a claimed outpoint may be disconnected and we need to resurrect
back outpoint among set of orignal pending claim request.
To guarantee consistency of contentious claimed outpoint we cache it
as OnchainEvent::ContentionsOutpoint and only delete it after
ANTI_REORG_DELAY.
Fix test broken by change, partial claiming on revoked txn
force us to regenerate txn
Antoine Riard [Sat, 7 Dec 2019 01:51:51 +0000 (20:51 -0500)]
Add test_bump_penalty_txn_on_remote_commitment
Antoine Riard [Sat, 7 Dec 2019 01:51:36 +0000 (20:51 -0500)]
Add test_bump_penalty_txn_on_revoked_htlcs
Antoine Riard [Tue, 2 Jul 2019 21:39:55 +0000 (17:39 -0400)]
Add test_bump_penalty_txn_on_revoked_commitment
Test multiple rounds of 25% heuristic in bump_claim_tx on remote revoked commitment
txn with htlcs pending in both directions.
Antoine Riard [Wed, 3 Jul 2019 14:26:17 +0000 (10:26 -0400)]
Add RBF-bumping of preimage/timeout txn on remote HTLC outputs
Given they are only signed by us we can RBF at wish
Fix tests broken by introduction of more txn broadcast
(channel_monitor_network_test)
Add locktime in RemoteHTLC as it's needed to generate
timeout txn.
Antoine Riard [Tue, 2 Jul 2019 19:52:58 +0000 (15:52 -0400)]
Implement bumping engine in ChannelMonitor::block_connected
Add RBF-bumping of justice txn, given they are only signed by us we
can RBF at wish.
Aggregation of bump-candidates and more aggresive bumping heuristics
are left open
Fix tests broken by introduction of more txn broadcast.
Some tests may have a relaxed check (claim_htlc_ouputs_single_tx)
as broadcast bumped txn are now interwining in previous broadcast ones
and breaking simple expectations
Use bumping engine to rebuild claiming transaction in case of partial-
claim of its outpoints set.
Antoine Riard [Tue, 10 Dec 2019 03:18:41 +0000 (22:18 -0500)]
Remove superflous pending_claims
As local onchain txn are already monitored in block_connected by
check_spend_local_transaction, it's useless to generate twice
pending claims for HTLC outputs on local commitment tx.
We could do the alternative.
Antoine Riard [Tue, 10 Dec 2019 03:18:20 +0000 (22:18 -0500)]
Move our_claim_txn_waiting_first_conf to pending_claim_requests
Add claimable_outpoints maps.
Both structures are tied and should ensure their mutual consistency.
Pending_claim_requests is cached by original claim txid. Medatada
and per input material should be constant between bumped transactions,
only change should be partial-claiming of outpoints set and block
reorgs.
Due to RBF rules, if an input has been part of an aggregate tx
at first claim try, if we want the bumped tx to land nicely
in the mempool, inputs should be distributed in multiple
bumped tx but still be aggregate in a new bumped tx.
Antoine Riard [Thu, 4 Jul 2019 20:09:19 +0000 (16:09 -0400)]
Add log_trace on bump candidates tracking-buffer insertions
Antoine Riard [Tue, 19 Nov 2019 20:53:52 +0000 (15:53 -0500)]
Add MIN_RELAY_FEE_SAT_PER_1000_WEIGHT
Hardcode min relay fee as its value is fixed on the bitcoin network
and updating it would be done really conservatively.
Matt Corallo [Mon, 9 Dec 2019 21:41:53 +0000 (21:41 +0000)]
Merge pull request #413 from TheBlueMatt/2019-12-381-nits
381 with a few nits resolved.
Steven Roose [Thu, 5 Dec 2019 20:29:16 +0000 (20:29 +0000)]
Document the default values of configs
Steven Roose [Fri, 18 Oct 2019 13:19:49 +0000 (14:19 +0100)]
Change the new() functions for config to Default::default()
Aleru [Mon, 9 Dec 2019 18:39:30 +0000 (13:39 -0500)]
Merge branch 'master' of https://github.com/rust-bitcoin/rust-lightning into new-api-ping
combine changes
Matt Corallo [Tue, 3 Dec 2019 19:37:34 +0000 (19:37 +0000)]
Merge pull request #403 from TheBlueMatt/2019-11-rand-onion
Randomize initial onion packet data.
Matt Corallo [Mon, 25 Nov 2019 21:12:45 +0000 (16:12 -0500)]
Randomize initial onion packet data.
This avoids at least the trivial hop count discovery attack, though
other obvious ones remain and are slightly harder to avoid.
See https://github.com/lightningnetwork/lightning-rfc/pull/697
Matt Corallo [Sat, 30 Nov 2019 04:00:45 +0000 (04:00 +0000)]
Merge pull request #405 from TheBlueMatt/2019-11-cleanups
Misc Cleanups
Matt Corallo [Sat, 30 Nov 2019 04:00:27 +0000 (04:00 +0000)]
Merge pull request #407 from TheBlueMatt/2019-11-396-english
#396 with a few english fixes
Matt Corallo [Sat, 30 Nov 2019 01:38:03 +0000 (20:38 -0500)]
Update comments to be a bit more descriptive and fix english a bit
Antoine Riard [Mon, 18 Nov 2019 05:43:49 +0000 (00:43 -0500)]
Add test_announce_disable_channels
Antoine Riard [Mon, 18 Nov 2019 05:43:13 +0000 (00:43 -0500)]
Add timer_chan_freshness_every_min
Latency/peer disconnection may trigger us to mark as disabled
some of our channels. After some time, if channels are still
disabled we need to broadcast ChannelUpdate to inform other network
peers about the uselessness of these channels.
Antoine Riard [Fri, 29 Nov 2019 06:39:33 +0000 (01:39 -0500)]
Add UpdateStatus in Channel to track freshness of gossiped liveness.
Added enum and method are only used in next commit.
Matt Corallo [Tue, 26 Nov 2019 20:39:50 +0000 (15:39 -0500)]
Fix add_update_monitor check to unwrap() instead of an unused bool
Matt Corallo [Thu, 28 Nov 2019 06:19:54 +0000 (01:19 -0500)]
Move test profile to crate root, so it has effect again
Matt Corallo [Mon, 25 Nov 2019 21:26:31 +0000 (16:26 -0500)]
Add dyn tags in fuzz_targets
We only support newish rust in fuzz_targets, so this is fine.
Matt Corallo [Mon, 25 Nov 2019 22:39:48 +0000 (22:39 +0000)]
Merge pull request #401 from ariard/2019-11-log-tx-broadcast
Add log for every tx broadcast
Antoine Riard [Fri, 22 Nov 2019 22:44:30 +0000 (17:44 -0500)]
Add log for every tx broadcast
Added macro log_tx in macro_logger.rs
Matt Corallo [Mon, 25 Nov 2019 21:19:23 +0000 (21:19 +0000)]
Merge pull request #399 from TheBlueMatt/2019-11-fuzz-top-level
Move fuzz to top level.
Matt Corallo [Fri, 22 Nov 2019 20:40:58 +0000 (15:40 -0500)]
Move fuzz to top level.
Aleru [Fri, 20 Sep 2019 15:16:45 +0000 (11:16 -0400)]
first add
updateS
add
commit
commit
updates
s
fixed first bug :D
fixed bug for real this time... probably should read docs of related structures before i begin hacking
coming along nicely
need docs and test
updates
commit
x
n
another update
cleaning it up a bit for groupwork
more cleaning :P
add todot
remove no longer relevant comment
fixed issue of disconnecting peer
removed extra comment
probably ready for PR
ready for pr... for real this time!
ready for pr act 3
ready for pr act 4
remove threads
just sharing work, not ready for review
just sharing work... need to rebase
Matt Corallo [Fri, 22 Nov 2019 18:26:44 +0000 (18:26 +0000)]
Merge pull request #389 from valentinewallace/split-chain-watch-interface
remove circular references in channelmanager and channelmonitor
Valentine Wallace [Mon, 18 Nov 2019 21:40:05 +0000 (16:40 -0500)]
chaininterface+multi: add filter_block and reentered to ChainWatchInterface
Because filter_block takes a and returns a list of s , we must add a lifetime to the ChainWatchInterface, which bubbles up in a lot of places. These places include adding a lifetime to the Node struct, which causes a lot of rearranging tests so that variables don't go out of scope before the Node that owns them does.
Valentine Wallace [Sat, 9 Nov 2019 01:12:13 +0000 (20:12 -0500)]
chaininterface: add BlockNotifier struct
Adding this struct will allow us to remove the circular reference
between ChainListeners and the ChainWatchInterface, because it
separates out the responsibility of notifying listeners about new
blocks from the responsibility of storing and retrieving watched
transactions.
Valentine Wallace [Sat, 9 Nov 2019 01:12:13 +0000 (20:12 -0500)]
multi: remove listeners field and method from ChainWatchInterface
This includes the purpose of this PR, which is to remove the circular reference created by ChainListeners self-adding themselves to their ChainWatchInterface's `listeners` field.
Matt Corallo [Thu, 21 Nov 2019 03:11:46 +0000 (03:11 +0000)]
Merge pull request #397 from ariard/2019-11-doc-announce-sigs
Doc announce_sigs
Antoine Riard [Tue, 19 Nov 2019 23:03:05 +0000 (18:03 -0500)]
Extend test for announcement_sigs
Antoine Riard [Tue, 19 Nov 2019 22:48:22 +0000 (17:48 -0500)]
Document our handling of announcement_sigs
We may have in the future to rebroadcast announcement_sigs at
peer reconnection if this a burning issue as spec lacks
a acknowledgement mechanism.
Matt Corallo [Tue, 19 Nov 2019 01:52:13 +0000 (01:52 +0000)]
Merge pull request #379 from rrybarczyk/use-workspaces
Use workspaces to separate crates
RJ Rybarczyk [Mon, 18 Nov 2019 23:51:21 +0000 (23:51 +0000)]
Merge branch 'master' of github.com:rust-bitcoin/rust-lightning into use-workspaces
RJ Rybarczyk [Mon, 18 Nov 2019 22:01:34 +0000 (22:01 +0000)]
Update travis file to accommodate workspaces
Matt Corallo [Mon, 18 Nov 2019 23:08:33 +0000 (23:08 +0000)]
Merge pull request #395 from ariard/2019-11-expected-amt-claim-funds
Avoid probing attacks with same hash lower amounts
Antoine Riard [Mon, 18 Nov 2019 04:52:49 +0000 (23:52 -0500)]
Add test_check_htlc_underpaying
Antoine Riard [Thu, 14 Nov 2019 23:50:24 +0000 (18:50 -0500)]
Check expected amount in claim_funds
Require to specify expected amount so that we can claim only
payment for thhe correct amount, and reject payments for incorrect
amounts (which are probably middle nodes probing to break our privacy).
Send back incorrect_or_unknown_payments_details (PERM|15) to avoid
the probe node learning that final node is waiting a payment with
the routed hash.
RJ Rybarczyk [Mon, 18 Nov 2019 19:44:55 +0000 (19:44 +0000)]
Merge branch 'master' of github.com:rust-bitcoin/rust-lightning into use-workspaces
Matt Corallo [Fri, 15 Nov 2019 22:47:34 +0000 (22:47 +0000)]
Merge pull request #394 from TheBlueMatt/2019-11-broken-build
Fix broken build
Matt Corallo [Fri, 15 Nov 2019 22:19:46 +0000 (17:19 -0500)]
Drop needless mut
Matt Corallo [Fri, 15 Nov 2019 22:19:26 +0000 (17:19 -0500)]
Fix build broken by silent merge conflicts
Matt Corallo [Fri, 15 Nov 2019 21:58:37 +0000 (21:58 +0000)]
Merge pull request #393 from ariard/2019-11-send-cmt-error-handling
Fulfill error handling for send_commitment in processing htlcs forward
Matt Corallo [Fri, 15 Nov 2019 21:57:36 +0000 (21:57 +0000)]
Merge pull request #390 from ariard/2019-11-consistent-errors
Make field error of ErrorPacket (former HandleError) mandatory
Matt Corallo [Fri, 15 Nov 2019 21:38:04 +0000 (21:38 +0000)]
Merge pull request #392 from ariard/2019-11-manager-init-height
Add init height in ChannelManager constructor
Antoine Riard [Tue, 5 Nov 2019 00:54:43 +0000 (19:54 -0500)]
Make field error of LightingError mandatory
We also fulfilled last empty ErrorAction:
- Router secp fail : IgnoreError
- processing error in Router : IgnoreError
- get_channel_update too early : IgnoreError
Antoine Riard [Thu, 14 Nov 2019 22:41:17 +0000 (17:41 -0500)]
Add init height in ChannelManager constructor
Matt Corallo [Fri, 15 Nov 2019 19:20:43 +0000 (19:20 +0000)]
Merge pull request #391 from ariard/2019-11-fix-preimage-collision-onchain
Avoid claiming remote received HTLCs with side-learned preimage
RJ Rybarczyk [Fri, 15 Nov 2019 02:44:30 +0000 (02:44 +0000)]
Use workspaces to separate crates
Antoine Riard [Thu, 14 Nov 2019 23:27:47 +0000 (18:27 -0500)]
Fulfill error handling for send_commitment in processing htlcs forward
Antoine Riard [Wed, 13 Nov 2019 00:33:27 +0000 (19:33 -0500)]
Add test_duplicate_htlc_different_direction_onchain
Antoine Riard [Wed, 13 Nov 2019 00:27:55 +0000 (19:27 -0500)]
Avoid claiming remote received HTLCs with preimage
In case of duplicate HTLCs with same hash going in opposite
directions we may learn preimage of offered one, but we shouldn't
claim received one to avoid invalidation of combined claim.
The received HTLC is going to be claimed by a timeout tx at
timelock expiration.
Fix #337
Antoine Riard [Tue, 5 Nov 2019 00:09:51 +0000 (19:09 -0500)]
Rename HandleError to LightningError to stress already-processed error
Matt Corallo [Mon, 28 Oct 2019 21:36:39 +0000 (21:36 +0000)]
Merge pull request #386 from TheBlueMatt/2019-10-useless-lints
Disable some useless lints