mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-25 02:31:08 +00:00
a84dd0dba5
Initial implementation for the plan discussed here: https://github.com/paritytech/polkadot-sdk/issues/701 Built on top of https://github.com/paritytech/polkadot-sdk/pull/1178 v0: https://github.com/paritytech/polkadot/pull/7554, ## Overall idea When approval-voting checks a candidate and is ready to advertise the approval, defer it in a per-relay chain block until we either have MAX_APPROVAL_COALESCE_COUNT candidates to sign or a candidate has stayed MAX_APPROVALS_COALESCE_TICKS in the queue, in both cases we sign what candidates we have available. This should allow us to reduce the number of approvals messages we have to create/send/verify. The parameters are configurable, so we should find some values that balance: - Security of the network: Delaying broadcasting of an approval shouldn't but the finality at risk and to make sure that never happens we won't delay sending a vote if we are past 2/3 from the no-show time. - Scalability of the network: MAX_APPROVAL_COALESCE_COUNT = 1 & MAX_APPROVALS_COALESCE_TICKS =0, is what we have now and we know from the measurements we did on versi, it bottlenecks approval-distribution/approval-voting when increase significantly the number of validators and parachains - Block storage: In case of disputes we have to import this votes on chain and that increase the necessary storage with MAX_APPROVAL_COALESCE_COUNT * CandidateHash per vote. Given that disputes are not the normal way of the network functioning and we will limit MAX_APPROVAL_COALESCE_COUNT in the single digits numbers, this should be good enough. Alternatively, we could try to create a better way to store this on-chain through indirection, if that's needed. ## Other fixes: - Fixed the fact that we were sending random assignments to non-validators, that was wrong because those won't do anything with it and they won't gossip it either because they do not have a grid topology set, so we would waste the random assignments. - Added metrics to be able to debug potential no-shows and mis-processing of approvals/assignments. ## TODO: - [x] Get feedback, that this is moving in the right direction. @ordian @sandreim @eskimor @burdges, let me know what you think. - [x] More and more testing. - [x] Test in versi. - [x] Make MAX_APPROVAL_COALESCE_COUNT & MAX_APPROVAL_COALESCE_WAIT_MILLIS a parachain host configuration. - [x] Make sure the backwards compatibility works correctly - [x] Make sure this direction is compatible with other streams of work: https://github.com/paritytech/polkadot-sdk/issues/635 & https://github.com/paritytech/polkadot-sdk/issues/742 - [x] Final versi burn-in before merging --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
108 lines
3.2 KiB
TOML
108 lines
3.2 KiB
TOML
[[bin]]
|
|
name = "polkadot"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "polkadot-execute-worker"
|
|
path = "src/bin/execute-worker.rs"
|
|
|
|
[[bin]]
|
|
name = "polkadot-prepare-worker"
|
|
path = "src/bin/prepare-worker.rs"
|
|
|
|
[package]
|
|
name = "polkadot"
|
|
description = "Implementation of a `https://polkadot.network` node in Rust based on the Substrate framework."
|
|
license = "GPL-3.0-only"
|
|
rust-version = "1.64.0"
|
|
readme = "README.md"
|
|
authors.workspace = true
|
|
edition.workspace = true
|
|
version = "1.5.0"
|
|
default-run = "polkadot"
|
|
|
|
[dependencies]
|
|
color-eyre = { version = "0.6.1", default-features = false }
|
|
tikv-jemallocator = { version = "0.5.0", optional = true, features = ["unprefixed_malloc_on_supported_platforms"] }
|
|
|
|
# Crates in our workspace, defined as dependencies so we can pass them feature flags.
|
|
polkadot-cli = { path = "cli", features = ["rococo-native", "westend-native"] }
|
|
polkadot-node-core-pvf = { path = "node/core/pvf" }
|
|
polkadot-node-core-pvf-prepare-worker = { path = "node/core/pvf/prepare-worker" }
|
|
polkadot-overseer = { path = "node/overseer" }
|
|
|
|
# Needed for worker binaries.
|
|
polkadot-node-core-pvf-common = { path = "node/core/pvf/common" }
|
|
polkadot-node-core-pvf-execute-worker = { path = "node/core/pvf/execute-worker" }
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
tikv-jemallocator = { version = "0.5.0", features = ["unprefixed_malloc_on_supported_platforms"] }
|
|
|
|
[dev-dependencies]
|
|
assert_cmd = "2.0.4"
|
|
nix = { version = "0.26.1", features = ["signal"] }
|
|
tempfile = "3.2.0"
|
|
tokio = "1.24.2"
|
|
substrate-rpc-client = { path = "../substrate/utils/frame/rpc/client/" }
|
|
polkadot-core-primitives = { path = "core-primitives" }
|
|
|
|
[build-dependencies]
|
|
substrate-build-script-utils = { path = "../substrate/utils/build-script-utils" }
|
|
|
|
[badges]
|
|
maintenance = { status = "actively-developed" }
|
|
|
|
[features]
|
|
runtime-benchmarks = ["polkadot-cli/runtime-benchmarks"]
|
|
try-runtime = ["polkadot-cli/try-runtime"]
|
|
fast-runtime = ["polkadot-cli/fast-runtime"]
|
|
runtime-metrics = ["polkadot-cli/runtime-metrics"]
|
|
pyroscope = ["polkadot-cli/pyroscope"]
|
|
jemalloc-allocator = [
|
|
"dep:tikv-jemallocator",
|
|
"polkadot-node-core-pvf-prepare-worker/jemalloc-allocator",
|
|
"polkadot-node-core-pvf/jemalloc-allocator",
|
|
"polkadot-overseer/jemalloc-allocator",
|
|
]
|
|
|
|
|
|
# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky
|
|
# when run locally depending on system load
|
|
ci-only-tests = ["polkadot-node-core-pvf/ci-only-tests"]
|
|
|
|
# Configuration for building a .deb package - for use with `cargo-deb`
|
|
[package.metadata.deb]
|
|
name = "polkadot"
|
|
extended-description = "Implementation of a https://polkadot.network node in Rust based on the Substrate framework."
|
|
section = "misc"
|
|
maintainer = "security@parity.io"
|
|
license-file = ["LICENSE", "0"]
|
|
# https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html
|
|
maintainer-scripts = "scripts/packaging/deb-maintainer-scripts"
|
|
assets = [
|
|
[
|
|
"target/release/polkadot",
|
|
"/usr/bin/",
|
|
"755",
|
|
],
|
|
[
|
|
"target/release/polkadot-prepare-worker",
|
|
"/usr/lib/polkadot/",
|
|
"755",
|
|
],
|
|
[
|
|
"target/release/polkadot-execute-worker",
|
|
"/usr/lib/polkadot/",
|
|
"755",
|
|
],
|
|
[
|
|
"scripts/packaging/polkadot.service",
|
|
"/lib/systemd/system/",
|
|
"644",
|
|
],
|
|
]
|
|
conf-files = ["/etc/default/polkadot"]
|
|
|
|
[package.metadata.spellcheck]
|
|
config = "./scripts/ci/gitlab/spellcheck.toml"
|