paritytech / paritytech/subxt

Can the `Backend` trait be unsealed?

Open
#2,253 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
489
Forks
293
Avg merge
18h 35m
Merged PRs (30d)
3

Description

This issue relates to #11297 which is one of the PRs for integrating the eth-rpc into the parachain nodes (e.g., polkadot-omni-node).

Currently, the eth-rpc communicates with the parachain node through a standard WS connection where subxt is used as the client to facilitate this connection. When the eth-rpc is integrated into the node everything will be running in the same process and therefore there will no longer be need for the eth-rpc to communicate with the node through web-sockets or for an RPC connection to the node at all.

One of the ways in which we're thinking about implementing this is through a custom implementation of the Backend trait. Currently, all of the Backend implementations in the codebase assume that communication with the node happens through an RpcClient and this new Backend we're thinking about implementing would instead call functions in the same compiled binary, bypassing the RPC entirely.

In order to do this, we would need the Backend trait to be un-sealed to allow us to implement our own custom backend.

The questions are:

  1. Why is the Backend trait sealed? Is it truly intended that no user of subxt ever implements their own Backend?
  2. Could we unseal the trait to implement our own custom Backend?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Backend trait and the existing Backend implementations that use RpcClient. Compare their assumptions with the proposed in-process custom backend, then review the discussion around whether external implementations are supported. Done means reaching a maintainer-backed decision on the trait's sealing and documenting the resulting scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.