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

Commit

Permalink
feat: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Jun 25, 2023
1 parent 7fc274c commit 0f90c7d
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 0f90c7d

Please sign in to comment.