-
Notifications
You must be signed in to change notification settings - Fork 26
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
book/architecture: RPC handlers and related #341
Draft
hinto-janai
wants to merge
4
commits into
Cuprate:main
Choose a base branch
from
hinto-janai:book
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
RPC stuff that needs to be written in the architecture book: | ||
|
||
## General | ||
- diagram showing full pipeline from input to output with crate responsibilities listed along the line | ||
|
||
## The handler | ||
- {json-rpc, binary, other} handler functions implemented in `cuprated` <CODE_LINK> | ||
- handler -> helper function -> internal component's `Service` | ||
|
||
## Unsupported RPC calls / RPC calls with different behavior | ||
- https://github.com/Cuprate/cuprate/issues/278 | ||
- binary strings -> full JSON: `get_transaction_pool_backlog`, `get_output_distribution` | ||
- not in `monerod` yet: `get_tx_ids_loose` | ||
|
||
## Differences with monerod (Request strictness) | ||
Some of `monerod`'s RPC request types contain fields not for users to provide, | ||
but for internal usage within the RPC handlers and `monerod` itself, some examples: | ||
- <LINK_TO_INTERNAL_FIELDS_IN_REQUEST_TYPE> | ||
|
||
Unless one of these actually allows something unintentionally bad to happen, this is mostly an unimportant detail. | ||
<CHECK_THAT_ONE_OF_THESE_FIELDS_ISNT_A_SECURITY_FLAW> | ||
|
||
Practically, it means users can provide these fields and `monerod` will deserialize them | ||
and accept them fine, while `cuprated` will not because they are not part of the type. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,2 +1,8 @@ | ||||||
# The handler | ||||||
> TODO: fill after `cuprate-rpc-handler` is created. | ||||||
The handlers (functions that map requests into responses) are / can be generic with `cuprate-rpc-interface`. | ||||||
|
||||||
The main handlers used by Cuprate is implemented in `cuprated` itself, it implements the standard RPC handlers modeled after `monerod`. | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
lol There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These links do not exist yet, they depend on #355. |
||||||
- JSON-RPC handlers: <LINK_TO_FILE> | ||||||
- Binary handlers: <LINK_TO_FILE> | ||||||
- Other JSON handlers: <LINK_TO_FILE> |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.