Skip to content
Snippets Groups Projects
Unverified Commit 5ba89217 authored by Alexandru Gheorghe's avatar Alexandru Gheorghe Committed by GitHub
Browse files

Fixup backing group computation time (#3170)


Fixes: https://github.com/paritytech/polkadot-sdk/issues/3165

---------

Signed-off-by: default avatarAlexandru Gheorghe <alexandru.gheorghe@parity.io>
parent 452f8136
No related merge requests found
Pipeline #440696 passed with stages
in 41 minutes and 7 seconds
......@@ -150,6 +150,14 @@ zombienet-polkadot-functional-0010-validator-disabling:
--local-dir="${LOCAL_DIR}/functional"
--test="0010-validator-disabling.zndsl"
zombienet-polkadot-functional-0011-async-backing-6-seconds-rate:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0011-async-backing-6-seconds-rate.zndsl"
zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
......
......@@ -45,6 +45,8 @@ pub fn validators<T: initializer::Config>() -> Vec<ValidatorId> {
/// Implementation for the `validator_groups` function of the runtime API.
pub fn validator_groups<T: initializer::Config>(
) -> (Vec<Vec<ValidatorIndex>>, GroupRotationInfo<BlockNumberFor<T>>) {
// This formula needs to be the same as the one we use
// when populating group_responsible in `availability_cores`
let now = <frame_system::Pallet<T>>::block_number() + One::one();
let groups = <scheduler::Pallet<T>>::validator_groups();
......@@ -95,6 +97,11 @@ pub fn availability_cores<T: initializer::Config>() -> Vec<CoreState<T::Hash, Bl
.expect("Occupied core always has pending availability; qed");
let backed_in_number = *pending_availability.backed_in_number();
// Use the same block number for determining the responsible group as what the
// backing subsystem would use when it calls validator_groups api.
let backing_group_allocation_time =
pending_availability.relay_parent_number() + One::one();
CoreState::Occupied(OccupiedCore {
next_up_on_available: <scheduler::Pallet<T>>::next_up_on_available(CoreIndex(
i as u32,
......@@ -106,7 +113,7 @@ pub fn availability_cores<T: initializer::Config>() -> Vec<CoreState<T::Hash, Bl
)),
availability: pending_availability.availability_votes().clone(),
group_responsible: group_responsible_for(
backed_in_number,
backing_group_allocation_time,
pending_availability.core_occupied(),
),
candidate_hash: pending_availability.candidate_hash(),
......
[settings]
timeout = 1000
[relaychain]
default_image = "{{ZOMBIENET_INTEGRATION_TEST_IMAGE}}"
chain = "rococo-local"
[relaychain.genesis.runtimeGenesis.patch.configuration.config]
needed_approvals = 4
relay_vrf_modulo_samples = 6
scheduling_lookahead = 2
group_rotation_frequency = 4
[relaychain.genesis.runtimeGenesis.patch.configuration.config.async_backing_params]
max_candidate_depth = 3
allowed_ancestry_len = 2
[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }
[[relaychain.node_groups]]
name = "alice"
args = [ "-lparachain=debug" ]
count = 12
[[parachains]]
id = 2000
addToGenesis = true
genesis_state_generator = "undying-collator export-genesis-state --pov-size=100000 --pvf-complexity=1"
[parachains.collator]
name = "collator01"
image = "{{COL_IMAGE}}"
command = "undying-collator"
args = ["-lparachain=debug", "--pov-size=100000", "--pvf-complexity=1", "--parachain-id=2000"]
[[parachains]]
id = 2001
cumulus_based = true
[parachains.collator]
name = "collator02"
image = "{{CUMULUS_IMAGE}}"
command = "polkadot-parachain"
args = ["-lparachain=debug"]
[types.Header]
number = "u64"
parent_hash = "Hash"
post_state = "Hash"
\ No newline at end of file
Description: Test we are producing blocks at 6 seconds clip
Network: ./0011-async-backing-6-seconds-rate.toml
Creds: config
# Check authority status.
alice: reports node_roles is 4
# Ensure parachains are registered.
alice: parachain 2000 is registered within 60 seconds
alice: parachain 2001 is registered within 60 seconds
# Ensure parachains made progress.
alice: reports substrate_block_height{status="finalized"} is at least 10 within 100 seconds
# This parachains should produce blocks at 6s clip, let's assume an 8s rate, allowing for
# some slots to be missed on slower machines
alice: parachain 2000 block height is at least 30 within 240 seconds
# This should already have produced the needed blocks
alice: parachain 2001 block height is at least 30 within 6 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment