diff --git a/packages/taiko-client/cmd/flags/proposer.go b/packages/taiko-client/cmd/flags/proposer.go index c1bb98dc31..fccd2267db 100644 --- a/packages/taiko-client/cmd/flags/proposer.go +++ b/packages/taiko-client/cmd/flags/proposer.go @@ -82,6 +82,13 @@ var ( Value: 0, EnvVars: []string{"EPOCH_MIN_TX_LIST_BYTES"}, } + MinTip = &cli.Uint64Flag{ + Name: "epoch.minTip", + Usage: "Minimum tip for a transaction to propose", + Category: proposerCategory, + Value: 0, + EnvVars: []string{"EPOCH_MIN_TIP"}, + } MinProposingInternal = &cli.DurationFlag{ Name: "epoch.minProposingInterval", Usage: "Minimum time interval to force proposing a block, even if there are no transaction in mempool", @@ -155,6 +162,7 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ ExtraData, MinGasUsed, MinTxListBytes, + MinTip, MinProposingInternal, MaxProposedTxListsPerEpoch, ProverEndpoints, diff --git a/packages/taiko-client/pkg/rpc/engine.go b/packages/taiko-client/pkg/rpc/engine.go index e1ec3a5c84..8b0428ae8b 100644 --- a/packages/taiko-client/pkg/rpc/engine.go +++ b/packages/taiko-client/pkg/rpc/engine.go @@ -99,8 +99,8 @@ func (c *EngineClient) ExchangeTransitionConfiguration( return result, nil } -// TxPoolContent fetches the transaction pool content from the L2 execution engine. -func (c *EngineClient) TxPoolContent( +// TxPoolContentWithMinTip fetches the transaction pool content from the L2 execution engine. +func (c *EngineClient) TxPoolContentWithMinTip( ctx context.Context, beneficiary common.Address, baseFee *big.Int, @@ -108,6 +108,7 @@ func (c *EngineClient) TxPoolContent( maxBytesPerTxList uint64, locals []string, maxTransactionsLists uint64, + minTip uint64, ) ([]*miner.PreBuiltTxList, error) { timeoutCtx, cancel := context.WithTimeout(ctx, defaultTimeout) defer cancel() @@ -116,13 +117,14 @@ func (c *EngineClient) TxPoolContent( if err := c.CallContext( timeoutCtx, &result, - "taikoAuth_txPoolContent", + "taikoAuth_txPoolContentWithMinTip", beneficiary, baseFee, blockMaxGasLimit, maxBytesPerTxList, locals, maxTransactionsLists, + minTip, ); err != nil { return nil, err } diff --git a/packages/taiko-client/pkg/rpc/methods.go b/packages/taiko-client/pkg/rpc/methods.go index a8a6355d84..20de0a3e4e 100644 --- a/packages/taiko-client/pkg/rpc/methods.go +++ b/packages/taiko-client/pkg/rpc/methods.go @@ -255,6 +255,7 @@ func (c *Client) GetPoolContent( maxBytesPerTxList uint64, locals []common.Address, maxTransactionsLists uint64, + minTip uint64, ) ([]*miner.PreBuiltTxList, error) { ctxWithTimeout, cancel := CtxWithTimeoutOrDefault(ctx, defaultTimeout) defer cancel() @@ -285,7 +286,7 @@ func (c *Client) GetPoolContent( localsArg = append(localsArg, local.Hex()) } - return c.L2Engine.TxPoolContent( + return c.L2Engine.TxPoolContentWithMinTip( ctxWithTimeout, beneficiary, baseFeeInfo.Basefee, @@ -293,6 +294,7 @@ func (c *Client) GetPoolContent( maxBytesPerTxList, localsArg, maxTransactionsLists, + minTip, ) } diff --git a/packages/taiko-client/proposer/config.go b/packages/taiko-client/proposer/config.go index 3c61fa4aa6..890fa98d79 100644 --- a/packages/taiko-client/proposer/config.go +++ b/packages/taiko-client/proposer/config.go @@ -32,6 +32,7 @@ type Config struct { LocalAddressesOnly bool MinGasUsed uint64 MinTxListBytes uint64 + MinTip uint64 MinProposingInternal time.Duration MaxProposedTxListsPerEpoch uint64 ProposeBlockTxGasLimit uint64 @@ -113,6 +114,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { LocalAddressesOnly: c.Bool(flags.TxPoolLocalsOnly.Name), MinGasUsed: c.Uint64(flags.MinGasUsed.Name), MinTxListBytes: c.Uint64(flags.MinTxListBytes.Name), + MinTip: c.Uint64(flags.MinTip.Name), MinProposingInternal: c.Duration(flags.MinProposingInternal.Name), MaxProposedTxListsPerEpoch: c.Uint64(flags.MaxProposedTxListsPerEpoch.Name), ProposeBlockTxGasLimit: c.Uint64(flags.TxGasLimit.Name), diff --git a/packages/taiko-client/proposer/proposer.go b/packages/taiko-client/proposer/proposer.go index 0469ba4b1d..92ffc17b66 100644 --- a/packages/taiko-client/proposer/proposer.go +++ b/packages/taiko-client/proposer/proposer.go @@ -202,6 +202,7 @@ func (p *Proposer) fetchPoolContent(filterPoolContent bool) ([]types.Transaction rpc.BlockMaxTxListBytes, p.LocalAddresses, p.MaxProposedTxListsPerEpoch, + p.MinTip, ) if err != nil { return nil, fmt.Errorf("failed to fetch transaction pool content: %w", err) diff --git a/packages/taiko-client/proposer/proposer_test.go b/packages/taiko-client/proposer/proposer_test.go index 7feebcda4b..7f69a6f48b 100644 --- a/packages/taiko-client/proposer/proposer_test.go +++ b/packages/taiko-client/proposer/proposer_test.go @@ -182,6 +182,7 @@ func (s *ProposerTestSuite) TestProposeOpNoEmptyBlock() { rpc.BlockMaxTxListBytes, p.LocalAddresses, p.MaxProposedTxListsPerEpoch, + 0, ) time.Sleep(time.Second) }