Skip to content

Verify overrides against chain metadata; per-para cores and messaging switches - #129

Merged
pepoviola merged 2 commits into
mainfrom
feat/metadata-overrides
Aug 28, 2026
Merged

Verify overrides against chain metadata; per-para cores and messaging switches#129
pepoviola merged 2 commits into
mainfrom
feat/metadata-overrides

Conversation

@mordamax

Copy link
Copy Markdown
Contributor
  • Storage keys derived from pallet/item names instead of hardcoded hashes; items the runtime doesn't have are skipped (e.g. ValidatorSet::Validators, which Polkadot/Kusama have no pallet for, was previously written blindly).
  • Every override value is decoded against its real on-chain type and must re-encode byte-identically; trailing bytes are an error, which is what the ValidatorGroups bug looked like.
  • Configuration::ActiveConfig is read live and patched (num_cores only) instead of replaced, so executor_params, async-backing params and max_pov_size of the bitten chain survive.
  • --para-cores <id>=<n> and --keep-messaging-state (both also settable in the TOML config).

Verification needs an RPC endpoint: the relay always has one, a parachain only when rpc_endpoint is set — otherwise overrides fall back to unverified with a warning.

Closes #124
Closes #125

@mordamax
mordamax requested a review from pepoviola August 26, 2026 17:04
@mordamax
mordamax marked this pull request as ready for review August 26, 2026 17:04
Comment thread src/cli.rs
/// when the relay's parachains are exactly the ones being bitten, so the
/// two snapshots agree on channel heads.
#[arg(long, default_value_t = false, verbatim_doc_comment)]
keep_messaging_state: bool,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@mordamax did you test this with polkadot/kusama?

@pepoviola

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@pepoviola
pepoviola merged commit d58003c into main Aug 28, 2026
4 checks passed
@pepoviola
pepoviola deleted the feat/metadata-overrides branch August 28, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants