Skip to content

Commit

Permalink
upgrade to polkadot v1.3.0 (#259)
Browse files Browse the repository at this point in the history
* bend deps to crates-io and polkadot 1.3

* fixes

* fixes

* runtimes build

* builds, but completely overwrites collator node. dropped shell support

* split service file simplify maintenance

* cosmetics

* taplo fmt

* lift patch and point to pallet release branch

* bump versions

* update README

* fixes

* fix feature propagation

* review fixes

* try to fix feature propagation for runtime-benchmarks

* try to fix feature propagation for runtime-benchmarks

* try to fix feature propagation for runtime-benchmarks

* fixed runtime-benchamrks build

* cleanup unnecessary dep pin

* trying to fix benchmarks

* next try. nope

* more tries to fix benchmarking build

* more attempts to fix benchmark feature propagation

* remove try-runtime-cli stuff

* fixed benchmarks build

* alignment with parachain-template

* use construct_partials macro. doesn't help

* further aligning with parachain-template

* re-ran benchmarks. manual corrections were necessary
  • Loading branch information
brenzi authored Feb 7, 2024
1 parent 959dfb7 commit 6d3ef2f
Show file tree
Hide file tree
Showing 38 changed files with 4,979 additions and 3,704 deletions.
3,882 changes: 2,451 additions & 1,431 deletions Cargo.lock

Large diffs are not rendered by default.

251 changes: 125 additions & 126 deletions Cargo.toml

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,24 @@ The benchmarks are run with the following script:

```
cargo build --release --features try-runtime
./target/release/integritee-collator try-runtime \
--chain integritee-kusama \
--runtime ./target/release/wbuild/integritee-runtime/integritee_runtime.wasm \
on-runtime-upgrade --checks=all \
live --uri wss://kusama.api.integritee.network:443
try-runtime --runtime ./target/release/wbuild/integritee-runtime/integritee_runtime.compact.compressed.wasm on-runtime-upgrade --checks=pre-and-post live --uri wss://kusama.api.integritee.network:443
```

## testing with chopsticks

To test runtime upgrades

```
nvm use 20
npx @acala-network/chopsticks@latest --config integritee-kusama --wasm-override ./target/release/wbuild/integritee-runtime/integritee_runtime.compact.compressed.wasm
```
to test XCM

```
npx @acala-network/chopsticks@latest xcm --p=karura --p=integritee-kusama
```
see other options in chopsticks help

## More Resources
* Thorough Readme about Rococo and Collators in general in the original [repository](https://github.com/paritytech/cumulus) of this fork.
* Parachains Development in the [Polkadot Wiki](https://wiki.polkadot.network/docs/build-pdk)
Expand Down
36 changes: 19 additions & 17 deletions polkadot-parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "integritee-collator"
description = "The Integritee parachain collator binary"
# align major.minor revision with the runtimes. bump patch revision ad lib. make this the github release tag
version = "1.7.8"
version = "1.8.0"
authors = ["Integritee AG <[email protected]>"]
homepage = "https://integritee.network/"
repository = "https://github.com/integritee-network/parachain"
Expand All @@ -24,9 +24,9 @@ serde = { workspace = true }
serde_json = { workspace = true }

# Parachain runtimes
parachain-runtime = { package = "integritee-runtime", path = "integritee-runtime" }
integritee-runtime = { path = "integritee-runtime" }
parachains-common = { path = "common" }
shell-runtime = { package = "shell-runtime", path = "shell-runtime" }
shell-runtime = { path = "shell-runtime" }

# Substrate dependencies
frame-benchmarking = { workspace = true, features = ["std"] }
Expand Down Expand Up @@ -64,21 +64,20 @@ sp-session = { workspace = true, features = ["std"] }
sp-timestamp = { workspace = true, features = ["std"] }
sp-transaction-pool = { workspace = true, features = ["std"] }
substrate-prometheus-endpoint = { workspace = true }
try-runtime-cli = { workspace = true }

# RPC related dependencies
frame-rpc-system = { workspace = true }
jsonrpsee = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
sc-transaction-pool-api = { workspace = true }
substrate-state-trie-migration-rpc = { workspace = true }
substrate-frame-rpc-system = { workspace = true }

# Cumulus dependencies
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-relay-chain = { workspace = true }
cumulus-client-consensus-proposer = { workspace = true }
cumulus-client-network = { workspace = true }
cumulus-client-service = { workspace = true }
cumulus-primitives-core = { workspace = true, features = ["std"] }
Expand All @@ -92,7 +91,7 @@ cumulus-relay-chain-rpc-interface = { workspace = true }
polkadot-cli = { workspace = true }
polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-service = { workspace = true }
xcm = { workspace = true, features = ["std"] }
staging-xcm = { workspace = true, features = ["std"] }

# Temporary pin only
# See https://github.com/bluejekyll/trust-dns/issues/1946 for more details.
Expand All @@ -106,27 +105,30 @@ assert_cmd = { workspace = true }
nix = { workspace = true }
pallet-sudo = { workspace = true, features = ["std"] }
polkadot-cli = { workspace = true, features = ["rococo-native"] } # purge_chain_works works with rococo-local and needs to allow this
substrate-test-client = { workspace = true }
substrate-test-runtime-client = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true }
wait-timeout = { workspace = true }

[features]
default = []
runtime-benchmarks = [
"try-runtime-cli/try-runtime",
"polkadot-service/runtime-benchmarks",
"parachain-runtime/runtime-benchmarks",
"shell-runtime/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"integritee-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"shell-runtime/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
]
fast-runtime = [
"polkadot-service/fast-runtime",
"parachain-runtime/fast-runtime",
"integritee-runtime/fast-runtime",
]
try-runtime = [
"try-runtime-cli/try-runtime",
"parachain-runtime/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
"integritee-runtime/try-runtime",
"shell-runtime/try-runtime",
]
12 changes: 5 additions & 7 deletions polkadot-parachains/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "parachains-common"
# major.minor revision must match collator node. patch bump ad lib
version = "1.7.0"
version = "1.8.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
description = "Logic which is common to all parachain runtimes"
Expand All @@ -18,7 +18,6 @@ smallvec = { workspace = true }
frame-executive = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-assets = { workspace = true }
pallet-authorship = { workspace = true }
pallet-balances = { workspace = true }
sp-consensus-aura = { workspace = true }
Expand All @@ -31,8 +30,8 @@ sp-std = { workspace = true }
polkadot-core-primitives = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-runtime-common = { workspace = true }
xcm = { workspace = true }
xcm-executor = { workspace = true }
staging-xcm = { workspace = true }
staging-xcm-executor = { workspace = true }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
Expand All @@ -44,7 +43,6 @@ std = [
"frame-executive/std",
"frame-support/std",
"frame-system/std",
"pallet-assets/std",
"pallet-authorship/std",
"pallet-balances/std",
"polkadot-core-primitives/std",
Expand All @@ -56,6 +54,6 @@ std = [
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"xcm-executor/std",
"xcm/std",
"staging-xcm-executor/std",
"staging-xcm/std",
]
19 changes: 15 additions & 4 deletions polkadot-parachains/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ pub mod fee;

pub mod xcm_config;
pub use constants::*;
pub use opaque::*;
pub use types::*;

/// Common types of parachains.
mod types {
use sp_runtime::traits::{IdentifyAccount, Verify};
use sp_runtime::{
generic,
traits::{BlakeTwo256, IdentifyAccount, Verify},
};

/// An index to a block.
pub type BlockNumber = u32;
Expand Down Expand Up @@ -63,6 +65,11 @@ mod types {

// Id used for identifying assets.
pub type AssetIdForTrustBackedAssets = u32;

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block header type as expected by this runtime.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
}

/// Common constants of parachains.
Expand Down Expand Up @@ -104,13 +111,17 @@ mod constants {
/// to even the core data structures.
pub mod opaque {
use super::*;
use sp_runtime::{generic, traits::BlakeTwo256};

pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic;
use sp_runtime::{
generic,
traits::{BlakeTwo256, Hash as HashT},
};
/// Opaque block header type.
pub type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// Opaque block type.
pub type Block = generic::Block<Header, UncheckedExtrinsic>;
/// Opaque block identifier type.
pub type BlockId = generic::BlockId<Block>;
/// Opaque block hash type.
pub type Hash = <BlakeTwo256 as HashT>::Output;
}
48 changes: 32 additions & 16 deletions polkadot-parachains/integritee-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "integritee-runtime"
description = "The Integritee parachain runtime"
# patch revision must match runtime spec_version
version = "1.7.44"
version = "1.8.45"
authors = ["Integritee AG <[email protected]>"]
homepage = "https://integritee.network/"
repository = "https://github.com/integritee-network/parachain"
Expand Down Expand Up @@ -58,23 +58,26 @@ pallet-utility = { workspace = true }
pallet-vesting = { workspace = true }
pallet-xcm = { workspace = true }
pallet-xcm-transactor = { workspace = true }
parachain-info = { workspace = true }
polkadot-parachain = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
polkadot-runtime-common = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-genesis-builder = { workspace = true }
sp-inherents = { workspace = true }
sp-io = { workspace = true }
sp-offchain = { workspace = true }
sp-runtime = { workspace = true }
sp-session = { workspace = true }
sp-std = { workspace = true }
sp-storage = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
xcm = { workspace = true }
xcm-builder = { workspace = true }
xcm-executor = { workspace = true }
staging-parachain-info = { workspace = true }
staging-xcm = { workspace = true }
staging-xcm-builder = { workspace = true }
staging-xcm-executor = { workspace = true }
xcm-transactor-primitives = { workspace = true }

# Benchmarking
Expand All @@ -90,7 +93,7 @@ polkadot-primitives = { workspace = true, features = ["std"] }
polkadot-runtime-parachains = { workspace = true, features = ["std"] }

[build-dependencies]
substrate-wasm-builder = { workspace = true }
substrate-wasm-builder = { workspace = true, optional = true }

[features]
default = ["std"]
Expand All @@ -103,11 +106,13 @@ std = [
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"cumulus-primitives-utility/std",
"frame-benchmarking?/std",
"frame-executive/std",
"frame-support/std",
"frame-system-benchmarking?/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"frame-try-runtime/std",
"frame-try-runtime?/std",
"log/std",
"orml-traits/std",
"orml-xcm-support/std",
Expand Down Expand Up @@ -136,36 +141,42 @@ std = [
"pallet-vesting/std",
"pallet-xcm-transactor/std",
"pallet-xcm/std",
"parachain-info/std",
"parachains-common/std",
"parity-scale-codec/std",
"polkadot-parachain/std",
"polkadot-parachain-primitives/std",
"polkadot-runtime-common/std",
"scale-info/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-genesis-builder/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-storage/std",
"sp-transaction-pool/std",
"sp-version/std",
"xcm-builder/std",
"xcm-executor/std",
"staging-parachain-info/std",
"staging-xcm-builder/std",
"staging-xcm-executor/std",
"staging-xcm/std",
"substrate-wasm-builder",
"xcm-transactor-primitives/std",
"xcm/std",
]
runtime-benchmarks = [
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-primitives-utility/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"hex-literal",
"orml-xtokens/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bounties/runtime-benchmarks",
"pallet-child-bounties/runtime-benchmarks",
Expand All @@ -185,8 +196,12 @@ runtime-benchmarks = [
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pallet-xcm-transactor/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"staging-xcm-builder/runtime-benchmarks",
"staging-xcm-executor/runtime-benchmarks",
]

try-runtime = [
Expand Down Expand Up @@ -222,7 +237,8 @@ try-runtime = [
"pallet-vesting/try-runtime",
"pallet-xcm-transactor/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polkadot-runtime-common/try-runtime",
"staging-parachain-info/try-runtime",
]
# Set timing constants (e.g. session period) to faster versions to speed up testing.
fast-runtime = []
Loading

0 comments on commit 6d3ef2f

Please sign in to comment.