Skip to content

Commit

Permalink
gate collator changes under elastic-scaling-experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian committed Mar 19, 2024
1 parent 4697b7b commit d40a2a6
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 104 deletions.
94 changes: 48 additions & 46 deletions cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ jsonrpsee = { version = "0.22", features = ["server"] }
people-rococo-runtime = { path = "../parachains/runtimes/people/people-rococo" }
people-westend-runtime = { path = "../parachains/runtimes/people/people-westend" }
parachains-common = { path = "../parachains/common" }
testnet-parachains-constants = { path = "../parachains/runtimes/constants", default-features = false, features = ["rococo", "westend"] }
testnet-parachains-constants = { path = "../parachains/runtimes/constants", default-features = false, features = [
"rococo",
"westend",
] }

# Substrate
frame-benchmarking = { path = "../../substrate/frame/benchmarking" }
Expand Down Expand Up @@ -123,51 +126,50 @@ wait-timeout = "0.2"
[features]
default = []
runtime-benchmarks = [
"asset-hub-rococo-runtime/runtime-benchmarks",
"asset-hub-westend-runtime/runtime-benchmarks",
"bridge-hub-rococo-runtime/runtime-benchmarks",
"bridge-hub-westend-runtime/runtime-benchmarks",
"collectives-westend-runtime/runtime-benchmarks",
"contracts-rococo-runtime/runtime-benchmarks",
"coretime-rococo-runtime/runtime-benchmarks",
"coretime-westend-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"glutton-westend-runtime/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"penpal-runtime/runtime-benchmarks",
"people-rococo-runtime/runtime-benchmarks",
"people-westend-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"rococo-parachain-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"asset-hub-rococo-runtime/runtime-benchmarks",
"asset-hub-westend-runtime/runtime-benchmarks",
"bridge-hub-rococo-runtime/runtime-benchmarks",
"bridge-hub-westend-runtime/runtime-benchmarks",
"collectives-westend-runtime/runtime-benchmarks",
"contracts-rococo-runtime/runtime-benchmarks",
"coretime-rococo-runtime/runtime-benchmarks",
"coretime-westend-runtime/runtime-benchmarks",
"cumulus-primitives-core/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"glutton-westend-runtime/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"penpal-runtime/runtime-benchmarks",
"people-rococo-runtime/runtime-benchmarks",
"people-westend-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"rococo-parachain-runtime/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"asset-hub-rococo-runtime/try-runtime",
"asset-hub-westend-runtime/try-runtime",
"bridge-hub-rococo-runtime/try-runtime",
"bridge-hub-westend-runtime/try-runtime",
"collectives-westend-runtime/try-runtime",
"contracts-rococo-runtime/try-runtime",
"coretime-rococo-runtime/try-runtime",
"coretime-westend-runtime/try-runtime",
"frame-support/try-runtime",
"frame-try-runtime/try-runtime",
"glutton-westend-runtime/try-runtime",
"pallet-transaction-payment/try-runtime",
"penpal-runtime/try-runtime",
"people-rococo-runtime/try-runtime",
"people-westend-runtime/try-runtime",
"polkadot-cli/try-runtime",
"polkadot-service/try-runtime",
"shell-runtime/try-runtime",
"sp-runtime/try-runtime",
]
fast-runtime = [
"bridge-hub-rococo-runtime/fast-runtime",
"asset-hub-rococo-runtime/try-runtime",
"asset-hub-westend-runtime/try-runtime",
"bridge-hub-rococo-runtime/try-runtime",
"bridge-hub-westend-runtime/try-runtime",
"collectives-westend-runtime/try-runtime",
"contracts-rococo-runtime/try-runtime",
"coretime-rococo-runtime/try-runtime",
"coretime-westend-runtime/try-runtime",
"frame-support/try-runtime",
"frame-try-runtime/try-runtime",
"glutton-westend-runtime/try-runtime",
"pallet-transaction-payment/try-runtime",
"penpal-runtime/try-runtime",
"people-rococo-runtime/try-runtime",
"people-westend-runtime/try-runtime",
"polkadot-cli/try-runtime",
"polkadot-service/try-runtime",
"shell-runtime/try-runtime",
"sp-runtime/try-runtime",
]
fast-runtime = ["bridge-hub-rococo-runtime/fast-runtime"]
elastic-scaling-experimental = ["polkadot-service/elastic-scaling-experimental"]
4 changes: 4 additions & 0 deletions polkadot/node/network/collator-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ parity-scale-codec = { version = "3.6.1", features = ["std"] }

polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
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 @@ -871,6 +871,7 @@ 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 @@ -881,6 +882,14 @@ 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 @@ -375,6 +375,7 @@ 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
117 changes: 59 additions & 58 deletions polkadot/node/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,75 +157,76 @@ default = ["db", "full-node"]
db = ["service/rocksdb"]

full-node = [
"kvdb-rocksdb",
"parity-db",
"polkadot-approval-distribution",
"polkadot-availability-bitfield-distribution",
"polkadot-availability-distribution",
"polkadot-availability-recovery",
"polkadot-collator-protocol",
"polkadot-dispute-distribution",
"polkadot-gossip-support",
"polkadot-network-bridge",
"polkadot-node-collation-generation",
"polkadot-node-core-approval-voting",
"polkadot-node-core-av-store",
"polkadot-node-core-backing",
"polkadot-node-core-bitfield-signing",
"polkadot-node-core-candidate-validation",
"polkadot-node-core-chain-api",
"polkadot-node-core-chain-selection",
"polkadot-node-core-dispute-coordinator",
"polkadot-node-core-prospective-parachains",
"polkadot-node-core-provisioner",
"polkadot-node-core-pvf",
"polkadot-node-core-pvf-checker",
"polkadot-node-core-runtime-api",
"polkadot-statement-distribution",
"kvdb-rocksdb",
"parity-db",
"polkadot-approval-distribution",
"polkadot-availability-bitfield-distribution",
"polkadot-availability-distribution",
"polkadot-availability-recovery",
"polkadot-collator-protocol",
"polkadot-dispute-distribution",
"polkadot-gossip-support",
"polkadot-network-bridge",
"polkadot-node-collation-generation",
"polkadot-node-core-approval-voting",
"polkadot-node-core-av-store",
"polkadot-node-core-backing",
"polkadot-node-core-bitfield-signing",
"polkadot-node-core-candidate-validation",
"polkadot-node-core-chain-api",
"polkadot-node-core-chain-selection",
"polkadot-node-core-dispute-coordinator",
"polkadot-node-core-prospective-parachains",
"polkadot-node-core-provisioner",
"polkadot-node-core-pvf",
"polkadot-node-core-pvf-checker",
"polkadot-node-core-runtime-api",
"polkadot-statement-distribution",
]

# Configure the native runtimes to use.
westend-native = ["bitvec", "westend-runtime", "westend-runtime-constants"]
rococo-native = ["bitvec", "rococo-runtime", "rococo-runtime-constants"]

runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-babe/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"polkadot-test-client/runtime-benchmarks",
"rococo-runtime?/runtime-benchmarks",
"sc-client-db/runtime-benchmarks",
"service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"westend-runtime?/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-babe/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"polkadot-test-client/runtime-benchmarks",
"rococo-runtime?/runtime-benchmarks",
"sc-client-db/runtime-benchmarks",
"service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"westend-runtime?/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-babe/try-runtime",
"pallet-im-online/try-runtime",
"pallet-staking/try-runtime",
"pallet-transaction-payment/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"rococo-runtime?/try-runtime",
"sp-runtime/try-runtime",
"westend-runtime?/try-runtime",
]
fast-runtime = [
"rococo-runtime?/fast-runtime",
"westend-runtime?/fast-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-babe/try-runtime",
"pallet-im-online/try-runtime",
"pallet-staking/try-runtime",
"pallet-transaction-payment/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"rococo-runtime?/try-runtime",
"sp-runtime/try-runtime",
"westend-runtime?/try-runtime",
]
fast-runtime = ["rococo-runtime?/fast-runtime", "westend-runtime?/fast-runtime"]

malus = ["full-node"]
runtime-metrics = [
"polkadot-runtime-parachains/runtime-metrics",
"rococo-runtime?/runtime-metrics",
"westend-runtime?/runtime-metrics",
"polkadot-runtime-parachains/runtime-metrics",
"rococo-runtime?/runtime-metrics",
"westend-runtime?/runtime-metrics",
]

elastic-scaling-experimental = [
"polkadot-collator-protocol?/elastic-scaling-experimental",
]

0 comments on commit d40a2a6

Please sign in to comment.