Skip to content
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

Add DecodeSidecarTicket RPC #285

Merged
merged 3 commits into from
Sep 28, 2021
Merged

Conversation

guggero
Copy link
Member

@guggero guggero commented Sep 6, 2021

Fixes #263.

Adds the DecodeSidecarTicket RPC.

Pull Request Checklist

  • LndServices minimum version has been updated if new lnd apis/fields are
    used.

@guggero guggero requested a review from Roasbeef September 6, 2021 11:59
@Roasbeef Roasbeef requested a review from bhandras September 7, 2021 18:53
Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR LGTM, just have one question regarding encoding.

rpcserver.go Outdated
OfferLeaseDurationBlocks: t.Offer.LeaseDurationBlocks,
OfferSignPubkey: serializePubKey(t.Offer.SignPubKey),
OfferAuto: t.Offer.Auto,
ExecutionPendingChannelId: nil,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to nil ExecutionPendingChannel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed.

rpcserver.go Outdated
}

if t.Execution != nil {
resp.ExecutionPendingChannelId = t.Execution.PendingChannelID[:]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to return raw byte arrays here and for OrderBidNonce and ID? I see in the next commit we use printJson but perhaps we could use a hex encoding for these byte buffers instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using github.com/lightninglabs/protobuf-hex-display for the printRespJSON(), so it will be printed on the command line as hex. I actually prefer having things as raw bytes on the protobuf level. That does make it a bit more difficult to use with REST since it'll be base64 by default. But using hex encoded strings just because of that feels kind of inefficient. Not sure about this tbh. What's your take, @Roasbeef?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great that protobuf-hex-display takes care of this. As for REST I'd say base64 is probably more convenient to use than hex encoding.

@guggero guggero force-pushed the decode-ticket branch 2 times, most recently from 1e267bb to 79bae1a Compare September 8, 2021 17:58
To make it possible to decode a sidecar ticket through RPC instead of
only relying on the output of the CLI, we add the DecodeSidecarTicket
RPC method to the trader daemon.
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🏊‍♀️

MultiSigPubKey: testPubKey2,
NodePubKey: testPubKey,
MultiSigPubKey: testPubKey2,
MultiSigKeyIndex: 77,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Roasbeef Roasbeef merged commit f633d70 into lightninglabs:master Sep 28, 2021
@guggero guggero deleted the decode-ticket branch September 29, 2021 07:26
positiveblue pushed a commit to positiveblue/pool that referenced this pull request Oct 11, 2022
sidecar channels 2/3: Allow sidecar tickets to be specified on bid orders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sidecar: add RPC for printticket
3 participants