diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index e4de73293..068be794a 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -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{ diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index 1ee720947..d24417ceb 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -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(), @@ -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(),