-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore(upgrade): v1.10.0 to v1.11.0 #2117
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,41 +3,39 @@ use cumulus_primitives_core::ParaId; | |
use frequency_service::chain_spec; | ||
use log::info; | ||
use sc_cli::SubstrateCli; | ||
use sp_runtime::traits::AccountIdConversion; | ||
|
||
pub fn run_as_parachain(cli: Cli) -> sc_service::Result<(), sc_cli::Error> { | ||
let runner = cli.create_runner(&cli.run.normalize())?; | ||
let collator_options = cli.run.collator_options(); | ||
|
||
runner.run_node_until_exit(|config| async move { | ||
let hwbench = (!cli.no_hardware_benchmarks) | ||
.then_some(config.database.path().map(|database_path| { | ||
let _ = std::fs::create_dir_all(database_path); | ||
sc_sysinfo::gather_hwbench(Some(database_path)) | ||
})) | ||
.flatten(); | ||
|
||
let para_id = chain_spec::Extensions::try_get(&*config.chain_spec) | ||
.map(|e| e.para_id) | ||
.map(|e: &chain_spec::Extensions| e.para_id) | ||
.ok_or("Could not find parachain ID in chain-spec.")?; | ||
let id = ParaId::from(para_id); | ||
|
||
let parachain_account = | ||
AccountIdConversion::<polkadot_primitives::AccountId>::into_account_truncating(&id); | ||
|
||
info!("Parachain id: {:?}", id); | ||
info!("Parachain Account: {}", parachain_account); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no more parachain account? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think this might be leftover code since it was only used for logging. The PR description where Parity removed it doesn’t provide a clear explanation. |
||
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); | ||
|
||
let tokio_handle = config.tokio_handle.clone(); | ||
let polkadot_cli = RelayChainCli::new( | ||
&config, | ||
[RelayChainCli::executable_name()].iter().chain(cli.relay_chain_args.iter()), | ||
); | ||
|
||
let id = ParaId::from(para_id); | ||
|
||
let tokio_handle = config.tokio_handle.clone(); | ||
|
||
let polkadot_config = | ||
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, tokio_handle) | ||
.map_err(|err| format!("Relay chain argument error: {}", err))?; | ||
|
||
let collator_options = cli.run.collator_options(); | ||
let hwbench = if !cli.no_hardware_benchmarks { | ||
config.database.path().map(|database_path| { | ||
let _ = std::fs::create_dir_all(&database_path); | ||
sc_sysinfo::gather_hwbench(Some(database_path)) | ||
}) | ||
} else { | ||
None | ||
}; | ||
info!("Parachain id: {:?}", id); | ||
info!("Is collating: {}", if config.role.is_authority() { "yes" } else { "no" }); | ||
|
||
return frequency_service::service::start_parachain_node( | ||
config, | ||
polkadot_config, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,46 +33,11 @@ pub fn development_config() -> ChainSpec { | |
.with_chain_type(ChainType::Development) | ||
.with_protocol_id("dev") | ||
.with_genesis_config(development_genesis( | ||
// initial collators. | ||
vec![ | ||
( | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_collator_keys_from_seed("Alice"), | ||
), | ||
( | ||
get_account_id_from_seed::<sr25519::Public>("Bob"), | ||
get_collator_keys_from_seed("Bob"), | ||
), | ||
], | ||
// Sudo | ||
Some(get_account_id_from_seed::<sr25519::Public>("Alice")), | ||
// Endowed Accounts | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_account_id_from_seed::<sr25519::Public>("Bob"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve"), | ||
get_account_id_from_seed::<sr25519::Public>("Ferdie"), | ||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"), | ||
common_runtime::constants::TREASURY_PALLET_ID.into_account_truncating(), | ||
], | ||
// Council members | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve"), | ||
], | ||
// Technical Committee members | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Bob"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave"), | ||
], | ||
development_invulnerables(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
development_root(), | ||
development_endowed_accounts(), | ||
development_council_members(), | ||
development_technical_committee_members(), | ||
// ParaId | ||
1000.into(), | ||
)) | ||
|
@@ -94,7 +59,7 @@ fn load_genesis_schemas() -> Vec<frequency_runtime::pallet_schemas::GenesisSchem | |
#[allow(clippy::unwrap_used)] | ||
fn development_genesis( | ||
invulnerables: Vec<(AccountId, AuraId)>, | ||
root_key: Option<AccountId>, | ||
root_key: AccountId, | ||
endowed_accounts: Vec<AccountId>, | ||
council_members: Vec<AccountId>, | ||
technical_committee_members: Vec<AccountId>, | ||
|
@@ -134,7 +99,7 @@ fn development_genesis( | |
parachain_system: Default::default(), | ||
sudo: SudoConfig { | ||
// Assign network admin rights. | ||
key: root_key, | ||
key: Some(root_key), | ||
}, | ||
schemas: frequency_runtime::pallet_schemas::GenesisConfig { | ||
initial_schemas: load_genesis_schemas(), | ||
|
@@ -152,3 +117,50 @@ fn development_genesis( | |
|
||
serde_json::to_value(&genesis).unwrap() | ||
} | ||
|
||
fn development_endowed_accounts() -> Vec<AccountId> { | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_account_id_from_seed::<sr25519::Public>("Bob"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve"), | ||
get_account_id_from_seed::<sr25519::Public>("Ferdie"), | ||
get_account_id_from_seed::<sr25519::Public>("Alice//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Bob//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve//stash"), | ||
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"), | ||
common_runtime::constants::TREASURY_PALLET_ID.into_account_truncating(), | ||
] | ||
} | ||
|
||
fn development_invulnerables() -> Vec<(AccountId, AuraId)> { | ||
vec![ | ||
( | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_collator_keys_from_seed("Alice"), | ||
), | ||
(get_account_id_from_seed::<sr25519::Public>("Bob"), get_collator_keys_from_seed("Bob")), | ||
] | ||
} | ||
|
||
fn development_root() -> AccountId { | ||
get_account_id_from_seed::<sr25519::Public>("Alice") | ||
} | ||
|
||
fn development_council_members() -> Vec<AccountId> { | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Alice"), | ||
get_account_id_from_seed::<sr25519::Public>("Charlie"), | ||
get_account_id_from_seed::<sr25519::Public>("Eve"), | ||
] | ||
} | ||
|
||
fn development_technical_committee_members() -> Vec<AccountId> { | ||
vec![ | ||
get_account_id_from_seed::<sr25519::Public>("Bob"), | ||
get_account_id_from_seed::<sr25519::Public>("Dave"), | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would you mind explaining why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I missed including that in the PR description. There’s now a standalone CLI, which is a result of this Polkadot-sdk issue.