Limit number of blocks per level (2nd attempt) (#1559)

Prevents the StateDbError::TooManySiblingBlocks error from being triggered by eagerly removing 
stale blocks from the backend on block import and before the error condition is met.

Introduces a just in time block recovery mechanism for blocks that were wrongly removed
via an explicit pov-recovery method

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Davide Galassi
2022-12-20 12:13:49 +01:00
committed by GitHub
parent f621351332
commit 73837c384e
17 changed files with 1096 additions and 184 deletions
+3
View File
@@ -10,6 +10,7 @@ async-trait = "0.1.59"
codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] }
dyn-clone = "1.0.10"
futures = "0.3.25"
log = "0.4.17"
tracing = "0.1.37"
# Substrate
@@ -24,7 +25,9 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
# Cumulus
cumulus-primitives-core = { path = "../../../primitives/core" }
cumulus-relay-chain-interface = { path = "../../relay-chain-interface" }
cumulus-client-pov-recovery = { path = "../../pov-recovery" }
[dev-dependencies]
futures-timer = "3.0.2"