-
Notifications
You must be signed in to change notification settings - Fork 102
Custom channels itest: Use group keys on some payments & invoices #995
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
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.
I think this is a good start as a sanity check for some of the new logic. I think we'll want to more or less run each test w/ both asset ID and group key, but that might eventually be a bit unwieldy when it comes to execution time.
Ultimately, we do expect most of the primary use cases to use group keys, so pehrhaps it's fine to lean towards coverage there?
itest/assets_test.go
Outdated
|
||
case len(groupID) > 0: | ||
groupHash := sha256.Sum256(groupID) | ||
targetID = hex.EncodeToString(groupHash[:]) |
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.
Hmm, do we need to modify what we return as JsonHtlc
to start to include a distinct group key field? IIRC, it's all TLV within the db/lnd, so shouldn't be a big lift there, and should be backwards compat.
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.
Hmm, good idea. We can definitely add that to make certain things easier. Even if it's just informative to the user and useful in itests (but not explicitly expected in the RFQ logic).
I agree with you here, ideally we'd want to even focus more on group key usage compared to single asset IDs. I'll think of an approach that lets us run everything in assetID / groupkey mode, and see if it's worth the trouble. Otherwise, we could just add groupkey explicit itests, and support the hybrid mode on the more extensive edge-case itests |
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.
Concept ACK
itest/assets_test.go
Outdated
|
||
case len(groupID) > 0: | ||
groupHash := sha256.Sum256(groupID) | ||
targetID = hex.EncodeToString(groupHash[:]) |
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.
Hmm, good idea. We can definitely add that to make certain things easier. Even if it's just informative to the user and useful in itests (but not explicitly expected in the RFQ logic).
2d7defe
to
072cc37
Compare
Added an extra commit which lets us run the liquidity edge cases in assetID & groupKey mode This way the edge case coverage is repeated for group keys without re-writing the whole test We could take a similar approach for all other tests, so please take a look and LMK if you agree with that approach. It would ofcs lead to running everything twice, so double total itest time. |
072cc37
to
e75169c
Compare
e75169c
to
673009d
Compare
rebased on |
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.
Looks pretty good! Have some ideas to reduce the size of the diff though.
itest/assets_test.go
Outdated
targetID = hex.EncodeToString(assetID) | ||
|
||
case len(groupID) > 0: | ||
groupHash := sha256.Sum256(groupID) |
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 x-coordinate. I wonder why this didn't cause things to fail? Or did this still point to the old commit in tapd
?
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.
I think you started the review a bit before I rebased & used latest ref to tapd, which also changed these lines in the LiT side
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.
ok so it was the wrong commit (other comment)
itest/litd_custom_channels_test.go
Outdated
@@ -1896,10 +1918,13 @@ func testCustomChannelsLiquidityEdgeCases(ctx context.Context, | |||
|
|||
logBalance(t.t, nodes, assetID, "10k sats") | |||
|
|||
opts = []payOpt{} |
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: var opts []payOpt
to match empty initialization style above?
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.
can't redeclare it, i'm just setting it again
673009d
to
da3cca1
Compare
unified the helpers / itests commit to make things simpler |
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 pending nits and update to the actual merged commit of tapd
.
da3cca1
to
9f885cc
Compare
@Roasbeef: review reminder |
9f885cc
to
21d7652
Compare
21d7652
to
2cb1bb2
Compare
We add support for group keys on payments and invoices across the itests. This includes all the required helpers and optional arguments to make adding invoices and sending payments group-key enabled. In order to run the liquidity edge cases twice, once using only asset IDs and once using only group keys, we need to extract the main logic into a re-usable function that has the group key option on the top level. If the group key flag is set, then we append the respective group key opt to the payment & invoice related calls.
2cb1bb2
to
91e5c85
Compare
Description
We sprinkle around some group keys across the grouped asset custom channels test. Some of the invoices and payments in that test now use a group key instead of a specific asset ID.
Related tapd PR: https://github.com/lightninglabs/taproot-assets/pull/1423/commits
For the liquidity edge cases itest, we now support running it in assetID & groupKey mode, meaning we can go through the full suite of edge cases by using either a single assetID or a groupKey.