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

Commit

Permalink
remove parentgasused for valid proof checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Aug 25, 2023
1 parent 0bbf349 commit 3394c12
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -720,16 +720,10 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien
return nil
}

block, err := p.rpc.L2ParentByBlockId(ctx, event.BlockId)
if err != nil {
return err
}

// cancel any proofs being generated for this block
isValidProof, err := p.isValidProof(
ctx,
event.BlockId.Uint64(),
block.GasUsed,
event.ParentHash,
event.BlockHash,
)
Expand Down Expand Up @@ -860,7 +854,6 @@ func (p *Prover) checkChainVerification(lastLatestVerifiedL1Height uint64) error
func (p *Prover) isValidProof(
ctx context.Context,
blockID uint64,
parentGasUsed uint64,
parentHash common.Hash,
blockHash common.Hash,
) (bool, error) {
Expand All @@ -874,7 +867,7 @@ func (p *Prover) isValidProof(
return false, err
}

if parent.GasUsed == parentGasUsed && parent.Hash() == parentHash && blockHash == block.Hash() {
if parent.Hash() == parentHash && blockHash == block.Hash() {
return true, nil
}

Expand Down

0 comments on commit 3394c12

Please sign in to comment.