Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add genesis config presets to runtime #3138

Merged
merged 35 commits into from
Jan 28, 2025

Conversation

manuelmauro
Copy link
Contributor

@manuelmauro manuelmauro commented Jan 17, 2025

What does it do?

When running run-benches-for-runtime.sh to generate the runtime weights, the following warning appears in the logs:

Using the chain spec instead of the runtime to generate the genesis state is deprecated. Please remove the `--chain`/`--dev`/`--local` argument, point `--runtime` to your runtime blob and set `--genesis-builder=runtime`. This warning may become a hard error any time after December 2024. 

This PR updates the script to use --runtime <runtime> instead of --chain=<chain-spec>.

In order to address the issue above, we need move the creation of the genesis config presets to the runtime. (Example PR on polkadot-sdk)

What important points reviewers should know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?

What value does it bring to the blockchain users?

Copy link
Contributor

github-actions bot commented Jan 17, 2025

WASM runtime size check:

Compared to target branch

Moonbase runtime: 2420 KB (+148 KB) 🚨

Moonbeam runtime: 2404 KB (+152 KB) 🚨

Moonriver runtime: 2400 KB (+156 KB) ⚠️

Compared to latest release (runtime-3401)

Moonbase runtime: 2420 KB (+388 KB compared to latest release) 🚨

Moonbeam runtime: 2404 KB (+392 KB compared to latest release) 🚨

Moonriver runtime: 2400 KB (+388 KB compared to latest release) ⚠️

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Coverage Report

@@                                Coverage Diff                                 @@
##           master   manuel/update-deprecation-in-benchmarks-script      +/-   ##
==================================================================================
+ Coverage   74.58%                                           74.59%   +0.01%     
+ Files         377                                              380       +3     
- Lines       96042                                            96035       -7     
==================================================================================
  Hits        71632                                            71632              
- Misses      24410                                            24403       -7     
Files Changed Coverage
/node/cli/src/command.rs 16.94% (+0.02%) 🔼
/node/service/src/chain_spec/moonbase.rs 79.28% (+0.97%) 🔼
/node/service/src/chain_spec/moonbeam.rs 32.04% (+20.00%) 🔼
/node/service/src/chain_spec/moonriver.rs 32.04% (+20.00%) 🔼
/runtime/common/src/apis.rs 28.82% (-0.03%) 🔽

Coverage generated Fri Jan 24 21:47:46 UTC 2025

@manuelmauro manuelmauro changed the title Update deprecation in benchmarks script Update deprecated option in benchmarks script Jan 20, 2025
@manuelmauro manuelmauro changed the title Update deprecated option in benchmarks script Add genesis config presets to runtime Jan 23, 2025
@manuelmauro manuelmauro added the B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes label Jan 23, 2025
@manuelmauro manuelmauro self-assigned this Jan 23, 2025
@manuelmauro manuelmauro marked this pull request as ready for review January 23, 2025 10:33
@manuelmauro manuelmauro requested review from a team as code owners January 23, 2025 10:33
@RomarQ RomarQ added the B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes label Jan 23, 2025
RomarQ
RomarQ previously approved these changes Jan 23, 2025
@RomarQ
Copy link
Contributor

RomarQ commented Jan 23, 2025

LGTM 🚀

@RomarQ
Copy link
Contributor

RomarQ commented Jan 24, 2025

Just noticed that this change increases the runtime size in around 140KB, would be nice if we could optimize things a little.

@RomarQ
Copy link
Contributor

RomarQ commented Jan 24, 2025

About the wasm size increase, we should remove all presets by using a new feature disable-genesis-builder that is enabled here:

on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]

on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]

on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]

runtime/moonbase/Cargo.toml Outdated Show resolved Hide resolved
RomarQ
RomarQ previously approved these changes Jan 24, 2025
@RomarQ RomarQ requested a review from TarekkMA January 24, 2025 17:55
@RomarQ RomarQ merged commit 6d6faaf into master Jan 28, 2025
38 checks passed
@RomarQ RomarQ deleted the manuel/update-deprecation-in-benchmarks-script branch January 28, 2025 14:01
@RomarQ RomarQ mentioned this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B5-clientnoteworthy Changes should be mentioned in any downstream projects' release notes B7-runtimenoteworthy Changes should be noted in any runtime-upgrade release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit not-breaking Does not need to be mentioned in breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants