From 6137cfc2be81c2473625c1dee11b7c970992c47c Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Wed, 29 May 2024 19:17:05 +0800 Subject: [PATCH] internal/ethapi: add back missing check for maxfee < maxPriorityFee (#23384) --- internal/ethapi/transaction_args.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 0f93c6367271..dbfa6313509d 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -120,6 +120,11 @@ func (args *TransactionArgs) setDefaults(ctx context.Context, b Backend) error { args.GasPrice = (*hexutil.Big)(price) } } + } else { + // Both maxPriorityfee and maxFee set by caller. Sanity-check their internal relation + if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 { + return fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas) + } } if args.Value == nil { args.Value = new(hexutil.Big)