go-ethereum/internal
ozpool 2133e014ae
internal/ethapi: reject gasPrice together with authorizationList (#35320)
Closes #35314.

### Problem

`TransactionArgs.ToTransaction` selects `SetCodeTxType` when an
`authorizationList` is present, but then unconditionally downgrades to
`LegacyTxType` when `gasPrice` is set:

```go
case args.AuthorizationList != nil || defaultType == types.SetCodeTxType:
    usedType = types.SetCodeTxType
...
if args.GasPrice != nil {
    usedType = types.LegacyTxType
}
```

A legacy transaction cannot carry an EIP-7702 authorization list, so the
list is silently dropped. `eth_sendTransaction`, `eth_signTransaction`
and `eth_fillTransaction` can then return a plain legacy
transaction/hash even though the requested delegation update or
revocation was never included.

The downgrade also masks a latent issue: `setFeeDefaults` returns early
once `gasPrice` is set (without `authorizationList`) and never fills
`MaxFeePerGas`/`MaxPriorityFeePerGas`. Building the `SetCodeTx` without
the downgrade would hit
`uint256.MustFromBig((*big.Int)(args.MaxFeePerGas))` with a nil fee cap
and panic. Erroring early is therefore the correct behavior.

### Fix

Reject the `gasPrice` + `authorizationList` combination in
`setFeeDefaults`, mirroring the existing `gasPrice` / EIP-1559 guard, so
the request fails explicitly instead of producing a transaction that
omits the authorization list.

### Test

Added a `setFeeDefaults` case asserting the new error. Verified
fail-on-main: with the guard reverted the test fails (`expected error:
both gasPrice and authorizationList specified`); with the guard it
passes. Full `internal/ethapi` package, `go vet` and `gofmt` are clean.

### Note

The same silent-drop applies to `gasPrice` + `blobVersionedHashes` (blob
transactions also cannot be legacy). I scoped this PR to the reported
`authorizationList` case; happy to extend the guard to blob hashes in
the same spot if preferred.
2026-07-08 11:57:31 -06:00
..
blocktest crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323) 2026-02-03 14:55:27 -07:00
build all: fix all typos, as reported by crates-ci/typos (#35008) 2026-06-10 18:50:51 +02:00
cmdtest cmd/geth, internal: fix flaky console tests (#31784) 2025-05-08 15:15:36 +02:00
debug internal/debug: add integration with Grafana Pyroscope (#33623) 2026-01-20 10:33:09 +01:00
download internal/download: close dst on io.Copy error (#34910) 2026-05-10 13:43:40 +02:00
era core/rawdb/eradb: support ere files in era store (#34978) 2026-06-22 17:00:43 +02:00
ethapi internal/ethapi: reject gasPrice together with authorizationList (#35320) 2026-07-08 11:57:31 -06:00
flags internal/flags: update copyright year to 2026 (#33550) 2026-01-08 11:49:13 +08:00
guide all: fix typos in docs and comments (#31548) 2025-04-02 13:52:40 -06:00
jsre internal/jsre: pass correct args to setTimeout/setInterval callbacks (#32936) 2025-10-28 12:34:14 +01:00
memlimit internal/memlimit: respect cgroup memory cap (#34947) 2026-06-12 13:31:15 +02:00
reexec internal/reexec: fix broken link to Docker/Moby in comment (#31859) 2025-05-20 15:58:00 +08:00
shutdowncheck eth, les: update unclean shutdown markers regularly (#24077) 2021-12-17 15:18:51 +01:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2021-10-07 15:47:50 +02:00
tablewriter cmd/geth: add inspect trie tool to analysis trie storage (#28892) 2026-02-24 10:56:00 -07:00
telemetry rpc, internal/telemetry: trace JSON-RPC response writes (#35049) 2026-06-02 14:13:06 +02:00
testlog internal/testlog: fix log output from sub-loggers (#31539) 2025-04-10 18:21:32 +02:00
testrand triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
utesting internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
version build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
web3ext eth: add debug_clearTxpool api (#33347) 2026-06-09 14:39:46 +02:00