-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reusable JSON RPC interface for ReadRPC and nearcore #315
Comments
In order to complete part related to the |
I see. Okay, my thought is let's introduce the
What do you think about it? |
Please elaborate, what do you mean? |
@khorolets at this point I'm not even sure that splitting the |
I wouldn't say I like it either.
don't rush in judgments :)
I wonder why you think it doesn't mean full compatibility. Please elaborate on the unified actix server idea. |
Even if |
Some time ago, along with the release of some ReadRPC versions, we accidentally removed logic from the parsing incoming parameters function. We relied on the official NEAR JSON RPC documentation for that. However, the
nearcore
JSON RPC supports so-called legacy input parameters, which is not encouraged and thus removed from the doc. Some parties in the ecosystem are still using them, and accidental removal has caused some trouble.We aim to give 100% compatibility with the
nearcore
JSON RPC implementation, so in the end, we introduced a hack that exposes the entirenear-jsonrpc
crate fromnearcore
, and now it is a dependency for the ReadRPC. This dependency is huge and has underlying dependencies that we don't need/want in the ReadRPC. Additionally, that hack doesn't belong to the main codebase of thenearcore
but rather in our fork, which introduces undesired points of potential failure and responsibility.While that was fine as a temporary solution, it's worth to handle it properly.
nearcore
sideOn the
nearcore
side, it would be better to extract the interface of the JSON RPC into a public trait in a separate crate that should be published along with othernearcore
crates similar tonear-jsonrpc-primives
,near-indexer-primitives
,near-primitives
etc.near-jsonrpc
to use that traitnearcore
logic there as a default implementation (this will help us to avoid breaking this part accidentally)nearcore
ReadRPC side
Once the
nearcore
part is done (or in parallel), we need to replace thenear-jsonrpc
dependency we have right now with the newly introduced trait.The text was updated successfully, but these errors were encountered: