-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4/5]: lnwallet: add new AuxSigner interface to mirror SigPool #8632
Conversation
Important Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Pull reviewers statsStats of the last 30 days for lnd:
|
54509a9
to
1858e19
Compare
1858e19
to
ffa19c0
Compare
ffa19c0
to
6bd862c
Compare
6bd862c
to
ddb5125
Compare
ddb5125
to
970ace4
Compare
8ed50cf
to
cfd4314
Compare
fc74f55
to
57adb13
Compare
Included all changes from the PoC branch, ready for first pass review. |
6123a1c
to
e258b87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple, clean diff ✨
Would be nice to mock the AuxSigner
and have some simple tests to verify the htlc sig processing flows & generated ExtraData
Could def make a TODO for when we're done with the saga, or perhaps coverage is introduced in a latter PR so I'll keep an eye on this 👀
LGTM
|
||
// AuxLeafStore is an optional data source that can be used by custom | ||
// channels to fetch+store various data. | ||
AuxLeafStore fn.Option[lnwallet.AuxLeafStore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this here / being removed now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was just in the wrong place, moved it to the AuxComponents
sub struct. When we just had a single aux interface it made sense here, as "store" vaguely has something to do with database. But with all the other components it made sense to move everything to its own struct.
// AuxSigner is an interface that is used to sign and verify HTLCs for custom | ||
// channels. It is similar to the existing SigPool, but uses opaque blobs to | ||
// shuffle around signature information and other metadata. | ||
type AuxSigner interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to mock this and have some minimal test coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this to the tracking issue, since we currently don't have any coverage for those aux interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
type BaseAuxJob struct { | ||
// OutputIndex is the output index of the HTLC on the commitment | ||
// transaction being signed. | ||
OutputIndex int32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be unsigned int rather than signed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value comes from here: https://github.com/lightningnetwork/lnd/blob/a350ccd7/lnwallet/channel.go#L308
So it can actually be negative. Added the same comment here.
In this commit, we add a new aux signer interface that's meant to mirror the SigPool. If present, this'll be used to (maybe) obtain signatures for second level HTLCs for certain classes of custom channels.
In this commit, we start to use the new AuxSigner to obtain+verify aux sigs for all second level HTLCs. This is similar to the existing SigPool, but we'll only attempt to do this if the AuxSigner is present (won't be for most channels).
Depends on #8622.
In this PR, we add a new aux signer interface that's meant to mirror the SigPool. If present, this'll be used to (maybe) obtain signatures for second level HTLCs for certain classes of custom channels.
TODO
tlv.Blob
on disk for HTLCsLink to all PRs in the saga: