Skip to content
This repository was archived by the owner on May 11, 2024. It is now read-only.

feat(driver): check the mismatch of last verified block #296

Merged
merged 3 commits into from
Jun 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add comments
  • Loading branch information
davidtaikocha committed Jun 25, 2023
commit 0f90c7dfd4e1d910cf15f7d52954a086fad65487
6 changes: 4 additions & 2 deletions driver/chain_syncer/calldata/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (s *Syncer) onBlockProposed(
lastInsertedBlockIDToReset *big.Int
err error
)
reorged, err = s.checkLastVerifiedBlockL1Reorged(ctx)
reorged, err = s.checkLastVerifiedBlockMismatch(ctx)
if err != nil {
return fmt.Errorf("failed to check if last verified block in L2 EE has been reorged: %w", err)
}
Expand Down Expand Up @@ -451,7 +451,9 @@ func (s *Syncer) createExecutionPayloads(
return payload, nil
}

func (s *Syncer) checkLastVerifiedBlockL1Reorged(ctx context.Context) (bool, error) {
// checkLastVerifiedBlockMismatch checks if there is a mismatch bewteen protocol's last verified block hash and
// the corresponding L2 EE block hash.
func (s *Syncer) checkLastVerifiedBlockMismatch(ctx context.Context) (bool, error) {
lastVerifiedBlockInfo := s.state.GetLatestVerifiedBlock()
l2Header, err := s.rpc.L2.HeaderByNumber(ctx, lastVerifiedBlockInfo.Height)
if err != nil {
Expand Down