Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Commit

Permalink
Release Pangolin2 (#225)
Browse files Browse the repository at this point in the history
* Reorder

* Adjust genesis

* Typo
  • Loading branch information
AurevoirXavier authored Jan 19, 2023
1 parent a266d90 commit 8ba1ff7
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 119 deletions.
9 changes: 8 additions & 1 deletion node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,20 @@ use sp_core::{Pair, Public};
// contracts. (PUSH1 0x00 PUSH1 0x00 REVERT)
const REVERT_BYTECODE: [u8; 5] = [0x60, 0x00, 0x60, 0x00, 0xFD];

// These are are testnet-only keys.
// These are devnet-only keys.
const ALITH: &str = "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac";
const BALTATHAR: &str = "0x3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0";
const CHARLETH: &str = "0x798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc";
const DOROTHY: &str = "0x773539d4Ac0e786233D90A233654ccEE26a613D9";
const ETHAN: &str = "0xFf64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB";
const FAITH: &str = "0xC0F0f4ab324C46e55D02D0033343B4Be8A55532d";
// These are testnet-only keys.
const C1: &str = "0x0eef9fabb6eb6fed2ab24a842931f8950426070a";
const C1_AURA: &str = "0xeed007f04d568b2d3bf329945a48c21a8ed030c81ca1dce61ad41c916599f405";
const C2: &str = "0xa858cde8f6cf178786578a3b0becf5c27d18300c";
const C2_AURA: &str = "0x28273ae24cc6048c515e6bcaefe98cbfaa50c69290d70cf8eca1de3329015c2f";
const C3: &str = "0x986b41d07776aa48f6d7a80caad49485f9a71714";
const C3_AURA: &str = "0xe25d860707bd1b88b9851cf40df3af3368cd57e5e82824cabac9c75fe537600f";
const SUDO: &str = "0x2748def2f9c3cfbbb963002935bc6d2e1c36ce2e";

// The default XCM version to set in genesis config.
Expand Down
47 changes: 36 additions & 11 deletions node/src/chain_spec/pangolin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use fp_evm::GenesisAccount;
// substrate
use sc_chain_spec::Properties;
use sc_service::ChainType;
use sp_core::H160;
use sp_core::{crypto::UncheckedInto, H160};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;
Expand Down Expand Up @@ -135,7 +135,6 @@ pub fn local_config() -> ChainSpec {
}

pub fn genesis_config() -> ChainSpec {
// TODO: update this before the final release
ChainSpec::from_genesis(
"Pangolin2",
"pangolin2",
Expand All @@ -149,7 +148,11 @@ pub fn genesis_config() -> ChainSpec {

// Monetary stuff.
balances: BalancesConfig {
balances: vec![(array_bytes::hex_n_into_unchecked(ALITH), 100_000_000 * UNIT)],
balances: vec![
(array_bytes::hex_n_into_unchecked(C1), 10_000 * UNIT),
(array_bytes::hex_n_into_unchecked(C2), 10_000 * UNIT),
(array_bytes::hex_n_into_unchecked(C3), 10_000 * UNIT),
],
},
transaction_payment: Default::default(),
assets: AssetsConfig {
Expand All @@ -167,16 +170,38 @@ pub fn genesis_config() -> ChainSpec {
// Consensus stuff.
staking: StakingConfig {
now: SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis(),
elapsed_time: 0,
elapsed_time: 11_516_352_020,
collator_count: 3,
collators: vec![(array_bytes::hex_n_into_unchecked(ALITH), UNIT)],
collators: vec![
(array_bytes::hex_n_into_unchecked(C1), UNIT),
(array_bytes::hex_n_into_unchecked(C2), UNIT),
(array_bytes::hex_n_into_unchecked(C3), UNIT),
],
},
session: SessionConfig {
keys: vec![(
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(ALITH),
session_keys(get_collator_keys_from_seed("Alice")),
)],
keys: vec![
(
array_bytes::hex_n_into_unchecked(C1),
array_bytes::hex_n_into_unchecked(C1),
session_keys(
array_bytes::hex2array_unchecked(C1_AURA).unchecked_into(),
),
),
(
array_bytes::hex_n_into_unchecked(C2),
array_bytes::hex_n_into_unchecked(C2),
session_keys(
array_bytes::hex2array_unchecked(C2_AURA).unchecked_into(),
),
),
(
array_bytes::hex_n_into_unchecked(C3),
array_bytes::hex_n_into_unchecked(C3),
session_keys(
array_bytes::hex2array_unchecked(C3_AURA).unchecked_into(),
),
),
],
},
aura: Default::default(),
aura_ext: Default::default(),
Expand All @@ -192,7 +217,7 @@ pub fn genesis_config() -> ChainSpec {
treasury: Default::default(),

// Utility stuff.
sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(ALITH)) },
sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(SUDO)) },

// XCM stuff.
polkadot_xcm: PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION) },
Expand Down
2 changes: 1 addition & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ pub fn run() -> Result<()> {
if config.role.is_authority() { "yes" } else { "no" }
);

if collator_options.relay_chain_rpc_url.is_some() && cli.relay_chain_args.len() > 0 {
if collator_options.relay_chain_rpc_url.is_some() && !cli.relay_chain_args.is_empty() {
log::warn!("Detected relay chain node arguments together with --relay-chain-rpc-url. This command starts a minimal Polkadot node that only uses a network-related subset of all relay chain CLI options.");
}

Expand Down
74 changes: 37 additions & 37 deletions runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,55 +230,55 @@ frame_support::construct_runtime! {
// To keep balances consistent with the existing XCM configurations.
Balances: pallet_balances = 5,
TransactionPayment: pallet_transaction_payment = 6,
Assets: pallet_assets = 34,
Vesting: pallet_vesting = 20,
Deposit: darwinia_deposit = 40,
AccountMigration: darwinia_account_migration = 41,
Assets: pallet_assets = 7,
Vesting: pallet_vesting = 8,
Deposit: darwinia_deposit = 9,
AccountMigration: darwinia_account_migration = 10,

// Consensus stuff.
Authorship: pallet_authorship = 7,
Staking: darwinia_staking = 8,
Session: pallet_session = 9,
Aura: pallet_aura = 10,
AuraExt: cumulus_pallet_aura_ext = 11,
MessageGadget: darwinia_message_gadget = 43,
EcdsaAuthority: darwinia_ecdsa_authority = 44,
Authorship: pallet_authorship = 11,
Staking: darwinia_staking = 12,
Session: pallet_session = 13,
Aura: pallet_aura = 14,
AuraExt: cumulus_pallet_aura_ext = 15,
MessageGadget: darwinia_message_gadget = 16,
EcdsaAuthority: darwinia_ecdsa_authority = 17,

// Governance stuff.
Democracy: pallet_democracy = 12,
Council: pallet_collective::<Instance1> = 13,
TechnicalCommittee: pallet_collective::<Instance2> = 14,
PhragmenElection: pallet_elections_phragmen = 15,
TechnicalMembership: pallet_membership::<Instance1> = 16,
Treasury: pallet_treasury = 17,
Tips: pallet_tips = 18,
Democracy: pallet_democracy = 18,
Council: pallet_collective::<Instance1> = 19,
TechnicalCommittee: pallet_collective::<Instance2> = 20,
PhragmenElection: pallet_elections_phragmen = 21,
TechnicalMembership: pallet_membership::<Instance1> = 22,
Treasury: pallet_treasury = 23,
Tips: pallet_tips = 24,

// Utility stuff.
Sudo: pallet_sudo = 19,
Utility: pallet_utility = 21,
Identity: pallet_identity = 22,
Scheduler: pallet_scheduler = 23,
Preimage: pallet_preimage = 24,
Proxy: pallet_proxy = 25,
Multisig: pallet_multisig = 26,
Sudo: pallet_sudo = 25,
Utility: pallet_utility = 26,
Identity: pallet_identity = 27,
Scheduler: pallet_scheduler = 28,
Preimage: pallet_preimage = 29,
Proxy: pallet_proxy = 30,
Multisig: pallet_multisig = 31,

// XCM stuff.
XcmpQueue: cumulus_pallet_xcmp_queue = 27,
PolkadotXcm: pallet_xcm = 28,
CumulusXcm: cumulus_pallet_xcm = 29,
DmpQueue: cumulus_pallet_dmp_queue = 30,
XcmpQueue: cumulus_pallet_xcmp_queue = 32,
PolkadotXcm: pallet_xcm = 33,
CumulusXcm: cumulus_pallet_xcm = 34,
DmpQueue: cumulus_pallet_dmp_queue = 35,

// EVM stuff.
Ethereum: pallet_ethereum = 31,
Evm: pallet_evm = 32,
MessageTransact: darwinia_message_transact = 39,
Ethereum: pallet_ethereum = 36,
Evm: pallet_evm = 37,
MessageTransact: darwinia_message_transact = 38,

// S2S stuff.
BridgePolkadotGrandpa: pallet_bridge_grandpa::<Instance1> = 35,
BridgePolkadotParachain: pallet_bridge_parachains::<Instance1> = 42,
BridgeDarwiniaMessages: pallet_bridge_messages::<Instance1> = 36,
BridgeDarwiniaDispatch: pallet_bridge_dispatch::<Instance1> = 37,
DarwiniaFeeMarket: pallet_fee_market::<Instance1> = 38
BridgePolkadotGrandpa: pallet_bridge_grandpa::<Instance1> = 39,
BridgePolkadotParachain: pallet_bridge_parachains::<Instance1> = 40,
BridgeDarwiniaMessages: pallet_bridge_messages::<Instance1> = 41,
BridgeDarwiniaDispatch: pallet_bridge_dispatch::<Instance1> = 42,
DarwiniaFeeMarket: pallet_fee_market::<Instance1> = 43
}
}

Expand Down
74 changes: 37 additions & 37 deletions runtime/darwinia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,55 +230,55 @@ frame_support::construct_runtime! {
// To keep balances consistent with the existing XCM configurations.
Balances: pallet_balances = 5,
TransactionPayment: pallet_transaction_payment = 6,
Assets: pallet_assets = 34,
Vesting: pallet_vesting = 20,
Deposit: darwinia_deposit = 40,
AccountMigration: darwinia_account_migration = 41,
Assets: pallet_assets = 7,
Vesting: pallet_vesting = 8,
Deposit: darwinia_deposit = 9,
AccountMigration: darwinia_account_migration = 10,

// Consensus stuff.
Authorship: pallet_authorship = 7,
Staking: darwinia_staking = 8,
Session: pallet_session = 9,
Aura: pallet_aura = 10,
AuraExt: cumulus_pallet_aura_ext = 11,
MessageGadget: darwinia_message_gadget = 43,
EcdsaAuthority: darwinia_ecdsa_authority = 44,
Authorship: pallet_authorship = 11,
Staking: darwinia_staking = 12,
Session: pallet_session = 13,
Aura: pallet_aura = 14,
AuraExt: cumulus_pallet_aura_ext = 15,
MessageGadget: darwinia_message_gadget = 16,
EcdsaAuthority: darwinia_ecdsa_authority = 17,

// Governance stuff.
Democracy: pallet_democracy = 12,
Council: pallet_collective::<Instance1> = 13,
TechnicalCommittee: pallet_collective::<Instance2> = 14,
PhragmenElection: pallet_elections_phragmen = 15,
TechnicalMembership: pallet_membership::<Instance1> = 16,
Treasury: pallet_treasury = 17,
Tips: pallet_tips = 18,
Democracy: pallet_democracy = 18,
Council: pallet_collective::<Instance1> = 19,
TechnicalCommittee: pallet_collective::<Instance2> = 20,
PhragmenElection: pallet_elections_phragmen = 21,
TechnicalMembership: pallet_membership::<Instance1> = 22,
Treasury: pallet_treasury = 23,
Tips: pallet_tips = 24,

// Utility stuff.
Sudo: pallet_sudo = 19,
Utility: pallet_utility = 21,
Identity: pallet_identity = 22,
Scheduler: pallet_scheduler = 23,
Preimage: pallet_preimage = 24,
Proxy: pallet_proxy = 25,
Multisig: pallet_multisig = 26,
Sudo: pallet_sudo = 25,
Utility: pallet_utility = 26,
Identity: pallet_identity = 27,
Scheduler: pallet_scheduler = 28,
Preimage: pallet_preimage = 29,
Proxy: pallet_proxy = 30,
Multisig: pallet_multisig = 31,

// XCM stuff.
XcmpQueue: cumulus_pallet_xcmp_queue = 27,
PolkadotXcm: pallet_xcm = 28,
CumulusXcm: cumulus_pallet_xcm = 29,
DmpQueue: cumulus_pallet_dmp_queue = 30,
XcmpQueue: cumulus_pallet_xcmp_queue = 32,
PolkadotXcm: pallet_xcm = 33,
CumulusXcm: cumulus_pallet_xcm = 34,
DmpQueue: cumulus_pallet_dmp_queue = 35,

// EVM stuff.
Ethereum: pallet_ethereum = 31,
Evm: pallet_evm = 32,
MessageTransact: darwinia_message_transact = 39,
Ethereum: pallet_ethereum = 36,
Evm: pallet_evm = 37,
MessageTransact: darwinia_message_transact = 38,

// S2S stuff.
BridgeKusamaGrandpa: pallet_bridge_grandpa::<Instance1> = 35,
BridgeKusamaParachain: pallet_bridge_parachains::<Instance1> = 42,
BridgeCrabMessages: pallet_bridge_messages::<Instance1> = 36,
BridgeCrabDispatch: pallet_bridge_dispatch::<Instance1> = 37,
CrabFeeMarket: pallet_fee_market::<Instance1> = 38
BridgeKusamaGrandpa: pallet_bridge_grandpa::<Instance1> = 39,
BridgeKusamaParachain: pallet_bridge_parachains::<Instance1> = 40,
BridgeCrabMessages: pallet_bridge_messages::<Instance1> = 41,
BridgeCrabDispatch: pallet_bridge_dispatch::<Instance1> = 42,
CrabFeeMarket: pallet_fee_market::<Instance1> = 43
}
}

Expand Down
64 changes: 32 additions & 32 deletions runtime/pangolin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,48 +227,48 @@ frame_support::construct_runtime! {
// To keep balances consistent with the existing XCM configurations.
Balances: pallet_balances = 5,
TransactionPayment: pallet_transaction_payment = 6,
Assets: pallet_assets = 34,
Vesting: pallet_vesting = 20,
Deposit: darwinia_deposit = 40,
AccountMigration: darwinia_account_migration = 41,
Assets: pallet_assets = 7,
Vesting: pallet_vesting = 8,
Deposit: darwinia_deposit = 9,
AccountMigration: darwinia_account_migration = 10,

// Consensus stuff.
Authorship: pallet_authorship = 7,
Staking: darwinia_staking = 8,
Session: pallet_session = 9,
Aura: pallet_aura = 10,
AuraExt: cumulus_pallet_aura_ext = 11,
MessageGadget: darwinia_message_gadget = 42,
EcdsaAuthority: darwinia_ecdsa_authority = 43,
Authorship: pallet_authorship = 11,
Staking: darwinia_staking = 12,
Session: pallet_session = 13,
Aura: pallet_aura = 14,
AuraExt: cumulus_pallet_aura_ext = 15,
MessageGadget: darwinia_message_gadget = 16,
EcdsaAuthority: darwinia_ecdsa_authority = 17,

// Governance stuff.
Democracy: pallet_democracy = 12,
Council: pallet_collective::<Instance1> = 13,
TechnicalCommittee: pallet_collective::<Instance2> = 14,
PhragmenElection: pallet_elections_phragmen = 15,
TechnicalMembership: pallet_membership::<Instance1> = 16,
Treasury: pallet_treasury = 17,
Tips: pallet_tips = 18,
Democracy: pallet_democracy = 18,
Council: pallet_collective::<Instance1> = 19,
TechnicalCommittee: pallet_collective::<Instance2> = 20,
PhragmenElection: pallet_elections_phragmen = 21,
TechnicalMembership: pallet_membership::<Instance1> = 22,
Treasury: pallet_treasury = 23,
Tips: pallet_tips = 24,

// Utility stuff.
Sudo: pallet_sudo = 19,
Utility: pallet_utility = 21,
Identity: pallet_identity = 22,
Scheduler: pallet_scheduler = 23,
Preimage: pallet_preimage = 24,
Proxy: pallet_proxy = 25,
Multisig: pallet_multisig = 26,
Sudo: pallet_sudo = 25,
Utility: pallet_utility = 26,
Identity: pallet_identity = 27,
Scheduler: pallet_scheduler = 28,
Preimage: pallet_preimage = 29,
Proxy: pallet_proxy = 30,
Multisig: pallet_multisig = 31,

// XCM stuff.
XcmpQueue: cumulus_pallet_xcmp_queue = 27,
PolkadotXcm: pallet_xcm = 28,
CumulusXcm: cumulus_pallet_xcm = 29,
DmpQueue: cumulus_pallet_dmp_queue = 30,
XcmpQueue: cumulus_pallet_xcmp_queue = 32,
PolkadotXcm: pallet_xcm = 33,
CumulusXcm: cumulus_pallet_xcm = 34,
DmpQueue: cumulus_pallet_dmp_queue = 35,

// EVM stuff.
Ethereum: pallet_ethereum = 31,
Evm: pallet_evm = 32,
MessageTransact: darwinia_message_transact = 39,
Ethereum: pallet_ethereum = 36,
Evm: pallet_evm = 37,
MessageTransact: darwinia_message_transact = 38,
}
}

Expand Down

0 comments on commit 8ba1ff7

Please sign in to comment.