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

transaction is null in eth_getUncleByBlockHashAndIndex #344

Open
APshenkin opened this issue Mar 17, 2021 · 2 comments
Open

transaction is null in eth_getUncleByBlockHashAndIndex #344

APshenkin opened this issue Mar 17, 2021 · 2 comments
Assignees

Comments

@APshenkin
Copy link

curl --location --request POST 'my etc node' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_getUncleByBlockHashAndIndex",
    "params": ["0x598d5411cb95500b04c0a13ae4b83c79f198d856a64b5dedbf7773d88a9acd9d", "0x0"],
    "id": 83
}'

returns

{
    "jsonrpc": "2.0",
    "id": 83,
    "result": {
        "number": "0xbcd646",
        "hash": "0x62da04e365016d3e410c5e44fad3a80c8aed22b2cbf8bbcfa459159152c20d84",
        "parentHash": "0x8a1d8ee37cb1237e961c04fb993ec2fe35434231aefe1c4b72ef8d56d01e81dd",
        "nonce": "0x474c989e39f4991a",
        "mixHash": "0x6d7511d4a276de622960059633fc43b55416ffb113aaa95af6d908774308a181",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "stateRoot": "0x20a1d59b52fab2872c3638a4876d3f2f0cc5fd636592e2c049658827ef9e609f",
        "miner": "0xdf7d7e053933b5cc24372f878c90e62dadad5d42",
        "difficulty": "0x60c8ddc372d6",
        "totalDifficulty": null,
        "extraData": "0x7374726174756d2d65752d32",
        "size": "0x211",
        "gasLimit": "0x7a6d7a",
        "gasUsed": "0x0",
        "timestamp": "0x6051f9fc",
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "transactions": null,
        "uncles": []
    }
}

transactions field is null. I think it should be an array (Don't know should it be filled with transactions or not)

https://github.com/etclabscore/core-geth/blob/master/internal/ethapi/api.go#L691
here inclTx param should be true?

@meowsbits
Copy link
Member

Thanks for this!

Here's a corresponding call at ethereum/go-ethereum v1.9.24 for reference; transactions is actually omitted entirely (different from getBlock_ methods).

ethrpc --http-addr https://mytoken.eth.rpc.rivet.cloud/ web3_clientVersion | jj -p | tee eth.clientVersion.json
{                                                                          
  "jsonrpc": "2.0",                                                                                    
  "id": 3918,                                                                                                                                                                                                                      
  "result": "Geth/v1.9.24-stable/linux-amd64/go1.15.5"                     
}            
ethrpc --http-addr https://mytoken.eth.rpc.rivet.cloud/ eth_getUncleByBlockHashAndIndex "0x94316c2b6901da4bf6a009a7b3b847b2e9cf9cf4a12137f3157f5dad2389b318" "0x0" | jj -p | tee eth.12057489.uncle-0.json
{
  "jsonrpc": "2.0", 
  "id": 4652, 
  "result": {
    "difficulty": "0x14474ebe510db4", 
    "extraData": "0x307834383639373636353666366532303530366636663663", 
    "gasLimit": "0xbea434", 
    "gasUsed": "0xbe5d56", 
    "hash": "0x2a830f76c4e3a027a77ba191bd55f9a523de03b32aad4bab50463889875d2f18", 
    "logsBloom": "0x5d33680a290d28e1849d207da9607cafc899b0f03ef815e383b3096c9ac18510a50f04fe1c2a1126d5685852110d8102ca75a9982dc2840eb88f164213203e59190169a26127cde0d835abe84c9a0ee3aca2a28685487ca525001bc9d3f02886561e848206a00024006c01077003f8c9f34317d91c6c2fa48d2d42525480e22c1854ab109080860002f65743052434c4d2e86d8bad311148a682384b52309b12274bc04d6dc4e8a264b65b9d990a6a240072018f0c2281634f495c581c15bb2ccc19426a092bd1717a80882820ca1e1cc1068a90851e93fa5402bcb28c836850359f3499112eb07b905194c095e3418c0c61027a699b70f6c233cb04a8ec228c", 
    "miner": "0x1ad91ee08f21be3de0ba2ba6918e714da6b45836", 
    "mixHash": "0x585354777ef83b66187ee6441a8989d955ff85a7ce710e52f3a71ba1ae841f31", 
    "nonce": "0x2e1d610003a83201", 
    "number": "0xb7fb90", 
    "parentHash": "0x23d47332898a0b3d29ad8bd8e5c2d61ed8cc6222b4f43416ad2f0566e3865e9b", 
    "receiptsRoot": "0xa1277e1d4dda45068fcd519dc96554566018edec02b1dbfabb1074f97e68f948", 
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", 
    "size": "0x221", 
    "stateRoot": "0xfdcc055744c601ca024525436f152356d1320de017638a1b725b367bb9fbe3fe", 
    "timestamp": "0x60523a40", 
    "transactionsRoot": "0x9ccdb34b2f1a1ae60e27c0d187939b91c40669dcb4fc7b6dcb7643ff2494e85c", 
    "uncles": []
  }
}

And although the docs are not a perfect source of reference, I'm including a screenshot here to show the Note indicating -- as I'm interpreting it -- that transactions should in fact be omitted.

image

https://eth.wiki/json-rpc/API (I'd provide a deep link but that feature appears to be broken.)

@meowsbits
Copy link
Member

Per the above auto-citation, I've included a fix for this in the PR resolving the other nullable fields issue (#332).

@meowsbits meowsbits self-assigned this Mar 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants