-
Notifications
You must be signed in to change notification settings - Fork 132
Bugfix supply commit state machine #1655
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
Conversation
Allows deriving a supply commit TxOut without specifying all RootCommitment fields. We make RootCommitTxOut exportable so that we can use it in itests.
Refactor newRootCommitment to ensure the commit transaction is fully defined before it is set as a field in RootCommitment.
Update the FetchUnspentPrecommits SQL query to retrieve the full internal key descriptor for pre-commitment outputs. This enables BIP32 derivation when spending these outputs.
Pull Request Test Coverage Report for Build 16369238272Details
💛 - Coveralls |
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.
Nice, LGTM 🎉
SignAndFinalizePsbt can't currently handle tapd family keys.
FetchSupplyCommit now returns the full key descriptor for the internal key. RootCommitment struct now includes the full internal key descriptor instead of just the public key. This enables specifying BIP32 derivations when spending supply commitment transactions during the creation of a new supply commitment transaction. And also specifying BIP32 derivations in PSBT outputs, and so on.
Add PSBT output with BIP32 derivation. This makes use of the full internal key descriptor that we made available in the previous commit.
When creating a supply commitment transaction, there are two types of inputs that can be spent: * Pre-commitment outputs from mint anchor transactions * Outputs from previous supply commitment transactions This commit adds support for a PSBT input to handle the latter case, allowing spending of a previous supply commitment transaction output.
Ensures the tree construction in the supplycommit package matches the method used in tapdb when storing the tree in the database.
f2015fe
to
dd17a24
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 🌾
for _, preCommit := range unspentPreCommits { | ||
newCommitTx.AddTxIn(preCommit.TxIn()) | ||
|
||
bip32Derivation, trBip32Derivation := | ||
tappsbt.Bip32DerivationFromKeyDesc( |
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.
Style nit: odd line wrapping here.
universe/supplycommit/transitions.go
Outdated
// on mint transactions where as the old commitment is the last | ||
// commitment that was broadcast. | ||
// | ||
// TODO(ffranr): Do we have everything we need to fund a PSBT 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.
TODO maybe addressed in a follow up PR?
@@ -447,6 +447,21 @@ func newRootCommitment(ctx context.Context, | |||
} | |||
} | |||
|
|||
bip32Derivation, trBip32Derivation := | |||
tappsbt.Bip32DerivationFromKeyDesc( |
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.
Same here re line wrapping.
Work towards closing: #1534
Multiple small bug fixes for the supply commit state machine.