Skip to content

feat: add blockAccessListHash and slotNumber to Block type - #5674

Merged
jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:feat/block-glamsterdam-fields
Nov 27, 2026
Merged

jxom merged 1 commit into
wevm:mainfrom
mortezashojaei:feat/block-glamsterdam-fields

Conversation

@mortezashojaei

Copy link
Copy Markdown
Contributor

Refs #5673

Why

Glamsterdam is live on Sepolia (since 2026-10-06), and mainnet is expected soon. Block objects there now include blockAccessListHash (EIP-7928) and slotNumber (EIP-7843). Both are already in the execution-apis block schema. Block / RpcBlock don't declare them, and formatBlock leaves slotNumber as a hex string.

Public code works around this. aztec-node checks 'blockAccessListHash' in block on an object-typed block. altana-sdk RLP-encodes getBlock() output through header: any. argonprotocol uses a hand-written eth_getBlockByNumber schema. Permalinks are in #5673.

What

  • src/types/block.ts: adds optional blockAccessListHash?: Hash | undefined and slotNumber?: quantity | undefined with TSDoc, in the file's alphabetical order.
  • src/utils/formatters/block.ts: formats slotNumber to bigint with ...(block.slotNumber && { … }). The key is omitted when the RPC omits it, so pre-Glamsterdam blocks are unchanged. blockAccessListHash already passes through via ...block.
  • block.test.ts: adds the two fields to the existing fixture, using values from a real Sepolia block, and updates the existing snapshots.
  • getBlock.test-d.ts: adds two assertions to the existing blockTag = "latest" case.
  • Patch changeset.

Usage

const block = await client.getBlock() // Sepolia
block.blockAccessListHash // `0x${string}` | undefined
block.slotNumber          // bigint | undefined

Validation

  • tsc -p src/tsconfig.json --noEmit: passes.
  • getBlock.test-d.ts, typechecked through a temporary tsconfig that extends test/tsconfig.json (composite: false): passes with this change. Without it, it fails with TS2339 on blockAccessListHash and slotNumber.
  • pnpm test --run src/utils/formatters/block.test.ts src/actions/public/getBlock.test.ts src/actions/public/watchBlocks.test.ts src/actions/public/watchBlockHeaders.test.ts src/celo/formatters.test.ts src/op-stack/formatters.test.ts src/zksync/formatters.test.ts: all pass (Anvil mainnet fork). The existing getBlock key snapshots are unchanged, which shows no key is added for pre-fork blocks.
  • Live PoC script (not included): getBlock() against Sepolia block 12217571 returned slotNumber: 11664655n. A cast-free header encoder using only declared Block fields gave keccak256(toRlp(header)) === block.hash. Against mainnet, both fields were undefined, there was no slotNumber key, and the hash still matched.
  • biome check on the changed files: clean.

Compatibility

The type change is additive and both fields are optional. The only runtime change is that the undeclared block.slotNumber becomes a bigint instead of a hex string, which matches its new type and the other header quantities. BigInt(block.slotNumber) keeps working. This follows the requestsHash (#5647) and parentBeaconBlockRoot (#2719) precedents.

AI assistance

I prepared this with help from an AI coding assistant (Claude Code). I reviewed the evidence, the diff, and the test results.

@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cbe7112

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

@jxom
jxom merged commit 09197e3 into wevm:main Nov 27, 2026
21 of 35 checks passed
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]>
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.

2 participants