Fix warp sync (#12281)

This commit is contained in:
Arkadiy Paronyan
2022-09-16 16:16:37 +02:00
committed by GitHub
parent d9a4d835d1
commit 86b122d7a7
4 changed files with 50 additions and 33 deletions
@@ -225,15 +225,16 @@ where
inherent_data.aura_replace_inherent_data(slot);
// skip the inherents verification if the runtime API is old.
if self
.client
.runtime_api()
.has_api_with::<dyn BlockBuilderApi<B>, _>(
&BlockId::Hash(parent_hash),
|v| v >= 2,
)
.map_err(|e| e.to_string())?
// skip the inherents verification if the runtime API is old or not expected to
// exist.
if !block.state_action.skip_execution_checks() &&
self.client
.runtime_api()
.has_api_with::<dyn BlockBuilderApi<B>, _>(
&BlockId::Hash(parent_hash),
|v| v >= 2,
)
.map_err(|e| e.to_string())?
{
self.check_inherents(
new_block.clone(),