Commit Graph

2046 Commits

Author SHA1 Message Date
Conner Fromknecht
c0f1d12521 utxonursery: refactors kidOutput SignDescriptor serialization 2017-08-25 17:56:50 -07:00
Conner Fromknecht
438c6b9621 lnwallet: move latest SignDescriptor + serialization 2017-08-25 17:56:50 -07:00
Conner Fromknecht
b7e426ecdc lnd_test: test breach persistence after breach conf 2017-08-25 17:56:50 -07:00
Conner Fromknecht
ce17d18249 breacharbiter_test: adds RetributionStore persistence unit tests 2017-08-25 17:56:50 -07:00
Conner Fromknecht
c3736e6893 breacharbiter: adds persistence to retribution flow
This commit introduces a RetributionStore interface, which
  establishes the methods used to access persisted information
  regarding breached channels. A RetributionStore is used to
  persist retributionInfo regarding all channels for which
  the wallet has signaled a breach.

  The current design could be improved by moving certain
  functionality, e.g. closing channels and htlc links, such
  that they are handled by upstream by their respective
  subsystems. This was investigated, but deemed preferable to
  postpone to a later update to prevent the current
  implementation from sprawling amongst too many packages.

  The test suite creates a mockRetributionStore and ensures that
  it exhibits the same behavior as the retribution store backed
  by a channeldb.DB.
2017-08-25 17:56:50 -07:00
Conner Fromknecht
6ffe33f01a lnw+ba+utxon+cdb: reverts OutPoint and TxOut encoding 2017-08-25 17:56:50 -07:00
Conner Fromknecht
8698085e35 breacharbiter: reverts retributionInfo naming and realign diffs 2017-08-25 17:56:50 -07:00
Conner Fromknecht
4cdce1fc0a breacharbiter+channeldb: resolves rebase conflicts 2017-08-25 17:56:50 -07:00
Philip Hayes
ce411f8e22 lint: fix linter complaints 2017-08-25 17:56:50 -07:00
Philip Hayes
56793a1041 utxonursery: finish migrating to lnwire OutPoint serialization 2017-08-25 17:56:50 -07:00
Philip Hayes
b19c483a04 breacharbiter: add retribution state persistence
This commit adds a breached contract retribution storage layer using
boltdb to the breach arbiter. The breach arbiter now stores retribution
state on disk between detecting a contract breach, broadcasting a
justice transaction that sweeps the channel, and finally witnessing the
justice transaction confirm on the blockchain. It is critical that such
state is persisted on disk, so that if our node restarts at any point
during the retribution procedure, we can recover and continue from the
persisted state.
2017-08-25 17:56:50 -07:00
Philip Hayes
d8c56433e3 lnwallet: extract SignDescriptor serialization and witness generator 2017-08-25 17:56:50 -07:00
Philip Hayes
f0aa186a56 channeldb+utxonursery+lnwire: use lnwire's OutPoint,TxOut serialization 2017-08-25 17:56:50 -07:00
Olaoluwa Osuntokun
7f575b688e
multi: txscript.WitnessScript -> txscript.WitnessSignature 2017-08-24 18:55:32 -07:00
Olaoluwa Osuntokun
9f0efddc20
multi: switch from btcrpcclient to rpcclient 2017-08-24 18:54:24 -07:00
Olaoluwa Osuntokun
ac128e4545
build: update glide files to point to latest btcsuite repos
This commit updates the glide packages in the repo to point to the
latest btcsuite repos. With this change, we’ll now be able to take
advantage of many of the recent updates to the btcsuite package of
repos. One highlight is that after this commit, we’ll now be using
bech32 by default for p2wkh addresses.
2017-08-24 18:44:58 -07:00
Olaoluwa Osuntokun
4e48a8cb86
docs: update installation docs, specify min version
This commit updates the installation docs to specify the min golfing
version. Additionally, we ensure that users running on linux will
download the latest version of golfing from their ppa. Finally, we also
now link directly to the golfing page of pre-compiled binaries for
users that seek to grab the source directly from the official goading
website.

Fixes #263.
2017-08-24 14:09:29 -07:00
Chris Moore
493d7b53f6 docs: add 'git clone' line for btcd installation
The installation instructions for btcd were missing a 'git clone' command.
2017-08-24 14:02:31 -07:00
Olaoluwa Osuntokun
48712526d6
lnd+cmd/lncli: bump to version 0.3 2017-08-23 11:57:01 -07:00
Olaoluwa Osuntokun
d4d5198e85
peer: if we don't have an advertised routing policy, fall back to default
This commit fixes a bug that could arise if either we had not, or the
remote party had not advertised a routing policy for either outgoing
channel edge. In this commit, we now detect if a policy wasn’t
advertised, falling back to the default routing policy if so.

Fixes #259.
2017-08-23 11:34:53 -07:00
Olaoluwa Osuntokun
d0b192c636
discovery: print proper error message when sigs fail to validate 2017-08-23 11:34:47 -07:00
Olaoluwa Osuntokun
6e3abdfd14
macaroons: ensure all bytes read from db are copied before returning
This commit is a precautionary commit put in place in order to ensure
that the logic of macaroon retrieval doesn’t run into a bug triggered
by returning a reference into bolt’s active memory map. This can arise
if one returns a pointer directly read from the database. We seek to
avoid this by instead ensuring all byte slices are fully copied before
returning.
2017-08-23 11:34:43 -07:00
Olaoluwa Osuntokun
ae5afcf555
docs: update installation notes with neutrino info 2017-08-22 21:01:24 -07:00
Olaoluwa Osuntokun
1ff389b449
README: update with latest information 2017-08-22 21:00:46 -07:00
Olaoluwa Osuntokun
ff997eab3e
discovery: ensure ChainHash field is populated when crafting new ChannelUpdates
This commit ensures that we *always* populate the ChainHash field when
we’re crafting new channel update messages either due to the periodic
broadcast, or when we’re updating the routing policies of a set of
target channels. Previously, this wasn’t set which would cause nodes to
reject the newly crafted ChannelUpdate messages.
2017-08-22 20:13:04 -07:00
Olaoluwa Osuntokun
2d45552ad9
htlcswitch: properly format chan_id on failure to find 2017-08-22 20:12:56 -07:00
Olaoluwa Osuntokun
90a03954b2
htlcswitch: fix linter errors 2017-08-22 01:05:32 -07:00
Olaoluwa Osuntokun
2b2a3714c1
multi: fix linter errors 2017-08-22 01:00:12 -07:00
Olaoluwa Osuntokun
ed3268b988
test: in testSingleHopInvoice also wait for bob to advertise the channel 2017-08-22 00:54:20 -07:00
Olaoluwa Osuntokun
321cc28cd8
routing: in findPath skip edge if incoming edge isn't advertised 2017-08-22 00:54:15 -07:00
Olaoluwa Osuntokun
c1aed90e72
docker: update containers to expose new default port 2017-08-22 00:54:12 -07:00
Olaoluwa Osuntokun
625b80b311
config: update default port to be 9735 to match BOLT-0001 2017-08-22 00:54:10 -07:00
Olaoluwa Osuntokun
08d22f8bb4
lnd: modify htlc error integration tests to account for max payment size
This commit modifies the HTLC integration tests to be mindful of the
max payment size. Rather than sending the payment in one large batch,
we instead now send it in chunks of the max payment size.
2017-08-22 00:54:07 -07:00
Olaoluwa Osuntokun
65526ba071
lnd: reset features as we no longer need to partition dated lnd nodes 2017-08-22 00:54:04 -07:00
Olaoluwa Osuntokun
1c22242a41
build: update glide files to track latest gRPC related repos/commits 2017-08-22 00:54:02 -07:00
Olaoluwa Osuntokun
2790617176
cmd/lncli: add command+parsing for updatefees and feereport 2017-08-22 00:53:59 -07:00
Olaoluwa Osuntokun
3df5b090da
rpc: enforce the max payment size as defined in BOLT-0002
This commit modifies the relevant RPC’s to enforce the max payment size
as defined in BOLT-0002. With this commit the largest payment possible
is now 2^32 mSAT, or 4,294,967 satoshis.
2017-08-22 00:53:57 -07:00
Olaoluwa Osuntokun
1a90991905
rpc: ensure the inner grouting within SendPayment will always exit
This commit adds a new reqQuit channel within SendPayment. The inner
goroutine will use this channel to detect if the request itself has
exited or not. Without this method, we’d possible leak a goroutine if a
client never closed the payment stream.
2017-08-22 00:53:54 -07:00
Olaoluwa Osuntokun
6ad803b99c
rpc: make NewWitnessAddress return np2wkh addresses
This commit modifies NewWitnessAddress to return nested p2wkh address.
We do this as this RPC call was put in place to be used within GUI’s to
allow users to deposit funds into their LN wallet. By using nested
p2wkh, we ensure that the generate address that can be used to directly
create channels.
2017-08-22 00:53:51 -07:00
Olaoluwa Osuntokun
d49172aa50
rpc: add feereport to set of read only macaroon caveats 2017-08-22 00:53:48 -07:00
Olaoluwa Osuntokun
44cafb01ae
rpc: add implementations for UpdateFees and FeeReport 2017-08-22 00:53:46 -07:00
Olaoluwa Osuntokun
2b411051e1
docs: update contribution guidelines with newest proto repos 2017-08-22 00:53:43 -07:00
Olaoluwa Osuntokun
129a0e10de
lnrpc: add two new RPC's, UpdateFees and FeeReport
This commit adds to new RPC’s to the Lightning service: UpdateFees and
FeeReport. Additionally, we also update to the latest version of protc,
golang protobuf, and the gRPC gateway.
2017-08-22 00:53:41 -07:00
Olaoluwa Osuntokun
e0bed8bc27
config: use a single global macaroon database, scope macaroons in datadir
This commit modifies the way that we create the macaroon database, and
also create the initial macaroons themselves. Rather than creating a
new macaroon DB for each chain, we instead create a single instance for
all chains. Additionally, if the datadir has been modified, and the
macaroon paths haven’t been modified, the macaroons are now scoped to
those paths.
2017-08-22 00:53:38 -07:00
Olaoluwa Osuntokun
f5d221012d
routing: update ChannelGraphSource due to latest API changes 2017-08-22 00:53:36 -07:00
Olaoluwa Osuntokun
bc4ad34190
routing: don't re-validate a channel update's edge if it already exists
By avoiding re-validating the channel edge, we avoid wasted network
bandwidth and queries.
2017-08-22 00:53:33 -07:00
Olaoluwa Osuntokun
b069406d1e
peer: fix bug, use the existing timestamp for the ChannelUpdate msg
This commit fixes a lingering bug within the logic for the
peer/htlcswitch/channellink. When the link needs to fetch the latest
update to send to a sending party due to a violation of the set routing
policy, previously it would modify the timestamp on the message read
from disk. This was incorrect as it would invalidate the signature
within the message itself. We fix this by instead
2017-08-22 00:53:31 -07:00
Olaoluwa Osuntokun
3086a9d06a
peer: ensure a peer can exit mid cooperative closure
This commit adds another conditional send select statement to ensure
that when sending the finalized contract to the breach arbiter, the
peer doesn’t possible cause the daemon to hang on shutdown.
2017-08-22 00:53:28 -07:00
Olaoluwa Osuntokun
c09713ebd1
peer+server: rename discoverSrv to authGossiper 2017-08-22 00:53:25 -07:00
Olaoluwa Osuntokun
dd1d69b140
peer: fetch forwarding policy from disk rather than using default
This commit modifies the logic when we are loading alll the channels
that we have with a particular peer to grab the current committed
forwarding policy from disk rather then using the default forwarding
policy. We do this as it’s now possible for active channels to have
distinct forwarding policies.
2017-08-22 00:53:23 -07:00