diff --git a/prover/config.go b/prover/config.go index 439f03e0e..299cdc1af 100644 --- a/prover/config.go +++ b/prover/config.go @@ -40,7 +40,7 @@ type Config struct { ContesterMode bool EnableLivenessBondProof bool RPCTimeout time.Duration - ProveBlockGasLimit *uint64 + ProveBlockGasLimit uint64 HTTPServerPort uint64 Capacity uint64 MinOptimisticTierFee *big.Int @@ -76,12 +76,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { startingBlockID = new(big.Int).SetUint64(c.Uint64(flags.StartingBlockID.Name)) } - var proveBlockTxGasLimit *uint64 - if c.IsSet(flags.TxGasLimit.Name) { - gasLimit := c.Uint64(flags.TxGasLimit.Name) - proveBlockTxGasLimit = &gasLimit - } - var allowance = common.Big0 if c.IsSet(flags.Allowance.Name) { amt, ok := new(big.Int).SetString(c.String(flags.Allowance.Name), 10) @@ -149,7 +143,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { ContesterMode: c.Bool(flags.ContesterMode.Name), EnableLivenessBondProof: c.Bool(flags.EnableLivenessBondProof.Name), RPCTimeout: c.Duration(flags.RPCTimeout.Name), - ProveBlockGasLimit: proveBlockTxGasLimit, + ProveBlockGasLimit: c.Uint64(flags.TxGasLimit.Name), Capacity: c.Uint64(flags.ProverCapacity.Name), HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name), MinOptimisticTierFee: new(big.Int).SetUint64(c.Uint64(flags.MinOptimisticTierFee.Name)), diff --git a/prover/init.go b/prover/init.go index 4a1857e74..5695bc515 100644 --- a/prover/init.go +++ b/prover/init.go @@ -123,6 +123,7 @@ func (p *Prover) initProofSubmitters( p.proofGenerationCh, p.cfg.TaikoL2Address, p.cfg.Graffiti, + p.cfg.ProveBlockGasLimit, txmgr, txBuilder, ); err != nil { diff --git a/prover/proof_submitter/proof_contester.go b/prover/proof_submitter/proof_contester.go index bb3834541..1f512615c 100644 --- a/prover/proof_submitter/proof_contester.go +++ b/prover/proof_submitter/proof_contester.go @@ -30,6 +30,7 @@ type ProofContester struct { // NewProofContester creates a new ProofContester instance. func NewProofContester( rpcClient *rpc.Client, + gasLimit uint64, txmgr *txmgr.SimpleTxManager, graffiti string, builder *transaction.ProveBlockTxBuilder, @@ -37,7 +38,7 @@ func NewProofContester( return &ProofContester{ rpc: rpcClient, txBuilder: builder, - sender: transaction.NewSender(rpcClient, txmgr, 0), // TODO + sender: transaction.NewSender(rpcClient, txmgr, gasLimit), graffiti: rpc.StringToBytes32(graffiti), } } diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index 5387b3109..8b781d30d 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -41,6 +41,7 @@ func NewProofSubmitter( resultCh chan *proofProducer.ProofWithHeader, taikoL2Address common.Address, graffiti string, + gasLimit uint64, txmgr *txmgr.SimpleTxManager, builder *transaction.ProveBlockTxBuilder, ) (*ProofSubmitter, error) { @@ -55,7 +56,7 @@ func NewProofSubmitter( resultCh: resultCh, anchorValidator: anchorValidator, txBuilder: builder, - sender: transaction.NewSender(rpcClient, txmgr, 0), + sender: transaction.NewSender(rpcClient, txmgr, gasLimit), proverAddress: txmgr.From(), taikoL2Address: taikoL2Address, graffiti: rpc.StringToBytes32(graffiti), @@ -131,7 +132,7 @@ func (s *ProofSubmitter) SubmitProof( log.Info( "NewProofSubmitter block proof", "blockID", proofWithHeader.BlockID, - "proposer", proofWithHeader.Meta.Coinbase, + "coinbase", proofWithHeader.Meta.Coinbase, "parentHash", proofWithHeader.Header.ParentHash, "hash", proofWithHeader.Opts.BlockHash, "stateRoot", proofWithHeader.Opts.StateRoot, diff --git a/prover/proof_submitter/proof_submitter_test.go b/prover/proof_submitter/proof_submitter_test.go index f2c87dd2e..43793aaad 100644 --- a/prover/proof_submitter/proof_submitter_test.go +++ b/prover/proof_submitter/proof_submitter_test.go @@ -78,12 +78,14 @@ func (s *ProofSubmitterTestSuite) SetupTest() { s.proofCh, common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), "test", + 0, txMgr, builder, ) s.Nil(err) s.contester = NewProofContester( s.RPCClient, + 0, txMgr, "test", builder, diff --git a/prover/prover.go b/prover/prover.go index 83ec015c6..2e5b37b31 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -160,6 +160,7 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { // Proof contester p.proofContester = proofSubmitter.NewProofContester( p.rpc, + p.cfg.ProveBlockGasLimit, p.txmgr, p.cfg.Graffiti, txBuilder,