Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
717ee38
rpc/chain_head: Add event structure for serialization
lexnv Oct 21, 2022
3716594
rpc/chain_head: Add tests for events
lexnv Oct 21, 2022
c3ac4b8
rpc/chain_head: Add API trait for `chainHead`
lexnv Oct 21, 2022
4f88981
rpc/chain_head: Add RPC errors
lexnv Oct 21, 2022
ab1bc81
rpc/chain_head: Manage subscription ID tracking for pinned blocks
lexnv Oct 21, 2022
2e2237f
rpc/chain_head: Add tests for subscription management
lexnv Oct 21, 2022
798acd2
rpc/chain_head: Constructor for the API
lexnv Oct 21, 2022
373887c
rpc/chain_head: Placeholders for API implementation
lexnv Oct 21, 2022
aa1d21b
rpc/chain_head: Accept RPC subscription sink
lexnv Oct 21, 2022
d8e60f7
rpc/chain_head: Generate the runtime API event
lexnv Oct 21, 2022
8dbdaf8
rpc/chain_head: Implement the `follow` method
lexnv Oct 21, 2022
3ed5c79
rpc/chain_head: Implement the `body` method
lexnv Oct 21, 2022
27d9a5c
rpc/chain_head: Implement the `header` method
lexnv Oct 21, 2022
9ec6b36
rpc/chain_head: Implement the `storage` method
lexnv Oct 21, 2022
70fd229
rpc/chain_head: Implement the `call` method
lexnv Oct 21, 2022
d93161a
rpc/chain_head: Implement the `unpin` method
lexnv Oct 21, 2022
2bec344
Update `Cargo.lock`
lexnv Oct 21, 2022
7e4326a
rpc/chain_head: Implement `getGenesis` method
lexnv Oct 24, 2022
0f32685
rpc/chain_head: Fix clippy
lexnv Oct 24, 2022
4ba5d77
rpc/chain_head: Parse params from hex string
lexnv Oct 24, 2022
542d360
rpc/chain_head: Constuct API with genesis hash
lexnv Oct 25, 2022
e1f5796
rpc/chain_head: Add the finalized block to reported tree route
lexnv Oct 25, 2022
cf3530c
rpc/chain_head: Export the API and events for better ergonomics
lexnv Oct 25, 2022
7ae67fa
chain_head/tests: Add test module with helper functions
lexnv Oct 25, 2022
80b8776
chain_head/tests: Test block events from the `follow` pubsub
lexnv Oct 25, 2022
83e926c
chain_head/tests: Test `genesisHash` getter
lexnv Oct 25, 2022
f047db9
chain_head/tests: Test `header` method
lexnv Oct 25, 2022
05d6219
chain_head/tests: Test `body` method
lexnv Oct 25, 2022
f9c004b
chain_head/tests: Test calling into the runtime API
lexnv Oct 25, 2022
e0ab77c
chain_head/tests: Test runtime for the `follow` method
lexnv Oct 25, 2022
04574cc
chain_head/tests: Add runtime code changes for `follow` method
lexnv Oct 25, 2022
b64a9c9
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Oct 26, 2022
2de8d6c
rpc/chain_head: Remove space from rustdoc
lexnv Oct 26, 2022
d78e04d
rpc/chain_head: Use the `child_key` for storage queries
lexnv Oct 26, 2022
ba8a257
rpc/chain_head: Test `storage` method
lexnv Oct 26, 2022
745c795
rpc/chain_head: Test child trie query for `storage` method
lexnv Oct 26, 2022
c80a428
rpc/chain_head: Event serialization typo
lexnv Oct 26, 2022
cce8e42
rpc/chain_head: Remove subscription aliases
lexnv Oct 27, 2022
a5678c4
rpc/chain_head: Add `NetworkConfig` parameter
lexnv Oct 27, 2022
e6f7df0
rpc/chain_head: Named parameters as camelCase if present
lexnv Oct 27, 2022
80ddec8
rpc/chain_head: Implement From<ApiError> for RuntimeEvents
lexnv Nov 3, 2022
08fe794
rpc/chain_head: Handle pruning of the best block in finalization window
lexnv Nov 4, 2022
76c0d2c
rpc/chain_head: Generate initial block events
lexnv Nov 4, 2022
cad484e
chain_head/tests: Verify that initial in-memory blocks are reported
lexnv Nov 7, 2022
351154f
chain_head/tests: Verify the finalized event with forks and pruned bl…
lexnv Nov 7, 2022
f185e7c
rpc/chain_head: Fix clippy
lexnv Nov 7, 2022
4742b7c
rpc/chain_head: Separate logic for generating initial events
lexnv Nov 8, 2022
06ac897
rpc/chain_head: Handle stopping a subscription ID
lexnv Nov 8, 2022
06797df
rpc/chain_head: Submit events until the "Stop" event is triggered
lexnv Nov 8, 2022
2a1b79f
rpc/chain_head: Separate logic for handling new and finalized blocks
lexnv Nov 8, 2022
e5fac2c
rpc/chain_head: Extend subscription logic with subId handle
lexnv Nov 9, 2022
6b84dd4
rpc/chain_head: Adjust to the new subscription mngmt API
lexnv Nov 9, 2022
091cd90
rpc/chain_head: Refuse RuntimeAPI calls without the runtime flag
lexnv Nov 9, 2022
f5514b8
chain_head/tests: Verify RuntimeAPI calls without runtime flag
lexnv Nov 9, 2022
a060fb8
rpc/chain_head: Add best block per subscription
lexnv Nov 9, 2022
d782cc2
rpc/chain_head: Check storage keys for prefixes
lexnv Nov 9, 2022
4ce5fe5
chain_head/tests: Check storage queries with invalid prefixes
lexnv Nov 9, 2022
60a46ab
rpc/chain_head: Allow maximum number of pinned blocks
lexnv Nov 10, 2022
239013c
chain_head/tests: Test the maximum number of pinned blocks
lexnv Nov 10, 2022
1edc4a7
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Nov 10, 2022
7804896
rpc/chain_head: Adjust to origin/master and apply clippy
lexnv Nov 10, 2022
42035bf
client/service: Enable the `chainHead` API
lexnv Nov 17, 2022
ed720a1
rpc/chain_head: Stop subscription on client disconnect and add debug …
lexnv Nov 17, 2022
3820d4f
rpc/chain_head: Fix sending `Stop` on subscription exit
lexnv Nov 17, 2022
e95fa3f
rpc/chain_head: Check best block is descendent of latest finalized
lexnv Nov 17, 2022
4372c4a
chain_head/tests: Report events before pruning the best block
lexnv Nov 18, 2022
eab917f
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Nov 23, 2022
9d25bea
rpc/chain_head: Nonrecursive initial block generation
lexnv Nov 23, 2022
1065eaf
rpc/chain_head: Generate initial events on subscription executor
lexnv Nov 23, 2022
6dbd383
rpc/chain_head: Reduce dev-dependencies for tokio
lexnv Nov 24, 2022
54b7395
Apply suggestions from code review
lexnv Nov 24, 2022
331e1bb
rpc/chain_head: Accept empty parameters
lexnv Nov 30, 2022
6da3073
rpc/chain_head: Use debug of `HexDisplay` for full format
lexnv Nov 30, 2022
cafd5ef
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Dec 12, 2022
cc4d1a5
rpc/chain_head: Enable subscription ID
lexnv Dec 12, 2022
9a3f5f7
rpc/chain_head: Use jsonrpsee 16.2 camelCase feature for paramaters
lexnv Dec 12, 2022
7e7afed
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Dec 13, 2022
22bd9fa
Merge remote-tracking branch 'origin/master' into lexnv/rpc_chainhead
lexnv Dec 19, 2022
0111353
rpc/chain_head: Use `NonZeroUsize` for `NetworkConfig` param
lexnv Dec 19, 2022
41aee3e
rpc/chain_head: Rename `runtime_updates` to `has_runtime_updates`
lexnv Dec 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rpc/chain_head: Use NonZeroUsize for NetworkConfig param
Signed-off-by: Alexandru Vasile <[email protected]>
  • Loading branch information
lexnv committed Dec 19, 2022
commit 0111353bbbcbb62c9fee97d9e5efb75d8301a2da
9 changes: 7 additions & 2 deletions client/rpc-spec-v2/src/chain_head/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use serde::{ser::SerializeStruct, Deserialize, Serialize, Serializer};
use sp_api::ApiError;
use sp_version::RuntimeVersion;
use std::num::NonZeroUsize;

/// The network config parameter is used when a function
/// needs to request the information from its peers.
Expand All @@ -36,7 +37,7 @@ pub struct NetworkConfig {
/// # Note
///
/// A zero value is illegal.
max_parallel: u64,
max_parallel: NonZeroUsize,
/// The time, in milliseconds, after which a single requests towards one peer
/// is considered unsuccessful.
timeout_ms: u64,
Expand Down Expand Up @@ -463,7 +464,11 @@ mod tests {

#[test]
fn chain_head_network_config() {
let conf = NetworkConfig { total_attempts: 1, max_parallel: 2, timeout_ms: 3 };
let conf = NetworkConfig {
total_attempts: 1,
max_parallel: NonZeroUsize::new(2).expect("Non zero number; qed"),
timeout_ms: 3,
};

let ser = serde_json::to_string(&conf).unwrap();
let exp = r#"{"totalAttempts":1,"maxParallel":2,"timeoutMs":3}"#;
Expand Down