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

feat: prepare mainnet runtime for registration #238

Merged
merged 8 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
contents: write
strategy:
matrix:
runtime: [ "devnet", "testnet" ]
runtime: [ "devnet", "testnet", "mainnet" ]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down
70 changes: 70 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ members = [
"node",
"primitives",
"runtime/devnet",
"runtime/mainnet",
"runtime/testnet",
]

Expand Down Expand Up @@ -54,6 +55,7 @@ substrate-wasm-builder = "23.0.0"
pop-primitives = { path = "./primitives", default-features = false }
pop-runtime-common = { path = "runtime/common", default-features = false }
pop-runtime-devnet = { path = "runtime/devnet", default-features = true } # default-features=true required for `-p pop-node` builds
pop-runtime-mainnet = { path = "runtime/mainnet", default-features = true } # default-features=true required for `-p pop-node` builds
pop-runtime-testnet = { path = "runtime/testnet", default-features = true } # default-features=true required for `-p pop-node` builds

# Substrate
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ paseo-runtime-constants.workspace = true
# Local
pop-runtime-common.workspace = true
pop-runtime-devnet.workspace = true
pop-runtime-mainnet.workspace = true

[features]
default = [ "std" ]
mainnet = [ "pop-runtime-mainnet/default" ]
std = [
"asset-hub-paseo-runtime/std",
"cumulus-primitives-core/std",
Expand All @@ -65,6 +67,7 @@ std = [
"polkadot-runtime-parachains/std",
"pop-runtime-common/std",
"pop-runtime-devnet/std",
"pop-runtime-mainnet/std",
"sp-authority-discovery/std",
"sp-consensus-aura/std",
"sp-consensus-babe/std",
Expand All @@ -87,6 +90,7 @@ runtime-benchmarks = [
"polkadot-primitives/runtime-benchmarks",
"pop-runtime-common/runtime-benchmarks",
"pop-runtime-devnet/runtime-benchmarks",
"pop-runtime-mainnet/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
Expand All @@ -99,5 +103,6 @@ try-runtime = [
"pallet-message-queue/try-runtime",
"paseo-runtime/try-runtime",
"pop-runtime-devnet/try-runtime",
"pop-runtime-mainnet/try-runtime",
"sp-runtime/try-runtime",
]
23 changes: 12 additions & 11 deletions integration-tests/src/chains/pop_network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,36 @@ pub(crate) mod genesis;

use emulated_integration_tests_common::{
impl_accounts_helpers_for_parachain, impl_assert_events_helpers_for_parachain,
impl_assets_helpers_for_parachain, impl_xcm_helpers_for_parachain, impls::Parachain,
xcm_emulator::decl_test_parachains,
impl_xcm_helpers_for_parachain, impls::Parachain, xcm_emulator::decl_test_parachains,
};
use frame_support::traits::OnInitialize;
#[cfg(not(feature = "mainnet"))]
use pop_runtime_devnet as runtime;
#[cfg(feature = "mainnet")]
use pop_runtime_mainnet as runtime;

// PopNetwork Parachain declaration
decl_test_parachains! {
pub struct PopNetwork {
genesis = genesis::genesis(),
on_init = {
pop_runtime_devnet::AuraExt::on_initialize(1);
runtime::AuraExt::on_initialize(1);
},
runtime = pop_runtime_devnet,
runtime = runtime,
core = {
XcmpMessageHandler: pop_runtime_devnet::XcmpQueue,
LocationToAccountId: pop_runtime_devnet::config::xcm::LocationToAccountId,
ParachainInfo: pop_runtime_devnet::ParachainInfo,
XcmpMessageHandler: runtime::XcmpQueue,
LocationToAccountId: runtime::config::xcm::LocationToAccountId,
ParachainInfo: runtime::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
pallets = {
PolkadotXcm: pop_runtime_devnet::PolkadotXcm,
Assets: pop_runtime_devnet::Assets,
Balances: pop_runtime_devnet::Balances,
PolkadotXcm: runtime::PolkadotXcm,
Balances: runtime::Balances,
}
},
}

// PopNetwork implementation
impl_accounts_helpers_for_parachain!(PopNetwork);
impl_assert_events_helpers_for_parachain!(PopNetwork);
impl_assets_helpers_for_parachain!(PopNetwork);
impl_xcm_helpers_for_parachain!(PopNetwork);
40 changes: 40 additions & 0 deletions networks/mainnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# pop up parachain -f ./networks/mainnet.toml

[relaychain]
chain = "paseo-local"

[relaychain.runtime_genesis_patch.balances]
balances = [
# Pop sovereign account
["5Ec4AhPKXY9B4ayGshkz2wFMh7N8gP7XKfAvtt1cigpG9FkJ", 60000000000000000],
]

[[relaychain.nodes]]
name = "alice"
rpc_port = 8833
validator = true

[[relaychain.nodes]]
name = "bob"
validator = true

[[parachains]]
id = 4001
chain = "mainnet"
default_command = "./target/release/pop-node"

[parachains.genesis_overrides.balances]
balances = [
# Dev accounts
["5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY", 10000000000000000],
["5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty", 10000000000000000],
["5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y", 10000000000000000],
["5DAAnrj7VHTznn2AWBemMuyBwZWs6FNFjdyVXUeYum3PTXFy", 10000000000000000],
["5HGjWAeFDfFCWPsjFQdVV2Msvz2XtMktvgocEZcCj68kUMaw", 10000000000000000],
["5CiPPseXPECbkjWCa6MnjNokrgYjMqmKndv2rSnekmSK2DjL", 10000000000000000],
]

[[parachains.collators]]
name = "pop"
rpc_port = 9944
args = ["-lruntime::contracts=debug", "-lpopapi::extension=debug"]
6 changes: 6 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ serde_json.workspace = true
# Local
pop-runtime-common.workspace = true
pop-runtime-devnet.workspace = true
pop-runtime-mainnet.workspace = true
pop-runtime-testnet.workspace = true

# Substrate
Expand Down Expand Up @@ -80,6 +81,9 @@ cumulus-relay-chain-interface.workspace = true
[build-dependencies]
substrate-build-script-utils.workspace = true

[dev-dependencies]
pallet-multisig.workspace = true

[features]
runtime-benchmarks = [
"cumulus-primitives-core/runtime-benchmarks",
Expand All @@ -89,13 +93,15 @@ runtime-benchmarks = [
"polkadot-primitives/runtime-benchmarks",
"pop-runtime-common/runtime-benchmarks",
"pop-runtime-devnet/runtime-benchmarks",
"pop-runtime-mainnet/runtime-benchmarks",
"pop-runtime-testnet/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"polkadot-cli/try-runtime",
"pop-runtime-devnet/try-runtime",
"pop-runtime-mainnet/try-runtime",
"pop-runtime-testnet/try-runtime",
"sp-runtime/try-runtime",
]
Loading
Loading