From aea202322db1cffdcc0374a2cb1c439dcccaa8d3 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 26 Jul 2023 15:53:09 +0200 Subject: [PATCH 1/2] Fix network_service discarding events --- light-base/src/network_service.rs | 9 +++++---- wasm-node/CHANGELOG.md | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/light-base/src/network_service.rs b/light-base/src/network_service.rs index 76c40fae09..bfa2778113 100644 --- a/light-base/src/network_service.rs +++ b/light-base/src/network_service.rs @@ -988,10 +988,11 @@ async fn background_task(mut task: BackgroundTask) { async { WhatHappened::Message(task.messages_rx.next().await.unwrap()) }; let can_generate_event = matches!(task.event_senders, either::Left(_)); let service_event = async { - if let (true, Some(event)) = ( - can_generate_event, - task.network.next_event(task.platform.now()), - ) { + if let Some(event) = if can_generate_event { + task.network.next_event(task.platform.now()) + } else { + None + } { WhatHappened::NetworkEvent(event) } else if let Some(start_connect) = task.network.next_start_connect(|| task.platform.now()) diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 18681a6fae..8b605df0d7 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -8,6 +8,10 @@ - A JSON-RPC error is now returned if the JSON-RPC client tries to open more than two simultaneous `chainHead_unstable_follow` subscriptions, in accordance with the latest changes in the JSON-RPC API specification. ([#962](https://github.com/smol-dot/smoldot/pull/962)) - Rename `chainHead_unstable_storageContinue` to `chainHead_unstable_continue`, in accordance with the latest changes in the JSON-RPC API specification. ([#965](https://github.com/smol-dot/smoldot/pull/965)) +### Fixed + +- Fix several potential panics due to mismatches in the state of the networking. + ## 1.0.13 - 2023-07-16 ### Added From ff59f7bc23e718bbbdaa0b717f5719835e5915bc Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 26 Jul 2023 15:54:01 +0200 Subject: [PATCH 2/2] PR link --- wasm-node/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wasm-node/CHANGELOG.md b/wasm-node/CHANGELOG.md index 8b605df0d7..b47eb0c5a0 100644 --- a/wasm-node/CHANGELOG.md +++ b/wasm-node/CHANGELOG.md @@ -10,7 +10,7 @@ ### Fixed -- Fix several potential panics due to mismatches in the state of the networking. +- Fix several potential panics due to mismatches in the state of the networking. ([#967](https://github.com/smol-dot/smoldot/pull/967)) ## 1.0.13 - 2023-07-16