Skip to content

[Bug] Graphnode can no longer process blocks with base_fee_per_gas over u64 limit #6571

@Isarafanikov

Description

@Isarafanikov

Bug report

When encountering a block with base_fee_per_gas being higher than 2^64, it fails to parse the block

In previous graphnode versions, the base_fee_per_gas field of the block header was U256

https://github.com/graphprotocol/rust-web3/blob/585c9db21576fd9aace40607b764ec870a5faebb/src/types/block.rs#L38-L39

In v0.42, graphnode switched to the alloy instead, which has the base_fee_per_gas as an u64

https://github.com/alloy-rs/alloy/blob/76aa416c661c370e588b9632d34d8e5062ab00f5/crates/consensus-any/src/block/header.rs#L60-L69

example block (Stable chain):

{
  "baseFeePerGas": "0x3635c9adc5dea00000",
  "blobGasUsed": "0x0",
  "difficulty": "0x0",
  "excessBlobGas": "0x0",
  "extraData": "0x",
  "gasLimit": "0x5f5e100",
  "gasUsed": "0x0",
  "hash": "0x4c2bdd9b606eaee018d298d05f5f87e515cda8a50de3a61707e0cafcc79d88a5",
  "logsBloom": "0x000", // truncated for readability
  "miner": "0x940d1df160e775dd10ae4d2a0e8f6b31b93e469d",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "nonce": "0x0000000000000000",
  "number": "0x24f946",
  "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0xb6e0b620c568296ad79c8f9c018916be70bc73dde41e88685d2a107e1fb46281",
  "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "size": "0x270",
  "stateRoot": "0x335a15e649f5e96135d84b8f41be3c39d99a8005567f6242361a1425d8e24eea",
  "timestamp": "0x691c1eda",
  "transactions": [],
  "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
  "uncles": [],
  "withdrawals": [],
  "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
}

Relevant log output

WARN Trying again after eth_getBlockByNumber RPC call for block number 2423110 failed (attempt #73753) with result Err(deserialization error: invalid value: string "0x3635c9adc5dea00000", expected a 8 byte hex string at line 1 column 1711
{"baseFeePerGas": "0x3635c9adc5dea00000", /* ... */ }

IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out

  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

OS information

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions