-
Notifications
You must be signed in to change notification settings - Fork 48
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
Upgrade trader accounts to Taproot/MuSig2 #375
Conversation
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.
First pass done, this looks really good @guggero 👏
dfe03c1
to
cb22c9d
Compare
I addressed all comments and got almost all itests working on the server side. |
68374a5
to
76acc47
Compare
@positiveblue: review reminder |
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 🌮
There is a small comment about how we are storing the new field but nothing blocking.
I would add the version field in multiple rpc calls, like ListAccounts
. Also it could be useful to add it to the terminal confirmation message before creating an account. However, I can add those two things later 👍
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.
Amazing PR!!
Love how we're able to handle all the upgrade logic behind the scenes, hidden away from the user. This change will also make it even cheaper (on chain) to buy/sell leases as well, since the account witness is much smaller.
Completed an initial pass, with the most major comments being some wanted fuzzing/testing of the new witness parsing logic as well as all the new scripts added for taproot.
dccf0a0
to
007610d
Compare
I addressed all comments except for the additional unit tests. I agree they should be added, but I'm going to work on them next week. |
might need to extend unit test frame work |
07acb3d
to
543f17d
Compare
I added a set of unit tests for the new spend paths. And I also ran the fuzzer locally for almost 2 hours and didn't find anything so far. |
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 🐞
665aeca
to
be2b1a8
Compare
be2b1a8
to
0f37262
Compare
Deliverable outcome:
|
Are we sure we want to wait for that? Updating to the latest spec means:
I think it would make more sense to instead add a version parameter to the MuSig2 API when we implement this, so we can upgrade later. |
No, it can proceed as defined. As mentioned, those changes themselves are still in a draft state, with no other implementations currently tracking the change (other than the python ref implementation used to generate the test vectors). Correctness is still retained without the changes. It would matter more in a p2p setting as you need cross implementation compatibility. Ofc, we could delay things, but then what if we hit another change in serialization somewhere that is "better" but doesn't affect correctness. Would we then do the same and pause to target the newer change? The tradeoff of being one of the first in the ecosystem to utilize these new features is that we sort of need to commit to having the proper versioning to handle future updates. |
@guggero agreed, iiuc we already have the versioning in the proper places as well. An account version is the most apt, since the serialization changes will change the actual aggregate key, so making the jump a future version would be an actual account version bump. |
Agree that versioning should be incorporated here to facilitate it being upgraded. Appears there was some misinterpretation about the code etc constrained/delayed by MuSig2 spec, which won't be the plan. |
With this commit we streamline the signing code somewhat to make it easier to understand. With the new flow the spendPkg struct is no longer needed as we directly pass back the (partially) signed TX.
During the integration tests we might want to shut down a trader client through the admin RPC. If that closes the shutdown channel on a package global interceptor, that means we can't start another trader client during that test. We need to make sure we can pass in an interceptor for each trader instance.
The `.UnsignedTx` of a psbt does not include the related SignatureScripts. Because SignatureScripts are not part of the signed data, the partial signature for a psbt that does not include them is a valid signature. However, the `TxHash` will change between a tx that has SignatureScripts set and one that does not. This behaviour led the auctioneer and the client to record the wrong outpoint when using np2wkh.
e333a17
to
a1dab84
Compare
Depends on #370.
Pull Request Checklist
used.