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

Rename ExportGenesisStateCommand to ExportGenesisHeadCommand and make it respect custom genesis block builders #2331

Merged
merged 53 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
6fb2596
aura AAAaaa
Nov 14, 2023
89e825b
println and 🤵 emojis
Nov 14, 2023
238a7e0
move log line :facepalm:
Nov 14, 2023
59b2c8f
hack the build-state command
Nov 14, 2023
f58981e
try again
Nov 14, 2023
3caefa5
comment the old generate_genesis_block function
Nov 14, 2023
08365ff
debugging in command
Nov 14, 2023
d456cd0
duplicate error message (To test for async weirdness).
Nov 14, 2023
7c84b90
block backend
Nov 14, 2023
5e20abc
try to have debug output not conflict with actual exported head data
Nov 14, 2023
c72c161
another log
Nov 14, 2023
e4ac486
some more random debugging lines
Nov 15, 2023
ece683a
comment idea to make logs more useful
Nov 15, 2023
cca6d02
format previous head data as hex to better compare to relay state and…
Nov 16, 2023
1b593f7
Remove some logs
Nov 16, 2023
a8e8fb1
Remove some more logging
Nov 16, 2023
439a5d4
Remove panics
Nov 16, 2023
297e1bd
delete commented code
Nov 16, 2023
1f6a2f3
remove some more debugging and tracing
Nov 16, 2023
757dc51
spelling
Nov 16, 2023
85d39ac
fmt
Nov 16, 2023
c187e00
Rename command
Nov 16, 2023
22136dc
update polkadot-parachain (but don't modify it's public CLI)
Nov 16, 2023
35d9518
Update template CLI preserving backward compatability
Nov 16, 2023
01dd857
Do all of the non-cumulus ones that copied the name
Nov 16, 2023
68d858f
And the test service also copied the name
Nov 16, 2023
8f2f471
remove last remaining debugging lines
Nov 16, 2023
81f5dfd
lingering comments
Nov 16, 2023
554fcb3
fmt
Nov 17, 2023
e8d4327
REstore original function in test client to be used only for tests.
Nov 17, 2023
babcd27
Oops, there were still logs left
Nov 17, 2023
30a55f8
comment
Nov 17, 2023
e1566bc
more stray stuff
Nov 17, 2023
50f7f47
x
Nov 17, 2023
31f8a2c
x
Nov 17, 2023
fe5b9f4
fmt
Nov 17, 2023
df69620
fix invocation
Nov 17, 2023
f7c04de
and fix polkadot parachain
Nov 17, 2023
6bc796d
x
Nov 17, 2023
238c874
Doc comments
Nov 17, 2023
89511b6
Basti's suggestion to use clap alias
JoshOrndorff Nov 29, 2023
c41f8a4
fmt
JoshOrndorff Nov 29, 2023
c19c29d
Don't need Block Backend
JoshOrndorff Nov 29, 2023
58a75ea
Merge branch 'master' into polkadot-v1.2.0-hack
JoshOrndorff Nov 29, 2023
a37a3d4
update `command.rs`s to reflect aliases
JoshOrndorff Nov 29, 2023
aa3d14a
update version extraction
JoshOrndorff Dec 12, 2023
0c9dbc2
Merge branch 'master' into polkadot-v1.2.0-hack
JoshOrndorff Dec 12, 2023
3c39cc9
Remove the custom export genesis head command
bkchr Dec 12, 2023
8da60f6
Update cumulus/parachain-template/node/src/cli.rs
bkchr Dec 13, 2023
1e528ee
Remove the custom export genesis wasm command
bkchr Dec 13, 2023
4866c84
Adds prdoc
bkchr Dec 13, 2023
1d5795b
Merge branch 'master' into polkadot-v1.2.0-hack
bkchr Dec 13, 2023
0a21af5
FMT
bkchr Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hack the build-state command
  • Loading branch information
Joshy Orndorff committed Nov 16, 2023
commit 59b2c8fce1157f7024a453f11306a37028630f78
8 changes: 5 additions & 3 deletions cumulus/client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::{
};

use codec::Encode;
use sc_chain_spec::ChainSpec;
use sc_chain_spec::{ChainSpec, BuildGenesisBlock};
use sc_client_api::ExecutorProvider;
use sc_service::{
config::{PrometheusConfig, TelemetryEndpoints},
Expand Down Expand Up @@ -147,17 +147,19 @@ pub struct ExportGenesisStateCommand {

impl ExportGenesisStateCommand {
/// Run the export-genesis-state command
pub fn run<Block: BlockT>(
pub fn run<Block: BlockT, Builder: BuildGenesisBlock<Block>>(
&self,
chain_spec: &dyn ChainSpec,
client: &impl ExecutorProvider<Block>,
genesis_block_builder: Builder,
) -> sc_cli::Result<()> {
let state_version = sc_chain_spec::resolve_state_version_from_wasm(
&chain_spec.build_storage()?,
client.executor(),
)?;

let block: Block = generate_genesis_block(chain_spec, state_version)?;
// let block: Block = generate_genesis_block(chain_spec, state_version)?;
let block: Block = genesis_block_builder.build_genesis_block()?.0;
let raw_header = block.header().encode();
let output_buf = if self.raw {
raw_header
Expand Down