Skip to content

Commit e693fd0

Browse files
authored
fix(en): Add check for commitment in diverged batch (#4493)
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Operational changes <!-- Any config changes? Any new flags? Any changes to any scripts? --> <!-- Please add anything that non-Matter Labs entities running their own ZK Chain may need to know --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`. Signed-off-by: Danil <[email protected]>
1 parent 6e8f526 commit e693fd0

File tree

1 file changed

+5
-0
lines changed
  • core/node/reorg_detector/src

1 file changed

+5
-0
lines changed

core/node/reorg_detector/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ impl ReorgDetector {
480480
return Ok(false);
481481
}
482482

483+
let commitment_match = self.commitment_match(l1_batch, l1batch_hashed_data).await?;
484+
if !commitment_match {
485+
return Ok(false);
486+
}
487+
483488
let mut storage = self.pool.connection().await?;
484489
let (_, last_l2_block_in_batch) = storage
485490
.blocks_dal()

0 commit comments

Comments
 (0)