-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use the peerswaprpc proto file for shared serialization #231
base: master
Are you sure you want to change the base?
Use the peerswaprpc proto file for shared serialization #231
Conversation
I didn't expect anyone to work on this ticket. This is very late right before a release. Are you sure this change has no impact on how things currently behave? |
No, this change may affect cln plugin behavior. |
|
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.
Hey @YusukeShimizu,
You definitely got the idea what #134 is about and your execution so far is exactly what I was hoping for.
This PR gives us the opportunity to clean up some technical dept and serialization overhead and allows us to revisit the API and how it is accessed by humans. I expect most comments and discussions to be about field names and values while you streamline the API.
All of that being said, as we are close to a release, we might want to wait postpone merging this PR until the transition to the peerswaprc
messages is fully completed. I do not expect the API to change that much, if at all in the meantime.
Cheers!
clightning/clightning_commands.go
Outdated
return nil, err | ||
} | ||
peerSwapPeerChannels = append(peerSwapPeerChannels, &peerswaprpc.PeerSwapPeerChannel{ | ||
ChannelId: scid.ToUint64(), |
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.
Maybe a scid
it is more intuitive and "human readable". Do you think it makes sense to update the proto message
peerswap/peerswaprpc/peerswaprpc.proto
Lines 152 to 157 in 3201594
message PeerSwapPeerChannel { | |
uint64 channel_id = 1; | |
uint64 local_balance = 2; | |
uint64 remote_balance = 3; | |
bool active = 5; | |
} |
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 there is a concern that replacing the channel id with a short channel id would be a breaking change and have a impact.
I think there will be a no problem if both channel id and short channel id are set, so I just add a short channel id.
de30b18
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.
Internally we use the scid so there should no be a problem here. Changing from channel_id
to scid
would "break" the api that is just consumed by peerswapcli
and maybe RTL so far. Vice versa for a change from scid
to channel_id
on the core-lightning plugin. We either way have to go with on change on the user facing api 😅
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.
Sorry, this may have caused a little confusion, so I will state it again.
I considered the following two way.
I personally believe that 1
is the way that will have the least impact, which do you think better?
- Add
string short_channel_id = 6;
.
The current change(de30b18) does this.
message PeerSwapPeerChannel {
uint64 channel_id = 1;
uint64 local_balance = 2;
uint64 remote_balance = 3;
bool active = 5;
string short_channel_id = 6;
}
- Update uint64
uint channel_id = 1;
tostring short_channel_id = 1;
message PeerSwapPeerChannel {
string short_channel_id = 1;
uint64 local_balance = 2;
uint64 remote_balance = 3;
bool active = 5;
}
I understand the above. |
We should take advantage of the peerswaprpc proto file and use the generated stubs for the responses of the cln-plugin. Part of the response message is changed.
de30b18
to
64d4fbe
Compare
A short channel id is more intuitive and "human readable". Added short channel id for rpc, and set the value both short channel id and channel id for cln.
64d4fbe
to
3df5a8a
Compare
This is for #134.
This change is the serialization part for peerswapd and the cln-plugin.
I use the peerswaprpc proto file for shared serialization.
The following changes will be made.
short channel id
andstate
for PeerSwapPeerChannel is converted tochannel id
andactive
.Important
We plan to merge after the stable release of
v4.0
. This is crucial information necessary for users to succeed.