Commit Graph

13343 Commits

Author SHA1 Message Date
Turtle
8d11a90d72 itest: test config option for picking particular peers 2022-04-19 12:37:44 -05:00
Turtle
747161a1f4 lnd: add config option for specifying particular peers to connect to 2022-04-19 12:37:44 -05:00
yyforyongyu
591dbb180b docs: add release note for revocation log removal 2022-04-20 01:19:41 +08:00
yyforyongyu
b288284566 channeldb: use BigSize to encode htlc amount
This commit uses bigsize record to encode the htlc amount, which could
save us 3 more bytes if the encoded value is no greater than roughly
0.043 bitcoin. The uint test has been updated with a more realistic
values to reflect the actual gain.
2022-04-20 01:19:40 +08:00
yyforyongyu
7c5daaf7c2 mod: update tlv's package version 2022-04-20 01:19:30 +08:00
yyforyongyu
22d98ca6d5 multi: use new revocation log when creating breach retribution
This commit changes the `NewBreachRetribution` to use the new revocation
log format, while maintaining the compatibilty to use an older
revocation log format. Unit tests have been added to make sure a breach
retribution can be created in both log formats.

This also means the watch tower needs to pass the relevant commit tx at
its backup height when creating the breach retribution during backing
up. This is achieved by recording the current remote commitment state
before advancing the remote commitment chain.
2022-04-20 01:18:14 +08:00
yyforyongyu
953767961e multi: use txid instead of tx in BreachRetribution
This commit replaces the field `BreachTransaction` with `BreachTxHash`
as there's no need to pass that large raw transaction.
2022-04-20 01:18:14 +08:00
yyforyongyu
37b11c4503 channeldb+lnwallet: store revocation log using the new format
This commit removes the usage of the old revocation log bucket and
starts to perform db operations using the new sub-bucket.
2022-04-20 01:18:14 +08:00
yyforyongyu
df810114cf lnwallet: add method to compute output indexes
This commit adds a new method, findOutputIndexesFromRemote to compute
the our/their output indexes. As we will see in the following commit,
saving these two fields(4+4=8 bytes) will end up saving us some disk
space.
2022-04-20 01:18:13 +08:00
yyforyongyu
a129930a95 channeldb: add unit test for revocation log 2022-04-20 01:18:13 +08:00
yyforyongyu
dc137bed8b channel: move deprecated log handling into the new file 2022-04-20 01:18:13 +08:00
yyforyongyu
c41175f233 channeldb: re-introduce revocationLogBucket
This commit adds `revocationLogBucket` using the new sub-bucket key
"revocation-log" to store the minimal info needed. Two structs,
`RevocationLog` and `HTLCEntry` are created to represent the disk
records.
2022-04-20 01:18:13 +08:00
yyforyongyu
4609ac2008 channeldb: deprecate old revocation log bucket
This commit marks the sub-bucket identified by "revocation-log-key" as
deprecated.
2022-04-20 01:18:13 +08: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
yyforyongyu
7eaf0d0089 channeldb+migration: add migration test for patching balances 2022-04-20 01:18:13 +08:00
yyforyongyu
c9843fd206 channeldb+migration: add migration to save the initial balances
This commit adds a migration to patch the newly added fields,
`InitialLocalBalance` and `InitialRemoteBalance` to channel info.
2022-04-20 01:18:12 +08:00
yyforyongyu
8b289e79f5 channeldb+migration: export commonly used methods
This commit exports several commonly used methods that can be used by
later migrations. It also adds a channel commit deserializer.
2022-04-20 01:18:12 +08:00
yyforyongyu
22f8f6ed4a channeldb+lnwallet: save initial balances during channel opening 2022-04-20 01:18:12 +08:00
yyforyongyu
291a8e4eff contractcourt: move breach handling into its own function
This commit refactors the breach handling logic into its own function
so that the related code can be unit tested.
2022-04-20 01:18:12 +08:00
yyforyongyu
9a4589d54e lnwallet: remove unused field PendingHTLCs 2022-04-20 01:18:12 +08:00
yyforyongyu
acde626ac9 lnwallet+htlcswitch: remove the redundant param in OweCommitment
This commit removes the bool param found in OweCommitment, which we
only ever use `true`.
2022-04-20 01:18:12 +08:00
yyforyongyu
fea97699ec contractcourt: remove unused bucket justice-txn
We never writes data to this bucket so it's removed.
2022-04-20 01:18:11 +08:00
yyforyongyu
5f508f9278 channeldb: replace method RevocationLogTail
This commit replaces the method RevocationLogTail which in used in our
unit test with a private method revocationLogTailCommitHeight. The new
method returns the commit height only since that's what's needed in the
test.
2022-04-20 01:18:11 +08:00
yyforyongyu
fcb314bf2c channeldb: add more verbose docs 2022-04-20 01:18:11 +08:00
Olaoluwa Osuntokun
3133154538 Merge pull request #6421 from yyforyongyu/tlv-compress
tlv: add new record type to encode `BigSize`
tlv/v1.0.3
2022-04-19 10:12:05 -07:00
Oliver Gugger
51a7566248 Merge pull request #6354 from guggero/fix-unit-tests
chainview: fix unit test timeout
2022-04-19 13:08:43 +02:00
Elle Mouton
eca2ac8a57 scripts: add gpg key for ellemouton [skip ci] 2022-04-19 11:38:04 +02:00
Oliver Gugger
3f757e56a7 docs: add release notes 2022-04-19 11:13:21 +02:00
Oliver Gugger
1c0b4fd1de chainview: increase connection timeout in test
The unit test sometimes fails with a connection timeout when trying to
connect to the reorg mining node. We attempt to make things more robust
by doubling both the number of retries as well as the retry timeout
itself.
2022-04-19 11:12:50 +02:00
Oliver Gugger
2195c71407 chainview: fix formatting 2022-04-19 11:12:49 +02:00
Oliver Gugger
b08df8437e Merge pull request #6428 from guggero/psbt-1-1-3
mod+docs: bump btcutil/psbt library to v1.1.3
2022-04-19 10:55:25 +02:00
Oliver Gugger
b6e1d2ae41 mod+docs: bump btcutil/psbt library to v1.1.3
Fixes #6386.
Bumps the btcutil/psbt library to the latest version v1.1.3 that fixes
an issue with de-serializing a PSBT that contains an unsigned
transaction with no inputs.
2022-04-19 09:45:38 +02:00
hieblmi
b1f6bc977e #4939 Add socks proxy support to lncli 2022-04-16 20:30:42 +02:00
yyforyongyu
4ddb5c586b tlv: add MakeBigSizeRecord to save space
This commit adds a pair of encoder/decoder to take the advantage of the
BigSize format when encoding an uint64 and possibly an uint32.

Often the time an uint64 value is not big enough to fill all the 8
bytes, thus using BigSize can save extra bytes when save it to db. And
for uint32, if we know most of the values do not exceed 65536, we can
also save at least 1 byte using BigSize format.

This commit introduces `MakeBigSizeRecord` that can be used optionally
where db space is a concern.
2022-04-16 12:05:23 +08:00
yyforyongyu
02d17bb81a tlv: update go mod to include require 2022-04-16 12:05:07 +08:00
Olaoluwa Osuntokun
0b20dcc4f5 Merge pull request #6414 from ellemouton/keysendFeatureBit
multi: announce Keysend feature bit
2022-04-15 16:09:04 -07:00
Elle Mouton
c54cc6e841 multi: announce Keysend feature bit
In this commit, we add the keysend feature bit to our NodeAnnouncement
if the accept-keysend option is set.
2022-04-14 14:01:19 +02:00
Olaoluwa Osuntokun
d397e3e680 Merge pull request #6340 from Roasbeef/go-1-18
build: update to Go 1.18
2022-04-13 15:02:26 -07:00
Olaoluwa Osuntokun
440f4d982c Merge pull request #5810 from bottlepay/payment-metadata
routing: send payment metadata
2022-04-13 15:01:56 -07:00
Olaoluwa Osuntokun
cd8a87c0da Merge pull request #6219 from bottlepay/onchain-interceptor
contractcourt: onchain htlc interceptor
2022-04-13 14:58:29 -07:00
Joost Jager
62ae0387ff htlcswitch+invoices: log payment metadata 2022-04-13 22:55:42 +02:00
Joost Jager
9195f29e61 routing+channeldb: send payment metadata from invoice 2022-04-13 22:55:40 +02:00
Joost Jager
135e27ddd3 zpay32: add payment metadata field 2022-04-13 22:55:38 +02:00
Oliver Gugger
044286ae2c Merge pull request #6024 from lightningriders/timepref
routing: add time preference parameter
2022-04-13 22:17:02 +02:00
Joost Jager
ba5abdc090 routing: add time_pref parameter to queryroutes and sendpayment 2022-04-13 20:26:46 +02:00
Joost Jager
269a8e74d3 routing: refactor reliability penalty calculation
Base the calculation on the actual float64 overflow point rather than an
indirect limit on probability.

This is a preparation for an infinite attempt cost.
2022-04-13 20:26:08 +02:00
Olaoluwa Osuntokun
c0d4308a23 Merge pull request #6389 from guggero/p2tr-addr-used
wallet: fix p2tr addresses not being marked as used
2022-04-13 10:32:51 -07:00
Oliver Gugger
f37ebb68ea docs: add release notes 2022-04-13 14:01:59 +02:00
Oliver Gugger
70c01e5bf1 mod: bump btcwallet to p2tr unused addr fix 2022-04-13 14:01:59 +02:00
Joost Jager
721fb4ee88 contractcourt: add onchain interception 2022-04-13 11:31:33 +02:00