17166 Commits

Author SHA1 Message Date
Elle Mouton
12d21062d1
docs: update release notes 2024-09-02 12:45:22 +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
093462bc73
docs: update release notes 2024-09-02 12:39:12 +02:00
Elle Mouton
0ddb7fb100
lnwire: add ChannelUpdate2
Add the new ChannelUpdate2 message and ensure that it implements the
ChannelUpdate interface.
2024-09-02 12:39:12 +02:00
Elle Mouton
90595cd271
lnwire: add ChannelAnnouncement2 message
And ensure that it implements the ChannelAnnouncement interface.
2024-09-02 12:39:12 +02:00
Elle Mouton
2e86f38b6f
lnwire: make RawFeatureVector a Record producer 2024-09-02 12:39:12 +02:00
Elle Mouton
ce6dcb0028
lnwire: add AnnounceSignatures2 message
And ensure that it implements the AnnounceSignatures interface.
2024-09-02 12:39:12 +02:00
Elle Mouton
9be42b09a0
lnwire: add MsgHash helper
This commit adds the MsgHash helper funcion which can be used to
calculate the digest of a message to be signed using schnorr signatures.
2024-09-02 12:39:12 +02:00
Elle Mouton
81c83f39d3
lnwire: add a ChannelUpdate interface
In this commit, a new ChannelUpdate interface is added and
ChannelUpdate1 is made to implement the new interface.
2024-09-02 12:39:12 +02:00
Elle Mouton
9a220765fc
multi: convert ChanUpdate validate funcs to methods
In this commit, the ChannelUpdate message verification and validation
functions are moved from `routing` to methods on the ChannelUpdate
struct in `lnwire`.
2024-09-02 12:39:12 +02:00
Elle Mouton
8b255f7215
lnwire: add a ChannelAnnouncement interface
Add a new ChannelAnnouncement interface and ensure that
ChannelAnnouncement1 implements it.
2024-09-02 12:39:12 +02:00
Elle Mouton
74606701cf
multi: move ChanAnn validation to method in lnwire
Remove the ValidateChanAnn function from `routing` and instead add a
`Validate` method on the `ChannelAnnouncement1` itself.
2024-09-02 12:39:12 +02:00
Elle Mouton
26ee1c6b37
discovery+lnwallet: add fetchPKScript helper to gossiper
This commit makes an lnwallet.BlockChainIO available to the gossiper and
uses it to construct a helper that can be used to fetch the pk script
for a given SCID. This will be used for channel announcement
verification in an upcoming commit.
2024-09-02 12:39:11 +02:00
Elle Mouton
2d7a39d5e1
graph+lnwallet: move FetchTx logic to lnwallet
So that it can be re-used elsewhere.
2024-09-02 12:39:11 +02:00
Elle Mouton
3066a41a23
lnwire: add AnnounceSignatures interface
Add a AnnounceSignatures interface and ensure that AnnounceSignatures1
implements it.
2024-09-02 12:00:05 +02:00
Elle Mouton
0229dab559
lnwire: add FirstBlock and BlockRange to GossipTimestampRange
Add new FirstBlockHeight and BlockRange TLV fields to the
GossipTimestampRange message. This will be used to query for Gossip 1.75
messages which are timestamped using block height instead of Unix
timestamps.
2024-09-02 11:59:42 +02:00
Elle Mouton
5ff7a043ac
lnwire: add btc and node announcement nonces to channel_ready
In preparation for Gossip 1.75, we add new TLV's to the `ChannelReady`
message. Namely: `AnnouncementBitcoinNonce` and `AnnouncementNodeNonce`.
These will be used to exchange nones required for producing the partial
signature to be send in the `AnnouncementSignatures2` message.
The type numbers for these new fields are even because if they are set,
then a peer is expecting its peer to understand gossip 1.75 and the new
fields.
2024-09-02 11:59:37 +02:00
Elle Mouton
7720aec8f1
multi: rename ChannelUpdate to ChannelUpdate1
In preparation for adding a new ChannelUpdate2 message and a
ChannelUpdate interface, we rename the existing message to
ChannelUpdate1.
2024-09-02 11:59:33 +02:00
Elle Mouton
0f0e436427
multi: rename ChannelAnnouncement to ChannelAnnouncment1
In preparation for adding the new ChannelAnnouncement2 message along
with a ChannelAnnouncement interface, we rename the existing message to
ChannelAnnouncement1.
2024-09-02 11:59:29 +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
Oliver Gugger
e8c5e7d5ce
Merge pull request #9044 from ProofOfKeags/refactor/stfu-prefactor
Refactor/stfu prefactor
2024-08-29 09:49:53 -06:00
Oliver Gugger
54eeb0e792
Merge pull request #9045 from ziggie1984/fix-blinded-payment-tc
fix blinded path itest.
2024-08-29 04:51:20 -06:00
ziggie
64fb4cb4ac
itest: fix blinded path itest. 2024-08-29 09:50:46 +02:00
Keagan McClelland
1422729f80
lnwallet+htlcswitch: define expanded NumPendingUpdates
This commit squashes the below operations for a net result where
we have an expanded capability of assessing pending updates. This
is made possible by packing the components into Duals in the prior
commits. We squash the operations to simplify review.

htlcswitch+lnwallet: rename PendingLocalUpdateCount

lnwallet: complete pending update queries API for LightningChannel

lnwallet+htlcswitch: consolidate NumPendingUpdates using ChannelParty

This commit makes the observation that we can cleanly define the
NumPendingUpdates function using a single expression by taking
advantage of the relevant fields being properly packed into Duals.
2024-08-28 14:03:00 -07:00
Keagan McClelland
ce7fcd30f8
lnwallet: pack commitment message indices into Dual
This is yet another commit that packs a symmetric structure into
a Dual. This is the last one needed for the time being to consolidate
Num{X}UpdatesPendingOn{Y} functions into a single one.
2024-08-28 14:02:59 -07:00
Keagan McClelland
2e7fbc446f
lnwallet: pack update logs into Dual
This commit, like the last one packs the update logs into a symmetric
Dual structure. This will allow us to index into them more concisely
in higher order logic.
2024-08-28 13:58:33 -07:00
Keagan McClelland
8077862225
lnwallet: pack commit chains into Dual
This commit packs the LightningChannel's localCommitmentChain and
remoteCommitmentChain into a Dual structure for better symmetric
access. This will be leveraged by an upcoming commit where we want
to more concisely express how we compute the number of pending
updates.
2024-08-28 13:51:23 -07:00
Keagan McClelland
a0515a16db
htlcswitch: extract error handling for syncChanStates 2024-08-28 13:46:52 -07:00
Oliver Gugger
5c3a8e949c
Merge pull request #9030 from lightningnetwork/extract-part1-from-staging-branch
[custom channels 1/5]: extract PART1 from mega staging branch
2024-08-28 07:06:53 -06:00
Oliver Gugger
9dfbde7013
lnwallet: thread thru input.AuxTapleaf to all relevant areas
In this commit, we start to thread thru the new aux tap leaf structures to all relevant areas. This includes: commitment outputs, resolution creation, breach handling, and also HTLC scripts.
2024-08-28 13:28:48 +02:00
Oliver Gugger
2ab22b0f0b
lnwallet: refactor commit keys to use lntypes.Dual 2024-08-28 13:26:18 +02:00
Oliver Gugger
b45d72fe59
multi: thread thru the AuxLeafStore everywhere 2024-08-28 13:26:14 +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
d95c1f93f3
lnwallet+channeldb: add new AuxLeafStore for dynamic aux leaves
In this commit, we add a new AuxLeafStore which can be used to dynamically fetch the latest aux leaves for a given state. This is useful for custom channel types that will store some extra information in the form of a custom blob, then will use that information to derive the new leaf tapscript leaves that may be attached to reach state.
2024-08-28 13:21:08 +02:00
Olaoluwa Osuntokun
c36cd9298f
input: add some utility type definitions for aux leaves
In this commit, we add some useful type definitions for the aux leaf.
2024-08-28 11:52:32 +02:00
Olaoluwa Osuntokun
d25f881433
lnwallet: add custom tlv blob to internal commitment struct
In this commit, we also add the custom TLV blob to the internal commitment struct that we use within the in-memory commitment linked list.

This'll be useful to ensure that we're tracking the current blob for our in memory commitment for when we need to write it to disk.
2024-08-28 11:52:32 +02:00