Support forking a custom relay chain - #137
Conversation
|
@pepoviola heads up, three more commits landed here after your review, all from actually forking public paseo with this branch (custom relay + PPN's next paras)
worth a second look at those three before this merges |
|
@pepoviola I ran this branch against real networks end to end Kusama relay + Asset Hub forked in ~20 min:
four fixes came out of the runs, all in this PR:
|
| cmd: context_relay.cmd(), | ||
| // The relay validators must run the doppelganger binary: it honours | ||
| // ZOMBIE_DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION, without which | ||
| // the stock dispute coordinator scans ancestor headers a warp-synced | ||
| // bite does not have, never initializes, and caps finality at the bite | ||
| // block forever while blocks keep being produced. | ||
| cmd: context_relay.doppelganger_cmd(), |
There was a problem hiding this comment.
This is incorrect, the final config should use the polkakdot binary with ZOMBIE_DISPUTE_CANDIDATE_LIFETIME_AFTER_FINALIZATION set to 1 in env
There was a problem hiding this comment.
reverted to the plain binary - my local polkadot was 1.22.0, one release before sdk#12247, hence the confusion. README now asks for v1.22.1+
| if para.chain.contains("asset-hub") { | ||
| // Elastic scaling (more than one core) requires slot-based | ||
| // authoring, whatever the parachain is called. | ||
| if para.chain.contains("asset-hub") || para.cores > 1 { |
There was a problem hiding this comment.
if the comment is true we should remove the para.chain.contains("asset-hub") part.
There was a problem hiding this comment.
removed, cores > 1 covers asset-hub anyway
| // first session rotation re-elects the production validators - whose | ||
| // Session::NextKeys the bite has just replaced - and authoring halts an | ||
| // epoch in. Forcing::ForceNone keeps the dev set elected. | ||
| set.inject("Staking", "ForceEra", "02"); |
There was a problem hiding this comment.
nice comment :) , my artisan hardcoded injection was not mention the cause :)
pepoviola
left a comment
There was a problem hiding this comment.
a few inline comments and then is good to merge 🚀
Stacked on #129, and includes #135's change (a custom relay has to be able to supply its endpoint, so the two overlap).
-r custom%<name>%<rpc_endpoint>%<chain_spec_path>forks a relay zombie-bite has no built-in knowledge of. The name is what artifacts are named after, the endpoint is what state and metadata are read from, and the spec is what the node is started with (--chain <spec>instead of a network name). There is no built-in host config for such a relay, soConfiguration::ActiveConfighas to come from the endpoint — the bite fails with that reason if it can't.A relay name outside
polkadot/kusama/paseo/westendis now a custom relay instead of silently falling back to polkadot. That is what lets the helper subcommands (generate-artifacts,clean-up-dir), which only get the name back as a string, keep naming a custom relay's artifacts correctly — and a typo'd name now fails instead of biting the wrong chain.The node stores its db under the chain-spec's own
id, which need not match the artifact name, so the snapshot path is resolved from the spec.Closes #133
Closes #134
Also fixes
ParaScheduler::ValidatorGroupsshape: one group per core with validators round-robined, instead of one group per validator. The old shape (always cores+1 groups) wedges the scheduler/approval subsystems on a live fork and finality stays pinned at the bite block - found by forking public paseo and comparing against preview-net's working bites. Requesting more cores than the dev validators can staff is now an error