Skip to content

Commit

Permalink
collator-protocol: remove elastic-scaling-experimental feature (par…
Browse files Browse the repository at this point in the history
…itytech#4595)

Validators already have been upgraded so they could already receive the
new `CollationWithParentHeadData` response when fetching collation.
However this is only sent by collators when the parachain has more than
1 core is assigned.

TODO:
- [x] PRDoc

---------

Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
  • Loading branch information
2 people authored and hitchhooker committed Jun 5, 2024
1 parent 607a02a commit 7da1069
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 18 deletions.
1 change: 0 additions & 1 deletion cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,3 @@ try-runtime = [
"sp-runtime/try-runtime",
]
fast-runtime = ["bridge-hub-rococo-runtime/fast-runtime"]
elastic-scaling-experimental = ["polkadot-service/elastic-scaling-experimental"]
1 change: 0 additions & 1 deletion polkadot/node/network/collator-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ polkadot-primitives-test-helpers = { path = "../../../primitives/test-helpers" }

[features]
default = []
elastic-scaling-experimental = []
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ async fn send_collation(
let peer_id = request.peer_id();
let candidate_hash = receipt.hash();

#[cfg(feature = "elastic-scaling-experimental")]
let result = match parent_head_data {
ParentHeadData::WithData { head_data, .. } =>
Ok(request_v2::CollationFetchingResponse::CollationWithParentHeadData {
Expand All @@ -935,13 +934,6 @@ async fn send_collation(
ParentHeadData::OnlyHash(_) =>
Ok(request_v1::CollationFetchingResponse::Collation(receipt, pov)),
};
#[cfg(not(feature = "elastic-scaling-experimental"))]
let result = {
// suppress unused warning
let _parent_head_data = parent_head_data;

Ok(request_v1::CollationFetchingResponse::Collation(receipt, pov))
};

let response =
OutgoingResponse { result, reputation_changes: Vec::new(), sent_feedback: Some(tx) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ impl Default for TestState {
impl TestState {
/// Adds a few more scheduled cores to the state for the same para id
/// compared to the default.
#[cfg(feature = "elastic-scaling-experimental")]
pub fn with_elastic_scaling() -> Self {
let mut state = Self::default();
let para_id = state.para_id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ fn distribute_collation_up_to_limit() {
/// Tests that collator send the parent head data in
/// case the para is assigned to multiple cores (elastic scaling).
#[test]
#[cfg(feature = "elastic-scaling-experimental")]
fn send_parent_head_data_for_elastic_scaling() {
let test_state = TestState::with_elastic_scaling();

Expand Down
4 changes: 0 additions & 4 deletions polkadot/node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,3 @@ runtime-metrics = [
"rococo-runtime?/runtime-metrics",
"westend-runtime?/runtime-metrics",
]

elastic-scaling-experimental = [
"polkadot-collator-protocol?/elastic-scaling-experimental",
]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log = { workspace = true, default-features = true }
test-parachain-adder = { path = ".." }
polkadot-primitives = { path = "../../../../primitives" }
polkadot-cli = { path = "../../../../cli" }
polkadot-service = { path = "../../../../node/service", features = ["elastic-scaling-experimental", "rococo-native"] }
polkadot-service = { path = "../../../../node/service", features = ["rococo-native"] }
polkadot-node-primitives = { path = "../../../../node/primitives" }
polkadot-node-subsystem = { path = "../../../../node/subsystem" }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ log = { workspace = true, default-features = true }
test-parachain-undying = { path = ".." }
polkadot-primitives = { path = "../../../../primitives" }
polkadot-cli = { path = "../../../../cli" }
polkadot-service = { path = "../../../../node/service", features = ["elastic-scaling-experimental", "rococo-native"] }
polkadot-service = { path = "../../../../node/service", features = ["rococo-native"] }
polkadot-node-primitives = { path = "../../../../node/primitives" }
polkadot-node-subsystem = { path = "../../../../node/subsystem" }

Expand Down
25 changes: 25 additions & 0 deletions prdoc/pr_4595.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
title: "Remove `elastic-scaling-experimental` feature flag"

doc:
- audience: Node Dev
description: |
The feature was masking the ability of collators to respond with `CollationWithParentHeadData`
to validator collation fetch requests, a requirement for elastic scaling.
Please note that `CollationWithParentHeadData` is only sent by collators of parachains with
multiple cores assigned, otherwise collators must respond with `CollationFetchingResponse::Collation`
- audience: Node Operator
description: |
This change enables elastic scaling support in collators. Please upgrade to latest version,
otherwise validator nodes will not be able to back elastic parachain blocks leading to
missed rewards.

crates:
- name: polkadot-collator-protocol
bump: major
validate: false
- name: polkadot-service
bump: major
validate: false
- name: polkadot-parachain-bin
bump: minor
validate: false

0 comments on commit 7da1069

Please sign in to comment.