Skip to content

refactor: rename GasPrice to FeesPerGas in l1 tx utils - #25152

Merged
spalladino merged 7 commits into
merge-train/spartanfrom
jb/rename-gas-price-to-fee-caps
Aug 10, 2026
Merged

spalladino merged 7 commits into
merge-train/spartanfrom
jb/rename-gas-price-to-fee-caps

Conversation

@benesjan

@benesjan benesjan commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

The original name was very misleading as gas price has a real meaning - that's the gas price paid for when the L1 tx is mined. For this reason I am renaming GasPrice as FeesPerGas, following viem's naming for the same EIP-1559 values.

Old naming is handled by the stores so this should be fine to merge.

`GasPrice` holds `{ maxFeePerGas, maxPriorityFeePerGas, maxFeePerBlobGas? }` — the EIP-1559 fee caps a tx
carries, not a gas price. The name collides with the things that really are gas prices: viem's
`PublicClient.getGasPrice()` (a legacy scalar bigint), `receipt.effectiveGasPrice`, and `stats.gasPrice`.
`l1TxUtils.getGasPrice()` and `client.getGasPrice()` read identically at a call site and return different shapes.

Renames the type and the identifiers that name the cap set, so "gas price" now means only a scalar wei-per-gas
price. Keys already written to disk keep their names, with a comment saying why.
@benesjan
benesjan force-pushed the jb/rename-gas-price-to-fee-caps branch from 59c1fde to 47f68fb Compare August 10, 2026 11:27
@benesjan
benesjan marked this pull request as ready for review August 10, 2026 12:38
@benesjan benesjan changed the title refactor: rename GasPrice to FeeCaps in l1 tx utils refactor: rename GasPrice to FeeCaps in l1 tx utils Aug 10, 2026
@benesjan
benesjan requested review from spalladino and spypsy August 10, 2026 13:13
@benesjan
benesjan changed the base branch from next to merge-train/spartan August 10, 2026 13:27
@spalladino

Copy link
Copy Markdown
Contributor

Code for the rename looks ok, but I'm not sold on the new name. I've seen ethers.js use FeeData, though it feels too generic, and viem uses FeesPerGas, which sounds a bit nicer.

I don't intend to die in this hill, so if you feel very strongly about the new name I'm ok approving, but I also don't see the need for the rename, given gasPrice is the historical pre-EIP1559 name for this.

@benesjan benesjan added the claudebox Owned by claudebox. it can push to this PR. label Aug 10, 2026
Follows viem's naming for the same EIP-1559 values.
@benesjan benesjan changed the title refactor: rename GasPrice to FeeCaps in l1 tx utils refactor: rename GasPrice to FeesPerGas in l1 tx utils Aug 10, 2026
@benesjan

Copy link
Copy Markdown
Contributor Author

Renamed to FeesPerGas as suggested. Thanks!

@spalladino
spalladino merged commit b30cd37 into merge-train/spartan Aug 10, 2026
15 checks passed
@spalladino
spalladino deleted the jb/rename-gas-price-to-fee-caps branch August 10, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants