Skip to content

[pull] master from graphprotocol:master#89

Merged
pull[bot] merged 1 commit intoHawthorne001:masterfrom
graphprotocol:master
Feb 6, 2026
Merged

[pull] master from graphprotocol:master#89
pull[bot] merged 1 commit intoHawthorne001:masterfrom
graphprotocol:master

Conversation

@pull
Copy link

@pull pull bot commented Feb 6, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* chain/ethereum: add json_patch module for unified type field patching

Add a dedicated module for JSON patching utilities that handle missing
`type` fields in Ethereum transactions and receipts. This consolidates
patching logic that will be used by both the HTTP transport layer (for
RPC responses) and cache deserialization (for stored blocks).

The module provides:
- patch_type_field: Adds "type": "0x0" to JSON objects missing the field
- patch_block_transactions: Patches all transactions in a block
- patch_receipts: Patches single receipts or arrays of receipts

* chain/ethereum: refactor PatchingHttp to use json_patch module

Refactor the HTTP transport's receipt patching to use the shared
json_patch module instead of duplicating the patching logic.

This removes the patch_receipt and patch_result methods from
PatchingHttp and replaces them with calls to json_patch::patch_receipts.
The patch_rpc_response and patch_response methods remain as they handle
RPC-specific JSON-RPC response structure.

* chain/ethereum: patch missing type field in cached blocks

Add patching for cached blocks before deserialization to handle blocks
that were cached before March 2022 when graph-node's rust-web3 fork
didn't capture the transaction type field.

This patches transactions and receipts in cached blocks at two locations:
- ancestor_block(): For full block deserialization (EthereumBlock),
  patches both transactions and transaction_receipts
- parent_ptr(): For light block deserialization (LightEthereumBlock),
  patches only transactions (light blocks don't include receipts)

The patching adds type: 0x0 (legacy) to transactions/receipts missing
the field, allowing alloy to deserialize blocks that would otherwise
fail due to the missing required field.

* chain/ethereum: add EthereumJsonBlock newtype for cached block handling

Introduce EthereumJsonBlock newtype with helper methods for format
detection (is_shallow, is_legacy_format) and deserialization
(into_full_block, into_light_block). Cleans up repeated logic and
avoids unnecessary clones by taking ownership of the JSON data.

* chain/ethereum: use concrete types in EthereumJsonBlock methods

Remove generic type parameters from into_full_block() and
into_light_block(), returning EthereumBlock and LightEthereumBlock
directly instead.

* chain/ethereum: add doc comments to EthereumJsonBlock methods

* chain/ethereum: remove unused From<Value> impl for EthereumJsonBlock
@pull pull bot locked and limited conversation to collaborators Feb 6, 2026
@pull pull bot added the ⤵️ pull label Feb 6, 2026
@pull pull bot merged commit 3ca739f into Hawthorne001:master Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant