Conner Fromknecht
af3fa69d05
docs: update release verification scripts for v0.12.1-beta
2021-09-27 15:48:20 +02:00
Conner Fromknecht
50d27e8050
docs: remove unnecessary docker pull from release verification
...
Docker will automatically pull the image if it isn't found locally.
2021-09-27 15:48:20 +02:00
Conner Fromknecht
fc4a16b672
scripts/verify-install.sh: pass expected version as argument
...
This removes a vulnerability brought up by @Kixunil where both the lnd
and lncli binaries are executed to obtain their version before they have
been verified against the release. A malicious binary could have already
compromised the user's system before any of the checks had been
performed.
This commit it split out from the doc changes so that it can easily be
cherry-picked to master/0.13.0.
2021-09-27 15:48:19 +02:00
Conner Fromknecht
4bb6cc9cee
lnrpc/addinvoice: bump default LND invoice timeouts
...
Increases the default MPP expiry from 1 hour to 1 day. For the new AMP
invoices, we increase the interval to 1 month. The longer time frames
for AMP invoices is used so that the invoice can be pseudo reused as
implemented in the prior commit.
The BOLT 11 default of 1 hour is still preserved whenever the field is
missing in the payment request itself, but as of this commit the field
will always be set by lnd.
2021-05-28 09:30:06 -07:00
Conner Fromknecht
d6f88cbe6f
lnrpc: allow payment addr override for AMP invoices
...
This permits an AMP invoice to be "pseudo-reusable", where the invoice
paramters can be used multiple times so long as a new payment address is
supplied. This prevents additional round trips between payer and payee
to obtain a new invoice, even though the payments/invoices won't be
logically associated via the RPC interface like they would when the full
reusable invoices are deployed.
2021-05-28 09:30:05 -07:00
Conner Fromknecht
a765ba1f3d
lntest/mpp_test: ensure ctx.alice and ctx.bob are shutdown
...
Not doing so prevents consecutive subtests from starting properly.
2021-05-28 09:30:05 -07:00
Conner Fromknecht
cfa7188b1d
Merge pull request #5298 from cfromknecht/bump-version-v0.13.0-beta.rc2
...
build/version: bump to v0.13.0-beta.rc2
2021-05-14 12:20:39 -07:00
Conner Fromknecht
5305854c2b
Merge pull request #5295 from wpaulino/getnodeinfo-policy-order
...
rpc: fix policy order for GetNodeInfo
2021-05-14 12:16:47 -07:00
Conner Fromknecht
196aea665e
build/version: bump to v0.13.0-beta.rc2
2021-05-14 11:03:30 -07:00
Conner Fromknecht
ef392dcd0c
lntest: add amp invoice test
2021-05-10 22:02:15 -07:00
Conner Fromknecht
4e93c1303c
lntest: isolate alice+bob in mppTestContext
2021-05-10 22:02:15 -07:00
Conner Fromknecht
2ecd1de713
config: expose distinct accept-amp flag
...
This mirrors the accept-keysend flag, but also permits users to
eventually toggle off keysend separately from AMP.
2021-05-10 22:02:15 -07:00
Conner Fromknecht
64d07558d9
lnrpc: set either payHash or setId depending on payreq type
2021-05-10 22:02:14 -07:00
Conner Fromknecht
8c404ade18
routing: allow splitting for AMP or MPP
2021-05-10 22:02:14 -07:00
Conner Fromknecht
b0949054e5
invoices: fail HTLCs that target the wrong type of invoice
2021-05-10 22:02:14 -07:00
Conner Fromknecht
dba055de2d
lntest/amp_test: assert subscribe invoice in sendtoroute_amp
2021-05-10 22:02:14 -07:00
Conner Fromknecht
8402e346f5
channeldb/invoice: fail extra HTLC sets immeidately
2021-05-10 16:55:18 -07:00
Conner Fromknecht
70efaa5fe2
invoices: use HTLCSet method with state filter
2021-05-10 16:55:17 -07:00
Conner Fromknecht
d93c3298b7
channeldb+invoice: add state filter to HTLCSet
2021-05-10 16:55:17 -07:00
Conner Fromknecht
620e426bc3
lncli: add --amp flag to invoice command
2021-05-10 16:55:17 -07:00
Conner Fromknecht
2be874f340
lnrpc: add IsAmp to Invoice
2021-05-10 16:55:17 -07:00
Conner Fromknecht
541041f4a8
invoicesrpc: add ability to generate AMP invoices
2021-05-10 16:55:17 -07:00
Conner Fromknecht
6a7d3c4b5e
lnrpc+rpcserver: thread GenAmpInvoiceFeatures to invoicesrpc
2021-05-10 16:55:17 -07:00
Conner Fromknecht
e97da53676
feature: populate SetInvoiceAmp with TlvOpt+PayAddrReq+AmpReq
2021-05-10 16:55:16 -07:00
Conner Fromknecht
bbb841bd5f
feature/set: add SetInvoiceAmp
...
AMP invoices need to signal:
- AMPRequired in order to avoid being paid by older clients that don't
support it.
- Can't advertised MPP optional, otherwise older clients will attempt
to pay the invoice with regular MPP payment.
Hence, the features advertised on AMP invoices are mutually exclusive
from those advertised on MPP. Create a new set to classify the two.
2021-05-10 16:55:16 -07:00
Conner Fromknecht
9020a4d2a5
lnrpc/invoicesrpc: extract paymentHashAndPreimage helper
2021-05-10 16:55:12 -07:00
Conner Fromknecht
6e5ccb4efb
Merge pull request #5229 from halseth/breacharbiter-twoway-handoff
...
breacharbiter<->chainwatcher two-way handoff
2021-05-06 16:17:03 -07:00
Conner Fromknecht
af289a180c
Merge pull request #5258 from wpaulino/validation-barrier-err-deadlock
...
routing: return err on validation barrier failure of network update
2021-05-04 10:44:08 -07:00
Conner Fromknecht
d771ed7616
Merge pull request #5159 from halseth/amp-sendpayment
...
AMP support for SendPaymentV2
2021-04-27 11:23:39 -07:00
Conner Fromknecht
e3a8b3b0c4
routing/router: prune zombies when either end is stale
2021-04-21 13:56:21 -05:00
Conner Fromknecht
672dbe39e7
channeldb/graph: only set laggard zombie pubkey
2021-04-21 13:56:19 -05:00
Conner Fromknecht
f28a98aa6f
discovery/gossiper: only parse zombie pubkey if non-empty
2021-04-21 13:56:16 -05:00
Conner Fromknecht
4baee9537b
discovery/gossiper: move zombie handling to helper
2021-04-21 13:56:11 -05:00
Conner Fromknecht
748265d097
Merge pull request #5207 from carlaKC/4727-singleinvoice
...
invoicesrpc: terminate SubscribeSingleInvoice once invoice reaches a final state
2021-04-14 15:32:53 -07:00
Conner Fromknecht
de7da3d223
Merge pull request #5182 from PierreRochard/node-update-addresses
...
rpcserver+lnrpc: make graph node addresses consistent
2021-04-13 14:30:07 -07:00
Conner Fromknecht
f8d201a605
channeldb/invoice: only allow pay-addr lookup w/ no query hash
...
Without this check, it's possible to send a probe HTLC w/ a valid
payment address but invalid payment hash that gets settled. Because
there was no assertion that the HTLC's payment hash matches the
invoice, the link would fail when it receives an invalid preimage for
the HTLC on its commitment.
2021-04-13 12:18:42 -07:00
Conner Fromknecht
791a82878d
Merge pull request #5208 from carlaKC/makefile-acc
...
makefile: bump goacc commit
2021-04-13 11:57:14 -07:00
Conner Fromknecht
213b264e4c
Merge pull request #5187 from bottlepay/config-commit-time
...
config: add commit time parameter
2021-04-09 16:44:40 -07:00
Conner Fromknecht
730b718208
lntest: add AMP itest
2021-04-07 12:09:47 -07:00
Conner Fromknecht
888af51ab4
lntest: make buildRoute method on mppTestContext
...
This will be reused by the amp itest.
2021-04-07 12:09:47 -07:00
Conner Fromknecht
352ce10658
lnrpc: add UnmarshalAMP decoding
2021-04-07 12:09:47 -07:00
Conner Fromknecht
00581efec6
lnrpc: add AMPRecord to Hop
2021-04-07 12:09:43 -07:00
Conner Fromknecht
cfa9e954c7
channeldb/invoice: allow creating AMP invoices w/o preiamge
2021-04-07 12:08:35 -07:00
Conner Fromknecht
ea934e1be9
invoices: add TestSpontaneousAmpPayment
...
Adds a set of test cases that exercise the spontaneous AMP payment flow
with valid and invalid reconstructions, as well as with single and
multiple HTLCs. This also asserts that spontaneous AMP is gated behind
the existing AcceptKeysend flag.
2021-04-07 12:08:35 -07:00
Conner Fromknecht
90a255078d
invoices: reconstruct AMP child preimages
2021-04-07 12:08:35 -07:00
Conner Fromknecht
2a49b59f4f
channeldb/invoices: rigorously test updateHtlc for MPP/AMP scenarios
2021-04-07 12:08:35 -07:00
Conner Fromknecht
0b5be8576e
channeldb/invoice: make Copy() a member of InvoiceHTLC
2021-04-07 12:08:35 -07:00
Conner Fromknecht
6780f74c87
channeldb/invoices: set AMP HTLC preimages when settling invoice
2021-04-07 12:08:35 -07:00
Conner Fromknecht
24d283e615
channeldb/invoice_test: only set htlc-level preimage on accept
2021-04-07 12:08:34 -07:00
Conner Fromknecht
88b72ab398
invoices: add processAMP
2021-04-07 12:08:34 -07:00
Conner Fromknecht
3fb70dd936
invoices: add checkSettleResolution and checkFailResolution
...
Also refactor existing unit tests to use them.
2021-04-07 12:08:34 -07:00
Conner Fromknecht
7e2f5a184b
channeldb: validate feature dependencies when adding invoice
2021-04-07 12:08:34 -07:00
Conner Fromknecht
7bed359296
channeldb: refactor InvoiceRef.String() with all optional fields
2021-04-07 12:08:34 -07:00
Conner Fromknecht
174d577524
channeldb: make payhash on InvoiceRef optional
...
Currently we support queries by payHash or payHash+payAddr. For handling
of AMP HTLCs, we only need to support querying by payAddr.
2021-04-07 12:08:34 -07:00
Conner Fromknecht
be6698447e
channeldb/invoice: add InvoiceRefByAddr
2021-04-07 12:08:34 -07:00
Conner Fromknecht
438b03afa4
features: define temporary AMP feature bits 30/31
2021-04-07 12:08:34 -07:00
Conner Fromknecht
c2729cbbbd
htlcswitch/hop: parse and validate AMP records
2021-04-07 12:08:33 -07:00
Conner Fromknecht
135a0a9f7f
htlcswitch/hop: make unknown required type const
...
Currently we use the AMP record type, this allows us to change it easily
as we add new known records. We also bump this to 0x0c instead of 0x0a.
2021-04-07 12:08:33 -07:00
Conner Fromknecht
82b4f11292
record/amp: use switch from 10 -> 14 for AMP TLV type
...
This is to not conflict with trampoline BOLT.
2021-04-07 12:08:33 -07:00
Conner Fromknecht
8fe4de88c1
record: convert child_index from uint16 to uint32
2021-04-07 12:08:29 -07:00
Conner Fromknecht
e2690918a0
Merge pull request #5002 from akovalenko/master
...
lncli addinvoice: allow specifying msat with --amt_msat
2021-03-17 10:03:56 -07:00
Conner Fromknecht
482ca0ddc4
Merge pull request #5068 from wpaulino/gossip-rate-limit-config
...
lncfg: expose channel update rate limiting options
2021-03-17 09:58:53 -07:00
Conner Fromknecht
b4aa661d16
Merge pull request #5064 from ellemouton/set-coop-close-target-confs
...
multi: allow setting target confs for co-op close
2021-03-16 11:14:15 -07:00
Conner Fromknecht
53c1175407
Merge pull request #5111 from yyforyongyu/fix-feature-check
...
routing: check payment.DestFeatures against nil
2021-03-16 10:01:00 -07:00
Conner Fromknecht
7e33548e8b
Merge pull request #4775 from halseth/input-tx-size-constants
...
[input/size] Check tx size constants
2021-03-10 09:23:40 -08:00
Conner Fromknecht
8c4e32012e
Merge pull request #5070 from alexbosworth/patch-14
...
trivial: match newline style
2021-03-05 12:30:20 -08:00
Conner Fromknecht
b121d1da4e
Merge pull request #5078 from carlaKC/fix-comment
...
lnrpc: correct comment on half life seconds
2021-03-05 12:29:59 -08:00
Conner Fromknecht
e7f3fe3923
Merge pull request #5074 from cfromknecht/add-invalid-onion-payload-rpc
...
lnrpc: expose INVALID_ONION_PAYLOAD via RPC
2021-03-05 09:50:47 -08:00
Conner Fromknecht
71db3a83bc
lnrpc: expose INVALID_ONION_PAYLOAD via RPC
2021-03-04 15:27:16 -08:00
Conner Fromknecht
56b61078c5
Merge pull request #4338 from cfromknecht/set-id-index
...
channeldb+invoices: add set id index for AMP
2021-03-04 12:17:08 -08:00
Conner Fromknecht
68688d6346
invoices: replace all asserts with requires
2021-03-04 10:11:22 -08:00
Conner Fromknecht
d004442efb
lnrpc+itest: expose AMP fields on InvoiceHTLC
...
We also test that legacy keysend payments are promoted to AMP payments
on the receiver-sdie by asserting basic properties of the fields
returned via the rpc.
2021-03-04 10:11:21 -08:00
Conner Fromknecht
ffddb85e9c
tlv/bench_test: fix ESatPerKw, pass reference to uint64
2021-03-04 10:02:29 -08:00
Conner Fromknecht
7cd78afd1a
tlv/bench_test: check for errors in benchmarks
2021-03-04 10:02:29 -08:00
Conner Fromknecht
137258fb58
invoices/invoiceregistry: unbundle invalid preimage error
2021-03-03 16:28:03 -08:00
Conner Fromknecht
9da3e7fc90
invoices: filter HTLC set by set id from AMP payload
2021-03-03 16:28:02 -08:00
Conner Fromknecht
5f34880040
channeldb/invoices: continue cancel loop early
2021-03-03 16:28:02 -08:00
Conner Fromknecht
fc9af92dd9
channeldb: only accept/settle non-empty HTLC sets
...
Prior to AMP, there could only be one HTLC set. Now that there can be
multiple, we introduce the inherent risk that we might be persisting a
settle/accept of the wrong HTLC set. To migitigate this risk, we add a
check to assert that an invoice can only be transitioned into an
Accepted or Settled state if the specified HTLC set is non-empty, i.e.
has accepted HTLCs.
To do this check, we unroll the loops in UpdateInvoice to first process
any added or canceled HTLCs. This ensures that the set of accepted HTLCs
is up-to-date when we got to transition the invoice into a new state, at
which point we can accurately check that the HTLC set is non-empty.
Previously this sort of check wasn't possible because a newly added HTLC
wouldn't be populated on the invoice when going to call
updateInvoiceState.
Once the invoice-level transition checks have completed, we complete a
final pass to move the HTLCs into their final states and recompute the
amount paid.
With this refactor, it is now possible to make stronger assertions
about the invoice and the state transitions being made by the
invoiceregistry before those changes are ultimately persisted.
2021-03-03 16:28:02 -08:00
Conner Fromknecht
e1b0fe5e98
channeldb/invoices: update AMP invoice htlcs
2021-03-03 16:28:02 -08:00
Conner Fromknecht
fad25f3f26
channeldb/invoices: add invoices to set id index on update
2021-03-03 16:28:01 -08:00
Conner Fromknecht
7c0d1e0093
channeldb/invoice: map zero-value timestamps to 0
...
Mainly affects ResolveTime which can be 0 before its settled.
2021-03-03 16:26:43 -08:00
Conner Fromknecht
da049ebcf7
channeldb: ensure invoices can't be added with HTLCs
2021-03-03 16:26:43 -08:00
Conner Fromknecht
b2234703f6
invoices+channeldb: add HTLCSet method to invoice
2021-03-03 16:26:43 -08:00
Conner Fromknecht
7f05c9d3bb
channeldb/invoice: persist optional AMP fields on InvoiceHTLC
2021-03-03 16:26:43 -08:00
Conner Fromknecht
464dff09ac
invoices: expose AMPRecord() method on Payload
2021-03-03 16:26:39 -08:00
Conner Fromknecht
c9ed5927f6
Merge pull request #5038 from cfromknecht/debug-unit
...
make: add unit-debug target
2021-02-19 14:01:31 -08:00
Conner Fromknecht
17489ba6a3
lntest/itest: add websocket close to error whitelist
2021-02-18 12:14:50 -08:00
Conner Fromknecht
250bc8560e
routing: avoid modifying AssumeChannelValid in unit tests
...
This produces a race condition when reading AssumeChannelValid from a
different goroutine. Instead we isolate the test cases and initial
AssumeChannelValid properly.
2021-02-17 22:43:24 -08:00
Conner Fromknecht
f7c5236bf6
routing: dial back max concurrent block fetches
...
This commit reduces the number of concurrent validation operations the
router will perform when fully validating the channel graph. Reports
from several users indicate that GetInfo would hang for several minutes,
which is believed to be caused by attempting to validate massive amounts
of channels in parallel. This commit returns the limit back to its
original state before adding the batched gossip improvements.
We keep the 1000 concurrent validation request limit for
AssumeChannelValid, since we don't fetch blocks in that case. This
allows us to still keep the performance benefits on mobile/low-resource
devices.
2021-02-17 18:17:09 -08:00
Conner Fromknecht
1c75d92929
Merge pull request #5037 from guggero/make-docker-release
...
release: fix golang version issue in docker-release and shasum issue in verification script
2021-02-17 10:45:47 -08:00
Conner Fromknecht
7f9dcc143f
make: add unit-debug target
2021-02-17 08:47:59 -08:00
Conner Fromknecht
db5af6fc14
Merge pull request #5017 from Roasbeef/default-max-parts
...
routing: if MaxShardAmt is set, then use that as a ceiling for our splits, use default of 16 for MaxParts
2021-02-16 09:43:34 -08:00
Conner Fromknecht
8c06eb57c5
Merge pull request #5026 from cfromknecht/init-mock-fee-estimator
...
htlcswitch: init mockFeeEstimator in other LinkChannelConfigs
2021-02-15 13:03:02 -08:00
Conner Fromknecht
4fcc82251e
Merge pull request #5016 from cfromknecht/extract-channel-whitelist
...
lntest: update error log whitelist
2021-02-15 12:50:33 -08:00
Conner Fromknecht
fd3dd2cfff
Merge pull request #5023 from cfromknecht/min-required-sigs-five
...
scripts/verify-install: require 5 of 7 signatures before accepting
2021-02-15 12:17:36 -08:00
Conner Fromknecht
774d29d890
htlcswitch: init mockFeeEstimator in other LinkChannelConfigs
...
If the tests don't execute quick enough, the link will try to sample the
network fee and cause a panic. This happens semi-regularly on travis.
2021-02-15 12:14:32 -08:00
Conner Fromknecht
95eadfee2f
scripts/verify-install.sh: combine final SUCCESS logs
2021-02-15 10:00:42 -08:00
Conner Fromknecht
c03f95a63b
scripts/verify-install: bump min required signatures to 5
2021-02-15 09:59:59 -08:00
Conner Fromknecht
12182d0fc9
Merge pull request #5019 from guggero/detach-sign
...
release: create and verify detached signatures, fix hashing command on MacOS
2021-02-15 09:48:17 -08:00
Conner Fromknecht
4a96c2e55a
Merge pull request #5021 from guggero/custom-binary-verify
...
scripts: allow verification of custom binary
2021-02-12 12:04:49 -08:00