diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index 17b5dfa00..e8694bfa1 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -31,6 +31,7 @@ type ZkevmRpcdProducer struct { Retry bool // retry proof computation if error CustomProofHook func() ([]byte, uint64, error) // only for testing purposes ProofTimeTarget uint64 // used for calculating proof delay + ProtocolConfig *bindings.TaikoDataConfig // protocol configurations } // RequestProofBody represents the JSON body for requesting the proof. @@ -43,25 +44,28 @@ type RequestProofBody struct { // RequestProofBody represents the JSON body of RequestProofBody's `param` field. type RequestProofBodyParam struct { - Circuit string `json:"circuit"` - Block *big.Int `json:"block"` - L2RPC string `json:"l2_rpc"` - Retry bool `json:"retry"` - Param string `json:"param"` - VerifyProof bool `json:"verify_proof"` - Mock bool `json:"mock"` - Aggregate bool `json:"aggregate"` - Prover string `json:"prover"` - L1SignalService string `json:"l1_signal_service"` - L2SignalService string `json:"l2_signal_service"` - TaikoL2 string `json:"l2_contract"` - MetaHash string `json:"meta_hash"` - BlockHash string `json:"block_hash"` - ParentHash string `json:"parent_hash"` - SignalRoot string `json:"signal_root"` - Graffiti string `json:"graffiti"` - GasUsed uint64 `json:"gas_used"` - ParentGasUsed uint64 `json:"parent_gas_used"` + Circuit string `json:"circuit"` + Block *big.Int `json:"block"` + L2RPC string `json:"l2_rpc"` + Retry bool `json:"retry"` + Param string `json:"param"` + VerifyProof bool `json:"verify_proof"` + Mock bool `json:"mock"` + Aggregate bool `json:"aggregate"` + Prover string `json:"prover"` + L1SignalService string `json:"l1_signal_service"` + L2SignalService string `json:"l2_signal_service"` + TaikoL2 string `json:"l2_contract"` + MetaHash string `json:"meta_hash"` + BlockHash string `json:"block_hash"` + ParentHash string `json:"parent_hash"` + SignalRoot string `json:"signal_root"` + Graffiti string `json:"graffiti"` + GasUsed uint64 `json:"gas_used"` + ParentGasUsed uint64 `json:"parent_gas_used"` + BlockMaxGasLimit uint64 `json:"block_max_gas_limit"` + MaxTransactionsPerBlock uint64 `json:"max_transactions_per_block"` + MaxBytesPerTxList uint64 `json:"max_bytes_per_tx_list"` } // RequestProofBodyResponse represents the JSON body of the response of the proof requests. @@ -92,6 +96,7 @@ func NewZkevmRpcdProducer( l2Endpoint string, retry bool, proofTimeTarget uint64, + protocolConfig *bindings.TaikoDataConfig, ) (*ZkevmRpcdProducer, error) { return &ZkevmRpcdProducer{ RpcdEndpoint: rpcdEndpoint, @@ -100,6 +105,7 @@ func NewZkevmRpcdProducer( L2Endpoint: l2Endpoint, Retry: retry, ProofTimeTarget: proofTimeTarget, + ProtocolConfig: protocolConfig, }, nil } @@ -200,25 +206,28 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput ID: common.Big1, Method: "proof", Params: []*RequestProofBodyParam{{ - Circuit: "pi", - Block: opts.Height, - L2RPC: p.L2Endpoint, - Retry: true, - Param: p.Param, - VerifyProof: true, - Mock: false, - Aggregate: false, - Prover: opts.ProverAddress.Hex()[2:], - L1SignalService: opts.L1SignalService.Hex()[2:], - L2SignalService: opts.L2SignalService.Hex()[2:], - TaikoL2: opts.TaikoL2.Hex()[2:], - MetaHash: opts.MetaHash.Hex()[2:], - BlockHash: opts.BlockHash.Hex()[2:], - ParentHash: opts.ParentHash.Hex()[2:], - SignalRoot: opts.SignalRoot.Hex()[2:], - Graffiti: opts.Graffiti, - GasUsed: opts.GasUsed, - ParentGasUsed: opts.ParentGasUsed, + Circuit: "pi", + Block: opts.Height, + L2RPC: p.L2Endpoint, + Retry: true, + Param: p.Param, + VerifyProof: true, + Mock: false, + Aggregate: false, + Prover: opts.ProverAddress.Hex()[2:], + L1SignalService: opts.L1SignalService.Hex()[2:], + L2SignalService: opts.L2SignalService.Hex()[2:], + TaikoL2: opts.TaikoL2.Hex()[2:], + MetaHash: opts.MetaHash.Hex()[2:], + BlockHash: opts.BlockHash.Hex()[2:], + ParentHash: opts.ParentHash.Hex()[2:], + SignalRoot: opts.SignalRoot.Hex()[2:], + Graffiti: opts.Graffiti, + GasUsed: opts.GasUsed, + ParentGasUsed: opts.ParentGasUsed, + BlockMaxGasLimit: p.ProtocolConfig.BlockMaxGasLimit, + MaxTransactionsPerBlock: p.ProtocolConfig.MaxTransactionsPerBlock, + MaxBytesPerTxList: p.ProtocolConfig.MaxBytesPerTxList, }}, } diff --git a/prover/proof_producer/zkevm_rpcd_producer_test.go b/prover/proof_producer/zkevm_rpcd_producer_test.go index 4e635fb45..82c9b46d5 100644 --- a/prover/proof_producer/zkevm_rpcd_producer_test.go +++ b/prover/proof_producer/zkevm_rpcd_producer_test.go @@ -12,7 +12,15 @@ import ( ) func TestNewZkevmRpcdProducer(t *testing.T) { - dummyZkevmRpcdProducer, err := NewZkevmRpcdProducer("http://localhost:18545", "", "", "", false, 0) + dummyZkevmRpcdProducer, err := NewZkevmRpcdProducer( + "http://localhost:18545", + "", + "", + "", + false, + 0, + &bindings.TaikoDataConfig{}, + ) require.Nil(t, err) dummyZkevmRpcdProducer.CustomProofHook = func() ([]byte, uint64, error) { diff --git a/prover/prover.go b/prover/prover.go index 59db4154f..b097a31f4 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -194,6 +194,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { cfg.L2HttpEndpoint, true, stateVars.ProofTimeTarget, + p.protocolConfigs, ); err != nil { return err }