diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3f6374b..48ef8771 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: run: rustup target add ${{ matrix.platform.target }} - name: Build node - run: cargo build --profile=production -p pop-node --target ${{ matrix.platform.target }} --features paseo + run: cargo build --profile=production -p pop-node --target ${{ matrix.platform.target }} - name: Package binary (Linux) if: contains(matrix.platform.target, 'linux') diff --git a/networks/README.md b/networks/README.md index f7d94bf6..e65544fc 100644 --- a/networks/README.md +++ b/networks/README.md @@ -1,13 +1,17 @@ # Zombienet ## Installation + You can install the Pop CLI as follows: + ```shell cargo install --git https://github.com/r0gue-io/pop-cli ``` ## Spawn Network + You can spawn a local network as follows: + ```shell -pop up -c ./networks/rococo.toml +pop up parachain -f ./networks/paseo.toml ``` \ No newline at end of file diff --git a/networks/paseo.toml b/networks/paseo.toml new file mode 100644 index 00000000..f3391ff2 --- /dev/null +++ b/networks/paseo.toml @@ -0,0 +1,22 @@ +# pop up parachain -f ./tests/networks/pop.toml + +[relaychain] +chain = "paseo-local" + +[[relaychain.nodes]] +name = "alice" +rpc_port = 8833 +validator = true + +[[relaychain.nodes]] +name = "bob" +validator = true + +[[parachains]] +id = 4001 +default_command = "./target/release/pop-node" + +[[parachains.collators]] +name = "pop" +rpc_port = 9944 +args = ["-lruntime::contracts=debug", "-lpopapi::extension=debug"] \ No newline at end of file diff --git a/node/Cargo.toml b/node/Cargo.toml index 41647419..b6f258c4 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -81,12 +81,7 @@ color-print.workspace = true substrate-build-script-utils.workspace = true [features] -default = ["paseo"] -paseo = [ - "pop-runtime-common/paseo", - "pop-runtime-devnet/paseo", - "pop-runtime-testnet/paseo", -] +default = [] runtime-benchmarks = [ "cumulus-primitives-core/runtime-benchmarks", "frame-benchmarking-cli/runtime-benchmarks", diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index e8896ad7..06cb2166 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -16,14 +16,9 @@ pub type TestnetChainSpec = /// The default XCM version to set in genesis config. const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION; + pub(crate) enum Relay { - #[cfg(not(feature = "paseo"))] - Rococo, - #[cfg(feature = "paseo")] Paseo, - #[cfg(not(feature = "paseo"))] - RococoLocal, - #[cfg(feature = "paseo")] PaseoLocal, } @@ -89,39 +84,14 @@ fn configure_for_relay( let para_id; match relay { - // Test relay chains - #[cfg(not(feature = "paseo"))] - Relay::Rococo => { - para_id = 4385; - properties.insert("tokenSymbol".into(), "ROC".into()); - properties.insert("tokenDecimals".into(), 12.into()); - - (Extensions { relay_chain: "rococo".into(), para_id }, para_id) - }, - #[cfg(feature = "paseo")] - Relay::Paseo => { - para_id = 4001; - properties.insert("tokenSymbol".into(), "PAS".into()); - properties.insert("tokenDecimals".into(), 10.into()); - - (Extensions { relay_chain: "paseo".into(), para_id }, para_id) - }, - // Local relay chains - #[cfg(not(feature = "paseo"))] - Relay::RococoLocal => { - para_id = 4385; - properties.insert("tokenSymbol".into(), "ROC".into()); - properties.insert("tokenDecimals".into(), 12.into()); - - (Extensions { relay_chain: "rococo-local".into(), para_id }, para_id) - }, - #[cfg(feature = "paseo")] - Relay::PaseoLocal => { + Relay::Paseo | Relay::PaseoLocal => { para_id = 4001; properties.insert("tokenSymbol".into(), "PAS".into()); properties.insert("tokenDecimals".into(), 10.into()); - (Extensions { relay_chain: "paseo-local".into(), para_id }, para_id) + let relay_chain = + if let Relay::Paseo = relay { "paseo".into() } else { "paseo-local".into() }; + (Extensions { relay_chain, para_id }, para_id) }, } } diff --git a/node/src/command.rs b/node/src/command.rs index 98af5450..8ba956e1 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -64,18 +64,9 @@ impl RuntimeResolver for PathBuf { fn load_spec(id: &str) -> std::result::Result, String> { Ok(match id { - #[cfg(not(feature = "paseo"))] - "dev-rococo" => Box::new(chain_spec::development_config(Relay::RococoLocal)), - #[cfg(feature = "paseo")] - "dev-paseo" => Box::new(chain_spec::development_config(Relay::PaseoLocal)), - #[cfg(not(feature = "paseo"))] - "pop-rococo" => Box::new(chain_spec::testnet_config(Relay::Rococo)), - #[cfg(feature = "paseo")] - "pop-paseo" => Box::new(chain_spec::testnet_config(Relay::Paseo)), - #[cfg(feature = "paseo")] + "dev" | "dev-paseo" => Box::new(chain_spec::development_config(Relay::PaseoLocal)), + "test" | "pop-paseo" => Box::new(chain_spec::testnet_config(Relay::Paseo)), "" | "local" => Box::new(chain_spec::development_config(Relay::PaseoLocal)), - #[cfg(not(feature = "paseo"))] - "" | "local" => Box::new(chain_spec::development_config(Relay::RococoLocal)), path => { let path: PathBuf = path.into(); match path.runtime() { diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index b46d43d8..0cd9aecb 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -29,5 +29,4 @@ std = ["frame-support/std", "sp-runtime/std"] runtime-benchmarks = [ "frame-support/runtime-benchmarks", "sp-runtime/runtime-benchmarks", -] -paseo = [] \ No newline at end of file +] \ No newline at end of file diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index d8562fdd..e62d55da 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -16,9 +16,6 @@ pub type Nonce = u32; /// up by `pallet_aura` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -#[cfg(not(feature = "paseo"))] -pub const MILLISECS_PER_BLOCK: u64 = 6000; -#[cfg(feature = "paseo")] pub const MILLISECS_PER_BLOCK: u64 = 12000; // NOTE: Currently it is not possible to change the slot duration after the chain has started. @@ -44,17 +41,11 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// We allow for 2 seconds of compute with a 6-second average block. pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts( - #[cfg(not(feature = "paseo"))] - WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2), - #[cfg(feature = "paseo")] WEIGHT_REF_TIME_PER_SECOND.saturating_div(2), polkadot_primitives::MAX_POV_SIZE as u64, ); // Unit = the base number of indivisible units for balances -#[cfg(not(feature = "paseo"))] -pub const UNIT: Balance = 1_000_000_000_000; // 12 decimals -#[cfg(feature = "paseo")] pub const UNIT: Balance = 10_000_000_000; // 10 decimals pub const MILLIUNIT: Balance = UNIT / 1_000; @@ -70,9 +61,6 @@ pub const EXISTENTIAL_DEPOSIT: Balance = MILLIUNIT; // Async backing /// Maximum number of blocks simultaneously accepted by the Runtime, not yet included /// into the relay chain. -#[cfg(not(feature = "paseo"))] -pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3; -#[cfg(feature = "paseo")] pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1; /// How many parachain blocks are processed by the relay chain per parent. Limits the diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 55d9942d..a6824acb 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -224,4 +224,3 @@ try-runtime = [ ] experimental = ["pallet-aura/experimental"] -paseo = ["pop-runtime-common/paseo"] diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index ffca8a12..2eb826a1 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -333,10 +333,6 @@ impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = Aura; - #[cfg(feature = "experimental")] - #[cfg(not(feature = "paseo"))] - type MinimumPeriod = ConstU64<0>; - #[cfg(not(feature = "experimental"))] type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } @@ -481,9 +477,6 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; - #[cfg(not(feature = "paseo"))] - type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "paseo")] type AllowMultipleBlocksPerSlot = ConstBool; #[cfg(feature = "experimental")] type SlotDuration = ConstU64; diff --git a/runtime/testnet/Cargo.toml b/runtime/testnet/Cargo.toml index d68bfd15..52d07d33 100644 --- a/runtime/testnet/Cargo.toml +++ b/runtime/testnet/Cargo.toml @@ -224,4 +224,3 @@ try-runtime = [ ] experimental = ["pallet-aura/experimental"] -paseo = ["pop-runtime-common/paseo"] diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 37f378f7..3a5d9025 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -332,10 +332,6 @@ impl pallet_timestamp::Config for Runtime { /// A timestamp: milliseconds since the unix epoch. type Moment = u64; type OnTimestampSet = Aura; - #[cfg(feature = "experimental")] - #[cfg(not(feature = "paseo"))] - type MinimumPeriod = ConstU64<0>; - #[cfg(not(feature = "experimental"))] type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>; type WeightInfo = (); } @@ -480,9 +476,6 @@ impl pallet_aura::Config for Runtime { type AuthorityId = AuraId; type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; - #[cfg(not(feature = "paseo"))] - type AllowMultipleBlocksPerSlot = ConstBool; - #[cfg(feature = "paseo")] type AllowMultipleBlocksPerSlot = ConstBool; #[cfg(feature = "experimental")] type SlotDuration = ConstU64; diff --git a/scripts/fund-dev-accounts/Cargo.toml b/scripts/fund-dev-accounts/Cargo.toml index f6bf2936..09c4a07a 100644 --- a/scripts/fund-dev-accounts/Cargo.toml +++ b/scripts/fund-dev-accounts/Cargo.toml @@ -15,7 +15,4 @@ path = "./main.rs" log.workspace = true subxt.workspace = true subxt-signer.workspace = true -tokio.workspace = true - -[features] -paseo = [] \ No newline at end of file +tokio.workspace = true \ No newline at end of file diff --git a/scripts/fund-dev-accounts/main.rs b/scripts/fund-dev-accounts/main.rs index 74a82b0f..d84daf42 100644 --- a/scripts/fund-dev-accounts/main.rs +++ b/scripts/fund-dev-accounts/main.rs @@ -9,66 +9,11 @@ use subxt_signer::sr25519::{dev, Keypair}; use std::time::Duration; -#[cfg(feature = "paseo")] mod paseo_interface; -#[cfg(not(feature = "paseo"))] -mod rococo_interface; - mod pop_interface; -const PARA_ID: u32 = 4385; - -#[cfg(not(feature = "paseo"))] -mod relay { - use super::*; - pub(crate) use crate::rococo_interface::api as runtime; - pub(crate) type RuntimeCall = runtime::runtime_types::rococo_runtime::RuntimeCall; - pub(crate) const UNIT: u128 = 1_000_000_000_000; - - use runtime::runtime_types::{ - staging_xcm::v4::{ - asset::Fungibility::Fungible, - asset::{Asset, AssetId, Assets}, - junction::Junction, - junctions::Junctions, - junctions::Junctions::X1, - location::Location, - }, - xcm::{v3::WeightLimit, VersionedAssets, VersionedLocation}, - }; - - // generate XCM message to reserve transfer funds to a designated account on - // Pop Parachain - pub(crate) fn gen_account_fund_message_call(account: Keypair) -> RuntimeCall { - let pop_location = VersionedLocation::V4(Location { - parents: 0, - interior: X1([Junction::Parachain(PARA_ID)]), - }); - let pop_beneficiary = VersionedLocation::V4(Location { - parents: 0, - interior: X1([Junction::AccountId32 { network: None, id: account.public_key().0 }]), - }); - let amount = Fungible(AMOUNT_TO_FUND); - let assets = VersionedAssets::V4(Assets { - 0: vec![Asset { - id: AssetId { 0: Location { parents: 0, interior: Junctions::Here } }, - fun: amount, - }], - }); - - RuntimeCall::XcmPallet( - crate::relay::runtime::xcm_pallet::Call::limited_reserve_transfer_assets { - dest: Box::new(pop_location), - beneficiary: Box::new(pop_beneficiary), - assets: Box::new(assets), - fee_asset_item: 0, - weight_limit: WeightLimit::Unlimited, - }, - ) - } -} +const PARA_ID: u32 = 4001; -#[cfg(feature = "paseo")] mod relay { use super::*; pub(crate) use crate::paseo_interface::api as runtime;