Skip to content

Commit 8b93ab6

Browse files
committed
fix: fix aura warp sync (see substrate PR paritytech#13221
1 parent 9d225c9 commit 8b93ab6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

client/consensus/aura/src/import_queue.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,15 @@ where
185185
&mut self,
186186
mut block: BlockImportParams<B, ()>,
187187
) -> Result<(BlockImportParams<B, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
188-
// When importing whole state we don't verify the seal as the state is not available.
189-
if block.with_state() {
190-
return Ok((block, Default::default()))
191-
}
192-
193-
// Skip checks that include execution, if being told so.
188+
// Skip checks that include execution, if being told so or when importing only state.
194189
//
195190
// This is done for example when gap syncing and it is expected that the block after the gap
196191
// was checked/chosen properly, e.g. by warp syncing to this block using a finality proof.
197-
if block.state_action.skip_execution_checks() {
192+
// Or when we are importing state only and can not verify the seal.
193+
if block.with_state() || block.state_action.skip_execution_checks() {
194+
// When we are importing only the state of a block, it will be the best block.
195+
block.fork_choice = Some(ForkChoiceStrategy::Custom(block.with_state()));
196+
198197
return Ok((block, Default::default()))
199198
}
200199

0 commit comments

Comments
 (0)