internal/ethapi: reject gasPrice with blob hashes

This commit is contained in:
Ray 2026-07-10 10:50:37 +08:00
parent 111e7b8b48
commit 15a7af3fa1
2 changed files with 10 additions and 0 deletions

View file

@ -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

View file

@ -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",