Skip to content

remote-ext: fix silent state corruption from lagging RPC providers#12268

Open
Stephenlawrence00 wants to merge 4 commits into
paritytech:masterfrom
Stephenlawrence00:remote-ext-fix
Open

remote-ext: fix silent state corruption from lagging RPC providers#12268
Stephenlawrence00 wants to merge 4 commits into
paritytech:masterfrom
Stephenlawrence00:remote-ext-fix

Conversation

@Stephenlawrence00

Copy link
Copy Markdown
Contributor

Fixes #12264 by treating per-item RPC errors as batch failures instead of empty values, verifying the computed storage root against the block header before caching a snapshot, and excluding RPC providers that lack the target block up front.

@Stephenlawrence00

Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience node_dev --bump patch

/// This is signalled by the empty prefix being queued for download (see
/// `init_remote_client`); partial scrapes (specific pallets/keys) never match.
fn is_complete_scrape(&self) -> bool {
self.as_online().hashed_prefixes.iter().any(|p| p.is_empty())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will this also work for child tries?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. With child_trie on, a complete scrape pulls every child trie (load_child_remote) and inserts it via insert_child. into_raw_snapshot recomputes each child root and folds it into the top trie, so the computed_root we compare to the header's state_root already covers child data. A stale child trie changes the top root and fails the check.

@ggwpez ggwpez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please patch up the dependencies here and do a full fetch with polkadot asset hub to ensure it will work end-to-end.

https://github.com/paritytech/try-runtime-cli

@Stephenlawrence00

Stephenlawrence00 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Please patch up the dependencies here and do a full fetch with polkadot asset hub to ensure it will work end-to-end.

https://github.com/paritytech/try-runtime-cli

Pointed try-runtime-cli's polkadot-sdk deps at this branch and ran a full create-snapshot against Polkadot Asset Hub (largest child trie state). It completed successfully, and the storage root verified against the header. Also added an ignored asset_hub_polkadot_storage_root_matches test mirroring the Bridge Hub one.

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.

remote-ext: parallel scraping silently drops errored values

2 participants