1185 Commits

Author SHA1 Message Date
Elle Mouton
c248f60cbd
channeldb: Update ChanUpdatesInHorizon
So that a start block and end block can also be passed in.
2024-09-02 14:12:44 +02:00
Elle Mouton
43de450156
routing: update to use lnwire.ChannelUpdate interface 2024-09-02 14:12:43 +02:00
Elle Mouton
c0b66d76df
channeldb: prep waiting proof store for taproot proofs
With a migration to migrate existing entries in the waiting proof store
to use a type byte prefix.
2024-09-02 14:12:42 +02:00
Elle Mouton
2a4f36397d
multi: use ChannelEdgePolicy interface where possible 2024-09-02 14:12:42 +02:00
Elle Mouton
1763517287
multi: updates to HasChannelPolicy 2024-09-02 14:12:42 +02:00
Elle Mouton
135888d0c7
channeldb: write to new update index for ChannelEdgePolicy2 2024-09-02 14:12:41 +02:00
Elle Mouton
b6410bf65d
channeldb: update reject cache
To take block heights too.
2024-09-02 14:12:41 +02:00
Elle Mouton
84abc0a311
multi: use models.ChannelEdgeInfo throughout 2024-09-02 14:12:41 +02:00
Elle Mouton
fe595b18ec
channeldb: update GraphCache to use interfaces where possible
Update the graph cache to use the new ChannelEdgePolicy and
ChannelEdgeInfo interfaces where possible.
2024-09-02 12:47:21 +02:00
Elle Mouton
674ff32a60
routing+channeldb: update CachedEdgePolicy
In preparation for CachedEdgePolicy being used to represent
ChannelEdgePolicy1 or ChannelEdgePolicy2, we update it to have
IsDisabled and HasMaxHTLC booleans (which can be extracted from both
messages) instead of having the MessageFlags and ChannelFlags which only
applies to ChannelEdgePolicy1.
2024-09-02 12:47:21 +02:00
Elle Mouton
18445db7fa
channeldb: add encoding for ChannelEdgePolicy2
Similarly to the previous commit, here we add the encoding for the new
ChannelEdgePolicy2. This is done in the same was as for
ChannelEdgeInfo2:
- a 0xff prefix
- followed by a type-byte
- followed by the TLV encoding of the ChannelEdgePolicy2.
2024-09-02 12:45:22 +02:00
Elle Mouton
7c9b38bcc6
channeldb: add encoding for ChannelEdgeInfo2
In this commit, we update the `putChanEdgeInfo` function to take in the
models.ChannelEdgeInfo interface. If the passed value is the legacy
models.ChannelEdgeInfo1, then the encoding and decoding remains the same
but if it is the new models.ChannelEdgeInfo2 then:
- the encoding will be prefixed with a 0xff byte. This should not clash
  with the encoding of the legacy struct since that encoding will always
  start with a pub key (of node 1) which means it will always start with
  0x02 or 0x03.
- The 0xff is then followed by a type-byte which will be used to
  identify the encoding that follows (this is to make it future proof).
  For now, there is only one possible type-byte here.
- This is then followed by the TLV encoding of ChannelEdgeInfo2.
2024-09-02 12:45:22 +02:00
Elle Mouton
de799f2525
channeldb+refactor: move ser/deser funcs to separate files
This commit moves the serialisation, deserialisation and update
functions for ChannelEdgePolicy1 and ChannelEdgeInfo1 into their own
files.
2024-09-02 12:45:22 +02:00
Elle Mouton
d3a88547a3
channeldb: add ChannelEdgePolicy2
And ensure that it implements the ChannelEdgePoicy interface.
2024-09-02 12:45:21 +02:00
Elle Mouton
66aa12bc13
channeldb: add ChannelEdgeInfo2
And ensure that it implements the ChannelEdgeInfo interface.
2024-09-02 12:45:21 +02:00
Elle Mouton
2f8b1c12f8
channeldb: add ChannelAuthProof2 2024-09-02 12:45:21 +02:00
Elle Mouton
9a167fcf1c
channeldb: add ChannelEdgePolicy interface
And ensure that ChannelEdgePolicy1 implements it.
2024-09-02 12:45:21 +02:00
Elle Mouton
81418fe473
channeldb: add ChanneEdgeInfo and ChannelAuthProof interfaces
Add new ChannelEdgeInfo and ChannelAuthProof interfaces and ensure that
they are implemented by ChannelEdgeInfo1 and ChannelAuthProof
respectively.
2024-09-02 12:45:21 +02:00
Elle Mouton
ec332086cd
multi: rename ChannelEdgeInfo
In preparaion for adding ChannelEdgeInfo2 and a ChannelEdgeInfo
interface, rename ChannelEdgeInfo to ChannelEdgeInfo1.
2024-09-02 12:40:02 +02:00
Elle Mouton
8ac489d9bb
multi: rename ChannelEdgePolicy
In preparation for the addition of ChannelEdgePolicy2 and a
ChannelEdgePolicy interface, rename ChannelEdgePolicy to
ChannelEdgePolicy1.
2024-09-02 12:40:02 +02:00
Elle Mouton
70ec8ca2a5
multi: rename ChannelAuthProof
To prepare for the addition of ChannelAuthProof2 along with a
ChannelAuthProof interface, rename ChannelAuthProof to
ChannelAuthProof1.
2024-09-02 12:40:02 +02:00
Elle Mouton
ab70c4c269
multi: rename AnnounceSignatures to AnnounceSignatures1
In preparation for adding a new message, AnnounceSignatures2 along with
an AnnounceSignatures interface, we rename the existing message to
AnnounceSignatures1.
2024-09-02 11:59:25 +02:00
Olaoluwa Osuntokun
2510c19024
channeldb: add HtlcIndex to HTLCEntry
This may be useful for custom channel types that base everything off the index (a global value) rather than the output index (can change with each state).
2024-08-28 13:24:04 +02:00
Olaoluwa Osuntokun
669740c84e
channeldb: add custom blobs to RevocationLog+HTLCEntry
This'll be useful for custom channel types that want to store extra information that'll be useful to help handle channel revocation cases.
2024-08-28 13:23:30 +02:00
Olaoluwa Osuntokun
61f276856a
channeldb: convert RevocationLog to use RecordT 2024-08-28 13:22:48 +02:00
Olaoluwa Osuntokun
1b1e7a6168
channeldb: convert HTLCEntry to use tlv.RecordT 2024-08-28 13:21:46 +02:00
Olaoluwa Osuntokun
c1e641e9d9
lnwallet: add TLV blob to PaymentDescriptor + htlc add
In this commit, we add a TLV blob to the PaymentDescriptor struct. We also now thread through this value from the UpdateAddHTLC message to the PaymentDescriptor mapping, and the other way around.
2024-08-28 13:21:12 +02:00
Olaoluwa Osuntokun
5c4428c3cf
channeldb: new custom blob nested TLV
In this commit, for each channel, we'll now start to store an optional custom blob. This can be used to store extra information for custom channels in an opauqe manner.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
edf959d39f
channeldb: add optional TapscriptRoot field + feature bit 2024-08-28 11:52:29 +02:00
Olaoluwa Osuntokun
ecca095a9b
channeldb: consolidate root bucket TLVs into new struct
In this commit, we consolidate the root bucket TLVs into a new struct.
This makes it easier to see all the new TLV fields at a glance. We also
convert TLV usage to use the new type param based APis.
2024-08-28 11:51:54 +02:00
Eugene Siegel
199e83d3f2
channeldb: add PutClosedScid and IsClosedScid
This commit adds the ability to store closed channels by scid in
the database. This will allow the gossiper to ignore channel
announcements for closed channels without having to do any
expensive validation.
2024-08-27 14:11:05 -04:00
Oliver Gugger
e99e6662cf
multi: update linter, fix new issues 2024-08-20 19:14:44 +02:00
ziggie
e5d7a7d371
discovery: add detailed comment.
Describe why it is ok to resurrect zombie channels based on the
timestamp of the `ReplyChannelRange` msg although its not verifiable
data.
2024-08-17 04:29:58 +02:00
ziggie
6fb1e0c17d
multi: fix time.Time initialization.
ChanUpdate timestamps are now restircted so that they cannot be
more than two weeks into the future. Moreover channels with both
timestamps in the ReplyChannelRange msg either too far in the past
or too far in the future are not queried.

Moreover fix unitests.
2024-08-17 04:29:57 +02:00
yyforyongyu
3b6e28d19b
channeldb+htlcswitch: make sure circuit is not nil in teardownCircuit 2024-08-07 22:17:59 +08:00
yyforyongyu
0928ba0149
routing: fix and enhance logging 2024-08-07 22:17:58 +08:00
Oliver Gugger
b63e5decad
Merge pull request #8886 from bitromortac/buildroute-inbound-fees
routing: inbound fees support for BuildRoute
2024-08-07 08:11:17 -06:00
bitromortac
8b32e3e785
routing: add inbound fee support for BuildRoute 2024-08-07 14:23:54 +02:00
Olaoluwa Osuntokun
c262b1b5a5
Merge pull request #8968 from ProofOfKeags/opening-party
[MICRO]: channeldb+lnwallet: add OpeningParty API
2024-08-05 16:42:22 -07:00
Keagan McClelland
a2b19afe59
channeldb+lnwallet: define Initiator for OpenChannel and LightningChannel
This commit introduces a new API to return information on which party opened
the channel using the new ChannelParty type. It does not change the underlying
structure of how we store this information.
2024-08-05 12:58:46 -07:00
Oliver Gugger
11c7e20d0a
Merge pull request #8953 from ProofOfKeags/refactor/lnwallet-channel-channel-constraints-partition
[MICRO]: multi: break ChannelConstraints into two sub-structures
2024-08-05 02:08:52 -06:00
Keagan McClelland
e3a9d0acbe
multi: break ChannelConstraints into two sub-structures
This commit breaks the ChannelConstraints structure into two
sub-structures that reflect the fundamental differences in how
these parameters are used. On its face it may not seem necessary,
however the distinction introduced here is relevant for how we
will be implementing the Dynamic Commitments proposal.
2024-08-01 12:00:32 -07:00
Slyghtning
2e3c96f986
routing: new failure reason for cancelled payments 2024-08-01 10:24:08 +02:00
Keagan McClelland
33934449ac
multi: refactor select methods within channeldb to use ChannelParty
Also in this commit is a small adjustment to the call-sites to get
the boundaries stitched back together.
2024-07-31 14:50:26 -07:00
Elle Mouton
f0558babf3
multi: send MPP payment to blinded path
Make various sender side adjustments so that a sender is able to send an
MP payment to a single blinded path without actually including an MPP
record in the payment.
2024-07-26 09:54:38 +02:00
Oliver Gugger
fdd28c8d88
Merge pull request #8915 from linghuying/master
chore: fix some comments for struct field
2024-07-16 08:40:33 -06:00
linghuying
91930d4ab8 chore: fix some comments for struct field
Signed-off-by: linghuying <1599935829@qq.com>
2024-07-16 11:44:35 +08:00
Elle Mouton
e9c89ae0ec
multi+refactor: create ForEachNodeChannel with no tx param
In prep for a clean Graph DB interface, we add a version of
ForEachNodeChannel that does not take in an existing db transaction.
2024-07-15 15:13:58 +02:00
Elle Mouton
c20d759d41
refactor: create FetchLightningNode with no tx param
In preparation for adding a clean Graph DB interface, we create a
version of FetchLightningNode that doesnt allow a caller to provide in a
transaction.
2024-07-15 15:13:57 +02:00
Elle Mouton
71e93526d6
multi+refactor: let FetchChanInfos not take tx
In preparation for having a clean graph DB interface, refactor
FetchChanInfos so that no transaction can be provided.
2024-07-15 15:13:57 +02:00