Commit Graph
100 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 3a052d2874 lnwallet: when creating new states, dispatch HTLC signing to sigPool 2017-07-30 17:50:40 -07:00
Olaoluwa Osuntokun f569b80a80 lnwallet: when verifying new states, dispatch HTLC sig validation to sigPool 2017-07-30 17:50:37 -07:00
Olaoluwa Osuntokun cd8672f824 lnwallet: update CreateCommitTx due to new key derivation 2017-07-30 17:50:34 -07:00
Olaoluwa Osuntokun e314b83559 lnwallet: update HTLC script generation to account for new covenant HTLC's
This commit updates the set of functions tasked with generating HTLC’s
scripts for new commitments to now adhere to the new commitment
transaction design. With this change, the process of claiming an HTLC
now requires a second-level HTLC transaction, which solves a prior
issues due to the tight coupling of the timeout and delay clauses when
claiming an HTLC.
2017-07-30 17:50:31 -07:00
Olaoluwa Osuntokun 8b9a58cb15 lnwallet: add a sigPool instances to the state machine struct 2017-07-30 17:50:27 -07:00
Olaoluwa Osuntokun 4c9bd9dc54 lnwallet: when handling possible channel breach, only log if contract breach 2017-07-30 17:50:24 -07:00
Olaoluwa Osuntokun e56258917e lnwallet: introduce populateHtlcIndexes for tracking HTLC indexes in commitments
This commit adds a new method to the commitment struct:
populateHtlcIndexes.  populateHtlcIndexes modifies the set of HTLC's
locked-into the target view to have full indexing information
populated. This information is required as we need to keep track of the
indexes of each HTLC in order to properly write the current state to
disk, and also to locate the PaymentDescriptor corresponding to HTLC
outputs in the commitment transaction.

We also modify toChannelDelta to take not of these new changes, and
access the appropriate index directly.
2017-07-30 17:50:21 -07:00
Olaoluwa Osuntokun 549688d793 lnwallet: remove isDustLocal and isDustRemote, replace w/ htlcIsDust
This commit modifies the way we account for dust HTLC’s within the
commitment state machine when creating and validating new states.
Previously, an HTLC was dust if the amount of the HTLC was below the
dustLimit of the commitment chain. Now, with the HTLC covenant
transaction, the value of the HTLC also needs to cover the required fee
of the HTLC covenant transaction at the specified fee rate of the
commitment chain.

As a result, we now determine if an HTLC is dust or not, only at the
commitment site, using the new htlcIsDust function.
2017-07-30 17:50:16 -07:00
Olaoluwa Osuntokun 91165d98bb lnwallet: eliminate the InitialRevocationWindow within the state machine
This commit modifies the current core channel state machine in order to
may a step towards BOLT-0002 and BOLT-0003 compliance. In this change,
we abandon the prior revocation window, in favor of a fixed revocation
window of size two. The revocation window will be filled at the start
of the lifetime of the channel, and never extended from there until the
channel has been fully closed.

We now maintain two variables, the current un-revoked commitment point,
and the next commitment point to use when creating a new state. The
next commitment point must initially be inserted into the channel state
with the InitNextRevocation method.

A major difference between the prior revocation key handling is that
the remote party now instead sends us the _commitment point_ in
isolation, which we then use locally (with our revocation base point)
to create the next full revocation key for _their_ commitment
transaction.
2017-07-30 17:50:13 -07:00
Olaoluwa Osuntokun c7df82ab68 lnwallet: update the LightningChannel API usage for recent channels changes
This commit updates much of the state interaction within the
LightningChannel structure to account for the recent changes within the
chanenldb involving the OpenChannel struct, namely the introduction of
ChannelConfig and ChannelConstraints.
2017-07-30 17:50:10 -07:00
Olaoluwa Osuntokun b5044e9217 lnwallet: introduce the sigPool struct to optimize state creation+verification
This commit introduce a new struct which acts as a companion struct to
the channel state machine struct. With the new commitment state
machine, we require a signature to be signed and validated for each
outstanding non-trimmed HTLC within the commitment state. As it’s
possible to have hundreds of HTLC’s on a given commitment transaction,
rather than perform all ECDSA operations in serial, we instead aim to
parallelize the computation with a worker pool of sign+verify workers.

The two primary methods of the sigPool are SubmitVerifyBatch and
SubmitSignBatch which allow a caller to trigger an asynchronous job
execution when creating or validating a new commitment state.
2017-07-30 17:50:06 -07:00
Olaoluwa Osuntokun 30b1cbc1fd lnwallet: update interface-level wallet tests for new funding flow
This commit updates the prior set of interface-level wallet tests to
exercise the new funding workflow, and also to switch to utilizing two
wallet instances throughout the tests. This allows us to abandon the
dependency on the bobNode struct.
2017-07-30 17:50:03 -07:00
Olaoluwa Osuntokun 5dc0b407f3 lnwallet: update the btcwallet Signer interface due to new key derivation 2017-07-30 17:50:00 -07:00
Olaoluwa Osuntokun c872d94606 lnwallet: convert interface-level tests to spin up two wallet instances
This commit modifies the interface-level wallet integration tests to
spin up two distinct wallet instances, wiping them after each
successful test. This change paves the way for an upcoming change which
uses two live wallet instances, rather than mocking out most of the
other interaction.
2017-07-30 17:49:57 -07:00
Olaoluwa Osuntokun 4f02a2af80 lnwallet: remove bobNode as sadly he's no longer needed
This commit removes bobNode from the wallet’s funding interaction
tests. bobNode was originally created at a very early point in lnd’s
life time before any sort of back end chain access was hooked in. At
that time the integration tests were unable to run, but bobNode allowed
us to test a portion of the funding workflow given idealized inputs.

The tests will be modified in a later commit to eschew bobNode in favor
of just having two LightningWallet instances communicate with one
another.
2017-07-30 17:49:54 -07:00
Olaoluwa Osuntokun eca8dd1076 lnwallet: update testSignOutputUsingTweaks to exercise new key derivation 2017-07-30 17:49:50 -07:00
Olaoluwa Osuntokun 9edc335049 lnwallet: update internal funding workflow to account for BOLT-0002
This commit updates the engine that drives the reservation workflow to
utilize the new ChannelConfig and ChannelConstraint structs added in
prior commits.  With this change, the internal reservation engine has
been modified to retain the prior dual funder workflow, but also be
able to properly manage and execute the new single funder workflow
defined in BOLT-0002.
2017-07-30 17:49:47 -07:00
Olaoluwa Osuntokun 441e5b2d7c lnwallet: add new helper function to generate both comitment pairs 2017-07-30 17:49:44 -07:00
Olaoluwa Osuntokun 62110b33e7 lnwallet: flesh out the Config struct, wallet constructor now takes 2017-07-30 17:49:41 -07:00
Olaoluwa Osuntokun c63c7cd22f lnwallet: update Channel[Reservation+Contribution] for new funding flow
This commit updates the channel reservation workflow in order to
properly implement the new funding workflow defined in BOLT-0002.

The workflow itself hasn’t changed significantly, but the contents of
the contributions of both sides have. The bulk of the fields within the
contribution of both sides has been boiled down into a pointer to the
ChannelConfig which houses all the data required to handle all states
of the channel, and commitment state machine.

For the two portions which are dictated by the other party, we now add
builder-like modifiers to allow specifying the constraints after the
initial portion of the workflow.
2017-07-30 17:49:37 -07:00
Olaoluwa Osuntokun e930af4b43 lnwallet: convert interface-level tests to be run as sub-tests 2017-07-30 17:49:34 -07:00
Olaoluwa Osuntokun 9c0261206d lnwallet: modify the Signer interface to reflect new key derivation scheme
This commit modifies the Signer interface to reflect the new key
derivation defined within BOLT-0003. This entails removing the prior
PrivateTweak field all together in favor of two new fields: SingleTweak
and DoubleTweak.

These two fields are mutually exclusive. The SingleTweak field is now
required in order to sign all regular non-delay, and also must be used
to generate signatures for the localKey, or delayKey. The DoubleTweak
field is used to generate the private key that corresponds to the
revoked revocation key.
2017-07-30 17:49:31 -07:00
Olaoluwa Osuntokun 7b002175f4 lnwallet: update state hint derivation to match BOLT-0003 2017-07-30 17:49:28 -07:00
Olaoluwa Osuntokun ca45ae7524 lnwallet: update TestCommitmentSpendValidation due to new commitment scripts 2017-07-30 17:49:25 -07:00
Olaoluwa Osuntokun 016f56e8e3 lnwallet: update TestRevocationKeyDerivation to use new derivation 2017-07-30 17:49:22 -07:00
Olaoluwa Osuntokun 44ffcf2156 lnwallet: add new test case to exercise singly tweaked key derivation 2017-07-30 17:49:19 -07:00
Olaoluwa Osuntokun 5b6cc5e92d lnwallet: TestHTLCSenderSpendValidation for new HTLC scripts 2017-07-30 17:49:16 -07:00
Olaoluwa Osuntokun 7c035a4729 lnwallet: update TestHTLCSenderSpendValidation for new scripts 2017-07-30 17:49:13 -07:00
Olaoluwa Osuntokun c4866723d1 lnwallet: add redemption+spend tests for the second-level HTLC txns 2017-07-30 17:49:09 -07:00
Olaoluwa Osuntokun 1a9ada4897 lnwallet: move stateHintTests global var into TestCommitTxStateHint 2017-07-30 17:49:06 -07:00
Olaoluwa Osuntokun 4e4375513d lnwallet: update MaxHTLCNumber to precisely match the spec 2017-07-30 17:49:03 -07:00
Olaoluwa Osuntokun 71e47283cf lnwallet: update size.go to add the weight of the success+timeout txns
This commit updates the constants in size.go to include the weight of
the HTLC success and timeout transactions. These values are required in
order to properly compute the fee required for a particular HTLC
transaction. The fee will change depending on if the HTLC is incoming
or outgoing.
2017-07-30 17:49:00 -07:00
Olaoluwa Osuntokun 360876944e lnwallet: add new functions to generate + claim second-level HTLC txns
This commit adds a series of new functions that can be used to generate
the second level HTLC transactions, and also to claim the output
created by the transaction after a delay. The details of the scripts
and transaction format can be found in BOLT #3.
2017-07-30 17:48:56 -07:00
Olaoluwa Osuntokun f70697bf71 lnwallet: update all witness gen funcs for receiver's HTLC scripts 2017-07-30 17:48:53 -07:00
Olaoluwa Osuntokun 4b1a7091e6 lnwallet: update public key scripts for the HTLC receiver's outputs
This commit updates all the pkScripts used within the commitment
transaction of the party that is on the reign side of an HTLC.

The major difference in these scripts as the prior generation’s is that
the claim action is now spared into a distinct transition. This clause
is guarded by a 2-of-2 multi-sig op code, which effecting creates an
off-chain covenant forcing the party claiming the transaction to incur
a delay before the funds can be swept.
2017-07-30 17:48:50 -07:00
Olaoluwa Osuntokun d697c6ca9a lnwallet: update the witness generation funcs for sender's HTLC output
This commit updates all the spendHtlcSpend* functions which are used to
spend each of the possible clauses within the HTLC contract placed on
the sender’s commitment transaction.
2017-07-30 17:48:47 -07:00
Olaoluwa Osuntokun 8f5129e08f lnwallet: update public key scripts for the HTLC sender's commitment tx 2017-07-30 17:48:44 -07:00
Olaoluwa Osuntokun 0b9c117bbd lnwallet: update key derivation for the commitment txn scheme
This commit updates the key derivation to match the derivation required
in order to construct and validate the commitment scheme that is used
within the draft specification of the Lightning Network. The new scheme
is very similar to the prior scheme aside from the following major
differences:
  * Each key (not just the revocation key) now changes with each state.
  * A commitment point (a component of the revocation key) is used to
randomize each key, and also generate new tweaked versions of the key.
   * Base points are used along with the commitment point to generate
the keys for the commitment transaction.
   * Before the remote party would send over the fully valid revocation
key. Now the remote party sends us a commitment point, which we then
use our local revocation base point to generate their revocation key.
2017-07-30 17:48:41 -07:00
Olaoluwa Osuntokun 13404243cf lnwallet: revocation root generation is now based on a block hash + node key
This commit modifies the prior revocation root generation to a newer
version which is intended to allow for easy recovery of revocation
state. Rather than using the node’s keys (which we can’t count on NOT
to change), we instead now use the block hash as a salt. With this,
given the block hash prior to the one that funded the channel, and the
node’s identity key, we can reconstruct our revocation state.
2017-07-30 17:48:38 -07:00
Olaoluwa Osuntokun 2408a3ddcf brontide: fix minor typo 2017-07-30 17:48:35 -07:00
Olaoluwa Osuntokun 88c15abeef channeldb: remove RevocationDelay field from the HTLC struct
This commit removes the RevocationDelay field from the HTLC struct as
with the latest commitment transaction scheme, it is no longer needed.
This is due to the fact the the delay is now observed when an on-chain
HTLC claim is attempted, rather than from Shane the HTLC itself has
been broadcast.
2017-07-30 17:48:32 -07:00
Olaoluwa Osuntokun e87cc29b36 brontide: add additional detail to handshake version error message
This commit adds some additional detail to the error message
encountered when the first byte of an act is an invalid handshake
version byte. This commit is meant to aide in tracking down a
re-occurring bug that has been encountered by early testers of the
software.
2017-07-30 17:48:29 -07:00
Olaoluwa Osuntokun 5ad6c23848 channeldb: update tests to reflect latest OpenChannel/HTLC API changes 2017-07-30 17:48:26 -07:00
Olaoluwa Osuntokun 5854ffb644 channeldb: add InsertNextRevocation method to OpenChannel
This commit adds a new method to the OpenChannel struct:
InsertNextRevocation. This functionality is required in order to
properly implement the new funding workflow and commitment transaction
state machine.

In the prior state machine, we utilized the “initial revocation window”
which would provide both sides with the necessary revocation keys that
they needed to create new commitment states. The version of the
commitment state machine within the specification has been simplified a
bit, and instead essentially incorporates a revocation window of 1. The
window is initially filled at the _opening_ of the commitment
transaction, then never extended, only “slid down” from there on.
2017-07-30 17:48:22 -07:00
Olaoluwa Osuntokun a14072a47e channeldb: store the second-level HTLC signature along with HTLC's
This commit modifies the HTLC struct within the channeldb struct in
order to accommodate the additional storage that’s now required as a
result of the change to 2-of-2 HTLC covenant transactions within the
commitment transaction.
2017-07-30 17:48:19 -07:00
Olaoluwa Osuntokun 9811b404e4 channeldb: integrate ChannelConfig and ChannelConstraints into OpenChannel
This commit is the next phase in a rather major overhaul of the
OpenChannel struct. With this commit we remove the old ours vs theirs
semantics with channel related state variables, and instead encapsulate
all local vs remote state into a ChannelConfig structure for each party
within the channel.
2017-07-30 17:48:16 -07:00
Olaoluwa Osuntokun 5780992f8d channeldb: eliminate ChanID in favor of FundingOutpoint
This commit eliminates a bit of redundancy within the OpenChannel
struct by eschewing the ChanID field, in favor of simply the
FundingOutpoint field.
2017-07-30 17:48:13 -07:00
Olaoluwa Osuntokun a092b0d82c channeldb: introduce ChannelConfig and ChannelConstraints
This commit introduces two new structs to the channeled package:
ChannelConfig and ChannelConstraints.

The ChannelConfig struct will eliminate many of the fields on the
OpenChannel struct (ours vs theirs), in favor of having a single config
for both sides (local and remote).

The ChannelConstraints struct will house the channel flow control and
HTLC policies for both sides. The fields of this struct will be used to
control the flow of HTLC’s within the channel. In the occasion that any
of these constraints are violated, either the connection, or the
channel entirely is to be failed.
2017-07-30 17:48:09 -07:00
Olaoluwa Osuntokun 1fb9d2e44e channeldb: reset database version back to zero
As we removed the prior migration in an earlier commit, we now reset
the version of the database back to zero (no migrations needed).
2017-07-30 17:48:04 -07:00
Olaoluwa Osuntokun c15cd12dcf channeldb: fix type in ErrSourceNodeNotSet comment 2017-07-30 17:48:01 -07:00
Olaoluwa Osuntokun d4916ba9c6 channeldb: remove prior migrations as their no longer needed
This commit removes a database migration that was added to fix a bug
introduced within the first alpha release. This migration is no longer
needed as the underlying database scheme has changed since then.
2017-07-30 17:47:58 -07:00
Olaoluwa Osuntokun de30c14aea lnwire: update testing/quick tests to new wire message updates 2017-07-30 17:47:55 -07:00
Olaoluwa Osuntokun f7800709ba lnwire: use %v instead of %x when printing length of oversized msg 2017-07-30 17:47:51 -07:00
Olaoluwa Osuntokun 53f45e8210 lnwire: update MessageType definition to include new funding messages 2017-07-30 17:47:48 -07:00
Olaoluwa Osuntokun 364a9a8059 lnwire: add a HtlcSigs field to the CommitSig message
This commit adds a new field to the CommitSig message: HtlcSigs. This
new field will house signatures for each of the HTLC’s on the newly
created commitment state. This addition allows us to implement the new
commitment transaction structure outlined within the specification
which modifies HTLC’s such that the claiming process is now a two-phase
process. The first state transitions an HTLC to the delay+claim state,
and the second state (after the delay has passed) allows the
broadcaster of the commitment transaction to sweep the HTLC’s.

Fixes #61.
2017-07-30 17:47:44 -07:00
Olaoluwa Osuntokun be67bd46cd lnwire: add a case for a slice of signatures to readElement/writeElement
This commit modifies the readElement and writeElement functions to add
the capability of reading/writing a slice of btcec.Signature. This new
case is required for the upcoming commit which will modify the
CommitSig message to include a field which houses signatures of reach
HTLC on the commitment transaction.
2017-07-30 17:47:40 -07:00
Olaoluwa Osuntokun 7f36b70a4a lnwire: add new single funder messages from specification
This commit adds the new set of single funder messages from the
specification. As a result, after this commit and a follow up, all of
our messages will directly line up with those that are detailed within
the specification.

The new set of funding messages are very similar to our prior ones,
aside from the main difference of the addition of several channel level
constraints that give nodes control over their exposure, throughput,
and other values.
2017-07-30 17:47:37 -07:00
Olaoluwa Osuntokun 2263a6a1b7 lnwire: modify RevokeAndAck to remove NextRevocationHash
This commit modifies the RevokeAndAck message in order to bring it more
in line with the current draft of the specification. The prior version
was based on a version that used a revocation hash for HTLC’s and a
revocation key for commitment outputs. The current commitment design
uses revocation keys uniformly throughout.
2017-07-30 17:47:33 -07:00
Olaoluwa Osuntokun b2d86bffc5 lnwire: remove deprecated single funding wire messages
This commit removes the original single funder wire messages as they’ve
now been deprecated by the new commitment and HTLC structure within the
latest draft of the specification.
2017-07-30 17:47:29 -07:00
Olaoluwa Osuntokun 78f6caf5d2 features: add temporary feature for encrypted payment errors 2017-07-14 20:09:00 -07:00
Olaoluwa Osuntokun a04fa76a4c lnwire+htlcswitch: minor grammatical, formatting fixes after error PR 2017-07-14 20:08:37 -07:00
Olaoluwa Osuntokun d43a660cb1 build: update to latest version of neutrino+btcwallet
The latest builds of neutrino and btcwallet include a number of
performance optimizations that should speed up the sync of neutrino
nodes while ensuring all the pessary data is in place for re-org
safety.
2017-07-14 18:36:03 -07:00
Olaoluwa Osuntokun 6128fc6971 funding: avoid dereferencing a nil localDiscoverySignal
This commit fixes a possible panic within the funding manger’s workflow
for pending channels. We now ensure that the local discovery signal
retrieved from the localDiscoverySignals map is always non-nil.
Otherwise, we risk a server panic in the case that a node retransmits
the FundingLocked message after a channel has been fully processed, or
even just sends a FundingLocked message for a non-existent channel.
2017-07-14 17:14:22 -07:00
Olaoluwa Osuntokun 14832d8c09 lnwallet+lnwire: minor grammatical fixes after UpdateFee merge 2017-07-14 17:10:42 -07:00
Olaoluwa Osuntokun 9c16319e0d build: update to latest build of the sphinx processing package
This new build of lightning-onion includes the routines necessary to
implement the encryption and decryption of HTLC errors as defined
within the specification.
2017-07-13 23:50:52 -07:00
Olaoluwa Osuntokun c47047c0b8 chainntnfs: extend interface test to ensure initial conf height is correct 2017-07-11 17:38:43 -07:00
Olaoluwa Osuntokun cc8008d5e1 build: update glide file to point to latest version of btcwallet
A rather nasty re-org related bug was recently fixed in the upstream
version of roasbeef’s btcwallet. In order to fix this within the main
lnd build, we update the glide files such that the latest changes will
be pulled in.
2017-07-11 16:29:43 -07:00
Olaoluwa Osuntokun f9f9d68543 test: ensure the WaitForBlockchainSync grouting always exits
This commit fixes a minor bug in the goroutine that’s launched to check
the sync status of a particular node. Previously, the goroutine could
end up infinitely stuck on a send as once the chain has been detected
as synced, it didn't exit.

We fix this now by ensure that the goroutine always terminates after
the initial notification to the caller. Additionally, we not ensure
that both the internal and exterior goroutine are both reading off of
the peer’s quit channel.
2017-07-11 16:29:35 -07:00
Olaoluwa Osuntokun 906771ba16 features: add temporary feature for proper HTLC dust accounting 2017-07-06 18:30:51 -07:00
Olaoluwa Osuntokun 497b522c13 lnd: update logging interaction to latest API changes 2017-07-06 14:37:02 -07:00
Olaoluwa Osuntokun 4c3e24567e build: update new logging related dependancies to latest versions 2017-07-06 14:36:16 -07:00
Olaoluwa Osuntokun 21cb3837c4 test: add synchronization to testDisconnectingTargetPeer 2017-07-06 14:18:04 -07:00
Olaoluwa Osuntokun f39b7aaaf9 build: create parallel travis builds to isolate race condition tests
This commit modifies the travis build script, and our local test script
to ensure that the race condition builds are conducted in a parallel
build. After this commit two travis builds will be kicked off for each
push/commit: one that runs the race condition tests in isolation, and
another that runs the integration tests then the coverage tests.

In order to do the above cleanly, the integration tests are now guarded
behind a build flag. In order to run the integration tests, one now
needs to specify the `-tags rpctest` flag when running the `go test`
command.
2017-07-04 16:05:22 -07:00
Olaoluwa Osuntokun 01d54c29af htlcswitch: restore the ability to properly handle debughtlc recv's
This commit fixes a regression introduce in the prior commit which
added full verification of the per-hop payloads to the ChannelLink
interface. When this was initially implemented, the added checks
weren’t guarded on the existence of debughtlc’s. As a result,
debughtlc’s would be rejected as they don’t match the expected invoice
value.

This commit fixes that issue by only checking the hop payload if debug
HTLC mode isn’t on.
2017-07-04 15:58:23 -07:00
Olaoluwa Osuntokun a824a2a855 cmd/lncli: properly display errors when sending payments 2017-07-04 15:55:34 -07:00
Olaoluwa Osuntokun c5f4049394 chainntnfs: convert ChainNotifier interface tests to use sub-tests 2017-07-04 15:54:45 -07:00
Olaoluwa Osuntokun 9daa659bb3 routing/chainview: convert chainview integration tests to use sub-tests 2017-07-04 15:53:58 -07:00
Olaoluwa Osuntokun 3b1db2b186 test: update integration test set up to reflect recent RPC change
A prior commit modified the walletbalance RPC to return satoshi instead
of BTC. As a result, we need to update the SetUp method in the
networkHarness to ensure we expect the proper value when asserting
wallet balances.
2017-07-04 15:53:06 -07:00
Olaoluwa Osuntokun 7c5af4b851 rpc: properly return satoshis in WalletBalance response 2017-07-04 15:51:08 -07:00
Olaoluwa Osuntokun 58d3fd9dd8 lnrpc: WalletBalance now returns satoshis instead o fBTC 2017-07-04 15:50:33 -07:00
Olaoluwa Osuntokun 9b9f419e51 routing: fix vet error, ensure wait group in topologyClient isn't copied 2017-06-25 13:48:52 +01:00
Olaoluwa Osuntokun 5c45d52ab6 routing: wait for topology clients to fully exit before closing ntfn chan
This commit fixes a send on closed channel panic by adding additional
synchronization when cancelling the notifications for a particular
topology client. We now ensure that all goroutines belonging to a
particular topology client exit fully before we close the notification
channel in order to avoid a panic.
2017-06-25 13:31:55 +01:00
Olaoluwa Osuntokun 286026fbb9 htlcswitch: increase timeout in bidi payment test due to travis slowness 2017-06-21 13:36:28 +01:00
Olaoluwa Osuntokun 5dd7b157a0 lnwallet: fix race condition when forwarding by creating new pubkey
This commit fixes a race condition that would at times occur in the
htlcswitch.TestChannelLinkBidirectionalOneHopPayments test case. A race
condition would occur in the goroutine running ReceiveNewCommitment
compared with the grouting that would obtain the snapshot in order to
make a forwarding decision.

We fix this by creating a new public key for each new commitment
transaction such that we complete avoid the read/write race condition.
2017-06-19 17:43:57 +02:00
Olaoluwa Osuntokun 9dd5af4990 test: increase history size of race condition detector
This commit increases the history size of the race condition detector
such that we will more reliably be able to recover the stack in the
case that a race condition occurs.
2017-06-19 17:16:07 +02:00
Olaoluwa Osuntokun a95d56741d config: don't log to stderr if lnd.conf isn't found
This commit fixes a bit of a wart in the configuration file handling
wherein if the config file isn’t found, an error was printed to stderr.
At times, this would cause the testing framework to erroneously mark as
test as failed. Instead, we now keep a particular config file error,
and check that, printing to a warning log level.
2017-06-19 16:44:30 +02:00
Olaoluwa Osuntokun 0fc62f123d htlcswitch: log regular channel ID when registering channels 2017-06-19 16:39:45 +02:00
Olaoluwa Osuntokun 10ca654054 test: in async bi-di payment test wait for both sides to see the channel 2017-06-19 16:39:12 +02:00
Olaoluwa Osuntokun 276a360353 build: re-generate hash for glide file 2017-06-19 14:42:57 +02:00
Olaoluwa Osuntokun fa6c56f16e test: run utxo nursery tests serially 2017-06-19 14:28:19 +02:00
Olaoluwa Osuntokun e2e21243d2 htlcswitch: make linter happy on go 1.7 2017-06-17 01:10:08 +02:00
Olaoluwa Osuntokun 00448fb4ee features: add temp feature bit for recent onion payload changes 2017-06-17 01:04:27 +02:00
Olaoluwa Osuntokun 4b0e331c62 htlcswitch: fix linter issues 2017-06-17 01:04:21 +02:00
Olaoluwa Osuntokun 1be4d67ce4 multi: run all test instances in parallel 2017-06-17 01:00:07 +02:00
Olaoluwa Osuntokun bb9bc9205a htlcswitch: run all unit tests in parallel 2017-06-17 00:41:47 +02:00
Olaoluwa Osuntokun a43b5658bb test: update integration tests to account for base fees
In a recent commit, a default base fee of 1 satoshi has been added, as
a result we now need to factor in the fees paid in a multi-hop setting.
2017-06-17 00:20:14 +02:00
Olaoluwa Osuntokun b47ffde4ad funding: use default routing policy when advertising initial channel routing policy 2017-06-17 00:15:38 +02:00
Olaoluwa Osuntokun 89537318c1 chains: add default routing policy for current supported blockchains 2017-06-17 00:12:43 +02:00
Olaoluwa Osuntokun e15604f7b5 peer: ensure latest version of htlcswitch.Peer interface is implemented 2017-06-17 00:11:10 +02:00
Olaoluwa Osuntokun 11f7a227ab server: update to latest htlcswitch API changes 2017-06-17 00:10:22 +02:00