mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-13 18:35:51 +00:00
BEEFY: Support compatibility with Warp Sync - Allow Warp Sync for Validators (#2689)
Resolves https://github.com/paritytech/polkadot-sdk/issues/2627 Initializes voter _after_ headers sync finishes in the background. This enables the BEEFY gadget to work with `--sync warp` (GRANDPA warp sync). Co-authored-by: Adrian Catangiu <adrian@parity.io>
This commit is contained in:
@@ -142,6 +142,16 @@ where
|
||||
// Run inner block import.
|
||||
let inner_import_result = self.inner.import_block(block).await?;
|
||||
|
||||
match self.backend.state_at(hash) {
|
||||
Ok(_) => {},
|
||||
Err(_) => {
|
||||
// The block is imported as part of some chain sync.
|
||||
// The voter doesn't need to process it now.
|
||||
// It will be detected and processed as part of the voter state init.
|
||||
return Ok(inner_import_result);
|
||||
},
|
||||
}
|
||||
|
||||
match (beefy_encoded, &inner_import_result) {
|
||||
(Some(encoded), ImportResult::Imported(_)) => {
|
||||
match self.decode_and_verify(&encoded, number, hash) {
|
||||
|
||||
Reference in New Issue
Block a user