Skip to content

Commit

Permalink
chore(upgrade): v1.11.0 to v1.13.0
Browse files Browse the repository at this point in the history
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
  • Loading branch information
enddynayn committed Aug 28, 2024
1 parent 07f7bd9 commit d624673
Show file tree
Hide file tree
Showing 36 changed files with 1,777 additions and 1,584 deletions.
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
rust 1.70
rust 1.77.0
make 4.3
cmake 3.24.1
1,221 changes: 612 additions & 609 deletions Cargo.lock

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions Cargo.toml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ start:
start-paseo-relay:
./scripts/init.sh start-paseo-relay-chain


start-paseo-collator-alice:
./scripts/init.sh start-paseo-collator-alice

start-paseo-collator-bob:
./scripts/init.sh start-paseo-collator-bob

start-frequency:
./scripts/init.sh start-frequency

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ make start-interval
### Mixed Terminal/Docker
This option runs one collator node as local host process and two relay chain validator nodes in each own docker container.
This option runs two collator node as local host process and two relay chain validator nodes in each own docker container.
1. Start relay chain validator nodes.
```sh
make start-relay
make start-paseo-relay
```
1. Register a new parachain slot (parachain id) for Frequency. _Note, if parachain was
Expand All @@ -232,13 +232,16 @@ This option runs one collator node as local host process and two relay chain val
make register
```
1. Start Frequency as parachain. This step will generate genesis/wasm and start the parachain collator.
1. Start Frequency as parachain with a single collator.
```sh
make start-frequency
make start-paseo-collator-alice
```
```sh
make start-paseo-collator-bob
```
1. Onboard Frequency to the relay chain
1. Generate genesis/wasm and onboard Frequency to the relay chain.
```sh
make onboard
```
Expand Down
10 changes: 5 additions & 5 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: "3"
services:
relay_paseo_alice:
container_name: alice
image: "parity/polkadot:v1.1.0"
image: "parity/polkadot:v1.13.0"
platform: linux/x86_64
hostname: relay_alice
ports:
Expand All @@ -26,12 +26,12 @@ services:
--rpc-cors=all
--rpc-methods=Unsafe
--alice
--log="main"
-ltxpool=trace
restart: unless-stopped

relay_paseo_bob:
container_name: bob
image: "parity/polkadot:v1.1.0"
image: "parity/polkadot:v1.13.0"
platform: linux/x86_64
hostname: relay_bob
ports:
Expand Down Expand Up @@ -72,5 +72,5 @@ services:
- "30333:30333" # p2p port
- "9944:9944" # ws and rpc port
depends_on:
- relay_alice
- relay_bob
- relay_paseo_alice
- relay_paseo_bob
4 changes: 3 additions & 1 deletion node/cli/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ pub fn inherent_benchmark_data() -> Result<InherentData> {
let timestamp = sp_timestamp::InherentDataProvider::new(d.into());
let mock_para_inherent_provider =
cumulus_client_parachain_inherent::MockValidationDataInherentDataProvider {
para_id: 1000.into(),
current_para_block_head: Some(cumulus_primitives_core::relay_chain::HeadData::default()),
current_para_block: 0,
relay_offset: 1,
relay_blocks_per_para_block: 2,
relay_blocks_per_para_block: 1,
xcm_config: Default::default(),
raw_downward_messages: Default::default(),
raw_horizontal_messages: Default::default(),
Expand Down
3 changes: 3 additions & 0 deletions node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ use cli_opt::SealingMode;
/// Sub-commands supported by the collator.
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Key management cli utilities
#[command(subcommand)]
Key(sc_cli::KeySubcommand),
/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),

Expand Down
1 change: 1 addition & 0 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ pub fn run() -> Result<()> {
let cli = Cli::from_args();

match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::BuildSpec(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
Expand Down
2 changes: 1 addition & 1 deletion node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sp_core::{Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};

/// Dummy chain spec for building and checking
pub type DummyChainSpec = sc_service::GenericChainSpec<(), Extensions>;
pub type DummyChainSpec = sc_service::GenericChainSpec<Extensions>;

#[cfg(feature = "frequency")]
pub mod frequency;
Expand Down
3 changes: 1 addition & 2 deletions node/service/src/chain_spec/frequency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use sp_core::ByteArray;
use sp_runtime::traits::AccountIdConversion;

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<frequency_runtime::RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

use super::{get_properties, Extensions};

Expand Down
3 changes: 1 addition & 2 deletions node/service/src/chain_spec/frequency_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use sc_service::ChainType;
use sp_core::sr25519;
use sp_runtime::traits::AccountIdConversion;
/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<frequency_runtime::RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;

use super::{get_account_id_from_seed, get_collator_keys_from_seed, get_properties, Extensions};

Expand Down
5 changes: 2 additions & 3 deletions node/service/src/chain_spec/frequency_paseo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ use sp_runtime::traits::AccountIdConversion;
use super::{get_account_id_from_seed, get_collator_keys_from_seed, get_properties, Extensions};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<frequency_runtime::RuntimeGenesisConfig, Extensions>;
pub type ChainSpec = sc_service::GenericChainSpec<Extensions>;
use sp_core::sr25519;

// Generic chain spec, in case when we don't have the native runtime.
pub type RelayChainSpec = sc_service::GenericChainSpec<(), RelayChainExtensions>;
pub type RelayChainSpec = sc_service::GenericChainSpec<RelayChainExtensions>;

#[allow(clippy::unwrap_used)]
/// Generates the Frequency Paseo chain spec from the raw json
Expand Down
7 changes: 4 additions & 3 deletions node/service/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ use cumulus_relay_chain_interface::{OverseerHandle, RelayChainError, RelayChainI
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
use futures::FutureExt;
use sc_consensus::{ImportQueue, LongestChain};
use sc_executor::{
HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY,
};
use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};

use sc_network::{NetworkBackend, NetworkBlock, NetworkService};
use sc_network_sync::SyncingService;
Expand Down Expand Up @@ -468,7 +466,10 @@ fn start_consensus(
relay_chain_slot_duration,
proposer,
collator_service,
#[cfg(any(feature = "frequency-testnet", feature = "frequency-local", feature = "frequency-lint-check"))]
// Very limited proposal time.
authoring_duration: Duration::from_millis(2000),
#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
authoring_duration: Duration::from_millis(500),
reinitialize: false,
};
Expand Down
96 changes: 45 additions & 51 deletions resources/paseo-local.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion resources/paseo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"/dns/boot.gatotech.network/tcp/33400/p2p/12D3KooWEvz5Ygv3MhCUNTVQbUTVhzhvf4KKcNoe5M5YbVLPBeeW",
"/dns/boot.gatotech.network/tcp/35400/wss/p2p/12D3KooWEvz5Ygv3MhCUNTVQbUTVhzhvf4KKcNoe5M5YbVLPBeeW",
"/dns/paseo-bootnode.turboflakes.io/tcp/30630/p2p/12D3KooWMjCN2CrnN71hAdehn6M2iYKeGdGbZ1A3SKhf4hxrgG9e",
"/dns/paseo-bootnode.turboflakes.io/tcp/30730/wss/p2p/12D3KooWMjCN2CrnN71hAdehn6M2iYKeGdGbZ1A3SKhf4hxrgG9e"
"/dns/paseo-bootnode.turboflakes.io/tcp/30730/wss/p2p/12D3KooWMjCN2CrnN71hAdehn6M2iYKeGdGbZ1A3SKhf4hxrgG9e",
"/dns/pso16.rotko.net/tcp/33246/p2p/12D3KooWRH8eBMhw8c7bucy6pJfy94q4dKpLkF3pmeGohHmemdRu",
"/dns/pso16.rotko.net/tcp/35246/wss/p2p/12D3KooWRH8eBMhw8c7bucy6pJfy94q4dKpLkF3pmeGohHmemdRu"
],
"telemetryEndpoints": null,
"protocolId": "pas",
Expand Down
19 changes: 18 additions & 1 deletion runtime/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ pub const TOKEN_DECIMALS: u8 = 8;
/// The maximum number of schema grants allowed per delegation
pub type MaxSchemaGrants = ConstU32<30>;

#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
/// This determines the average expected block time that we are targeting.
/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`.
/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
/// up by `pallet_aura` to implement `fn slot_duration()`.
///
/// Change this to adjust the block time.
pub const MILLISECS_PER_BLOCK: u64 = 12000;
pub const MILLISECS_PER_BLOCK: u64 = 12_000;

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
pub const MILLISECS_PER_BLOCK: u64 = 6000;

// NOTE: Currently it is not possible to change the slot duration after the chain has started.
// Attempting to do so will brick block production.
Expand Down Expand Up @@ -63,10 +67,18 @@ pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
/// `Operational` extrinsics.
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);

#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
/// We allow for 0.5 of a second of compute with a 12 second average block time.
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, 0)
.saturating_div(2)
.set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64);

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
);

pub type ZERO = ConstU32<0>;
pub type TWO = ConstU32<2>;
pub type FIFTY = ConstU32<50>;
Expand Down Expand Up @@ -125,6 +137,11 @@ pub type MinReleaseTransfer = ConstU128<0>;
pub const MAX_RELEASE_SCHEDULES: u32 = 50;
// -end- TimeRelease Pallet ---

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
// --- Timestamp Pallet ---
pub type MinimumPeriod = ConstU64<0>;

#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
// --- Timestamp Pallet ---
pub type MinimumPeriod = ConstU64<{ SLOT_DURATION / 2 }>;
// -end- Timestamp Pallet ---
Expand Down
18 changes: 18 additions & 0 deletions runtime/common/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for SubstrateWeight<T>
// Minimum execution time: 4_955_000 picoseconds.
Weight::from_parts(5_331_000, 0)
}
fn burn_allow_death() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 27_491_000 picoseconds.
Weight::from_parts(28_444_000, 0)
.saturating_add(Weight::from_parts(0, 0))
}

fn burn_keep_alive() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 18_290_000 picoseconds.
Weight::from_parts(19_227_000, 0)
.saturating_add(Weight::from_parts(0, 0))

}
}


Expand Down
1 change: 1 addition & 0 deletions runtime/frequency/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ std = [
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"cumulus-pallet-session-benchmarking/std",
"sp-transaction-pool/std",
"sp-genesis-builder/std",
"common-runtime/std",
Expand Down
21 changes: 15 additions & 6 deletions runtime/frequency/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 108,
spec_version: 109,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand All @@ -375,7 +375,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("frequency-testnet"),
impl_name: create_runtime_str!("frequency"),
authoring_version: 1,
spec_version: 108,
spec_version: 109,
impl_version: 0,
apis: apis::RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -947,17 +947,25 @@ impl pallet_passkey::Config for Runtime {
type Currency = Balances;
}

#[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))]
#[cfg(any(
feature = "frequency",
feature = "runtime-benchmarks",
feature = "frequency-lint-check",
))]
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;

#[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))]
/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
const BLOCK_PROCESSING_VELOCITY: u32 = 1;
#[cfg(any(not(feature = "frequency-no-relay"), feature = "frequency-lint-check"))]
/// Relay chain slot duration, in milliseconds.
const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6000;
const RELAY_CHAIN_SLOT_DURATION_MILLIS: u32 = 6_000;

// See https://paritytech.github.io/substrate/master/pallet_parachain_system/index.html for
// the descriptions of these configs.
Expand All @@ -973,8 +981,6 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
type ReservedXcmpWeight = ();
type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases;
type WeightInfo = ();
// TODO: Remove this when Async Backing is activated and the feature is set for cumulus-pallet-parachain-system
#[cfg(feature = "parameterized-consensus-hook")]
type ConsensusHook = ConsensusHook;
}

Expand Down Expand Up @@ -1012,6 +1018,9 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = AuraMaxAuthorities;
#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
type AllowMultipleBlocksPerSlot = ConstBool<true>;
#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
type AllowMultipleBlocksPerSlot = ConstBool<false>;
type SlotDuration = ConstU64<SLOT_DURATION>;
}
Expand Down
6 changes: 2 additions & 4 deletions scripts/enact-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ sudo_secret=$1
ws_provider=$2
wasm_location=$3

cd scripts/js/onboard

yarn && yarn upgrade-enact $ws_provider $sudo_secret $wasm_location

cd scripts/js/onboard

npm i && npm run upgrade-enact $ws_provider $sudo_secret $wasm_location
Loading

0 comments on commit d624673

Please sign in to comment.