diff --git a/packages/taiko-client/pkg/rpc/engine.go b/packages/taiko-client/pkg/rpc/engine.go index ca30e6ae192..24012f88175 100644 --- a/packages/taiko-client/pkg/rpc/engine.go +++ b/packages/taiko-client/pkg/rpc/engine.go @@ -19,6 +19,7 @@ type EngineClient struct { *rpc.Client } +// NewJWTEngineClient creates a new EngineClient with JWT authentication. func NewJWTEngineClient(url, jwtSecret string) (*EngineClient, error) { var jwt = StringToBytes32(jwtSecret) if jwt == (common.Hash{}) || url == "" { diff --git a/packages/taiko-client/pkg/rpc/ethclient.go b/packages/taiko-client/pkg/rpc/ethclient.go index 23254d1b666..6b5e0312f3d 100644 --- a/packages/taiko-client/pkg/rpc/ethclient.go +++ b/packages/taiko-client/pkg/rpc/ethclient.go @@ -485,7 +485,7 @@ type SignTransactionResult struct { Tx *types.Transaction `json:"tx"` } -// FillTransaction fill transaction. +// FillTransaction fills in the missing fields of a transaction and signs it. func (c *EthClient) FillTransaction(ctx context.Context, args *TransactionArgs) (*types.Transaction, error) { ctxWithTimeout, cancel := CtxWithTimeoutOrDefault(ctx, c.timeout) defer cancel() diff --git a/packages/taiko-client/pkg/rpc/fallback.go b/packages/taiko-client/pkg/rpc/fallback.go deleted file mode 100644 index 6237f2105a0..00000000000 --- a/packages/taiko-client/pkg/rpc/fallback.go +++ /dev/null @@ -1,29 +0,0 @@ -package rpc - -import ( - "errors" - "math/big" - "strings" -) - -// Taken from: -// https://github.com/ethereum-optimism/optimism-legacy/blob/develop/bss-core/drivers/max_priority_fee_fallback.go -var ( - //lint:ignore ST1005 allow `errMaxPriorityFeePerGasNotFound` to be capitalized. - errMaxPriorityFeePerGasNotFound = errors.New( - "method eth_maxPriorityFeePerGas not found", - ) - - // FallbackGasTipCap is the default fallback gasTipCap used when we are - // unable to query an L1 backend for a suggested gasTipCap. - FallbackGasTipCap = big.NewInt(1500000000) -) - -// IsMaxPriorityFeePerGasNotFoundError returns true if the provided error -// signals that the backend does not support the eth_maxPriorityFeePerGas -// method. In this case, the caller should fallback to using the constant above. -func IsMaxPriorityFeePerGasNotFoundError(err error) bool { - return strings.Contains( - err.Error(), errMaxPriorityFeePerGasNotFound.Error(), - ) -} diff --git a/packages/taiko-client/pkg/rpc/fallback_test.go b/packages/taiko-client/pkg/rpc/fallback_test.go deleted file mode 100644 index a7d05649dc7..00000000000 --- a/packages/taiko-client/pkg/rpc/fallback_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package rpc - -import ( - "errors" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestIsMaxPriorityFeePerGasNotFoundError(t *testing.T) { - require.False(t, IsMaxPriorityFeePerGasNotFoundError(errors.New("test"))) - require.True(t, IsMaxPriorityFeePerGasNotFoundError(errMaxPriorityFeePerGasNotFound)) -} diff --git a/packages/taiko-client/pkg/utils/utils.go b/packages/taiko-client/pkg/utils/utils.go index a7f7b0eb8df..7c7ca2845aa 100644 --- a/packages/taiko-client/pkg/utils/utils.go +++ b/packages/taiko-client/pkg/utils/utils.go @@ -69,14 +69,6 @@ func Min[T constraints.Integer](a, b T) T { return b } -// Max return the maximum value of two integers. -func Max[T constraints.Integer](a, b T) T { - if a > b { - return a - } - return b -} - // Compress compresses the given txList bytes using zlib. func Compress(txList []byte) ([]byte, error) { var b bytes.Buffer diff --git a/packages/taiko-client/proposer/proposer.go b/packages/taiko-client/proposer/proposer.go index 3ac58e51565..866bc5b86e8 100644 --- a/packages/taiko-client/proposer/proposer.go +++ b/packages/taiko-client/proposer/proposer.go @@ -293,6 +293,7 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { "lastProposedAt", p.lastProposedAt, ) + // Fetch pending L2 transactions from mempool. txLists, err := p.fetchPoolContent(filterPoolContent) if err != nil { return err