go-ethereum/internal/ethapi
rayoo 1481f98554 internal/ethapi: apply block overrides to header in eth_call
When BlockOverrides specifies BaseFeePerGas, doCall applies the
override to the derived EVM block context, but the original header is
still passed down to applyMessage. applyMessage then computes the
message's gasPrice via args.ToMessage(header.BaseFee, ...) which
ignores the override, so subsequent GASPRICE queries and
effectiveTip calculations use the pre-override basefee.

As a result, eth_call with a 1559 transaction (MaxFeePerGas +
MaxPriorityFeePerGas) and a BaseFeePerGas block override returns a
GASPRICE derived from the real block's basefee instead of the
override. tracers/api.go and simulate.go already read BaseFee from
the overridden block context, so only eth_call was affected.

Mirror the fix applied to DoEstimateGas in #34081: after applying the
overrides to blockCtx, rebuild the header via blockOverrides.MakeHeader
so downstream code sees the overridden basefee.

Add a TestCall case that asserts GASPRICE returns tip + overridden
basefee. It fails on master and passes with this change.
2026-04-28 10:49:43 +08:00
..
override eth/catalyst: implement testing_buildBlockV1 (#33656) 2026-02-23 15:56:31 +01:00
testdata internal/ethapi: Add timestamp to eth_getTransactionByHash (#33709) 2026-02-02 12:20:16 +01:00
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api.go internal/ethapi: apply block overrides to header in eth_call 2026-04-28 10:49:43 +08:00
api_test.go internal/ethapi: apply block overrides to header in eth_call 2026-04-28 10:49:43 +08:00
backend.go internal/ethapi: add eth_SendRawTransactionSync (#32830) 2025-10-16 17:34:47 +02:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
errors.go core, internal/ethapi: fix incorrect max-initcode RPC error mapping (#34067) 2026-03-23 22:10:32 +08:00
logtracer.go internal/ethapi: add timestamp to logs in eth_simulate (#32831) 2025-10-06 18:19:25 +02:00
simulate.go consensus, core, internal, miner: remove FinalizeAndAssemble (#34726) 2026-04-21 20:58:21 +02:00
simulate_test.go internal/ethapi: fix gas cap for eth_simulateV1 (#33952) 2026-03-05 09:09:07 +08:00
transaction_args.go internal/ethapi: include AuthorizationList in gas estimation (#33849) 2026-02-23 18:07:26 +01:00
transaction_args_test.go ethapi: reduce some of the wasted effort in GetTransactionReceipt (#32021) 2025-07-01 15:18:49 +08:00