Files
pezkuwi-subxt/polkadot/node/service/Cargo.toml
T
Alexandru Gheorghe a84dd0dba5 Approve multiple candidates with a single signature (#1191)
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>
2023-12-13 08:43:15 +02:00

228 lines
11 KiB
TOML

[package]
name = "polkadot-service"
rust-version = "1.60"
version = "1.0.0"
authors.workspace = true
edition.workspace = true
license.workspace = true
description = "Utils to tie different Polkadot components together and allow instantiation of a node."
[dependencies]
# Substrate Client
sc-authority-discovery = { path = "../../../substrate/client/authority-discovery" }
babe = { package = "sc-consensus-babe", path = "../../../substrate/client/consensus/babe" }
beefy = { package = "sc-consensus-beefy", path = "../../../substrate/client/consensus/beefy" }
grandpa = { package = "sc-consensus-grandpa", path = "../../../substrate/client/consensus/grandpa" }
mmr-gadget = { path = "../../../substrate/client/merkle-mountain-range" }
sp-mmr-primitives = { path = "../../../substrate/primitives/merkle-mountain-range" }
sc-block-builder = { path = "../../../substrate/client/block-builder" }
sc-chain-spec = { path = "../../../substrate/client/chain-spec" }
sc-client-api = { path = "../../../substrate/client/api" }
sc-client-db = { path = "../../../substrate/client/db" }
sc-consensus = { path = "../../../substrate/client/consensus/common" }
sc-consensus-slots = { path = "../../../substrate/client/consensus/slots" }
sc-executor = { path = "../../../substrate/client/executor" }
sc-network = { path = "../../../substrate/client/network" }
sc-network-common = { path = "../../../substrate/client/network/common" }
sc-network-sync = { path = "../../../substrate/client/network/sync" }
sc-transaction-pool = { path = "../../../substrate/client/transaction-pool" }
sc-transaction-pool-api = { path = "../../../substrate/client/transaction-pool/api" }
sc-sync-state-rpc = { path = "../../../substrate/client/sync-state-rpc" }
sc-keystore = { path = "../../../substrate/client/keystore" }
sc-basic-authorship = { path = "../../../substrate/client/basic-authorship" }
sc-offchain = { path = "../../../substrate/client/offchain" }
sc-sysinfo = { path = "../../../substrate/client/sysinfo" }
service = { package = "sc-service", path = "../../../substrate/client/service", default-features = false }
telemetry = { package = "sc-telemetry", path = "../../../substrate/client/telemetry" }
# Substrate Primitives
sp-authority-discovery = { path = "../../../substrate/primitives/authority-discovery" }
consensus_common = { package = "sp-consensus", path = "../../../substrate/primitives/consensus/common" }
beefy-primitives = { package = "sp-consensus-beefy", path = "../../../substrate/primitives/consensus/beefy" }
grandpa_primitives = { package = "sp-consensus-grandpa", path = "../../../substrate/primitives/consensus/grandpa" }
sp-inherents = { path = "../../../substrate/primitives/inherents" }
sp-keyring = { path = "../../../substrate/primitives/keyring" }
sp-api = { path = "../../../substrate/primitives/api" }
sp-block-builder = { path = "../../../substrate/primitives/block-builder" }
sp-blockchain = { path = "../../../substrate/primitives/blockchain" }
sp-core = { path = "../../../substrate/primitives/core" }
sp-io = { path = "../../../substrate/primitives/io" }
sp-keystore = { path = "../../../substrate/primitives/keystore" }
sp-offchain = { package = "sp-offchain", path = "../../../substrate/primitives/offchain" }
sp-runtime = { path = "../../../substrate/primitives/runtime" }
sp-session = { path = "../../../substrate/primitives/session" }
sp-storage = { path = "../../../substrate/primitives/storage" }
sp-transaction-pool = { path = "../../../substrate/primitives/transaction-pool" }
pallet-transaction-payment = { path = "../../../substrate/frame/transaction-payment" }
sp-timestamp = { path = "../../../substrate/primitives/timestamp" }
sp-consensus-babe = { path = "../../../substrate/primitives/consensus/babe" }
sp-state-machine = { path = "../../../substrate/primitives/state-machine" }
sp-weights = { path = "../../../substrate/primitives/weights" }
sp-version = { path = "../../../substrate/primitives/version" }
# Substrate Pallets
pallet-babe = { path = "../../../substrate/frame/babe" }
pallet-im-online = { path = "../../../substrate/frame/im-online" }
pallet-staking = { path = "../../../substrate/frame/staking" }
pallet-transaction-payment-rpc-runtime-api = { path = "../../../substrate/frame/transaction-payment/rpc/runtime-api" }
frame-system = { path = "../../../substrate/frame/system" }
# Substrate Other
frame-system-rpc-runtime-api = { path = "../../../substrate/frame/system/rpc/runtime-api" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../substrate/utils/prometheus" }
frame-support = { path = "../../../substrate/frame/support" }
frame-benchmarking-cli = { path = "../../../substrate/utils/frame/benchmarking-cli" }
frame-benchmarking = { path = "../../../substrate/frame/benchmarking" }
# External Crates
async-trait = "0.1.57"
futures = "0.3.21"
hex-literal = "0.4.1"
is_executable = "1.0.1"
gum = { package = "tracing-gum", path = "../gum" }
log = "0.4.17"
schnellru = "0.2.1"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
thiserror = "1.0.48"
kvdb = "0.13.0"
kvdb-rocksdb = { version = "0.19.0", optional = true }
parity-db = { version = "0.4.12", optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1" }
parking_lot = "0.12.1"
# Polkadot
polkadot-core-primitives = { path = "../../core-primitives" }
polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" }
polkadot-overseer = { path = "../overseer" }
polkadot-parachain-primitives = { path = "../../parachain" }
polkadot-primitives = { path = "../../primitives" }
polkadot-node-primitives = { path = "../primitives" }
polkadot-rpc = { path = "../../rpc" }
polkadot-node-subsystem = { path = "../subsystem" }
polkadot-node-subsystem-util = { path = "../subsystem-util" }
polkadot-node-subsystem-types = { path = "../subsystem-types" }
polkadot-runtime-parachains = { path = "../../runtime/parachains" }
polkadot-node-network-protocol = { path = "../network/protocol" }
# Polkadot Runtime Constants
rococo-runtime-constants = { path = "../../runtime/rococo/constants", optional = true }
westend-runtime-constants = { path = "../../runtime/westend/constants", optional = true }
# Polkadot Runtimes
westend-runtime = { path = "../../runtime/westend", optional = true }
rococo-runtime = { path = "../../runtime/rococo", optional = true }
# Polkadot Subsystems
polkadot-approval-distribution = { path = "../network/approval-distribution", optional = true }
polkadot-availability-bitfield-distribution = { path = "../network/bitfield-distribution", optional = true }
polkadot-availability-distribution = { path = "../network/availability-distribution", optional = true }
polkadot-availability-recovery = { path = "../network/availability-recovery", optional = true }
polkadot-collator-protocol = { path = "../network/collator-protocol", optional = true }
polkadot-dispute-distribution = { path = "../network/dispute-distribution", optional = true }
polkadot-gossip-support = { path = "../network/gossip-support", optional = true }
polkadot-network-bridge = { path = "../network/bridge", optional = true }
polkadot-node-collation-generation = { path = "../collation-generation", optional = true }
polkadot-node-core-approval-voting = { path = "../core/approval-voting", optional = true }
polkadot-node-core-av-store = { path = "../core/av-store", optional = true }
polkadot-node-core-backing = { path = "../core/backing", optional = true }
polkadot-node-core-bitfield-signing = { path = "../core/bitfield-signing", optional = true }
polkadot-node-core-candidate-validation = { path = "../core/candidate-validation", optional = true }
polkadot-node-core-chain-api = { path = "../core/chain-api", optional = true }
polkadot-node-core-chain-selection = { path = "../core/chain-selection", optional = true }
polkadot-node-core-dispute-coordinator = { path = "../core/dispute-coordinator", optional = true }
polkadot-node-core-prospective-parachains = { path = "../core/prospective-parachains", optional = true }
polkadot-node-core-provisioner = { path = "../core/provisioner", optional = true }
polkadot-node-core-pvf = { path = "../core/pvf", optional = true }
polkadot-node-core-pvf-checker = { path = "../core/pvf-checker", optional = true }
polkadot-node-core-runtime-api = { path = "../core/runtime-api", optional = true }
polkadot-statement-distribution = { path = "../network/statement-distribution", optional = true }
[dev-dependencies]
polkadot-test-client = { path = "../test/client" }
polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }
test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../primitives/test-helpers" }
env_logger = "0.9.0"
assert_matches = "1.5.0"
serial_test = "2.0.0"
tempfile = "3.2"
[features]
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",
]
# Configure the native runtimes to use.
westend-native = ["westend-runtime", "westend-runtime-constants"]
rococo-native = ["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",
]
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",
]
malus = ["full-node"]
runtime-metrics = [
"polkadot-runtime-parachains/runtime-metrics",
"rococo-runtime?/runtime-metrics",
"westend-runtime?/runtime-metrics",
]