Skip to content

Commit

Permalink
fix(collator): fix counters on extract merged group
Browse files Browse the repository at this point in the history
  • Loading branch information
serejkaaa512 authored and Rexagon committed Oct 10, 2024
1 parent fa7dd36 commit 1e06b0d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions collator/src/collator/message_group_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ impl MessageGroupsV2 {
DisplayMessageGroup(&group),
);

self.int_messages_count = 0;
self.ext_messages_count = 0;

Some(group)
}
}
Expand Down
10 changes: 5 additions & 5 deletions collator/src/collator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,10 +1221,10 @@ impl CollatorStdImpl {
);

// check has unprocessed messages in buffer or queue
let has_uprocessed_messages = self
let has_unprocessed_messages = self
.check_has_unprocessed_messages(&mut working_state)
.await?;
if has_uprocessed_messages {
if has_unprocessed_messages {
tracing::info!(target: tracing_targets::COLLATOR,
"there are unprocessed messages from previous block, will collate next block",
);
Expand Down Expand Up @@ -1259,7 +1259,7 @@ impl CollatorStdImpl {
&& gas_used_from_last_anchor > self.config.gas_used_to_import_next_anchor;

// check if has pending internals or externals
let no_pending_msgs = !has_uprocessed_messages && !has_externals;
let no_pending_msgs = !has_unprocessed_messages && !has_externals;

// import next anchor if meet one of above conditions
let next_anchor_info_opt = if force_mc_block_by_uncommitted_chain {
Expand Down Expand Up @@ -1304,11 +1304,11 @@ impl CollatorStdImpl {
};

// collate block if has internals or externals
if (has_uprocessed_messages || has_externals) && !force_mc_block_by_uncommitted_chain {
if (has_unprocessed_messages || has_externals) && !force_mc_block_by_uncommitted_chain {
drop(histogram);
self.do_collate(working_state, None).await?;
} else {
if !has_uprocessed_messages && !has_externals {
if !has_unprocessed_messages && !has_externals {
self.accounts_load = Default::default();
}

Expand Down

0 comments on commit 1e06b0d

Please # to comment.