Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL failure for the miner field in a block #1272

Closed
roderik opened this issue Aug 1, 2020 · 0 comments
Closed

GraphQL failure for the miner field in a block #1272

roderik opened this issue Aug 1, 2020 · 0 comments
Assignees
Labels
bug Something isn't working P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion)

Comments

@roderik
Copy link
Contributor

roderik commented Aug 1, 2020

Description

An IBFTv2 network:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["1699055", true],"id":1}' https://xxx
{
  "jsonrpc" : "2.0",
  "id" : 1,
  "result" : {
    "number" : "0x19ecef",
    "hash" : "0x265504d25ba18eb1d12508db876432267774089419ab3caab2bcd352641260bd",
    "parentHash" : "0x2af32151398458420d8245f2ba97026e53515c5965bbcce4d2a14d6e7713cdda",
    "nonce" : "0x0000000000000000",
    "sha3Uncles" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "logsBloom" : "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "transactionsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "stateRoot" : "0xd72609c05d014eeab7914d30ed74d80424a94833c91f0fbc1b39d59db11ab0eb",
    "receiptsRoot" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "miner" : "0xe8e710e5447d07271546d190baba1ff29fd98e45",
    "difficulty" : "0x1",
    "totalDifficulty" : "0x19ecf0",
    "extraData" : "0xf8daa0444f4e27542050414e4943202120484f444c2c20484f444c2c20484f444c2021ea94c450fc44aa2284ed4477bdbbd7536932458a1efd94e8e710e5447d07271546d190baba1ff29fd98e45808400000000f886b8415c2a31964b83aa885791cca9538d46fff948387a47f3f808ee1b519e77d835937a87dec9179c02fae1ca23fbb3aac5ea61ba2a1208b126c105eaa025a1b5278501b8419d8b3a1408fef35905d7c0ec160e1fc6d95906b685740337cffbb832217685ba4739c4113e38a0c3992114345415d04b6ea5a83b6ed8418e1d63129adac8c1ab01",
    "size" : "0x2e0",
    "gasLimit" : "0x1fffffffffffff",
    "gasUsed" : "0x0",
    "timestamp" : "0x5f2502f0",
    "uncles" : [ ],
    "transactions" : [ ]
  }
}

The equivalent GraphQL query

query getBlock($blockNumber: Long!) {
  block(number: $blockNumber) {
    number
    hash
    parent {
      hash
    }
    nonce
    ommerHash
    logsBloom
    transactionsRoot
    stateRoot
    receiptsRoot
    miner {
      address
    }
    difficulty
    totalDifficulty
    extraData
    gasLimit
    gasUsed
    timestamp
    ommers {
      hash
    }
    transactions {
      hash
    }
  }
}

Returns the following error:

{
  "errors" : [ {
    "message" : "Exception while fetching data (/block/miner/address) : java.lang.reflect.InvocationTargetException",
    "locations" : [ {
      "line" : 15,
      "column" : 7
    } ],
    "path" : [ "block", "miner", "address" ],
    "extensions" : {
      "classification" : "DataFetchingException"
    }
  } ],
  "data" : null
}

Removing the miner gives me the data:

{
  "data": {
    "block": {
      "number": 1699055,
      "hash": "0x265504d25ba18eb1d12508db876432267774089419ab3caab2bcd352641260bd",
      "parent": {
        "hash": "0x2af32151398458420d8245f2ba97026e53515c5965bbcce4d2a14d6e7713cdda"
      },
      "nonce": "0x0000000000000000",
      "ommerHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
      "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
      "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "stateRoot": "0xd72609c05d014eeab7914d30ed74d80424a94833c91f0fbc1b39d59db11ab0eb",
      "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
      "difficulty": "0x1",
      "totalDifficulty": "0x19ecf0",
      "extraData": "0xf8daa0444f4e27542050414e4943202120484f444c2c20484f444c2c20484f444c2021ea94c450fc44aa2284ed4477bdbbd7536932458a1efd94e8e710e5447d07271546d190baba1ff29fd98e45808400000000f886b8415c2a31964b83aa885791cca9538d46fff948387a47f3f808ee1b519e77d835937a87dec9179c02fae1ca23fbb3aac5ea61ba2a1208b126c105eaa025a1b5278501b8419d8b3a1408fef35905d7c0ec160e1fc6d95906b685740337cffbb832217685ba4739c4113e38a0c3992114345415d04b6ea5a83b6ed8418e1d63129adac8c1ab01",
      "gasLimit": 9007199254740991,
      "gasUsed": 0,
      "timestamp": "0x5f2502f0",
      "ommers": [],
      "transactions": []
    }
  }
}

In other spots, like in transactions or receipts, from { address } etc works like expected

Versions (Add all that apply)

  • Software version: [besu --version] 1.4.6 on k8s
@timbeiko timbeiko added bug Something isn't working P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion) labels Aug 4, 2020
@shemnon shemnon self-assigned this Aug 6, 2020
@shemnon shemnon closed this as completed Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P3 Medium (ex: JSON-RPC request not working with a specific client library due to loose spec assumtion)
Projects
None yet
Development

No branches or pull requests

3 participants