Skip to content

Commit 79cfb09

Browse files
authored
adding to section (#1031)
1 parent 4a39431 commit 79cfb09

File tree

1 file changed

+24
-0
lines changed
  • website/src/pages/en/subgraphs/developing/creating/graph-ts

1 file changed

+24
-0
lines changed

website/src/pages/en/subgraphs/developing/creating/graph-ts/api.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,30 @@ store.remove('Transfer', id)
372372

373373
The Ethereum API provides access to smart contracts, public state variables, contract functions, events, transactions, blocks and the encoding/decoding Ethereum data.
374374

375+
#### Ethereum JSON‑RPC Schema Changes & Execution Client Compatibility
376+
377+
Following Ethereum's [transition to Proof of Stake](https://ethereum.org/en/roadmap/merge/), the Execution Layer JSON-RPC schema was updated to reflect changes in block metadata.
378+
379+
The `totalDifficulty` field was [officially removed](https://github.com/ethereum/execution-apis/pull/570) from the `eth_getBlockByNumber` response. Additionally, the `difficulty` field—previously used in Proof of Work—was retained as **optional** but is now considered obsolete and typically returned as `"0x0"` by spec-compliant clients. While some clients continue to include these fields for backward compatibility, developers relying on them should update their subgraphs and tooling to accommodate these schema changes. Full schema details are available in the [Ethereum Execution APIs documentation](https://ethereum.github.io/execution-apis/). We've added a chart with the current client compatibility with these updates as of July 17, 2025. **Please check for specific client updates as needed**.
380+
381+
**Ethereum JSON‑RPC Schema Changes Post-Merge**
382+
383+
| Field | JSON‑RPC Schema Status (Post-Merge) |
384+
| ----------------- | --------------------------------------------------------------------------- |
385+
| `totalDifficulty` | ❌ Removed from `eth_getBlockByNumber` response |
386+
| `difficulty` | ⚠️ Optional, expected to be `0x0` post-Merge, but many clients still return |
387+
| `size` | ⚠️ Optional; may be omitted depending on client |
388+
389+
**Execution Client Compatibility**
390+
391+
| Client | totalDifficulty | difficulty | size | Notes |
392+
| --- | --- | --- | --- | --- |
393+
| **Erigon v3** | Not returned | Non-zero | Usually present | Strict spec compliance, noted [here](https://github.com/erigontech/erigon/issues/13012) |
394+
| **Geth** | Returned | Non-zero | Returned | Maintains legacy behavior, noted [here](https://ethereum.org/developers/docs/apis/json-rpc/#eth_getblockbyhash) |
395+
| **Nethermind** | Returned | Non-zero | Returned | Maintains legacy behavior, noted [here](https://docs.nethermind.io/interacting/json-rpc-ns/eth/#eth_getblockbynumber) |
396+
| **Besu** | Returns `0` for an uncle block | Non-zero | Returned | Returns deprecated fields with valid values, noted [here](https://besu.hyperledger.org/public-networks/reference/api/objects) |
397+
| **Reth** | Not Returned | `"0x0"` | Returned | Highly spec-compliant, aligns with post-Merge schema |
398+
375399
#### Support for Ethereum Types
376400

377401
As with entities, `graph codegen` generates classes for all smart contracts and events used in a Subgraph. For this, the contract ABIs need to be part of the data source in the Subgraph manifest. Typically, the ABI files are stored in an `abis/` folder.

0 commit comments

Comments
 (0)