Skip to content

feat: return blob gas fields from getFeeHistory - #5635

Merged
jxom merged 2 commits into
mainfrom
fee-history-blob-fields
Nov 21, 2026
Merged

jxom merged 2 commits into
mainfrom
fee-history-blob-fields

Conversation

@jxom

@jxom jxom commented Nov 21, 2026

Copy link
Copy Markdown
Member

Supersedes #5634 by @mortezashojaei, keeping their commit and adding fixes on top.

getFeeHistory and formatFeeHistory now return the EIP-4844 baseFeePerBlobGas (blockCount + 1 entries) and blobGasUsedRatio (blockCount entries) fields of eth_feeHistory, matching the execution-apis spec. No extra RPC calls.

Changes on top of #5634:

  • formatFeeHistory omits the blob fields when the node doesn't return them (pre-Cancun clients, non-Ethereum chains) instead of setting undefined keys, with a regression test.
  • The new array fields are readonly.
  • The getFeeHistory docs example and Returns section show the new fields.

Verified: getFeeHistory and formatFeeHistory tests pass against the Anvil mainnet fork, Biome is clean, tsc -b passes, and the CJS bundle is 121.12 kB (limit 121.5 kB).

mortezashojaei and others added 2 commits November 21, 2026 19:06
Nodes without EIP-4844 support no longer produce undefined
baseFeePerBlobGas and blobGasUsedRatio keys. The new array fields are
readonly, and the getFeeHistory docs show them.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1ff81-8a1e-746e-8dcd-e866842e525a
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
viem Error Error Nov 21, 2026 7:23pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 21, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0693b5e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T19:21:28.989292Z 0693b5e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Published [email protected] under the pr-5635 dist-tag, which follows this pull request until it closes.

pnpm add viem@pr-5635
pnpm add [email protected]

@jxom
jxom merged commit 745bfaf into main Nov 21, 2026
39 of 40 checks passed
@jxom
jxom deleted the fee-history-blob-fields branch November 21, 2026 23:41
@github-actions github-actions Bot mentioned this pull request Nov 21, 2026
jxom added a commit to wevm/ox that referenced this pull request Nov 28, 2026
…e`, `Hex` and `PersonalMessage` (#729)

- Kept a leading U+FEFF when decoding UTF-8 strings (wevm/viem#5590).
- Rejected a missing static head after a dynamic parameter in AbiParameters.decode (wevm/viem#5572).
- Rejected odd-length hex in PersonalMessage.encode (wevm/viem#5631).
- Added blockAccessListHash and slotNumber to Block (wevm/viem#5674).
- Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory (wevm/viem#5635).

Amp-Thread-ID: https://ampcode.com/threads/T-01a21f59-905f-745c-8634-6581aa9f965e

Co-authored-by: Amp <[email protected]>
jxom added a commit to wevm/ox that referenced this pull request Nov 28, 2026
…e`, `Hex` and `PersonalMessage` (#730)

- Kept a leading U+FEFF when decoding UTF-8 strings (wevm/viem#5590).
- Rejected a missing static head after a dynamic parameter in AbiParameters.decode (wevm/viem#5572).
- Rejected odd-length hex in PersonalMessage.encode (wevm/viem#5631).
- Added blockAccessListHash and slotNumber to Block (wevm/viem#5674).
- Added baseFeePerBlobGas and blobGasUsedRatio to Fee.FeeHistory (wevm/viem#5635).

Backport of #729.

Amp-Thread-ID: https://ampcode.com/threads/T-01a21f59-905f-745c-8634-6581aa9f965e

Co-authored-by: Amp <[email protected]>

This branch had an error being deployed

1 failed deployment
Preview — 0693b5ef Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants