Skip to content

Optional RPC Server plugin dependency #4190

@AnnaShaleva

Description

@AnnaShaleva

Summary or problem description
For cases like #4161 (comment) we need to provide an ability to disable RPC Server plugin dependency if needed.

For example, dBFT plugin requires StateService for stateroot calculation, but definitely doesn't need RPC Server plugin as a dependency (because RPC should likely be disabled on consensus nodes due to security reasons). However, right now StateService plugin requires RPC Server plugin as a dependency because StateService exposes a couple of RPC methods.

Do you have any solution you want to propose?
For now, there are two possible solutions suggested:

  1. One solution is described in Introduce StateRootInHeader #4161 (comment): split StateService plugin into two plugins: plugin A should calculate stateroots, plugin B should expose state-related RPC methods. Then dBFT will be dependent from plugin A only, it won't introduce RPC Service plugin dependency to dBFT.
  2. Another solution is suggested by @shargon: decouple RpcMethod attribute implementation from RPC Server plugin and make RPC Server plugin dependency kind of an "optional". So that if RPC Server plugin is installed, then state-related RPC methods of StateService plugin are available, but if RPC Service plugin is not installed, then state-related RPC methods won't be exposed.

Where in the software does this update applies to?

  • Plugins

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionInitial issue state - proposed but not yet acceptedEnhancementType - Changes that may affect performance, usability or add new features to existing modules.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions