Remove jsonrpsee and implement json-rpc directly on top of axum#6315
Open
Remove jsonrpsee and implement json-rpc directly on top of axum#6315
Conversation
Migrate the JSON-RPC admin server from jsonrpsee to axum/tower, which are already used elsewhere in the codebase (server/graphman). This removes the jsonrpsee dependency while maintaining full protocol compatibility. Changes: - Add jsonrpc.rs: JSON-RPC 2.0 types (request, response, error, ID) - Add error.rs: Error code mapping from SubgraphRegistrarError - Add handlers.rs: Request dispatch and method handlers - Add server.rs: Axum-based HTTP server with graceful shutdown - Update lib.rs: Module structure with public exports - Update Cargo.toml: Replace jsonrpsee with axum, serde_json, thiserror
Consolidate the repetitive success/error handling pattern into a single `to_response` helper function. Inline the error module into handlers.rs and remove redundant per-handler logging (the dispatch function already logs method, params, and connection info).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This has two advantages:
Since our json-rpc server is very simple, there isn't a big downside to not relying on an external library for this
With this change, we log the following for each json-rpc request: