lightning icon indicating copy to clipboard operation
lightning copied to clipboard

msggen: add `missing-grpc` command

Open jackstar12 opened this issue 1 year ago • 6 comments
trafficstars

This PR adds a missing-grpc command to msggen which can be used to track down missing grpc methods: https://github.com/ElementsProject/lightning/issues/7167#issuecomment-2016969997 It currently outputs:

Missing RPC commands in grpc:
delforward
makesecret
reserveinputs
batching
upgradewallet
openchannel_signed
dev-forget-channel
renepaystatus
autoclean-status
delpay
fundchannel_complete
bkpr-listaccountevents
emergencyrecover
check
sql-template
splice_init
commando-blacklist
openchannel_abort
showrunes
getlog
listinvoicerequests
parsefeerate
multiwithdraw
openchannel_init
disableinvoicerequest
splice_signed
disableoffer
commando-listrunes
notifications
openchannel_bump
bkpr-dumpincomecsv
autoclean-once
checkrune
recoverchannel
fundchannel_start
deprecations
splice_update
bkpr-channelsapy
blacklistrune
sendonionmessage
recover
addpsbtoutput
unreserveinputs
listconfigs
plugin
createrune
fundchannel_cancel
commando-rune
listsqlschemas
commando
help
multifundchannel
renepay
openchannel_update
funderupdate
bkpr-inspect
bkpr-listbalances
sendinvoice
invoicerequest
setpsbtversion
setconfig

jackstar12 avatar Apr 11 '24 10:04 jackstar12

@jackstar12 Could you please rebase the PR on origin/master and resolve the conflict?

ShahanaFarooqui avatar Jun 19 '24 01:06 ShahanaFarooqui

Just rebased:

Missing RPC commands in grpc:
deprecations
listsqlschemas
parsefeerate
commando-blacklist
notifications
batching
check
sql-template
commando-listrunes
commando-rune
commando

jackstar12 avatar Jun 26 '24 21:06 jackstar12

@jackstar12 Thanks for the PR and adding the missing commands list code too :).

Also I would suggest that only six RPC commands are missing now:

1: deprecations
2: listsqlschemas
3: parsefeerate
4: notifications
5: batching
6: check

Below is the justification for others to be removed from the list:

  • sql-template: It is not an rpc command, just a template to generate final sql schema json with db details
  • commando-blacklist: Deprecated, will be removed v25.02. Encourage users to use blacklistrune instead.
  • commando-listrunes: Deprecated, will be removed v25.02. Encourage users to use showrunes instead.
  • commando-rune: Deprecated, will be removed v25.02. Encourage users to use createrune instead.
  • commando: Commando is difficult to define due to it's recursive nature (Reference).

ShahanaFarooqui avatar Jun 27 '24 01:06 ShahanaFarooqui

@jackstar12 Also please add a change-log entry including the list of rpc methods added with this PR. Something like commit.

ShahanaFarooqui avatar Jun 27 '24 02:06 ShahanaFarooqui

I would also.add that the two methods notifications and batching cannot be translated in their current form. Both act on the file descriptor, subscribing to notifications on the same client connection, and deferring DB commits on commands coming through the instrumented file descriptor.

Since there is no concept of a connection as such in grpc (it multiplexes commands over several connections so which connection you're instrumenting is not clear) and cln-rpc opens a new FD for every call as well, these methods have absolutely no effect and should not be mapped.

This leaves us with 4 methods to translate. Shall we maybe just mao them and skip adding a separate tool to identify unmapped methods?

cdecker avatar Jun 27 '24 14:06 cdecker

Keeping the logic to identify un-mapped methods might not be a bad idea. It will be helpful in identifying future new methods (eg. listaddresses) as well. We can also confirm it with added or changelog entries but this seems cleanest way to identify. Though we can filter-out ["sql-template", "commando-blacklist", "commando-listrunes", "commando-rune", "commando", "notifications", "batching"] methods to keep the list accurate.

Updated missing commands list:
- check
- deprecations
- listsqlschemas
- parsefeerate
- listaddresses (adding in v24.08) 

ShahanaFarooqui avatar Jun 28 '24 03:06 ShahanaFarooqui

Note that some commands are either experimental or internal use only. We haven't documented this well in the past, so they get baked in: we should consider this in future.

rustyrussell avatar Jul 05 '24 23:07 rustyrussell

We should also move this list of supported commands to the schema, where documentation can access it.

rustyrussell avatar Jul 05 '24 23:07 rustyrussell