Repository navigation
feat: add blockAccessListHash and slotNumber to Block type - #5674
Merged
Merged
Conversation
|
@mortezashojaei is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: cbe7112 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) andslotNumber(EIP-7843). Both are already in the execution-apis block schema.Block/RpcBlockdon't declare them, andformatBlockleavesslotNumberas a hex string.Public code works around this. aztec-node checks
'blockAccessListHash' in blockon anobject-typed block. altana-sdk RLP-encodesgetBlock()output throughheader: any. argonprotocol uses a hand-writteneth_getBlockByNumberschema. Permalinks are in #5673.What
src/types/block.ts: adds optionalblockAccessListHash?: Hash | undefinedandslotNumber?: quantity | undefinedwith TSDoc, in the file's alphabetical order.src/utils/formatters/block.ts: formatsslotNumbertobigintwith...(block.slotNumber && { … }). The key is omitted when the RPC omits it, so pre-Glamsterdam blocks are unchanged.blockAccessListHashalready 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 existingblockTag = "latest"case.Usage
Validation
tsc -p src/tsconfig.json --noEmit: passes.getBlock.test-d.ts, typechecked through a temporary tsconfig that extendstest/tsconfig.json(composite: false): passes with this change. Without it, it fails withTS2339onblockAccessListHashandslotNumber.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 existinggetBlockkey snapshots are unchanged, which shows no key is added for pre-fork blocks.getBlock()against Sepolia block 12217571 returnedslotNumber: 11664655n. A cast-free header encoder using only declaredBlockfields gavekeccak256(toRlp(header)) === block.hash. Against mainnet, both fields wereundefined, there was noslotNumberkey, and the hash still matched.biome checkon the changed files: clean.Compatibility
The type change is additive and both fields are optional. The only runtime change is that the undeclared
block.slotNumberbecomes abigintinstead of a hex string, which matches its new type and the other header quantities.BigInt(block.slotNumber)keeps working. This follows therequestsHash(#5647) andparentBeaconBlockRoot(#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.