Skip to content

Commit

Permalink
fix(collator): clear uncommitted diffs on sync
Browse files Browse the repository at this point in the history
  • Loading branch information
SmaGMan committed Dec 11, 2024
1 parent 37692c0 commit 956e5c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion collator/src/collator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl CollatorStdImpl {
));
} else {
// last processed_to anchor in shard can be before last procssed in master
// it is normal, so we should not cancel collation buy we unable to import init anchors
// it is normal, so we should not cancel collation but we unable to import init anchors
false
}
} else {
Expand Down
5 changes: 5 additions & 0 deletions collator/src/manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,11 @@ where
&mc_block_entry.top_shard_blocks_info,
)?;

// when we run sync by any reason we should drop uncommitted queue updates
// after restoring the required state
// to avoid panics if next block was already collated before an it is incorrect
self.mq_adapter.clear_session_state()?;

let state = mc_block_entry.cached_state()?;

// HACK: do not need to set master block latest chain time from zerostate when using mempool stub
Expand Down

0 comments on commit 956e5c3

Please sign in to comment.