onflow / flow-evm-gateway

FlowEVM Gateway implements an Ethereum-equivalent JSON-RPC API for EVM clients to use
https://developers.flow.com/evm/about
Apache License 2.0
11 stars 10 forks source link

Missing block in public testnet gateway #483

Closed alecalve closed 2 months ago

alecalve commented 2 months ago

Steps to Reproduce

Getting block 0xfb3099de4dd8b9f39210366b74561633e9661c22ac47286197cd0f98125b41e0 and looking at its parent hash:

$ curl --silent 'https://testnet.evm.nodes.onflow.org' -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","id":1,"method":"eth_getBlockByHash","params":["0xfb3099de4dd8b9f39210366b74561633e9661c22ac47286197cd0f98125b41e0", false]}' | jq ".result.parentHash"
"0x0e742970c53cc2924d55830a588609ca1db460cce41850df7af119639fe42d91"

Then I query the parent by hash and it's missing:

$ curl --silent 'https://testnet.evm.nodes.onflow.org' -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","id":1,"method":"eth_getBlockByHash","params":["0x0e742970c53cc2924d55830a588609ca1db460cce41850df7af119639fe42d91", false]}' | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": null
}

There's been a reorg at that height, maybe it's related.

sideninja commented 2 months ago

Looking into this now. Thank you for reporting.

sideninja commented 2 months ago

@alecalve we need to reindex the data and this issue will be resolved. This will probably happen tomorrow.

sideninja commented 2 months ago

This should be fixed now

Example:

curl --silent 'https://testnet.evm.nodes.onflow.org' -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0","id":1,"method":"eth_getBlockByHash","params":["0x0e742970c53cc2924d55830a588609ca1db460cce41850df7af119639fe42d91", false]}' | jq
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "number": "0x152412",
    "hash": "0x0e742970c53cc2924d55830a588609ca1db460cce41850df7af119639fe42d91",
    "parentHash": "0x95b9d3a30ce797062ab5162d6dc4c60d887ff66eeec49640931c2d7ac014974d",
    "nonce": "0x0100000000000000",
    "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "miner": "0x0000000000000000000000030000000000000000",
    "difficulty": "0x0",
    "totalDifficulty": "0x0",
    "extraData": "0x",
    "size": "0xa2",
    "gasLimit": "0xe4e1c0",
    "gasUsed": "0x0",
    "timestamp": "0x66c7ad34",
    "transactions": [],
    "uncles": [],
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "baseFeePerGas": "0x0"
  }
}