-
Notifications
You must be signed in to change notification settings - Fork 374
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
Taproot signer variant #2512
Taproot signer variant #2512
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2512 +/- ##
==========================================
- Coverage 88.55% 88.55% -0.01%
==========================================
Files 114 114
Lines 89417 89421 +4
Branches 89417 89421 +4
==========================================
+ Hits 79186 79187 +1
+ Misses 7859 7858 -1
- Partials 2372 2376 +4 ☔ View full report in Codecov by Sentry. |
0da4669
to
8a4e8ed
Compare
73bb025
to
636624b
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.
LGTM.
cc1b9df
to
44f46e7
Compare
fc492b3
to
9f2f4de
Compare
7057185
to
f61ce0d
Compare
f61ce0d
to
8e222d4
Compare
c026313
to
917eaee
Compare
Needs rebase. |
8cc2e03
to
cf66eb8
Compare
cf66eb8
to
d773914
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.
Feel free to address these in a follow-up if you'd like.
lightning/src/sign/taproot.rs
Outdated
/// Generate a local nonce pair, which requires committing to ahead of time | ||
/// The counterparty needs the public nonce generated herein to compute a partial signature |
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.
Nit: end with periods
lightning/src/sign/taproot.rs
Outdated
/// | ||
/// An external signer implementation should check that the commitment has not been revoked. | ||
/// | ||
/// [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor |
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.
Nit: this is stale now
lightning/src/sign/taproot.rs
Outdated
/// must be be computed using [`SchnorrSighashType::Default`]. Note that this should only be | ||
/// used to sign HTLC transactions from channels supporting anchor outputs after all additional | ||
/// inputs/outputs have been added to the transaction. |
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 can be removed, taproot relies on anchors.
d065fd5
to
f04dc3f
Compare
|
f04dc3f
to
cc8fa8c
Compare
Needs rebased. |
For Taproot support, we need to define an alternative trait to EcdsaChannelSigner. This trait will be implemented by all signers that wish to support Taproot channels.
Previously, SignerProvider was not laid out to support multiple signer types. However, with the distinction between ECDSA and Taproot signers, we now need to account for SignerProviders needing to support both. This approach does mean that if ever we introduced another signer type in the future, all implementers of SignerProvider would need to add it as an associated type, and would also need to write a set of dummy implementations for any Signer trait they do not wish to support. For the time being, the TaprootSigner associated type is cfg-gated.
ChannelSignerType is an enum that contains variants of all currently supported signer types. Given that those signer types are enumerated as associated types in multiple places, it is prudent to denote one type as the authority on signer types. SignerProvider seemed like the best option. Thus, instead of ChannelSignerType declaring the associated types itself, it simply uses their definitions from SignerProvider.
To separate out the logic in the `sign` module, which will start to be convoluted with multiple signer types, we're splitting out each signer type into its own submodule, following the taproot.rs example from a previous commit.
cc8fa8c
to
88ce7d6
Compare
Why is |
/// An external signer implementation should check that the commitment has not been revoked. | ||
/// | ||
// TODO: Document the things someone using this interface should enforce before signing. | ||
fn finalize_holder_commitment(&self, commitment_number: u64, |
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.
commitment_number
is already present in the HolderCommitmentTransaction
object. We shouldn't repeat ourselves here.
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.
Two followups, but nothing blocking.
Oh, also, please fix the new warnings by adding a |
No description provided.