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

Commit

Permalink
feat(prover): fix a RequestProof issue (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Mar 1, 2024
1 parent 2237295 commit 0f15192
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pkg/rpc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,17 @@ func GetBlockProofStatus(
return nil, err
}

l1Header, err := cli.L1.HeaderByNumber(ctxWithTimeout, new(big.Int).Sub(l1Origin.L1BlockHeight, common.Big1))
header, err := cli.L2.HeaderByHash(ctxWithTimeout, l1Origin.L2BlockHash)
if err != nil {
return nil, err
}

if l1Origin.L2BlockHash != transition.BlockHash || transition.StateRoot != l1Header.Root {
if l1Origin.L2BlockHash != transition.BlockHash || transition.StateRoot != header.Root {
log.Info(
"Different block hash or state root detected, try submitting a contest",
"localBlockHash", common.BytesToHash(l1Origin.L2BlockHash[:]),
"protocolTransitionBlockHash", common.BytesToHash(transition.BlockHash[:]),
"localStateRoot", l1Header.Root,
"localStateRoot", header.Root,
"protocolTransitionStateRoot", common.BytesToHash(transition.StateRoot[:]),
)
return &BlockProofStatus{
Expand Down
7 changes: 1 addition & 6 deletions prover/proof_submitter/proof_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,6 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko
return err
}

l1Header, err := s.rpc.L1.HeaderByHash(ctx, event.Meta.L1Hash)
if err != nil {
return err
}

// Request proof.
opts := &proofProducer.ProofRequestOptions{
BlockID: block.Number(),
Expand All @@ -129,7 +124,7 @@ func (s *ProofSubmitter) RequestProof(ctx context.Context, event *bindings.Taiko
MetaHash: blockInfo.Blk.MetaHash,
BlockHash: block.Hash(),
ParentHash: block.ParentHash(),
StateRoot: l1Header.Root,
StateRoot: block.Root(),
EventL1Hash: event.Raw.BlockHash,
Graffiti: common.Bytes2Hex(s.graffiti[:]),
GasUsed: block.GasUsed(),
Expand Down

0 comments on commit 0f15192

Please sign in to comment.