[go: up one dir, main page]

Plugin: clean up RPC registration

Category: code quality

  • first item: day, medium priority
  • second item: days, needs to be discussed, medium priority
  • third item: depends on second item, low priority

As a result of moving some RPCs files from lib_protocol to lib_plugin in !14094 (merged), the control flow of RPC registration in the plugin is a bit weird.

  • Now that delegate_services.ml is in the plugin, there is no reason for some delegate-related RPCs to be still be defined in RPC.ml instead of delegate_services.ml. Same for contract_services.ml.

  • Do we want to move all RPCs from the protocol to the plugin, not just the staking-related one? This requires further discussions, as it might cause problems when trying to upgrade the protocol by auto-downloading the new protocol without a new Octez release. However, currently we have other problems if we want to do this anyway, so is it a good reason to not move the RPCs?

  • There is a lot of code duplication between lib_protocol/services_registration.ml and lib_plugin/services_registration_plugin.ml. (Moving all RPCs from the protocol to the plugin would incidentally solve this)

Edited by Diane Gallois-Wong