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

[anchors] lnrpc: add commitment_type to listchannels #4068

Merged
merged 1 commit into from
Mar 13, 2020

Conversation

halseth
Copy link
Contributor

@halseth halseth commented Mar 11, 2020

Now that we have a third commitment type active (#3829), we deprecate the static_remote_key field on listchannels, and instead add another commitment_type.

@halseth halseth requested a review from joostjager March 11, 2020 08:14
@halseth halseth changed the title lnrpc: add commitment_type to listchannels [anchors] lnrpc: add commitment_type to listchannels Mar 11, 2020
@bhandras bhandras self-requested a review March 11, 2020 08:15
@halseth halseth force-pushed the anchors-rpc-committype branch from 5cfd2b6 to 08d668a Compare March 11, 2020 08:17
A channel using the legacy commitment format having tweaked to_remote
keys.
*/
LEGACY = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Legacy as a type isn't very scalable. Static remote key will be legacy at some point too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OG? :P

Copy link
Contributor

Choose a reason for hiding this comment

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

GENESIS

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sticking with legacy 😛

rpcserver.go Outdated
@@ -3080,6 +3090,7 @@ func createRPCOpenChannel(r *rpcServer, graph *channeldb.ChannelGraph,
LocalChanReserveSat: int64(dbChannel.LocalChanCfg.ChanReserve),
RemoteChanReserveSat: int64(dbChannel.RemoteChanCfg.ChanReserve),
StaticRemoteKey: dbChannel.ChanType.IsTweakless(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is StaticRemoteKey also true for anchors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that confusing? We could also define the bool as indicating that particular format, not a format feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, it could be either or. Not sure how much it matters, as we are deprecating it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, it doesn't matter much. My preference would be to consider the boolean a channel type and not a channel feature, because it is simpler to explain. ListChannels only communicates channel types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Went with your suggestion :)

Copy link
Collaborator

@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.

LGTM 🥇


/**
A channel that uses the modern commitment format where the key in the
output of the remote party does not change each state. This makes back
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: maybe (but i'm also a bit unsure) "does not change upon state changes"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sticking with this, as that was the original doc on static_remote_key

lnrpc/rpc.proto Outdated Show resolved Hide resolved
@Roasbeef Roasbeef added this to the 0.10.0 milestone Mar 11, 2020
@halseth halseth force-pushed the anchors-rpc-committype branch from 08d668a to 7d305fd Compare March 13, 2020 19:01
@Roasbeef Roasbeef merged commit 7f78054 into lightningnetwork:master Mar 13, 2020
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.

5 participants