chain-spec: support for json config/patch (and GenesisBuilder API)#7508
chain-spec: support for json config/patch (and GenesisBuilder API)#7508michalkucharczyk wants to merge 20 commits intomasterfrom
chain-spec: support for json config/patch (and GenesisBuilder API)#7508Conversation
New feature fast-runtime-10m was added. This adds new rococo-runtime blob with hard-coded epochDuration. This prevents from manipulating the state to change the runtime constants. This commit also allows to remove `RococoGenesisExt` hack.
In this commit: - all references to `RuntimeGenesisConfig` are removed, - `RococoGenesisExt` is removed. It was the hack to allow overwriting `EpochDurationInBlocks` (1m/10m/60m rococo runtimes are now available), - all `(kusama|polkadot|versi|rococo|wococo)_(staging|dev)_genesis_config` functions now return the JSON patch for default runtime `GenesisConfig`, - ChainSpecBuilder is used, `from_gensis` is removed,
…ort-for-genesis-builder-api
Explicitly building fast-runtime version of rococo runtime is no longer done. Environment variables which control the time::EpochDurationInBlocks value were added: - ROCOCO_FAST_RUNTIME - enables the fast runtime version of runtime with default value of EpochDurationInBlocks set to 10. Value of env does not matter. - ROCOCO_EPOCH_DURATION - enables the fast runtime version with provided value of EpochDurationInBlocks (epoch duration will be set to the value of env). Examples: - to build runtime for `versi_staging_testnet_config which had EpochDurationInBlocks set to 100: ``` ROCOCO_EPOCH_DURATION=100 cargo build -p rococo ``` - to build runtime for `versi_staging_testnet_config which had EpochDurationInBlocks set to 100: ``` ROCOCO_EPOCH_DURATION=100 cargo build -p rococo-runtime ``` - to build runtime for `wococo_development` ``` ROCOCO_EPOCH_DURATION=10 cargo build -p rococo-runtime or ROCOCO_FAST_RUNTIME=1 cargo build -p rococo-runtime ```
|
bot rebase |
…ort-for-genesis-builder-api
|
Rebased |
…ort-for-genesis-builder-api
|
bot rebase |
…ort-for-genesis-builder-api
|
Rebased |
|
bot rebase |
…ort-for-genesis-builder-api
|
Rebased |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
|
@paritytech/devrel , @the-right-joyce I wanted to give you a heads-up about some changes that have just been made in this PR. I've modified the default You can find additional details in the PR description. This change could affect tutorials (and docs maybe?) that rely on timing within these runtimes. Therefore, I request you to please review and update them accordingly, and include information on how to adjust timings based on these changes. Thank you for your attention. |
This PR is a step towards adding support of RuntimeGenesisConfig into the wasm runtime:
In this PR:
all references to
RuntimeGenesisConfiginnode/serviceare removed,RococoGenesisExtis removed. It was the hack to allow overwritingEpochDurationInBlocks. Removal ofRococGenesisExtprevents from manipulating the state to change the runtime constants, what allows to keep metadata const.all
(kusama|polkadot|versi|rococo|wococo)_(staging|dev)_genesis_configfunctions now return the JSON patch for default runtimeGenesisConfig,ChainSpecBuilderis used,ChainSpec::from_genesisis removed,rococo-runtimechanges:rococo-runtimeis no longer done.time::EpochDurationInBlocksvalue were added:ROCOCO_FAST_RUNTIME- enables the fast runtime version of runtime with default value of EpochDurationInBlocks set to 10. Value ofenvdoes not matter.ROCOCO_EPOCH_DURATION- enables the fast runtime version with provided value of EpochDurationInBlocks (epoch duration will be set to the value of env).rococo-runtimebuilding examples:versi_staging_testnetwhich had EpochDurationInBlocks set to 100:wococo_developmentversi-stagingchain spec:wococo-devchain spec:Companion for: paritytech/substrate#14562
cumulus companion: paritytech/cumulus#2936
Step towards: paritytech/polkadot-sdk#25