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: separate runtimes #46

Merged
merged 24 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
736eae4
feat(pop-network): ready for testnet
al3mart Mar 22, 2024
5bd7c95
fix(pop-network): address feedback
al3mart Mar 23, 2024
c785630
chore(pop-network): fmt
al3mart Mar 23, 2024
188f2aa
chore(pop-network): rebase & conflicts
al3mart Mar 23, 2024
35c9476
chore(pop-network): update cargo lock
al3mart Mar 23, 2024
90206a9
chore(pop-network): runtime descriptions and FilteredCalls
al3mart Mar 25, 2024
0a375be
chroe(pop-network): complete relay naming
al3mart Mar 25, 2024
5311bec
chore(pop-network): feature-gate async backing
al3mart Mar 25, 2024
5134708
typo(pop-network): wrong feature name
al3mart Mar 25, 2024
bc708a8
chore(pop-network): relay_chain_slot_time is always 6000
al3mart Mar 25, 2024
c1516ad
chrose(pop-network): paseo feature works properly
al3mart Mar 26, 2024
f60d7a3
chore(pop-network): fmt
al3mart Mar 26, 2024
343b88e
fix(pop-network): rococo genesis doesn't depend on pop-runtime
al3mart Mar 26, 2024
c415908
fix(pop-network): Make CI happy
al3mart Mar 26, 2024
c196eeb
fix(pop-network): missing contruct_benchmark_partials
al3mart Mar 26, 2024
a1b3e23
chrone(pop-network): fix fmt
al3mart Mar 26, 2024
e585fb4
chore(pop-network): typo
al3mart Mar 26, 2024
e29df66
refactor(integration-tests): simplify runtime imports
evilrobot-01 Mar 26, 2024
cfef5f8
refactor(node): fix clippy warnings
evilrobot-01 Mar 26, 2024
40c21b1
fix(chain-spec): remove endowments
evilrobot-01 Mar 26, 2024
3ead157
refactor: remove unnecessary default runtime
evilrobot-01 Mar 26, 2024
494a569
refactor: simplify manifests
evilrobot-01 Mar 26, 2024
587e52e
docs(runtime): remove old link
evilrobot-01 Mar 26, 2024
6293ce8
Merge pull request #52 from r0gue-io/frank/feat-separate-runtimes
al3mart Mar 27, 2024
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
519 changes: 306 additions & 213 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ edition = "2021"
homepage = "https://r0gue.io"
license = "Unlicense"
repository = "https://github.com/r0gue-io/pop-node/"
description = "Pop Network makes it easy for smart contract developers to use the Power of Polkadot."

[workspace]
members = [
"node",
"runtime",
"runtime/devnet",
"runtime/testnet",
"integration-tests",
"primitives",
]
Expand Down Expand Up @@ -39,7 +41,9 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", b
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }

# Local
pop-runtime = { path = "./runtime", default-features = true } # default-features=true required for `-p pop-node` builds
pop-runtime-devnet = { path = "runtime/devnet", 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
pop-runtime-common = { path = "runtime/common", default-features = false }
pop-primitives = { path = "./primitives", default-features = false }

# Substrate
Expand Down Expand Up @@ -143,4 +147,4 @@ cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk",
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }
cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }
cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }
cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.1" }
11 changes: 6 additions & 5 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ cumulus-primitives-core.workspace = true
emulated-integration-tests-common.workspace = true

# Local
pop-runtime.workspace = true
pop-runtime-devnet.workspace = true
pop-runtime-common.workspace = true

[features]
default = ["std"]
Expand All @@ -52,7 +53,7 @@ std = [
"pallet-xcm/std",
"polkadot-primitives/std",
"polkadot-runtime-parachains/std",
"pop-runtime/std",
"pop-runtime-devnet/std",
"rococo-runtime-constants/std",
"rococo-runtime/std",
"sp-authority-discovery/std",
Expand All @@ -73,7 +74,7 @@ runtime-benchmarks = [
"pallet-balances/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"pop-runtime/runtime-benchmarks",
"pop-runtime-devnet/runtime-benchmarks",
"rococo-runtime/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
Expand All @@ -85,7 +86,7 @@ try-runtime = [
"pallet-assets/try-runtime",
"pallet-balances/std",
"pallet-message-queue/try-runtime",
"pop-runtime/try-runtime",
"pop-runtime-devnet/try-runtime",
"rococo-runtime/try-runtime",
"sp-runtime/try-runtime",
]
]
2 changes: 1 addition & 1 deletion integration-tests/src/chains/asset_hub_rococo/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use emulated_integration_tests_common::{
accounts, build_genesis_storage, collators, SAFE_XCM_VERSION,
};
use pop_runtime::Balance;
use pop_runtime_common::Balance;
use sp_core::storage::Storage;

pub(crate) const PARA_ID: u32 = 1000;
Expand Down
27 changes: 14 additions & 13 deletions integration-tests/src/chains/pop_network/genesis.rs
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
use emulated_integration_tests_common::{build_genesis_storage, collators};
use pop_runtime::Balance;
use pop_runtime_common::Balance;
use pop_runtime_devnet as runtime;
use sp_core::storage::Storage;

pub(crate) const ED: Balance = pop_runtime::EXISTENTIAL_DEPOSIT;
pub(crate) const ED: Balance = runtime::EXISTENTIAL_DEPOSIT;
const PARA_ID: u32 = 9090;
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

pub(crate) fn genesis() -> Storage {
let genesis_config = pop_runtime::RuntimeGenesisConfig {
system: pop_runtime::SystemConfig::default(),
balances: pop_runtime::BalancesConfig { ..Default::default() },
parachain_info: pop_runtime::ParachainInfoConfig {
let genesis_config = runtime::RuntimeGenesisConfig {
system: runtime::SystemConfig::default(),
balances: runtime::BalancesConfig { ..Default::default() },
parachain_info: runtime::ParachainInfoConfig {
parachain_id: PARA_ID.into(),
..Default::default()
},
collator_selection: pop_runtime::CollatorSelectionConfig {
collator_selection: runtime::CollatorSelectionConfig {
invulnerables: collators::invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: ED * 16,
..Default::default()
},
session: pop_runtime::SessionConfig {
session: runtime::SessionConfig {
keys: collators::invulnerables()
.into_iter()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
pop_runtime::SessionKeys { aura }, // session keys
acc.clone(), // account id
acc, // validator id
runtime::SessionKeys { aura }, // session keys
)
})
.collect(),
},
polkadot_xcm: pop_runtime::PolkadotXcmConfig {
polkadot_xcm: runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
Expand All @@ -40,6 +41,6 @@ pub(crate) fn genesis() -> Storage {

build_genesis_storage(
&genesis_config,
pop_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"),
)
}
16 changes: 8 additions & 8 deletions integration-tests/src/chains/pop_network/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ decl_test_parachains! {
pub struct PopNetwork {
genesis = genesis::genesis(),
on_init = {
pop_runtime::AuraExt::on_initialize(1);
pop_runtime_devnet::AuraExt::on_initialize(1);
evilrobot-01 marked this conversation as resolved.
Show resolved Hide resolved
},
runtime = pop_runtime,
runtime = pop_runtime_devnet,
core = {
XcmpMessageHandler: pop_runtime::XcmpQueue,
LocationToAccountId: pop_runtime::xcm_config::LocationToAccountId,
ParachainInfo: pop_runtime::ParachainInfo,
XcmpMessageHandler: pop_runtime_devnet::XcmpQueue,
LocationToAccountId: pop_runtime_devnet::xcm_config::LocationToAccountId,
ParachainInfo: pop_runtime_devnet::ParachainInfo,
MessageOrigin: cumulus_primitives_core::AggregateMessageOrigin,
},
pallets = {
PolkadotXcm: pop_runtime::PolkadotXcm,
Assets: pop_runtime::Assets,
Balances: pop_runtime::Balances,
PolkadotXcm: pop_runtime_devnet::PolkadotXcm,
Assets: pop_runtime_devnet::Assets,
Balances: pop_runtime_devnet::Balances,
}
},
}
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/src/chains/rococo/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use emulated_integration_tests_common::{
accounts, build_genesis_storage, get_account_id_from_seed, get_from_seed, get_host_config,
validators,
};
use polkadot_primitives::{AssignmentId, ValidatorId};
use pop_runtime::Balance;
use polkadot_primitives::{AssignmentId, Balance, ValidatorId};
use rococo_runtime_constants::currency::UNITS as ROC;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use sp_consensus_babe::AuthorityId as BabeId;
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ use frame_support::{
sp_runtime::DispatchResult,
};
use polkadot_runtime_parachains::assigner_on_demand;
use pop_runtime::{xcm_config::XcmConfig as PopNetworkXcmConfig, Balance};
use pop_runtime_common::Balance;
use pop_runtime_devnet as pop_runtime;
use pop_runtime_devnet::xcm_config::XcmConfig as PopNetworkXcmConfig;
use rococo_runtime::xcm_config::XcmConfig as RococoXcmConfig;
use sp_core::Encode;
use xcm::prelude::*;
Expand Down
140 changes: 74 additions & 66 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,93 +1,101 @@
[package]
name = "pop-node"
version = "0.1.0"
authors = { workspace = true }
description = "A new Cumulus FRAME-based Substrate Node, ready for hacking together a parachain."
authors.workspace = true
description.workspace = true
license = "Unlicense"
homepage = { workspace = true }
homepage.workspace = true
repository.workspace = true
edition.workspace = true
build = "build.rs"
publish = false

[dependencies]
clap = { workspace = true }
log = { workspace = true }
codec = { workspace = true }
serde = { workspace = true }
jsonrpsee = { workspace = true }
futures = { workspace = true }
serde_json = { workspace = true }
clap.workspace = true
log.workspace = true
codec.workspace = true
serde.workspace = true
jsonrpsee.workspace = true
futures.workspace = true
serde_json.workspace = true

# Local
pop-runtime = { workspace = true }
pop-runtime-devnet.workspace = true
pop-runtime-testnet.workspace = true
pop-runtime-common.workspace = true

# Substrate
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-basic-authorship = { workspace = true }
sc-chain-spec = { workspace = true }
sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-offchain = { workspace = true }
sc-consensus = { workspace = true }
sc-executor = { workspace = true }
sc-network = { workspace = true }
sc-network-sync = { workspace = true }
sc-rpc = { workspace = true }
sc-service = { workspace = true }
sc-sysinfo = { workspace = true }
sc-telemetry = { workspace = true }
sc-tracing = { workspace = true }
sc-transaction-pool = { workspace = true }
sc-transaction-pool-api = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-keystore = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-timestamp = { workspace = true }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
frame-benchmarking.workspace = true
frame-benchmarking-cli.workspace = true
pallet-transaction-payment-rpc.workspace = true
sc-basic-authorship.workspace = true
sc-chain-spec.workspace = true
sc-cli.workspace = true
sc-client-api.workspace = true
sc-offchain.workspace = true
sc-consensus.workspace = true
sc-executor.workspace = true
sc-network.workspace = true
sc-network-sync.workspace = true
sc-rpc.workspace = true
sc-service.workspace = true
sc-sysinfo.workspace = true
sc-telemetry.workspace = true
sc-tracing.workspace = true
sc-transaction-pool.workspace = true
sc-transaction-pool-api.workspace = true
sp-api.workspace = true
sp-block-builder.workspace = true
sp-blockchain.workspace = true
sp-consensus-aura.workspace = true
sp-core.workspace = true
sp-keystore.workspace = true
sp-io.workspace = true
sp-offchain.workspace = true
sp-runtime.workspace = true
sp-session.workspace = true
sp-timestamp.workspace = true
sp-transaction-pool.workspace = true
substrate-frame-rpc-system.workspace = true
substrate-prometheus-endpoint.workspace = true

# Polkadot
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true }
xcm = { workspace = true }
polkadot-cli.workspace = true
polkadot-primitives.workspace = true
xcm.workspace = true

# Cumulus
cumulus-client-cli = { workspace = true }
cumulus-client-collator = { workspace = true }
cumulus-client-consensus-aura = { workspace = true }
cumulus-client-consensus-common = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-parachain-inherent = { workspace = true }
cumulus-relay-chain-interface = { workspace = true }
color-print = { workspace = true }
cumulus-client-cli.workspace = true
cumulus-client-collator.workspace = true
cumulus-client-consensus-aura.workspace = true
cumulus-client-consensus-common.workspace = true
cumulus-client-consensus-proposer.workspace = true
cumulus-primitives-aura.workspace = true
cumulus-client-service.workspace = true
cumulus-primitives-core.workspace = true
cumulus-primitives-parachain-inherent.workspace = true
cumulus-relay-chain-interface.workspace = true
color-print.workspace = true

[build-dependencies]
substrate-build-script-utils = { workspace = true }
substrate-build-script-utils.workspace = true

[features]
default = []
runtime-benchmarks = [
"cumulus-primitives-core/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"pop-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"pop-runtime-devnet/runtime-benchmarks",
"pop-runtime-testnet/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"pop-runtime/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
"pop-runtime-devnet/try-runtime",
"pop-runtime-testnet/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
]
73 changes: 73 additions & 0 deletions node/chain_specs/pop-paseo.plain.json

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions node/chain_specs/pop-paseo.raw.json

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions node/chain_specs/pop-rococo.plain.json

Large diffs are not rendered by default.

74 changes: 74 additions & 0 deletions node/chain_specs/pop-rococo.raw.json

Large diffs are not rendered by default.

Loading
Loading