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 presets for glutton westend #7481

Merged

Conversation

clangenb
Copy link
Contributor

@clangenb clangenb commented Feb 5, 2025

Extracted from #7473.

Part of: #5704.

@clangenb clangenb requested review from a team as code owners February 5, 2025 14:16
@clangenb clangenb changed the title add glutton westend genesis presets add genesis presets for glutton westend Feb 5, 2025
@clangenb clangenb marked this pull request as draft February 19, 2025 21:48
@clangenb clangenb marked this pull request as ready for review February 20, 2025 08:01
@clangenb
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor

Copy link
Contributor

@bkontur bkontur left a comment

Choose a reason for hiding this comment

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

@clangenb also please clean cumulus/polkadot-parchain/src/chain_spec/glutton.rs

@clangenb
Copy link
Contributor Author

@clangenb also please clean cumulus/polkadot-parchain/src/chain_spec/glutton.rs

Hmm, I don't think this is a good idea, polkadot-parachain-bin CLI wants to extract the para-id from the command, see

para_id.expect("Must specify parachain id"),
.

But we can't do this with the genesis presets, as the para-id is hardcoded. So I think I should only clean this up, if we decide to remove the option for passing custom para-ids from the CLI. What is your take on this?

…s_config_presets.rs

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
@bkontur
Copy link
Contributor

bkontur commented Feb 20, 2025

@clangenb also please clean cumulus/polkadot-parchain/src/chain_spec/glutton.rs

Hmm, I don't think this is a good idea, polkadot-parachain-bin CLI wants to extract the para-id from the command, see

para_id.expect("Must specify parachain id"),

.

But we can't do this with the genesis presets, as the para-id is hardcoded. So I think I should only clean this up, if we decide to remove the option for passing custom para-ids from the CLI. What is your take on this?

I see, so you don't need to use .with_genesis_config_preset_name(sp_genesis_builder::LOCAL_TESTNET_RUNTIME_PRESET), but you can still use

.with_genesis_config_patch(glutton_westend_runtime::genesis_config_presets::glutton_westend_genesis(
		para_id,
		vec![Sr25519Keyring::Alice.public().into()],
	))

at least we will use one source of this genesis, and it should be ok, while we are referencing the glutton_westend_runtime::WASM_BINARY above.

@clangenb
Copy link
Contributor Author

Ahh, damn you are right. I could have thought of this too. Thanks. 🚀

@clangenb
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor

Copy link
Contributor

Command "prdoc --audience runtime_dev --bump minor" has failed ❌! See logs here

@clangenb
Copy link
Contributor Author

/cmd prdoc --audience runtime_dev --bump minor --force

@clangenb
Copy link
Contributor Author

PR is ready for more reviews. 🚀

…stend-genesis-presets

# Conflicts:
#	Cargo.lock
Copy link
Contributor

@seadanda seadanda left a comment

Choose a reason for hiding this comment

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

We're aiming to deprecate the use of polkadot-parachain with its hardcoded list of runtimes in favour of the omni-node anyway, which just takes the runtime wasm and other configs as arguments. You always need to recompile the wasm to change the para id in the presets though.

@clangenb
Copy link
Contributor Author

Cool, thanks for the reviews! I guess we can add this to the merge queue if someone could add a label?

@bkontur bkontur added the R0-silent Changes should not be mentioned in any release notes label Feb 26, 2025
Comment on lines +44 to 49
.with_genesis_config_patch(
glutton_westend_runtime::genesis_config_presets::glutton_westend_genesis(
authorities,
para_id,
),
)
Copy link
Member

Choose a reason for hiding this comment

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

Why are you not using the preset here? Why are you calling the code from the runtime here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because the current implementation wants to pass the para-id from the CLI, but the presets have a hardcoded para-id (see above discussion). If this is no longer the desired behaviour I am happy to change it.

Only glutton has this behaviour, and I remember that some wanted to launch many gluttons on one relay chain for stress testing. So I thought it should remain like that.

Copy link
Member

Choose a reason for hiding this comment

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

I just saw the comments above. Maybe we need some with_genesis_config_patch_and_preset.

CC @michalkucharczyk

Copy link
Contributor

@michalkucharczyk michalkucharczyk Feb 26, 2025

Choose a reason for hiding this comment

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

Yeah, ideally if presets/more patches could be stacked.

But also GenesisConfigBuilderRuntimeCaller::get_named_preset could be called to get preset from wasm, and then simply merge the patch:

crate::json_patch::merge(&mut config, json!({... para_id}));

And use merged output in ChainSpecBuilder::with_genesis_config_patch.

That flow would avoid call into the native runtime.

@bkchr bkchr added this pull request to the merge queue Feb 26, 2025
Merged via the queue into paritytech:master with commit cbc9b90 Feb 26, 2025
266 of 271 checks passed
@clangenb clangenb deleted the cl/add-glutton-westend-genesis-presets branch February 27, 2025 06:46
@bkchr
Copy link
Member

bkchr commented Feb 28, 2025

/tip medium

Copy link

@bkchr A referendum for a medium (80 DOT) tip was successfully submitted for @clangenb (16YCL3UVpVWQLGW3p3Zx4k5WAEp9W1DwdDnxAbyAaPxVxnp3 on polkadot).

Referendum number: 1461.
tip

Copy link

The referendum has appeared on Polkassembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants