diff --git a/lib/src/json_rpc/parse.rs b/lib/src/json_rpc/parse.rs index d9e201bf26..b526b0be2c 100644 --- a/lib/src/json_rpc/parse.rs +++ b/lib/src/json_rpc/parse.rs @@ -289,7 +289,7 @@ pub fn build_error_response( (SerdeErrorCode::ServerError(n), msg) } ErrorResponse::ApplicationDefined(n, msg) => { - assert!(!(-32700..=-32000).contains(&n)); + assert!(!(-32768..=-32000).contains(&n)); (SerdeErrorCode::MethodError(n), msg) } }; diff --git a/light-base/src/json_rpc_service/background/chain_head.rs b/light-base/src/json_rpc_service/background/chain_head.rs index 7d254d2622..1ad7202422 100644 --- a/light-base/src/json_rpc_service/background/chain_head.rs +++ b/light-base/src/json_rpc_service/background/chain_head.rs @@ -98,7 +98,7 @@ impl Background { "Rejected `chainHead_unstable_follow` subscription due to limit reached." ); request.fail(json_rpc::parse::ErrorResponse::ApplicationDefined( - -32100, + -32800, "Maximum number of `chainHead_unstable_follow` subscriptions reached", )); return; diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 69a18e934a..85b2577551 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -11,6 +11,7 @@ - Fix panic when the runtime of a chain provides consensus information that is inconsistent with the information found in the finalized block. ([#1317](https://github.com/smol-dot/smoldot/pull/1317)) - Incoming notification substreams are now properly when accepted when a peer doesn't have a slot or gets a slot later on. ([#1369](https://github.com/smol-dot/smoldot/pull/1369)) +- Fix panic when `chainHead_unstable_follow` is called too many times. ([#1392](https://github.com/smol-dot/smoldot/pull/1392)) ## 2.0.10 - 2023-11-17