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

Don't panic if failing to find the desired runtime API #512

Merged
merged 3 commits into from
May 3, 2023
Merged
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
10 changes: 8 additions & 2 deletions light-base/src/json_rpc_service/background.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1289,9 +1289,15 @@ impl<TPlat: PlatformRef> Background<TPlat> {
.apis
.find_version(api_name);
match version {
None => return Err(RuntimeCallError::ApiNotFound),
None => {
runtime_call_lock.unlock(virtual_machine);
return Err(RuntimeCallError::ApiNotFound);
}
Some(v) if version_range.contains(&v) => Some(v),
Some(v) => return Err(RuntimeCallError::ApiVersionUnknown { actual_version: v }),
Some(v) => {
runtime_call_lock.unlock(virtual_machine);
return Err(RuntimeCallError::ApiVersionUnknown { actual_version: v });
}
}
} else {
None
Expand Down
1 change: 1 addition & 0 deletions wasm-node/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- Fix panic when the best block of a chain switches to being equal to the current finalized block. This can occasionally happen for parachains in case of a reorg on the relay chain. ([#497](https://github.com/smol-dot/smoldot/pull/497))
- Fix panic when failing to find the desired runtime API in a runtime. ([#512](https://github.com/smol-dot/smoldot/pull/512))

## 1.0.3 - 2023-04-27

Expand Down