Skip to content

Commit 2b9576c

Browse files
committed
aura/import: Skip block execution when collators have no parent block state
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
1 parent 5a82c96 commit 2b9576c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cumulus/client/consensus/aura/src/collators/slot_based/block_import.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,16 @@ where
9797
) -> Result<sc_consensus::ImportResult, Self::Error> {
9898
// If the channel exists and it is required to execute the block, we will execute the block
9999
// here. This is done to collect the storage proof and to prevent re-execution, we push
100-
// downwards the state changes. `StateAction::ApplyChanges` is ignored, because it either
101-
// means that the node produced the block itself or the block was imported via state sync.
102-
if !self.sender.is_closed() && !matches!(params.state_action, StateAction::ApplyChanges(_))
100+
// downwards the state changes.
101+
//
102+
// The following states are ignored:
103+
// - `StateAction::ApplyChanges`: means that the node produced the block itself or the
104+
// block was imported via state sync.
105+
// - `StateAction::Skip`: means that the block should be skipped. The is evident in the
106+
// context of gap-sync with collators running in non-archive modes. The state of the
107+
// parent block has already been discarded and therefore any import would fail.
108+
if !self.sender.is_closed() &&
109+
!matches!(params.state_action, StateAction::ApplyChanges(_) | StateAction::Skip)
103110
{
104111
let mut runtime_api = self.client.runtime_api();
105112

0 commit comments

Comments
 (0)