Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into ao-alternative-validator-discovery-design
Browse files Browse the repository at this point in the history
* master:
  Actually connect to new validators at session boundary. (#3055)
  Register ReadRuntimeVersionExt (#3045)
  Bump version & spec version in prep for v0.9.2 (#3046)
  Remove host configuration set migration from Kusama & Westend (#3050)
  • Loading branch information
ordian committed May 19, 2021
2 parents 6f524b6 + 9fd0f5b commit 9d69bf8
Show file tree
Hide file tree
Showing 32 changed files with 237 additions and 311 deletions.
357 changes: 179 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ path = "src/main.rs"
name = "polkadot"
description = "Implementation of a https://polkadot.network node in Rust based on the Substrate framework."
license = "GPL-3.0-only"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-cli"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion core-primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-core-primitives"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion erasure-coding/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-erasure-coding"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
24 changes: 24 additions & 0 deletions node/core/pvf/src/executor_intf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub fn execute(
let mut extensions = sp_externalities::Extensions::new();

extensions.register(sp_core::traits::TaskExecutorExt::new(spawner));
extensions.register(sp_core::traits::ReadRuntimeVersionExt::new(ReadRuntimeVersion));

let mut ext = ValidationExternalities(extensions);

Expand Down Expand Up @@ -244,3 +245,26 @@ impl sp_core::traits::SpawnNamed for TaskExecutor {
self.0.spawn_ok(future);
}
}

struct ReadRuntimeVersion;

impl sp_core::traits::ReadRuntimeVersion for ReadRuntimeVersion {
fn read_runtime_version(
&self,
wasm_code: &[u8],
_ext: &mut dyn sp_externalities::Externalities,
) -> Result<Vec<u8>, String> {
let blob = RuntimeBlob::uncompress_if_needed(wasm_code)
.map_err(|e| format!("Failed to read the PVF runtime blob: {:?}", e))?;

match sc_executor::read_embedded_version(&blob)
.map_err(|e| format!("Failed to read the static section from the PVF blob: {:?}", e))?
{
Some(version) => {
use parity_scale_codec::Encode;
Ok(version.encode())
},
None => Err(format!("runtime version section is not found")),
}
}
}
7 changes: 6 additions & 1 deletion node/network/gossip-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ async fn determine_relevant_authorities(
relay_parent: Hash,
) -> Result<Vec<AuthorityDiscoveryId>, util::Error> {
let authorities = util::request_authorities(relay_parent, ctx.sender()).await.await??;
tracing::debug!(
target: LOG_TARGET,
authority_count = ?authorities.len(),
"Determined relevant authorities"
);
Ok(authorities)
}

Expand Down Expand Up @@ -145,7 +150,7 @@ impl State {
for leaf in leaves {
let current_index = util::request_session_index_for_child(leaf, ctx.sender()).await.await??;
let maybe_new_session = match self.last_session_index {
Some(i) if i <= current_index => None,
Some(i) if i >= current_index => None,
_ => Some((current_index, leaf)),
};

Expand Down
2 changes: 1 addition & 1 deletion node/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-service"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion node/test/client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-test-client"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion node/test/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-test-service"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-parachain"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachains"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Integration tests using the test-parachains"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachain-adder"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/adder/collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachain-adder-collator"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator for the adder test parachain"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion parachain/test-parachains/halt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-parachain-halt"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-primitives"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-rpc"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime-common"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/slot_range_helper/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "slot-range-helper"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kusama-runtime"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
52 changes: 0 additions & 52 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1457,57 +1457,6 @@ construct_runtime! {
}
}

pub struct ParachainHostConfigurationMigration;
impl frame_support::traits::OnRuntimeUpgrade for ParachainHostConfigurationMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
let config = parachains_configuration::HostConfiguration {
max_code_size: MaxCodeSize::get(),
max_head_data_size: MaxHeadSize::get(),
max_upward_queue_count: 10,
max_upward_queue_size: 50 * 1024,
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 10,
hrmp_max_message_num_per_candidate: 10,
validation_upgrade_frequency: 1 * DAYS,
validation_upgrade_delay: EPOCH_DURATION_IN_SLOTS,
max_pov_size: MAX_POV_SIZE,
max_downward_message_size: 50 * 1024,
preferred_dispatchable_upward_messages_step_weight: 0,
hrmp_max_parachain_outbound_channels: 10,
hrmp_max_parathread_outbound_channels: 0,
hrmp_open_request_ttl: 2,
hrmp_sender_deposit: deposit(1004, 100 * 1024),
hrmp_recipient_deposit: deposit(1004, 100 * 1024),
hrmp_channel_max_capacity: 1000,
hrmp_channel_max_total_size: 100 * 1024,
hrmp_max_parachain_inbound_channels: 10,
hrmp_max_parathread_inbound_channels: 0,
hrmp_channel_max_message_size: 100 * 1024,
code_retention_period: 2 * DAYS,
parathread_cores: 0,
parathread_retries: 0,
group_rotation_frequency: 1 * MINUTES,
chain_availability_period: 1 * MINUTES,
thread_availability_period: 1 * MINUTES,
scheduling_lookahead: 1,
max_validators_per_core: Some(5),
max_validators: Some(200),
dispute_period: 6,
dispute_post_conclusion_acceptance_period: 1 * HOURS,
dispute_max_spam_slots: 2,
dispute_conclusion_by_time_out_period: 1 * HOURS,
no_show_slots: 2,
n_delay_tranches: 89,
zeroth_delay_tranche_width: 0,
needed_approvals: 30,
relay_vrf_modulo_samples: 1,
};

ParachainsConfiguration::force_set_active_config(config);
RocksDbWeight::get().writes(1)
}
}

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block header type as expected by this runtime.
Expand Down Expand Up @@ -1537,7 +1486,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
ParachainHostConfigurationMigration,
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime-parachains"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-runtime"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadot"),
impl_name: create_runtime_str!("parity-polkadot"),
authoring_version: 0,
spec_version: 9011,
spec_version: 9020,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rococo-runtime"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-test-runtime"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "westend-runtime"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
Expand Down
54 changes: 1 addition & 53 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 9011,
spec_version: 9020,
impl_version: 0,
#[cfg(not(feature = "disable-runtime-api"))]
apis: RUNTIME_API_VERSIONS,
Expand Down Expand Up @@ -1051,57 +1051,6 @@ construct_runtime! {
}
}

pub struct ParachainHostConfigurationMigration;
impl frame_support::traits::OnRuntimeUpgrade for ParachainHostConfigurationMigration {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
let config = parachains_configuration::HostConfiguration {
max_code_size: MaxCodeSize::get(),
max_head_data_size: MaxHeadSize::get(),
max_upward_queue_count: 10,
max_upward_queue_size: 50 * 1024,
max_upward_message_size: 50 * 1024,
max_upward_message_num_per_candidate: 10,
hrmp_max_message_num_per_candidate: 10,
validation_upgrade_frequency: 1 * DAYS,
validation_upgrade_delay: EPOCH_DURATION_IN_SLOTS,
max_pov_size: 5 * 1024 * 1024,
max_downward_message_size: 50 * 1024,
preferred_dispatchable_upward_messages_step_weight: 0,
hrmp_max_parachain_outbound_channels: 10,
hrmp_max_parathread_outbound_channels: 0,
hrmp_open_request_ttl: 2,
hrmp_sender_deposit: deposit(1004, 100 * 1024),
hrmp_recipient_deposit: deposit(1004, 100 * 1024),
hrmp_channel_max_capacity: 1000,
hrmp_channel_max_total_size: 100 * 1024,
hrmp_max_parachain_inbound_channels: 10,
hrmp_max_parathread_inbound_channels: 0,
hrmp_channel_max_message_size: 100 * 1024,
code_retention_period: 2 * DAYS,
parathread_cores: 0,
parathread_retries: 0,
group_rotation_frequency: 1 * MINUTES,
chain_availability_period: MINUTES / 2,
thread_availability_period: MINUTES / 2,
scheduling_lookahead: 1,
max_validators_per_core: Some(5),
max_validators: Some(200),
dispute_period: 6,
dispute_post_conclusion_acceptance_period: 1 * HOURS,
dispute_max_spam_slots: 2,
dispute_conclusion_by_time_out_period: 1 * HOURS,
no_show_slots: 2,
n_delay_tranches: 40,
zeroth_delay_tranche_width: 0,
needed_approvals: 15,
relay_vrf_modulo_samples: 1,
};

ParachainsConfiguration::force_set_active_config(config);
RocksDbWeight::get().writes(1)
}
}

/// The address format for describing accounts.
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
/// Block header type as expected by this runtime.
Expand Down Expand Up @@ -1131,7 +1080,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
ParachainHostConfigurationMigration,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
Expand Down
2 changes: 1 addition & 1 deletion statement-table/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polkadot-statement-table"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion xcm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xcm"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies x<admin@parity.io>"]
description = "The basic XCM datastructures."
edition = "2018"
Expand Down
Loading

0 comments on commit 9d69bf8

Please sign in to comment.