Skip to content

Rewrite the light client JSON-RPC server#1685

Merged
tomaka merged 41 commits intosmol-dot:mainfrom
tomaka:light-json-rpc-clean
Mar 11, 2024
Merged

Rewrite the light client JSON-RPC server#1685
tomaka merged 41 commits intosmol-dot:mainfrom
tomaka:light-json-rpc-clean

Conversation

@tomaka
Copy link
Copy Markdown
Contributor

@tomaka tomaka commented Feb 15, 2024

cc #1415

This PR rewrites the light client JSON-RPC server in order to get rid of the json_rpc::services module of the library. This module was badly designed and is to be replaced with #1436.

Once #1436 is finished and merged, the code in this PR will be split into multiple different JSON-RPC servers (the idea right now being: one for the legacy API, one for the new API, one for transactions) that are merged together through the ServersMultiplexer.

The new code in this PR removes the security properties of the JSON-RPC server. They were never actually documented anywhere, and smoldot doesn't need to have a secure JSON-RPC server at the moment. These security properties will be restored after #1436.

Work time: 45h

@tomaka
Copy link
Copy Markdown
Contributor Author

tomaka commented Mar 11, 2024

Note that I've been trying to keep the existing behavior as much as possible.

However, I remember instinctively changing some return values w.r.t. the new JSON-RPC API to better match the spec, but maybe not all of them. Unfortunately, I don't remember exactly what I've changed, so I don't know what to put in the CHANGELOG.
After this PR, I will do a review of the return codes so that they match the spec.

@tomaka tomaka marked this pull request as ready for review March 11, 2024 13:52
@tomaka
Copy link
Copy Markdown
Contributor Author

tomaka commented Mar 11, 2024

While it's not unlikely that some bugs are being introduced, I'm reasonably confident in the code of this module, and thus I'm going to merge this once CI passes.

@tomaka tomaka added this pull request to the merge queue Mar 11, 2024
Merged via the queue into smol-dot:main with commit 978f907 Mar 11, 2024
@tomaka tomaka deleted the light-json-rpc-clean branch March 11, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant