diff --git a/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor.go b/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor.go index c97bbbe040a..a930c862441 100644 --- a/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor.go +++ b/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor.go @@ -8,6 +8,7 @@ import ( "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + consensus "github.com/ethereum/go-ethereum/consensus/taiko" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" @@ -17,12 +18,6 @@ import ( "github.com/taikoxyz/taiko-mono/packages/taiko-client/pkg/rpc" ) -var ( - // Each TaikoL2.anchor transaction should use this value as it's gas limit. - AnchorGasLimit uint64 = 250_000 - GoldenTouchAddress = common.HexToAddress("0x0000777735367b36bC9B61C50022d9D0700dB4Ec") -) - // AnchorTxConstructor is responsible for assembling the anchor transaction (TaikoL2.anchor) in // each L2 block, which must be the first transaction, and its sender must be the golden touch account. type AnchorTxConstructor struct { @@ -87,22 +82,22 @@ func (c *AnchorTxConstructor) transactOpts( ) // Get the nonce of golden touch account at the specified parentHeight. - nonce, err := c.rpc.L2AccountNonce(ctx, GoldenTouchAddress, parentHeight) + nonce, err := c.rpc.L2AccountNonce(ctx, consensus.GoldenTouchAccount, parentHeight) if err != nil { return nil, err } log.Info( "Golden touch account nonce", - "address", GoldenTouchAddress, + "address", consensus.GoldenTouchAccount, "nonce", nonce, "parent", parentHeight, ) return &bind.TransactOpts{ - From: GoldenTouchAddress, + From: consensus.GoldenTouchAccount, Signer: func(address common.Address, tx *types.Transaction) (*types.Transaction, error) { - if address != GoldenTouchAddress { + if address != consensus.GoldenTouchAccount { return nil, bind.ErrNotAuthorized } signature, err := c.signTxPayload(signer.Hash(tx).Bytes()) @@ -115,7 +110,7 @@ func (c *AnchorTxConstructor) transactOpts( Context: ctx, GasFeeCap: baseFee, GasTipCap: common.Big0, - GasLimit: AnchorGasLimit, + GasLimit: consensus.AnchorGasLimit, NoSend: true, }, nil } diff --git a/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor_test.go b/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor_test.go index 0aa240a1a06..4b6e2831bdb 100644 --- a/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor_test.go +++ b/packages/taiko-client/driver/anchor_tx_constructor/anchor_tx_constructor_test.go @@ -7,6 +7,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" + consensus "github.com/ethereum/go-ethereum/consensus/taiko" "github.com/ethereum/go-ethereum/crypto" "github.com/stretchr/testify/suite" @@ -32,7 +33,7 @@ func (s *AnchorTxConstructorTestSuite) SetupTest() { } func (s *AnchorTxConstructorTestSuite) TestGasLimit() { - s.Greater(AnchorGasLimit, uint64(0)) + s.Greater(consensus.AnchorGasLimit, uint64(0)) } func (s *AnchorTxConstructorTestSuite) TestAssembleAnchorTx() { diff --git a/packages/taiko-client/driver/chain_syncer/blob/syncer.go b/packages/taiko-client/driver/chain_syncer/blob/syncer.go index 82c8ad671d4..fdaed3bd418 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/syncer.go +++ b/packages/taiko-client/driver/chain_syncer/blob/syncer.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/beacon/engine" "github.com/ethereum/go-ethereum/common" + consensus "github.com/ethereum/go-ethereum/consensus/taiko" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" @@ -454,7 +455,7 @@ func (s *Syncer) createExecutionPayloads( BlockMetadata: &engine.BlockMetadata{ HighestBlockID: headBlockID, Beneficiary: event.Meta.Coinbase, - GasLimit: uint64(event.Meta.GasLimit) + anchorTxConstructor.AnchorGasLimit, + GasLimit: uint64(event.Meta.GasLimit) + consensus.AnchorGasLimit, Timestamp: event.Meta.Timestamp, TxList: txListBytes, MixHash: event.Meta.Difficulty,