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

Commit

Permalink
fix(prover): fix a check in isValidProof()
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Apr 2, 2024
1 parent 55717c8 commit c76a412
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Push docker image to GCR"

on:
push:
branches: [main]
branches: [main,fix-isValidProof]
tags:
- "v*"

Expand Down
2 changes: 2 additions & 0 deletions prover/event_handler/transition_proved.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func (h *TransitionProvedEventHandler) Handle(
return nil
}

log.Info("Is valid proof", "isValid", isValid)

// If the proof is invalid, we contest it.
blockInfo, err := h.rpc.GetL2BlockInfo(ctx, e.BlockId)
if err != nil {
Expand Down
12 changes: 1 addition & 11 deletions prover/event_handler/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,9 @@ func isValidProof(
return false, err
}

l1Origin, err := rpc.L2.L1OriginByID(ctx, blockID)
if err != nil {
return false, err
}

l1Header, err := rpc.L1.HeaderByNumber(ctx, new(big.Int).Sub(l1Origin.L1BlockHeight, common.Big1))
if err != nil {
return false, err
}

return parent.Hash() == parentHash &&
l2Header.Hash() == blockHash &&
l1Header.Root == stateRoot, nil
l2Header.Root == stateRoot, nil
}

// getProvingWindow returns the provingWindow of the given proposed block.
Expand Down

0 comments on commit c76a412

Please sign in to comment.