Skip to content

Commit

Permalink
Merge branch 'master' into export-sc-service-public-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored May 15, 2024
2 parents ca79cdf + 3fcdada commit fff39d4
Show file tree
Hide file tree
Showing 39 changed files with 256 additions and 289 deletions.
3 changes: 2 additions & 1 deletion .gitlab/pipeline/zombienet.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.zombienet-refs:
extends: .build-refs
variables:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.99"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.103"
PUSHGATEWAY_URL: "http://zombienet-prometheus-pushgateway.managed-monitoring:9091/metrics/job/zombie-metrics"
DEBUG: "zombie,zombie::network-node,zombie::kube::client::logs"

include:
# substrate tests
Expand Down
1 change: 0 additions & 1 deletion .gitlab/pipeline/zombienet/cumulus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
- echo "${COL_IMAGE}"
- echo "${GH_DIR}"
- echo "${LOCAL_DIR}"
- export DEBUG=zombie
- export RELAY_IMAGE=${POLKADOT_IMAGE}
- export COL_IMAGE=${COL_IMAGE}

Expand Down
1 change: 0 additions & 1 deletion .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
- if [[ $CI_COMMIT_REF_NAME == *"gh-readonly-queue"* ]]; then export DOCKER_IMAGES_VERSION="${CI_COMMIT_SHORT_SHA}"; fi
- export PIPELINE_IMAGE_TAG=${DOCKER_IMAGES_VERSION}
- export BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" # from build-linux-stable job
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="${POLKADOT_IMAGE}":${PIPELINE_IMAGE_TAG}
- export COL_IMAGE="${COLANDER_IMAGE}":${PIPELINE_IMAGE_TAG}
- export CUMULUS_IMAGE="docker.io/paritypr/polkadot-parachain-debug:${DOCKER_IMAGES_VERSION}"
Expand Down
1 change: 0 additions & 1 deletion .gitlab/pipeline/zombienet/substrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- echo "${ZOMBIENET_IMAGE}"
- echo "${GH_DIR}"
- echo "${LOCAL_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="${SUBSTRATE_IMAGE}":${SUBSTRATE_IMAGE_TAG}
- echo "${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
stage: zombienet
Expand Down
29 changes: 14 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cumulus/parachains/chain-specs/coretime-westend.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"bootNodes": [
"/dns/westend-coretime-collator-node-0.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWP93Dzk8T7GWxyWw9jhLcz8Pksokk3R9vL2eEH337bNkT",
"/dns/westend-coretime-collator-node-1.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWMh2imeAzsZKGQgm2cv6Uoep3GBYtwGfujt1bs5YfVzkH",
"/dns/coretime-westend-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWK7Zj1mCPg6h3eMp7v6akJ1o6AocRr59NLusDwBXQgrhw",
"/dns/coretime-westend-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWK7Zj1mCPg6h3eMp7v6akJ1o6AocRr59NLusDwBXQgrhw",
"/dns/westend-coretime-collator-node-0.parity-testnet.parity.io/tcp/30335/ws/p2p/12D3KooWP93Dzk8T7GWxyWw9jhLcz8Pksokk3R9vL2eEH337bNkT",
"/dns/westend-coretime-collator-node-1.parity-testnet.parity.io/tcp/30335/ws/p2p/12D3KooWMh2imeAzsZKGQgm2cv6Uoep3GBYtwGfujt1bs5YfVzkH",
"/dns/westend-coretime-collator-node-0.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWP93Dzk8T7GWxyWw9jhLcz8Pksokk3R9vL2eEH337bNkT",
Expand Down
2 changes: 1 addition & 1 deletion cumulus/polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ substrate-build-script-utils = { path = "../../substrate/utils/build-script-util

[dev-dependencies]
assert_cmd = "2.0"
nix = { version = "0.27.1", features = ["signal"] }
nix = { version = "0.28.0", features = ["signal"] }
tempfile = "3.8.0"
tokio = { version = "1.32.0", features = ["macros", "parking_lot", "time"] }
wait-timeout = "0.2"
Expand Down
22 changes: 21 additions & 1 deletion cumulus/polkadot-parachain/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;

/// Generic extensions for Parachain ChainSpecs.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
#[serde(deny_unknown_fields)]
pub struct Extensions {
/// The relay chain of the Parachain.
#[serde(alias = "relayChain", alias = "RelayChain")]
pub relay_chain: String,
/// The id of the Parachain.
#[serde(alias = "paraId", alias = "ParaId")]
pub para_id: u32,
}

Expand Down Expand Up @@ -78,3 +79,22 @@ where
pub fn get_collator_keys_from_seed<AuraId: Public>(seed: &str) -> <AuraId::Pair as Pair>::Public {
get_from_seed::<AuraId>(seed)
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn can_decode_extension_camel_and_snake_case() {
let camel_case = r#"{"relayChain":"relay","paraId":1}"#;
let snake_case = r#"{"relay_chain":"relay","para_id":1}"#;
let pascal_case = r#"{"RelayChain":"relay","ParaId":1}"#;

let camel_case_extension: Extensions = serde_json::from_str(camel_case).unwrap();
let snake_case_extension: Extensions = serde_json::from_str(snake_case).unwrap();
let pascal_case_extension: Extensions = serde_json::from_str(pascal_case).unwrap();

assert_eq!(camel_case_extension, snake_case_extension);
assert_eq!(snake_case_extension, pascal_case_extension);
}
}
2 changes: 1 addition & 1 deletion polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tikv-jemallocator = { version = "0.5.0", features = ["unprefixed_malloc_on_suppo

[dev-dependencies]
assert_cmd = "2.0.4"
nix = { version = "0.27.1", features = ["signal"] }
nix = { version = "0.28.0", features = ["signal"] }
tempfile = "3.2.0"
tokio = "1.37"
substrate-rpc-client = { path = "../substrate/utils/frame/rpc/client" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ statement-table = { package = "polkadot-statement-table", path = "../../../state
bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] }
gum = { package = "tracing-gum", path = "../../gum" }
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
schnellru = "0.2.1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/dispute-coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ parity-scale-codec = "3.6.1"
kvdb = "0.13.0"
thiserror = { workspace = true }
schnellru = "0.2.1"
fatality = "0.1.0"
fatality = "0.1.1"

polkadot-primitives = { path = "../../../primitives" }
polkadot-node-primitives = { path = "../../primitives" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/prospective-parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ futures = "0.3.30"
gum = { package = "tracing-gum", path = "../../gum" }
parity-scale-codec = "3.6.4"
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
bitvec = "1"

polkadot-primitives = { path = "../../../primitives" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/provisioner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
futures-timer = "3.0.2"
fatality = "0.1.0"
fatality = "0.1.1"
schnellru = "0.2.1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/pvf/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cpu-time = "1.0.0"
futures = "0.3.30"
gum = { package = "tracing-gum", path = "../../../gum" }
libc = "0.2.152"
nix = { version = "0.27.1", features = ["resource", "sched"] }
nix = { version = "0.28.0", features = ["resource", "sched"] }
thiserror = { workspace = true }

parity-scale-codec = { version = "3.6.1", default-features = false, features = [
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/pvf/execute-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ workspace = true
cpu-time = "1.0.0"
gum = { package = "tracing-gum", path = "../../../gum" }
cfg-if = "1.0"
nix = { version = "0.27.1", features = ["process", "resource", "sched"] }
nix = { version = "0.28.0", features = ["process", "resource", "sched"] }
libc = "0.2.152"

parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/pvf/prepare-worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rayon = "1.5.1"
tracking-allocator = { package = "staging-tracking-allocator", path = "../../../tracking-allocator" }
tikv-jemalloc-ctl = { version = "0.5.0", optional = true }
tikv-jemallocator = { version = "0.5.0", optional = true }
nix = { version = "0.27.1", features = ["process", "resource", "sched"] }
nix = { version = "0.28.0", features = ["process", "resource", "sched"] }

parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] }

Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/availability-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ thiserror = { workspace = true }
rand = "0.8.5"
derive_more = "0.99.17"
schnellru = "0.2.1"
fatality = "0.1.0"
fatality = "0.1.1"

[dev-dependencies]
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/availability-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ futures = "0.3.30"
tokio = "1.37"
schnellru = "0.2.1"
rand = "0.8.5"
fatality = "0.1.0"
fatality = "0.1.1"
thiserror = { workspace = true }
async-trait = "0.1.79"
gum = { package = "tracing-gum", path = "../../gum" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-overseer = { path = "../../overseer" }
parking_lot = "0.12.1"
bytes = "1"
fatality = "0.1.0"
fatality = "0.1.1"
thiserror = { workspace = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/collator-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ polkadot-node-network-protocol = { path = "../protocol" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-node-subsystem = { path = "../../subsystem" }
fatality = "0.1.0"
fatality = "0.1.1"
thiserror = { workspace = true }
tokio-util = "0.7.1"

Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/dispute-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sc-network = { path = "../../../../substrate/client/network" }
sp-application-crypto = { path = "../../../../substrate/primitives/application-crypto" }
sp-keystore = { path = "../../../../substrate/primitives/keystore" }
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
schnellru = "0.2.1"
indexmap = "2.0.0"

Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ sp-runtime = { path = "../../../../substrate/primitives/runtime" }
strum = { version = "0.26.2", features = ["derive"] }
futures = "0.3.30"
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
rand = "0.8"
derive_more = "0.99"
gum = { package = "tracing-gum", path = "../../gum" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/statement-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ arrayvec = "0.7.4"
indexmap = "2.0.0"
parity-scale-codec = { version = "3.6.1", default-features = false, features = ["derive"] }
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
bitvec = "1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/subsystem-util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parking_lot = "0.12.1"
pin-project = "1.0.9"
rand = "0.8.5"
thiserror = { workspace = true }
fatality = "0.1.0"
fatality = "0.1.1"
gum = { package = "tracing-gum", path = "../gum" }
derive_more = "0.99.17"
schnellru = "0.2.1"
Expand Down
12 changes: 12 additions & 0 deletions prdoc/pr_3962.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
title: Change fork calculation algorithm.

doc:
- audience: Node Dev
description: |
This PR changes the fork calculation and pruning algorithm to enable future block header pruning.
During the finalization of the block we prune known stale forks, so forks are pruned faster.

crates:
- name: sc-client-api
- name: sc-client-db
- name: sp-blockchain
2 changes: 1 addition & 1 deletion substrate/bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ sp-crypto-hashing = { path = "../../../primitives/crypto/hashing" }
futures = "0.3.30"
tempfile = "3.1.0"
assert_cmd = "2.0.2"
nix = { version = "0.27.1", features = ["signal"] }
nix = { version = "0.28.0", features = ["signal"] }
regex = "1.6.0"
platforms = "3.0"
soketto = "0.7.1"
Expand Down
14 changes: 0 additions & 14 deletions substrate/client/api/src/in_mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,20 +419,6 @@ impl<Block: BlockT> blockchain::Backend<Block> for Blockchain<Block> {
Ok(self.storage.read().leaves.hashes())
}

fn displaced_leaves_after_finalizing(
&self,
block_number: NumberFor<Block>,
) -> sp_blockchain::Result<Vec<Block::Hash>> {
Ok(self
.storage
.read()
.leaves
.displaced_by_finalize_height(block_number)
.leaves()
.cloned()
.collect::<Vec<_>>())
}

fn children(&self, _parent_hash: Block::Hash) -> sp_blockchain::Result<Vec<Block::Hash>> {
unimplemented!()
}
Expand Down
Loading

0 comments on commit fff39d4

Please sign in to comment.