bug: Increment transition_id if block changeset is present (#1718)

This commit is contained in:
rakita
2023-03-13 10:35:02 +01:00
committed by GitHub
parent 29a2e1ab3a
commit 3ba2398f95

View File

@@ -719,6 +719,8 @@ where
current_transition_id += 1;
}
let have_block_changeset = !results.block_changesets.is_empty();
// If there are any post block changes, we will add account changesets to db.
for (address, changeset) in results.block_changesets.into_iter() {
trace!(target: "sync::stages::execution", ?address, current_transition_id, "Applying block reward");
@@ -729,7 +731,13 @@ where
spurious_dragon_active,
)?;
}
current_transition_id += 1;
// Transition is incremeneted every time before Paris hardfork and after
// Shanghai only if there are Withdrawals in the block. So it is correct to
// to increment transition id every time there is a block changeset present.
if have_block_changeset {
current_transition_id += 1;
}
}
Ok(())
}