Commit Graph

1088 Commits

Author SHA1 Message Date
yyforyongyu
8f472bf063
itest: refactor testChannelBalance 2022-11-17 21:06:11 +08:00
yyforyongyu
876bb5c066
itest: refactor testExportChannelBackup 2022-11-17 21:06:11 +08:00
yyforyongyu
40a5f94ef7
lntemp+itest: refactor testChannelBackupUpdates 2022-11-17 21:06:11 +08:00
yyforyongyu
4e821a6e3d
lntemp+itest: refactor testInvoiceSubscriptions 2022-11-17 21:06:11 +08:00
yyforyongyu
d260ac1ab5
itest: refactor testPaymentFollowingChannelOpen 2022-11-17 21:06:11 +08:00
yyforyongyu
e963506f7d
lntemp+itest: refactor testListPayments 2022-11-17 21:06:10 +08:00
yyforyongyu
fc9c6c426e
lntemp+itest: refactor testUpdateNodeAnnouncement 2022-11-17 21:06:10 +08:00
yyforyongyu
c990e053c6
itest: refactor testNodeAnnouncement 2022-11-17 21:06:10 +08:00
yyforyongyu
7029698c16
lntemp+itest: refactor testGraphTopologyNotifications 2022-11-17 21:06:10 +08:00
yyforyongyu
1084e32f0e
itest: refactor testUnannouncedChannels 2022-11-17 21:06:10 +08:00
yyforyongyu
a211e60936
itest: refactor testAddPeerConfig 2022-11-17 21:06:08 +08:00
yyforyongyu
cc1d5f5f8d
lntemp+itest: refactor testReconnectAfterIPChange 2022-11-17 21:05:35 +08:00
yyforyongyu
4c16e053bf
lntemp+itest: refactor testNetworkConnectionTimeout 2022-11-17 21:05:33 +08:00
yyforyongyu
6b943a042c
itest: refactor testUpdateChannelPolicyFeeRateAccuracy 2022-11-17 20:58:06 +08:00
yyforyongyu
cd7f02c866
lntemp+itest: refactor testUpdateChannelPolicyForPrivateChannel 2022-11-17 20:58:06 +08:00
yyforyongyu
b579ed72d9
lntemp+itest: refactor testSendUpdateDisableChannel 2022-11-17 20:58:06 +08:00
yyforyongyu
22f8f83412
multi: refactor testUpdateChannelPolicy 2022-11-17 20:58:05 +08:00
yyforyongyu
1d7c568fcf
lntemp+itest: refactor testBatchChanFunding 2022-11-17 20:29:52 +08:00
yyforyongyu
21097feb85
multi: refactor testFundingPersistence
This commit refactors the test `testFundingPersistence`. In addition, it
also changes the old `OpenChannelAssertPending` method and adds a new
method `OpenChannelAssertStream` for clarity.
2022-11-17 20:29:52 +08:00
yyforyongyu
6a66f3984f
lntemp+itest: refactir testUnconfirmedChannelFunding 2022-11-17 20:29:52 +08:00
yyforyongyu
6a42270ba6
itest: refactor testChannelFundingInputTypes 2022-11-17 20:29:52 +08:00
yyforyongyu
5208c501a2
itest: refactor testOnchainFundRecovery 2022-11-17 20:29:52 +08:00
yyforyongyu
b4d288cc10
lntemp+itest: refactor testGetRecoveryInfo 2022-11-17 20:29:51 +08:00
yyforyongyu
b1b989afae
lntemp+itest: refactor testAbandonChannel 2022-11-17 20:29:51 +08:00
yyforyongyu
2c12c8a77c
multi: refactor testListAddresses 2022-11-17 20:29:51 +08:00
yyforyongyu
4104a72b3a
lntemp+itest: refactor testNodeSignVerify 2022-11-17 20:29:51 +08:00
yyforyongyu
1938e42f4e
itest: refactor testRejectHTLC 2022-11-17 20:29:51 +08:00
yyforyongyu
0c8bce0c1c
itest: refactor testGarbageCollectLinkNodes 2022-11-17 20:29:51 +08:00
yyforyongyu
ba61e9edff
itest+lntemp: refactor testMaxPendingChannels 2022-11-17 20:29:51 +08:00
yyforyongyu
d1ac08b336
itest+lntemp: refactor testListChannels 2022-11-17 20:29:50 +08:00
yyforyongyu
5336c8e5f5
multi: refactor testSphinxReplayPersistence 2022-11-17 20:29:50 +08:00
yyforyongyu
f5ebaa5f35
multi: refactor testDisconnectingTargetPeer 2022-11-17 20:29:50 +08:00
yyforyongyu
d39303f246
itest: wrap assertTxLabel inside wait 2022-11-17 20:29:50 +08:00
yyforyongyu
bbe69f1bd3
multi: refactor testSweepAllCoins 2022-11-17 20:29:50 +08:00
alpeb-btc
0cae501009
lnrpc: provide hop hints when adding an invoice with no amount
With this change we allow adding hop hints when adding an invoice, even
if its amount is zero.

A couple of new unit test case have been added, and the
`testInvoiceRoutingHints` itest was expanded to account for this
scenario.
2022-11-12 05:01:10 -05:00
alpeb-btc
a96483c7d2
itest: refactor testInvoiceRoutingHints' hints check logic
Move code into new closure `checkInvoiceHints` to reuse when checking
other invoices.
2022-11-12 05:01:09 -05:00
Oliver Gugger
b3f6fe315e
itest: add test coverage for Taproot tweak key mutation 2022-11-11 10:20:09 +01:00
Oliver Gugger
e3536dd770
mod+keychain+lntest: bump btcd to version with tweak fix
This commit bumps to the latest version of btcd that fixes a key
mutation issue when signing for Taproot outputs.
2022-11-11 10:20:08 +01:00
yyforyongyu
b7816489a1
itest: add temp fix to bring back btcd build 2022-11-10 13:59:17 +08:00
Joost Jager
511fb00777
htlcswitch: add final htlc event to notifier 2022-10-27 16:42:36 +02:00
Joost Jager
b85cda2a1d
routerrpc: add htlc notifier subscribed event 2022-10-27 16:42:35 +02:00
Slyghtning
8e53996c52 itest: test ForwardingHistory peer lookup opt-in behavior 2022-10-27 07:11:20 -04:00
yyforyongyu
14f45d0722
lntemp+lntest: fix make lint 2022-10-27 01:11:35 +08:00
yyforyongyu
42eab93ba0
lntemp+lntest: use t.Cleanup to register cleanup functions 2022-10-27 01:11:34 +08:00
yyforyongyu
ab62109865
lntemp+lntest: always wait for nodes sync after mining blocks
In this commit, we introduce two mining methods, `MineBlocks` and
`MineBlocksAndAssertNumTxes`, to `HarnessTest`. These methods are
different from the miner's methods as they would 1) mine the blocks
slowly and 2) assert all active nodes have synced. The miner's methods
are kept for future tests such as mining blocks really fast and see the
behavior of `lnd`.
2022-10-27 01:11:34 +08:00
yyforyongyu
f202d27324
itest: break testChannelBackupRestore into smaller tests
This commit breaks the large `testChannelBackupRestore` into smaller
tests to take advantage of our parallel testing framework. A smaller
test also makes the debugging easier, hence better code health.
2022-10-27 01:11:34 +08:00
yyforyongyu
78de9dae05
itest: break testMultiHopHtlcClaims into smaller test cases
This commit breaks the large `testMultiHopHtlcClaims` into independent
test cases to take the advantage of parallel testing. The old setup will
put the stress of creating and syncing new blocks into a single core,
which causes a much longer test time and sometimes times out.
2022-10-27 01:11:34 +08:00
yyforyongyu
3f14ee5870
itest: fix testMultiHopHtlcRemoteChainClaim and linters
This commit makes sure the test `testMultiHopHtlcRemoteChainClaim` takes
account of the one block mined while closing the channel.
2022-10-27 01:11:34 +08:00
yyforyongyu
47279fb9af
itest: fix testMultiHopHtlcLocalChainClaim 2022-10-27 01:11:34 +08:00
yyforyongyu
4668193cfa
itest: fix testMultiHopLocalForceCloseOnChainHtlcTimeout 2022-10-27 01:11:34 +08:00
yyforyongyu
b6cc13417c
itest: move multi hop claim tests into one file 2022-10-27 01:11:33 +08:00
yyforyongyu
c3bc4d403c
itest: reduce blocks mined to save sync time 2022-10-27 01:11:33 +08:00
yyforyongyu
b463147595
itest: refactor testMultiHopHtlcAggregation 2022-10-27 01:11:33 +08:00
yyforyongyu
0115ec8719
itest: refactor testMultiHopHtlcRemoteChainClaim 2022-10-27 01:11:33 +08:00
yyforyongyu
200796b8e2
itest: refactor testMultiHopHtlcLocalChainClaim 2022-10-27 01:11:33 +08:00
yyforyongyu
f65002255c
itest: refactor testMultiHopRemoteForceCloseOnChainHtlcTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
6b5f4f407c
itest: refactor testMultiHopLocalForceCloseOnChainHtlcTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
d51f98efc6
itest: refactor testMultiHopReceiverChainClaim 2022-10-27 01:11:32 +08:00
yyforyongyu
5a7c6cea02
lntest+lntemp: refactor testMultiHopHtlcLocalTimeout 2022-10-27 01:11:32 +08:00
yyforyongyu
4a7f45b5d4
itest+lntemp: refactor testMultiHopHtlcClaims 2022-10-27 01:11:32 +08:00
yyforyongyu
e629a3b45a
itest: deprecate createThreeHopNetwork 2022-10-27 01:11:32 +08:00
yyforyongyu
36c84bbd43
itest: refactor testDataLossProtection 2022-10-27 01:11:32 +08:00
yyforyongyu
1fafabe012
itest: move testDataLossProtection to backup test file 2022-10-27 01:11:31 +08:00
yyforyongyu
8cd5a9b6b1
itest: refactor testChannelBackupRestore 2022-10-27 01:11:31 +08:00
yyforyongyu
2966773018
lntemp: add more assertions and supporting methods 2022-10-27 01:11:31 +08:00
yyforyongyu
1b741cb6cc
itest: refactor testExternalFundingChanPoint 2022-10-27 01:11:30 +08:00
yyforyongyu
773cc8e295
itest: refactor testBasicChannelFunding
The test `testExternalFundingChanPoint` is commented out and will be put
back in the following commit.
2022-10-27 01:11:30 +08:00
yyforyongyu
85210b947f
itest: deprecate deriveFundingShim 2022-10-27 01:11:30 +08:00
Slyghtning
85f0ec2954 itest: check peer alias in ForwardingHistory 2022-10-20 09:23:50 -04:00
yyforyongyu
353b744039
lntemp+itest: create interface WebFeeService
This commit adds a new interface, `WebFeeService`, so external projects
can create their own mocked fee services.
2022-10-14 15:45:25 +08:00
yyforyongyu
9d79e76876
itest: timeout while waiting for predicate result
This commit sends the returned value of pred() inside a goroutine such
that when a predicate function never returns during the first run, the
wait package can timeout properly.
2022-10-14 15:45:24 +08:00
yyforyongyu
2ab842c645
itest: refactor test testUpdateChanStatus 2022-10-14 15:45:24 +08:00
yyforyongyu
1350f76627
itest: add a new test entry point to run the temp tests
This commit adds a new function, `TestLightningNetworkDaemonTemp`, to
run the new tests.
2022-10-14 15:45:24 +08:00
yyforyongyu
cd5ab844e2
lntest: export flag logoutput
This commit temporarily exports the flag `logoutput` so it can be used
by `lntemp`.
2022-10-14 07:25:29 +08:00
yyforyongyu
55f8a621ae
lntest+github: add flag temptest to run tests separately
This commit adds a new flag `temptest` so we can run new and old tests
separately. This flag will be removed once the migration from old tests
to new tests is finished.
2022-10-14 07:25:28 +08:00
Olaoluwa Osuntokun
2482de9cab
lnwallet/chancloser: properly compute initial fee of cop close txn
In this commit, we modify the way we compute the starting ideal fee for
the co-op close transaction. Before thsi commit, channel.CalcFee was
used, which'll compute the fee based on the commitment transaction
itself, rathern than the co-op close transaction. As the co-op close
transaction is potentailly bigger (two P2TR outputs) than the commitment
transaction, this can cause us to under estimate the fee, which can
result in the fee rate being too low to propagate.

To remedy this, we now compute a fee estimate from scratch, based on the
delivery fees of the two parties.

We also add a bug fix in the chancloser unit tests that wasn't caught
due to loop variable shadowing.

The wallet import itest has been updated as well, since we'll now pay
600 extra saothis to close the channel, since we're accounting for the
added weight of the P2TR outputs.

Fixes #6953
2022-10-10 14:50:45 -07:00
Slyghtning
41822a8baf itest: openchannel fee scenarios 2022-09-29 08:31:47 -04:00
Olaoluwa Osuntokun
d062a5263e
build: update to latest version of btcwallet w/ taproot estimation fix
Fixes https://github.com/lightningnetwork/lnd/issues/6873
2022-09-27 11:24:39 -07:00
Jesse de Wit
4bc3007668
lntest: add trackpayments itest
Add an itest for the new TrackPayments api.
2022-09-08 10:48:34 +02:00
Oliver Gugger
c45d0f6b07
itest: add integration tests for tapscript import
We add basic integration test coverage for importing Tapscript
addresses. Note that FundPsbt is not supported with those types of
imported keys, so we need to manually fill in all information in the
PSBT to be able to sweep the funds again.
2022-08-25 09:21:52 +02:00
Oliver Gugger
0d6e791042
lntest+lnwallet: add ImportTaprootScript to wallet interface 2022-08-25 09:20:23 +02:00
Oliver Gugger
3a66a09d9d
itest: test BIP-0086 Taproot account+pubkey import 2022-08-25 09:20:23 +02:00
Eng Zer Jun
ca5c695526
lntest/itest: use T.TempDir to create temporary test directory
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-08-24 09:03:04 +08:00
yyforyongyu
0735522194
multi: fix make fmt 2022-08-23 22:10:24 +08:00
priyanshiiit
3105d6a2ec lntest: adds test for list addresses 2022-08-18 08:09:16 +05:30
priyanshiiit
99e4728eb7 lnwallet: adds list addresses method 2022-08-18 07:58:24 +05:30
Slyghtning
b2e624cd52 psbt: Indicate which psbt inputs were signed 2022-08-16 19:31:06 -04:00
eugene
48912560e2
lntest: update zero-conf tests to account for zeroconfacceptor 2022-08-12 16:36:17 -04:00
Olaoluwa Osuntokun
3bf2790e21
lntest/itest: add new itest to cover taproot co-op close 2022-08-10 18:44:39 -07:00
Oliver Gugger
17014b592e
Merge pull request #6730 from Roasbeef/notifier-optional-block
chainntfns: add new option for conf notifications to send block
2022-08-10 13:52:49 +02:00
eugene
6ec2826f6c
sweep: account for all script types in craftSweepTx
With this change, transactions created via craftSweepTx will be
standard. Previously, p2wsh/p2pkh scripts passed in via SendCoins would
be weighted as p2wpkh scripts. With a feerate of 1 sat/vbyte,
transactions returned would be non-standard. Luckily, the critical
sweeper subsystem only used p2wpkh scripts so this only affected
callers from the rpcserver.

Also added is an integration test that fails if SendCoins manages
to generate a non-standard transaction. All script types are now
accounted for in getWeightEstimate, which now errors if an unknown
script type is passed in.
2022-08-08 15:33:00 -04:00
Olaoluwa Osuntokun
89dc75cd90
lntest/itest: add test case for conf ntfn w/ block
In this commit, we add a test case to exercise the fact that if we
request a confirmation notification with the raw block, then it includes
one. We add this to the existing test that uses the conf ntfn rpc call
for simplicity.
2022-08-01 19:59:33 -07:00
Olaoluwa Osuntokun
08f1c2e93a
chainntfns: add new option for conf notifications to send block
In this commit, we add a new option for the existing confirmation
notification system that optionally allows the caller to specify that a
block should be included as well.

The only quirk w/ the implementation here is the neutrino backend:
usually we get filtered blocks, we so need to first fetch the block
again so we can deliver the full block to the notifier. On the notifier
end, it'll only be checking for the transactions we care about, to
sending a full block doesn't affect the correctness.

We also extend the `testBatchConfirmationNotification` test to assert
that a block is only included if the caller specifies it.
2022-08-01 19:59:21 -07:00
Olaoluwa Osuntokun
fec8fd9c63
Merge pull request #6754 from ellemouton/ensureRpcRegistrationOrder
multi: synchronous rpc middleware registration
2022-07-26 19:05:30 -05:00
Elle Mouton
25acb51ba3
multi: registration complete MW interceptor msg
In this commit, we change the flow of the rpc middleware registration
a bit. In order to allow a client to add rpc middleware interceptors in
a deterministic order, we now make the server send a "registration
complete" message to the client after compeleting the registration
process so that the client knows when it can go ahead and register the
next client.
2022-07-20 14:58:47 -05:00
Matt Morehouse
7a05f07634
itest: fix sign_psbt failure
Ensure the wallet has synced the blockchain before attempting to spend
funds.

Prior to this fix, I get the following error:
  rpc error: code = Unknown desc = wallet couldn't fund PSBT: error
      creating funding TX: insufficient funds available to construct
      transaction
2022-07-19 12:41:34 -05:00
ErikEk
14453ea7db
itest: cover sign and verify msg 2022-07-14 10:29:29 +02:00
ErikEk
b5af0ce327
signrpc: add schnorr sig to sign and validate msg 2022-07-14 10:29:29 +02:00
Oliver Gugger
9774db614b
itest: add integration test for error interception 2022-07-14 09:36:50 +02:00
Oliver Gugger
e1efb39177
itest: add integration test for request replacement 2022-07-14 09:36:50 +02:00
Oliver Gugger
989648b7ec
itest: fix timeout in sign_psbt test 2022-07-08 16:08:21 +02:00
Oliver Gugger
6980a18ab1
Merge pull request #6712 from Roasbeef/itest-keep-failed-payments
lntest: keep all failed payments by default for HarnessNode
2022-07-08 14:31:37 +02:00
Olaoluwa Osuntokun
2a18263336
lntest: keep all failed payments by default for HarnessNode
In this commit, we fix a detected flake: we go to make a payment, and
then want to assert that 2 attempts we required. The existing logic
assumes that the success and the payment will still be on disk. With a
recent PR, we now delete failed payments by default, but after the fact,
in a non-atomic fashion.

We fix this issue simply by having all the nodes keep around failed
payments for the sake of all the old itests that assumed this
information would always be on disk.

Introduced in: https://github.com/lightningnetwork/lnd/pull/6438.

Fixes https://github.com/lightningnetwork/lnd/issues/6711.
2022-07-07 19:28:30 -07:00
eugene
5e0a2d3f92
itest: zero-conf, scid-alias channel-type integration tests 2022-07-07 17:10:30 -04:00
eugene
49dd4b9e34
multi: add zero-conf, scid-alias channel-types to rpc
This allows the open channel rpcs to use the zero-conf or scid-alias
channel types.
2022-07-07 17:10:30 -04:00
Oliver Gugger
3af42eede9
Merge pull request #6687 from guggero/sign-psbt-np2wkh
walletrpc: Fix SignPsbt for NP2WKH inputs
2022-06-30 12:18:12 +02:00
Oliver Gugger
bb3cec6b12
itest: add test for FundPsbt->SignPsbt|FinalizePsbt flow 2022-06-30 10:27:39 +02:00
Oliver Gugger
9d339f0fe2
Merge pull request #6680 from guggero/compute-input-script
Taproot: Fix p2tr support in `ComputeInputScript`
2022-06-30 10:11:11 +02:00
eugene
a7f5b89cf3
itest: update switch delivery tests with more robust reconnect logic 2022-06-29 13:50:03 -04:00
Oliver Gugger
825ff22eec
itest: add itest for p2tr via ComputeInputScript 2022-06-29 18:29:00 +02:00
Oliver Gugger
6ee4c533f4
itest: fix incorrect naming 2022-06-29 18:29:00 +02:00
Oliver Gugger
21f69192be
itest: rename too specific variables 2022-06-29 18:29:00 +02:00
priyanshiiit
ec9cebea34 lntest: adds check for reserve 2022-06-28 23:31:51 +05:30
priyanshiiit
150c0b5de8 lnwallet: adds RequiredReserve method 2022-06-28 23:31:51 +05:30
priyanshiiit
f6d21d9b1b lntest: adds test for previous outpoints 2022-06-27 16:00:40 +05:30
yyforyongyu
6b34ebbe44
rpcserver: fix wrong unit used in PushAmountSat 2022-05-16 05:49:05 +08:00
Oliver Gugger
70103a1838
multi: return more information in list of leased outputs
With this commit we return the additional information the wallet now
provides about locked/leased outputs.
2022-05-12 10:24:40 +02:00
Oliver Gugger
6c495c1bbe
itest: add Taproot PSBT signing tests 2022-05-11 10:07:51 +02:00
Oliver Gugger
fe30b9e987
itest: refactor PSBT signing itest 2022-05-11 10:07:51 +02:00
Oliver Gugger
d1a151010a
lntest+rpcwallet: support remote p2tr script spend signing 2022-05-11 10:07:51 +02:00
Oliver Gugger
7f4e977073
lntest+rpcwallet: support remote p2tr key spend signing 2022-05-11 10:07:50 +02:00
Olaoluwa Osuntokun
630fc36dcf
multi: introduce and use new TapTweak and SignMethod fields
In this commit, we add a new field `TapTweak` to be used for key path
spends. Before this commit, we'd overload the existing `WitnessScript`
field to pass this information to the signing context. This was
confusing as for tapscript spends, this was the leaf script, which
mirrors the other script based spending types.

With this new filed, users need to set this to the script root for
keypath spends where the output key commits to a real merkle root, and
nothing when bip 86 spending is being used.

To make the signing even more explicit, we also add a new field called
sign_method with an enum type that differentiates between the different
segwit v0 and v1 signing methods.

Fixes https://github.com/lightningnetwork/lnd/issues/6446.
2022-05-11 10:07:49 +02:00
Elle Mouton
e789107e1f
multi: new bitcoind rpcpolling backend for itests 2022-05-11 09:02:13 +02:00
Oliver Gugger
4fd43b4afe
itest: add new funding test with all input types 2022-05-10 20:35:28 +02:00
Oliver Gugger
fd7fe2ae5a
itest: use SendCoinsUnconfirmed in funding test 2022-05-10 18:39:45 +02:00
Oliver Gugger
e27a9fec66
lntest: rename sendCoins to SendCoinsOfType 2022-05-10 18:31:18 +02:00
Oliver Gugger
5d8fba6810
Merge pull request #6502 from bhandras/musig-fix
signer: fix crash in `MuSig2Combine` when the final signature isn't ready
2022-05-06 13:24:27 +02:00
Andras Banki-Horvath
ddf0571031
itest: cover musig2 combine without all signatures ready 2022-05-06 12:29:32 +02:00
Olaoluwa Osuntokun
0ec88b5346
Merge pull request #6347 from yyforyongyu/5388-rm-revc-log
lnwallet+channeldb: store minimal info in revocation log bucket
2022-05-05 15:52:59 -07:00
Oliver Gugger
52e42fc107
lnrpc+itest: implement MuSig2Cleanup RPC 2022-05-04 19:23:58 +02:00
Oliver Gugger
95ff670c0e
multi: add MuSig2Cleanup method to MuSig2 signer 2022-05-04 19:23:58 +02:00
eugene
f7b3da4bb2
htlcswitch+lntest: modify Switch to persist resolution messages
Include unit tests for the Switch, and integration tests that
exercise the persistence logic.
2022-04-29 16:40:19 -04:00
Oliver Gugger
63e93ae572
itest: add taproot SignOutputRaw Bip86 signing test 2022-04-29 11:42:46 +02:00
Oliver Gugger
3ba6421d5c
itest: add MuSig2 end-to-end tests 2022-04-29 11:42:43 +02:00
Oliver Gugger
e31aab5af6
multi: fix inclusion proof size
The inclusion proof field in the TapscriptPartialReveal function was
incorrect. An inclusion proof can be zero or more elements of 32-byte
slices. So an empty inclusion proof can be valid too for a tree that
only consists of a single leaf.
2022-04-29 11:41:09 +02:00
Oliver Gugger
f7275c7fc4
multi: implement MuSig2 RPCs and remote signing 2022-04-29 11:41:09 +02:00
Oliver Gugger
fee2b28d1b
itest: refactor taproot test 2022-04-29 11:41:05 +02:00
Turtle
8d11a90d72 itest: test config option for picking particular peers 2022-04-19 12:37:44 -05:00
yyforyongyu
f42d1f2d62
multi: remove function BalancesAtHeight
This commit deletes the function `BalancesAtHeight` since its only
usague is to find the push amount, which can be achieved by saving the
initial balances.
Another reason to remove it is to pave the way to incooperate our new
revocation log. If we ever need this function again, we can add it back
by visiting all the revocation logs to calculate the balances at a given
height.
2022-04-20 01:18:13 +08:00
Oliver Gugger
1e72d6737d
lnrpc+itest: fix panic with missing UTXO info
Fixes #6396.
This commit fixes a panic that occurred when trying to sign for a
Taproot output without specifying the full UTXO information for each
input. Instead of panicking an error is now returned.
2022-04-12 19:30:12 +02:00
positiveblue
ae2aa5671f
lnrpc/peers: handle feature bit changes in updateNodeAnnouncement 2022-04-02 19:10:25 -07:00
positiveblue
76196db70e
lnrpc/peers: handle net address changes in updateNodeAnnouncement 2022-04-02 19:09:10 -07:00
positiveblue
aacb2565f5
lnrpc/peers: handle color changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
ce4813940d
lnrpc/peers: handle alias changes in updateNodeAnnouncement 2022-04-01 18:36:26 -07:00
positiveblue
e4e0935816
lnrpc/peers: skeleton logic for updateNodeAnnouncement
Basic logic for the endpoint:

- Get the current nodeAnn information
- Calculate modifications
- Apply modifications
- Return changes
2022-04-01 18:36:21 -07:00
Oliver Gugger
3b5585c12b
multi: fix and test v1 output spend ntfns
Because Taproot key spend only spends don't allow us to re-construct the
spent pkScript from the witness alone, we cannot support registering
spend notifications for v1 pkScripts only. We instead require the
outpoint to be specified. This commit makes it possible to only match by
outpoint and also adds an itest for it.
2022-03-24 18:02:40 +01:00
Oliver Gugger
ef98f2df8a
multi: add p2tr tapscript key path signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
78db46be7e
multi: add p2tr tapscript signing capabilities 2022-03-24 18:02:39 +01:00
Oliver Gugger
5109c55721
itest: assert P2TR on-chain fund recovery 2022-03-24 18:02:38 +01:00
Oliver Gugger
c73cf03a55
multi: add p2tr keyspend wallet support 2022-03-24 18:02:38 +01:00
Oliver Gugger
0dcaa511a2
Merge pull request #6341 from guggero/remote-signer-signoutputraw
remote signer: fix SignOutputRaw RPC for incomplete key info, fix healthcheck connection leak
2022-03-24 14:59:38 +01:00
Oliver Gugger
42b0aa9a8e
rpcwallet+itest: fix incomplete key info problem
Fixes an issue with SignOutputRaw in remote signing mode where we
weren't able to sign on the remote signer if we only provided the public
key or only the family/index (and not both).

Fixes part of an issue detected in lightninglabs/loop#457.
2022-03-24 14:13:05 +01:00
Oliver Gugger
efa36ce8f2
lntest+lnwallet: add AddressInfo to WalletController
We need to be able to query the watch-only wallet about a public key
when trying to sign with a key that we don't know the family or index
of. The easiest way to do that is to leverage the wallet's address index
to query the derivation path for a public key.
To give the RPC wallet access to that functionality, we need to expose
the method on the WalletController interface.
2022-03-24 14:13:05 +01:00
Oliver Gugger
e86a0ba197
itest: add new test for SignOutputRaw RPC 2022-03-24 14:13:04 +01:00
Liviu
57cb9d09da itest: fix node shutdown in interceptor itests 2022-03-23 19:45:45 -07:00
Andras Banki-Horvath
0e4d7cf143
itest: make use of session ttl in failover test 2022-03-22 14:20:40 +01:00
Olaoluwa Osuntokun
e5625878e9
lntest/itest: add new itest for 3rd party anchor spends
In this commit, we add a new integration tests to exercise the fix
introduced in the prior commit. In this test, we reconstruct a scenario
for a 3rd party to sweep an anchor spend after force closing, causing a
prior spend we had to be invalidated. Without the prior commit, this test
fails as the original anchor sweep is still found in the wallet.
2022-03-17 16:36:49 -07:00
Olaoluwa Osuntokun
e1e9de24df
sweep: remove all unconfirmed descendant transactions when a sweep conflicts
Before this commit, we we were trying to sweep an anchor output, and
that output was spent by someone else (not the sweeper), then we would
report this back to the original resolver (allowing it to be cleaned
up), and also remove the set of inputs spent by that transaction from
the set we need to sweep.

However, it's possible that if a user is spending unconfirmed outputs,
then the wallet is holding onto an invalid transaction, as the outputs
that were used as inputs have been double spent elsewhere.

In this commit, we fix this issue by recursively removing all descendant
transactions of our past sweeps that have an intersecting input set as
the spending transaction. In cases where a user spent an unconfirmed
output to funding a channel, and that output was a descendant of the now
swept anchor output, the funds will now properly be marked as available.

Fixes #6241
2022-03-17 16:36:47 -07:00
Oliver Gugger
7dfe4018ce
multi: use btcd's btcec/v2 and btcutil modules
This commit was previously split into the following parts to ease
review:
 - 2d746f68: replace imports
 - 4008f0fd: use ecdsa.Signature
 - 849e33d1: remove btcec.S256()
 - b8f6ebbd: use v2 library correctly
 - fa80bca9: bump go modules
2022-03-09 19:02:37 +01:00
yyforyongyu
e4d9551a6a
itest: check feeService against nil upon shutdown [skip ci] 2022-02-22 13:16:06 +08:00
Oliver Gugger
13f187046b
multi: fix issues reported by whitespace linter 2022-02-15 16:26:08 +01:00
Oliver Gugger
895a2e497b
multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
Oliver Gugger
ffee7d1bcf
multi: fix newly detected linter issues 2022-02-10 11:02:02 +01:00
Oliver Gugger
dfdc2bff8b
multi: run gosimports 2022-02-10 11:02:01 +01:00
carla
4ac6f82b5e
itest: fix lack of hop hint coverage in hold invoice test
Update our test to assert that we have hop hints present when we
expect them, and fix the "alice is a private node" issue that was
previously preventing us from adding hop hints. Asserting that we
have hop hints present in this itest ensures that we'll fail our
itests if a change to SelectHopHints results in our no longer
having hints in this secnario.
2022-02-07 09:03:09 +02:00
Oliver Gugger
8d3d8580f9
Merge pull request #6197 from carlaKC/itest-policy-ensureconnected
lntest/test: ensure nodes connected before disconnecting
2022-01-27 13:20:13 +01:00
Oliver Gugger
bc3319a7d2
lntest: set --lnddir instead of --datadir
If we only set the --datadir flag then lnd will create empty directories
(for letsencrypt and watchtower client) in the default user's home .lnd
directory and will also pick up a config file from there if one exists.
To instruct lnd to only act within the temp itest directory, we need to
use the --lnddir flag instead.
Using the --lnddir flag also overwrites the TLS cert/key path and the
log dir, so we don't need to explicitly set those anymore.
But we need to make sure the node's variables point to the correct
default files/directories.
2022-01-26 11:37:10 +01:00
Andras Banki-Horvath
9591e058ea itest: add test for the channel policy fee rate round down bug 2022-01-25 15:58:43 -08:00
carla
5e8f86a9b6
lntest/test: ensure nodes connected before disconnecting [skip ci] 2022-01-25 14:42:11 +02:00
Olaoluwa Osuntokun
234fdc6c9c
Merge pull request #6185 from sangaman/rpc-middleware-custom-caveat
rpcperms: set CustomCaveatCondition on middleware req
2022-01-24 15:45:49 -08:00
Daniel McNally
4a573b18cf
rpcperms: set CustomCaveatCondition on middleware req
This sets the `CustomCaveatCondition` value on rpc middleware requests
if one exists. Previously, this value was always blank even if the
macaroon had a value set for its custom caveat condition.
2022-01-24 11:39:07 -05:00
Oliver Gugger
1482e5e20a
Merge pull request #6156 from rex4539/typos
multi: Fix typos
2022-01-24 13:24:49 +01:00
Dimitris Apostolou
530a2059e5
multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
zdebra
6baf7af79e itest: fix documentation for LookupNodeByPub [skip ci] 2022-01-23 18:00:24 +01:00
naveen
87a0e52464
multi: Removed deprecated interfacer linter
Removed the deprecated interfacer linter from being called for linting.

Also removed the `nolint:interfacer` within the code.

https://github.com/lightningnetwork/lnd/issues/5741
2022-01-11 14:08:18 +01:00
naveen
545e84f4ce
multi: formatting changes 2022-01-11 14:08:17 +01:00
MrManPew
0f167fd03e
config: better error message if config file doesn't exist 2022-01-11 14:08:17 +01:00
Harsha Goli
baf6977948
Revert "lntest: export attributes of type BitcoindBackendConfig"
[skip ci]

This reverts commit eccf20c5b2.
2022-01-10 14:49:29 -05:00
Harsha Goli
69ae56ad5c
lntest: surface bitcoin backend rpc credentials
[skip ci]
2022-01-10 14:49:10 -05:00
Olaoluwa Osuntokun
fd63301dc5
Merge pull request #6006 from guggero/remote-signer-no-chain
Allow remote signer to run without chain backend
2022-01-07 17:37:16 -08:00
Oliver Gugger
afc53d1c52
lnwallet: initialize first 255 accounts
This fixes lightninglabs/loop#437 by adding all accounts that are used
in liquidity products such as Loop or Pool. Since both of these products
use key families below 255, we can get by with that number.
The alternative to creating way too many accounts (which increases the
default wallet size by ~250kB) would be to hard code the exact accounts
used by Loop (99) and Pool (210). But that sounds like a bad idea given
that there could always be more accounts being added to those (or other)
products. By making sure the first 255 accounts exist, we have a lot
more flexibility in those products for choosing key families.
2022-01-06 14:35:26 +01:00
Oliver Gugger
3d353a9879
config_builder+rpcwallet: simplify RPC signing
With the remote signing instance now not needing to know anything about
addresses or current derivation indices, we don't need to forward any
such calls to that instance and can simplify the RPCKeyRing
considerably.
2022-01-06 14:35:24 +01:00
Oliver Gugger
8994d86a1d
walletrpc+itest: add SignPsbt RPC 2022-01-06 14:35:07 +01:00
Oliver Gugger
d135b638f6
btcwallet: add SignPsbt 2022-01-06 13:24:32 +01:00
Oliver Gugger
8c77829c46
lnwallet+lntest+mod: bump btcwallet to export ScriptForOutput 2022-01-06 13:24:30 +01:00
Oliver Gugger
9da8333a6e
multi: fix formatting 2022-01-06 13:24:30 +01:00
Oliver Gugger
5401b12402
lntest: export base node config for re-use 2022-01-06 12:58:27 +01:00
Oliver Gugger
8c3f2eaba0
lntest: export ListenerFormat constant 2022-01-06 12:57:27 +01:00
Oliver Gugger
5afe7852b5
lntest: fix colliding variable name
The variable name "bytes" collides with an imported package name, so we
rename it to avoid shadowing.
2022-01-06 12:57:27 +01:00
Oliver Gugger
10d876ae98
itest: fix RPC middleware itest 2022-01-06 15:01:02 +08:00
yyforyongyu
587273174e
itest: start using harness miner in harness net
This commit replaces the old miner with the new HarnessMiner and cleans
harness_node.go by moving methods into the test_common.go.
2022-01-05 13:10:06 +08:00
yyforyongyu
337aa6670b
itest: introduce harness miner
This commit adds a new component, harness miner, to the itest. This
newly added component is responsible for checking the mempool and blocks
for the itest.
2022-01-05 13:10:06 +08:00
yyforyongyu
61d6f5da11
itest: refactor initClientWhenReady to clean up init node 2022-01-05 13:10:05 +08:00
yyforyongyu
75da5cabc8
itest: add method waitTillServerState in harness node 2022-01-05 13:10:05 +08:00
yyforyongyu
f5f1289dab
itest: use node.rpc namespace inside harness net
This commit adds a new struct RPCClients to better handle rpc clients.
A private field, rpc, is added to HarnessNode to prevent direct access
to its clients. Inside RPCClients, all clients are exported in case a
test case need access to a specific client.
2022-01-05 13:10:05 +08:00
yyforyongyu
f8cf7c8775
itest: shorten functions inside harness node
This commit refactors the long function start() into smaller pieces and
moves commonly used functions into test_common.go.
2022-01-05 13:10:05 +08:00
Martin Habovstiak
2b3b70d40b test: don't enforce reserved value in PSBT midstep
This adds an integration test that makes sure channel can be funded from
empty wallet using PSBT if the funding transaction contains an output
belonging to the wallet, satisfying the reserve.
2021-12-10 00:22:17 +01:00
Oliver Gugger
c75c3bd847
Merge pull request #5756 from yyforyongyu/itest-1-run-ctx
itest: refactor context management inside harness node and net
2021-12-07 13:14:27 +01:00
yyforyongyu
05ac516762
itest: replace fakeLogger with v2 logger with Discard 2021-12-04 14:54:37 +08:00
yyforyongyu
403fdaa716
itest: use run context when making rpc requests 2021-12-04 14:54:37 +08:00