fix(node): don't spawn Frontier-RPC pool validation tasks as essential#4051
Merged
Kailai-Wang merged 2 commits intoJun 25, 2026
Merged
Conversation
The standard-frontier migration (#3841) added a secondary transaction pool solely to expose a low-level `graph::Pool` to the Frontier txpool/graph RPC, built via `FullChainApi::new(.., &task_manager.spawn_essential_handle())`. `FullChainApi::new` spawns two `transaction-pool-task-{0,1}` validation tasks through that spawner. Because they were spawned with the ESSENTIAL handle, when those tasks resolve at startup the whole node is torn down with `Essential task `transaction-pool-task-0` failed. Shutting down service.` — deterministically, even on a fresh genesis DB. This made every v0.9.26 image unable to start on heima (it was never a host-function/runtime issue). Spawn that secondary pool's tasks NON-essentially via a small `NonEssentialSpawner` adapter (forwards SpawnEssentialNamed -> ordinary SpawnNamed). The RPC graph still works; the tasks completing is no longer fatal. The primary transaction pool is unaffected.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
SpawnTaskHandle's spawn/spawn_blocking are inherent methods, so the SpawnNamed trait need not be in scope. CI builds with -D warnings, and the unused import failed parachain-check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every
v0.9.26node image crashes immediately on heima — even on a fresh genesis DB at #0:This is why production has never been able to move off
v0.9.25-01. It is not a host-function or runtime-version issue (the on-chain runtime imports zero moonbeam host functions); it is a node-side wiring bug.Root cause
The standard-frontier migration (#3841, commit
305767d2d) added a secondary transaction pool, used only to expose a low-levelsc_transaction_pool::Pool<FullChainApi>(graph) to the standard Frontiertxpool/graphRPC (which requires the inner pool type, unlike the old fork that accepted the high-level handle):FullChainApi::newspawns twotransaction-pool-task-{0,1}validation tasks via that spawner. Their loop returns when the validation channel closes, and they resolve at startup. Because they were spawned with the essential handle, an essential task ending (not even panicking) triggerstask_manager's "Essential task failed. Shutting down service." — tearing the whole node down. (No panic/backtrace ever appears precisely because it's a normal task completion, not a panic.)Fix
Spawn that secondary RPC-only pool's tasks non-essentially via a small
NonEssentialSpawneradapter that implementsSpawnEssentialNamedby forwarding to the ordinarySpawnNamedmethods of aSpawnTaskHandle. The Frontier RPC graph still works; those tasks completing is no longer fatal. The primary transaction pool (and--pool-type) is untouched.Testing
v0.9.26build; the crash disappears with this change in principle (validation-task completion no longer fatal).rpassword/__errno_locationtoolchain issue blocks the build on the dev machine before reaching the node crate); relying on CI (Linux) for the compile, and recommend validating the built image against a heima DB snapshot before any production swap.Note
Keep prod on
v0.9.25-01until an image built from this is verified to start and author on a heima snapshot.