From 15a7af3fa1920162f3ce5cf356331ba1c1d44947 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 10 Jul 2026 10:50:37 +0800 Subject: [PATCH] internal/ethapi: reject gasPrice with blob hashes --- internal/ethapi/transaction_args.go | 3 +++ internal/ethapi/transaction_args_test.go | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 586df48759..5acd2de76b 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -201,6 +201,9 @@ func (args *TransactionArgs) setFeeDefaults(ctx context.Context, b Backend, head if args.GasPrice != nil && args.AuthorizationList != nil { return errors.New("both gasPrice and authorizationList specified") } + if args.GasPrice != nil && args.BlobHashes != nil { + return errors.New("both gasPrice and blobVersionedHashes specified") + } // If the tx has completely specified a fee mechanism, no default is needed. // This allows users who are not yet synced past London to get defaults for // other tx values. See https://github.com/ethereum/go-ethereum/pull/23274 diff --git a/internal/ethapi/transaction_args_test.go b/internal/ethapi/transaction_args_test.go index 1d587032bb..f0c4993496 100644 --- a/internal/ethapi/transaction_args_test.go +++ b/internal/ethapi/transaction_args_test.go @@ -224,6 +224,13 @@ func TestSetFeeDefaults(t *testing.T) { nil, errors.New("both gasPrice and (maxFeePerGas or maxPriorityFeePerGas) specified"), }, + { + "set gas price and blob hashes", + "cancun", + &TransactionArgs{GasPrice: fortytwo, BlobHashes: []common.Hash{{0x01}}}, + nil, + errors.New("both gasPrice and blobVersionedHashes specified"), + }, { "fill maxFeePerBlobGas", "cancun",