Skip to content

feat(rpc-server): implement an RPC method #541

Open
@dnut

Description

@dnut

Implement a simple POC to support a single nontrivial RPC method. It should be:

  • supported by both io_uring and basic backends
  • asynchronous for io_uring: should not block the io_uring loop. for the basic backend, it does not need to be
  • nontrivial: It shouldn't just return a constant but it executes some work that depends on validator state.
  • simple: We don't need the most elegant or generalized approach. It just needs to meet the above criteria. A more sophisticated approach can be implemented later in enhancement(rpc server:io_uring): consider intermediate event loop #516. It should also be a relatively easy method that doesn't require extra logic to be implemented. Ideally it would be something easy that just gets some data from a sig component and returns it without needing additional logic.

The initial plan is to select one of the accountsdb RPC methods due to familiarity, but it can be any method. getAccountInfo seems like a reasonable choice.

Inital plan/outline (feel free to edit):

  • accept a POST request and respond with some data
    • basic backend
    • io_uring
  • de/serialize inputs and outputs
  • dispatch request based on method name
  • basic approach to asynchronous execution for io_uring
  • provide validator state to execution scope (e.g. AccountsDB struct)
  • implement logic to read the data from the validator state

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status

    📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions