rpc-v2: Enable the `archive` class of methods (#3017)
The
[archive](https://github.com/paritytech/json-rpc-interface-spec/blob/main/src/api/archive.md)
API is unstable and subject to change.
This PR enables the `archive` class of the RPC-V2 spec to substrate
based chains.
The `archive` API is enabled for archive nodes:
- the state of the blocks is in archive mode
- the block's bodies are in archive mode
While at it, this PR extends the `BlocksPrunning` enum with an
`is_archive` helper to check if the pruning mode keeps the block's
bodies for long enough.
Defaults used for the `archive` API:
- a maximum of 5 responses are provided for descendants queries (this is
similar to chainHead)
- a maximum of 8 item queries are accepted at a time
Before stabilizing the API we should look into these defaults and adjust
after collecting some data.
---------
Signed-off-by:
Alexandru Vasile <alexandru.vasile@parity.io>
parent
b4dfad83
Showing
- substrate/client/db/src/lib.rs 10 additions, 0 deletionssubstrate/client/db/src/lib.rs
- substrate/client/rpc-spec-v2/src/archive/archive.rs 42 additions, 10 deletionssubstrate/client/rpc-spec-v2/src/archive/archive.rs
- substrate/client/rpc-spec-v2/src/archive/archive_storage.rs 11 additions, 7 deletionssubstrate/client/rpc-spec-v2/src/archive/archive_storage.rs
- substrate/client/rpc-spec-v2/src/archive/mod.rs 1 addition, 0 deletionssubstrate/client/rpc-spec-v2/src/archive/mod.rs
- substrate/client/rpc-spec-v2/src/archive/tests.rs 12 additions, 5 deletionssubstrate/client/rpc-spec-v2/src/archive/tests.rs
- substrate/client/service/src/builder.rs 23 additions, 1 deletionsubstrate/client/service/src/builder.rs
Please register or sign in to comment