Skip to content
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

Update for JSON-RPC spec change #2994

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions bin/light-base/src/json_rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ impl<TPlat: Platform> Background<TPlat> {
follow_subscription,
hash,
key,
child_key,
child_trie,
network_config,
} => {
self.chain_head_storage(
Expand All @@ -1114,7 +1114,7 @@ impl<TPlat: Platform> Background<TPlat> {
&*follow_subscription,
hash,
key,
child_key,
child_trie,
network_config,
)
.await;
Expand Down
9 changes: 5 additions & 4 deletions bin/light-base/src/json_rpc_service/chain_head.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ impl<TPlat: Platform> Background<TPlat> {
follow_subscription: &str,
hash: methods::HashHexString,
key: methods::HexString,
child_key: Option<methods::HexString>,
child_trie: Option<methods::HexString>,
network_config: Option<methods::NetworkConfig>,
) {
let network_config = network_config.unwrap_or(methods::NetworkConfig {
Expand All @@ -872,23 +872,24 @@ impl<TPlat: Platform> Background<TPlat> {
total_attempts: 3,
});

if child_key.is_some() {
if child_trie.is_some() {
// TODO: implement this
self.requests_subscriptions
.respond(
&state_machine_request_id,
json_rpc::parse::build_error_response(
request_id,
json_rpc::parse::ErrorResponse::ServerError(
-32000,
"Child key storage queries not supported yet",
"Child trie storage queries not supported yet",
),
None,
),
)
.await;
log::warn!(
target: &self.log_target,
"chainHead_unstable_storage with a non-null childKey has been called. \
"chainHead_unstable_storage with a non-null childTrie has been called. \
This isn't supported by smoldot yet."
);
return;
Expand Down
4 changes: 4 additions & 0 deletions bin/wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- The `childKey` parameter of the `chainHead_unstable_storage` JSON-RPC function has been renamed to `childTrie` in accordance to the latest specification changes. ([#2994](https://github.com/paritytech/smoldot/pull/2994))

## 0.7.6 - 2022-11-04

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/json_rpc/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ define_methods! {
#[rename = "followSubscription"] follow_subscription: Cow<'a, str>,
hash: HashHexString,
key: HexString,
#[rename = "childKey"] child_key: Option<HexString>,
#[rename = "childTrie"] child_trie: Option<HexString>,
#[rename = "networkConfig"] network_config: Option<NetworkConfig>
) -> Cow<'a, str>,
chainHead_unstable_unfollow(
Expand Down