mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
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:
@@ -42,19 +42,19 @@ impl<Block: BlockT> ActiveCandidateRecovery<Block> {
|
||||
Self { recoveries: Default::default(), candidates: Default::default(), overseer_handle }
|
||||
}
|
||||
|
||||
/// Recover the given `pending_candidate`.
|
||||
/// Recover the given `candidate`.
|
||||
pub async fn recover_candidate(
|
||||
&mut self,
|
||||
block_hash: Block::Hash,
|
||||
pending_candidate: crate::PendingCandidate<Block>,
|
||||
candidate: &crate::Candidate<Block>,
|
||||
) {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
self.overseer_handle
|
||||
.send_msg(
|
||||
AvailabilityRecoveryMessage::RecoverAvailableData(
|
||||
pending_candidate.receipt,
|
||||
pending_candidate.session_index,
|
||||
candidate.receipt.clone(),
|
||||
candidate.session_index,
|
||||
None,
|
||||
tx,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user