diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index 0610db44c..f8440d6f9 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -27,11 +27,6 @@ import ( txListValidator "github.com/taikoxyz/taiko-client/pkg/txlist_validator" ) -var ( - // Brecht recommends to hardcore 149, may be unrequired as proof system changes - defaultMaxTxPerBlock = uint64(149) -) - // Syncer responsible for letting the L2 execution engine catching up with protocol's latest // pending block through deriving L1 calldata. type Syncer struct { @@ -71,7 +66,6 @@ func NewSyncer( anchorConstructor: constructor, txListValidator: txListValidator.NewTxListValidator( uint64(configs.BlockMaxGasLimit), - defaultMaxTxPerBlock, configs.BlockMaxTxListBytes.Uint64(), rpc.L2.ChainID, ), diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index 152805afc..6acbe87bf 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -29,10 +29,9 @@ var ( errEmptyTiersList = errors.New("empty proof tiers list in protocol") // syncProgressRecheckDelay is the time delay of rechecking the L2 execution engine's sync progress again, // if the previous check failed. - syncProgressRecheckDelay = 12 * time.Second - waitL1OriginPollingInterval = 3 * time.Second - defaultWaitL1OriginTimeout = 3 * time.Minute - defaultMaxTransactionsPerBlock = uint64(149) + syncProgressRecheckDelay = 12 * time.Second + waitL1OriginPollingInterval = 3 * time.Second + defaultWaitL1OriginTimeout = 3 * time.Minute // Request urls. sidecarsRequestURL = "eth/v1/beacon/blob_sidecars/%d" @@ -274,7 +273,6 @@ func (c *Client) GetPoolContent( "taiko_txPoolContent", beneficiary, baseFee, - defaultMaxTransactionsPerBlock, blockMaxGasLimit, maxBytesPerTxList, localsArg, diff --git a/pkg/rpc/methods_test.go b/pkg/rpc/methods_test.go index 9f5a5b043..81bac9460 100644 --- a/pkg/rpc/methods_test.go +++ b/pkg/rpc/methods_test.go @@ -169,7 +169,7 @@ func TestGetPoolContentValid(t *testing.T) { gasLimit, maxBytes.Uint64(), txPools, - defaultMaxTransactionsPerBlock, + 4, ) require.Nil(t, err2) } diff --git a/pkg/txlist_validator/tx_list_validator.go b/pkg/txlist_validator/tx_list_validator.go index 2a65863cb..1d1801a77 100644 --- a/pkg/txlist_validator/tx_list_validator.go +++ b/pkg/txlist_validator/tx_list_validator.go @@ -10,24 +10,21 @@ import ( // TxListValidator is responsible for validating the transactions list in a TaikoL1.proposeBlock transaction. type TxListValidator struct { - blockMaxGasLimit uint64 - maxTransactionsPerBlock uint64 - maxBytesPerTxList uint64 - chainID *big.Int + blockMaxGasLimit uint64 + maxBytesPerTxList uint64 + chainID *big.Int } // NewTxListValidator creates a new TxListValidator instance based on giving configurations. func NewTxListValidator( blockMaxGasLimit uint64, - maxTransactionsPerBlock uint64, maxBytesPerTxList uint64, chainID *big.Int, ) *TxListValidator { return &TxListValidator{ - maxTransactionsPerBlock: maxTransactionsPerBlock, - blockMaxGasLimit: blockMaxGasLimit, - maxBytesPerTxList: maxBytesPerTxList, - chainID: chainID, + blockMaxGasLimit: blockMaxGasLimit, + maxBytesPerTxList: maxBytesPerTxList, + chainID: chainID, } } @@ -54,13 +51,6 @@ func (v *TxListValidator) ValidateTxList( return false } - log.Debug("Transactions list decoded", "blockID", blockID, "length", len(txs)) - - if txs.Len() > int(v.maxTransactionsPerBlock) { - log.Info("Too many transactions", "blockID", blockID, "count", txs.Len()) - return false - } - log.Info("Transaction list is valid", "blockID", blockID) return true } diff --git a/pkg/txlist_validator/tx_list_validator_test.go b/pkg/txlist_validator/tx_list_validator_test.go index 4cf0fd018..01b1fc896 100644 --- a/pkg/txlist_validator/tx_list_validator_test.go +++ b/pkg/txlist_validator/tx_list_validator_test.go @@ -17,7 +17,6 @@ import ( var ( maxBlocksGasLimit = uint64(50) - maxBlockNumTxs = uint64(11) maxTxlistBytes = uint64(10000) chainID = genesis.Config.ChainID testKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") @@ -34,7 +33,6 @@ var ( func TestIsTxListValid(t *testing.T) { v := NewTxListValidator( maxBlocksGasLimit, - maxBlockNumTxs, maxTxlistBytes, chainID, ) @@ -56,12 +54,6 @@ func TestIsTxListValid(t *testing.T) { randBytes(0x1), false, }, - { - "txListBytes too many transactions", - chainID, - rlpEncodedTransactionBytes(int(maxBlockNumTxs)+1, true), - false, - }, { "success empty tx list", chainID, diff --git a/proposer/proposer.go b/proposer/proposer.go index b605618ed..16b2e6bf0 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -278,7 +278,8 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { return nil } -func (p *Proposer) makeProposeBlockTxWithBlobHash( +// makeBlobProposeBlockTx tries to send a TaikoL1.proposeBlock transaction with txList bytes saved in blob. +func (p *Proposer) makeBlobProposeBlockTx( ctx context.Context, txListBytes []byte, ) (*types.Transaction, error) { @@ -354,13 +355,14 @@ func (p *Proposer) makeProposeBlockTxWithBlobHash( return nil, err } - log.Info("Tx", "proposeBlockTx", proposeTx, "type", proposeTx.Type()) + log.Debug("Transaction", " nonce", proposeTx.Nonce(), "type", proposeTx.Type()) return proposeTx, nil } -// makeProposeBlockTx tries to send a TaikoL1.proposeBlock transaction. -func (p *Proposer) makeProposeBlockTx( +// makeCalldataProposeBlockTx tries to send a TaikoL1.proposeBlock transaction +// with txList bytes saved in calldata. +func (p *Proposer) makeCalldataProposeBlockTx( ctx context.Context, txListBytes []byte, ) (*types.Transaction, error) { @@ -451,12 +453,12 @@ func (p *Proposer) ProposeTxList( ) // Send tx list by blob tx. if p.BlobAllowed { - tx, err = p.makeProposeBlockTxWithBlobHash( + tx, err = p.makeBlobProposeBlockTx( ctx, txListBytes, ) } else { - tx, err = p.makeProposeBlockTx( + tx, err = p.makeCalldataProposeBlockTx( ctx, txListBytes, ) diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index 617173b0a..fe5a691d9 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -174,9 +174,9 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { s.Nil(err) var newTx *types.Transaction if s.p.BlobAllowed { - newTx, err = s.p.makeProposeBlockTxWithBlobHash(context.Background(), encoded) + newTx, err = s.p.makeBlobProposeBlockTx(context.Background(), encoded) } else { - newTx, err = s.p.makeProposeBlockTx( + newTx, err = s.p.makeCalldataProposeBlockTx( context.Background(), encoded, )