Skip to content

runtime_service: don't panic if to_background_tx fails to upgrade after chain removal#2248

Open
SAY-5 wants to merge 2 commits into
paritytech:mainfrom
SAY-5:say5/runtime-service-upgrade-3238
Open

runtime_service: don't panic if to_background_tx fails to upgrade after chain removal#2248
SAY-5 wants to merge 2 commits into
paritytech:mainfrom
SAY-5:say5/runtime-service-upgrade-3238

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 2, 2026

Copy link
Copy Markdown

Fixes paritytech/smoldot#3238 (the same code path lives here at light-base/src/runtime_service.rs:1689).

When a chain object is removed concurrently with an in-flight SubscribeAll response, background.to_background_tx.upgrade() returns None and the unwrap() panics the runtime task, this is the panic users started hitting after upgrading to 3.1.1 in browser dapps. The receiver is going away anyway in that case; skip the response with continue.

…er chain removal

Signed-off-by: SAY-5 <say.apm35@gmail.com>
@cla-bot-2021

cla-bot-2021 Bot commented May 2, 2026

Copy link
Copy Markdown

User @SAY-5, please sign the CLA here.

@voliva voliva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiarised enough with the codebase, but I'm wondering... the .unwrap() has been there for quite a long time, and it hasn’t caused issues until 3.1.1.

To me, it looks like it was written based on an assumption that may no longer hold true, and that could matter. Simply turning it into a noop when background_tx.upgrade() returns None might have other implications as well.

My question is, what’s actually causing this channel to close instead of cleanly shutting down whatever process it was handling?

@lexnv

lexnv commented May 11, 2026

Copy link
Copy Markdown
Contributor

The fix has been adopted in:

Would suggest creating PRs against the https://github.com/paritytech/smoldot, we plan to keep this as an archive / history repo 🙏

@SAY-5 thanks for contributing!

@SAY-5

SAY-5 commented May 11, 2026

Copy link
Copy Markdown
Author

Thanks for the pointer, closing this in favour of the smoldot fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smoldot panic after initial parachain sync if the chain object was removed

3 participants