casper-network / casper-node

Reference client for CASPER protocol
https://casper.network
Apache License 2.0
390 stars 221 forks source link

Add new communication endpoint to node- RPC Sidecar #4389

Closed SaiProServ closed 7 months ago

SaiProServ commented 11 months ago

Node should be able to serve raw data from storage.

rafal-ch commented 11 months ago

Requirements:

cc: @marc-casperlabs @Fraser999

rafal-ch commented 11 months ago

Node side:

Sidecar side:

rafal-ch commented 10 months ago

Regarding the in-memory data that is used in the RPC queries, here's the summary from @jacek-casper: https://gist.github.com/jacek-casper/9dce32c2e4b0282efd497f6e7abffaba

rafal-ch commented 10 months ago

Updated todo list:

Additional TODOs after the first review meeting:

struct BinaryResponse { request: BinaryRequest, payload_type: PayloadType, payload: Vec, }


* [x] `AllValues` and `Trie` variants of `GetRequest` should be disabled by default (via appropriate config settings)
* [ ] `completed_blocks` vs `complete_blocks` - use consistent naming (across the node, not only binary port)
* [x] Each request that take a block as an input should use `BlockIdentifier` and not be limited to either `BlockHeight` or `BlockHash`
* [x] Add a `Status` request that will deliver all data needed for the `/status` endpoint at once
* [x] NCTL, casper-test **and** casper-client-rs should talk to sidecar in the initial release - then we can consider modifying them to talk directly to the binary port
* [x] Rework `TrySpeculativeExec` and `TrySpeculativeExec` - speculative execution should require only a single call to `TrySpeculativeExec` (unlike right now, when it first needs to do `TrySpeculativeExec`. 
* [x] Create new "upgrade scenario" to test upgrade from a node without sidecar
* [x] Create test that verifies that RPC sidecar is able to process legacy data (pre 1.5)
* [x] BinaryRequest two-pass parse
* [ ] Proptest for `TryAcceptTransaction` and `TrySpeculativeExecution`
* [x] Write binary protocol specification
* [x] bytesrepr roundrip tests
* [x] component tests for `Db`, `TrySepculativeExec` and `TryAcceptTransaction`