diff --git a/light-base/src/json_rpc_service/background.rs b/light-base/src/json_rpc_service/background.rs index 8b7cade732..4d1b738927 100644 --- a/light-base/src/json_rpc_service/background.rs +++ b/light-base/src/json_rpc_service/background.rs @@ -1289,9 +1289,15 @@ impl Background { .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 diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index b98244fd81..84d06f805f 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -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