diff --git a/prover/proof_producer/dummy_producer.go b/prover/proof_producer/dummy_producer.go index c601d8a2a..f6ca986df 100644 --- a/prover/proof_producer/dummy_producer.go +++ b/prover/proof_producer/dummy_producer.go @@ -36,7 +36,12 @@ func (d *DummyProofProducer) RequestProof( time.AfterFunc(d.proofDelay(), func() { resultCh <- &ProofWithHeader{ - BlockID: blockID, Meta: meta, Header: header, ZkProof: []byte{0xff}, Degree: CircuitsDegree10Txs, + BlockID: blockID, + Meta: meta, + Header: header, + ZkProof: []byte{0xff}, + Degree: CircuitsDegree10Txs, + Opts: opts, } }) diff --git a/prover/proof_producer/proof_producer.go b/prover/proof_producer/proof_producer.go index 936b9ae24..d5022129a 100644 --- a/prover/proof_producer/proof_producer.go +++ b/prover/proof_producer/proof_producer.go @@ -41,6 +41,7 @@ type ProofWithHeader struct { Header *types.Header ZkProof []byte Degree uint64 + Opts *ProofRequestOptions } type ProofProducer interface { diff --git a/prover/proof_producer/special_proof_producer.go b/prover/proof_producer/special_proof_producer.go index 35a92448f..810381565 100644 --- a/prover/proof_producer/special_proof_producer.go +++ b/prover/proof_producer/special_proof_producer.go @@ -153,6 +153,7 @@ func (p *SpecialProofProducer) RequestProof( Header: header, Meta: meta, ZkProof: proof, + Opts: opts, } }) diff --git a/prover/proof_producer/zkevm_cmd_producer.go b/prover/proof_producer/zkevm_cmd_producer.go index a639a934a..130a85a4c 100644 --- a/prover/proof_producer/zkevm_cmd_producer.go +++ b/prover/proof_producer/zkevm_cmd_producer.go @@ -72,6 +72,7 @@ func (p *ZkevmCmdProducer) RequestProof( Meta: meta, ZkProof: proof, Degree: CircuitsDegree10Txs, + Opts: opts, } return nil diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index 2719d1452..7932adc05 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -137,6 +137,7 @@ func (p *ZkevmRpcdProducer) RequestProof( Meta: meta, ZkProof: proof, Degree: degree, + Opts: opts, } return nil diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index 0c6d76b6c..d219a2dc2 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -201,29 +201,14 @@ func (s *ValidProofSubmitter) SubmitProof( return fmt.Errorf("failed to fetch anchor transaction receipt: %w", err) } - signalRoot, err := s.anchorTxValidator.GetAnchoredSignalRoot(ctx, anchorTx) - if err != nil { - return err - } - - parent, err := s.rpc.L2.BlockByHash(ctx, block.ParentHash()) - if err != nil { - return err - } - - blockInfo, err := s.rpc.TaikoL1.GetBlock(nil, blockID) - if err != nil { - return err - } - evidence := &encoding.TaikoL1Evidence{ - MetaHash: blockInfo.MetaHash, - ParentHash: block.ParentHash(), - BlockHash: block.Hash(), - SignalRoot: signalRoot, + MetaHash: proofWithHeader.Opts.MetaHash, + ParentHash: proofWithHeader.Opts.ParentHash, + BlockHash: proofWithHeader.Opts.BlockHash, + SignalRoot: proofWithHeader.Opts.SignalRoot, Graffiti: s.graffiti, - ParentGasUsed: uint32(parent.GasUsed()), - GasUsed: uint32(block.GasUsed()), + ParentGasUsed: uint32(proofWithHeader.Opts.ParentGasUsed), + GasUsed: uint32(proofWithHeader.Opts.GasUsed), Proof: zkProof, }