oasisprotocol / sapphire-paratime

Oasis Sapphire - the confidential EVM-compatible ParaTime for the Oasis Network
https://oasisprotocol.org/sapphire
Apache License 2.0
37 stars 27 forks source link

Weird: eth_getBlockByHash retrieval, same block two blockhashes #240

Closed CedarMist closed 11 months ago

CedarMist commented 11 months ago

This was noticed with the following blockhashes both reported as being block number 0x14b6ae (1357486):

$ curl -s -H 'Content-Type: application/json' -d '{"params":["0xedd87e1b070dc3ab67639f155a4bb9928c57786659e80b4363819196f364aa48",false],"method":"eth_getBlockByHash","jsonrpc":"2.0","id":"0x1"}' https://sapphire.oasis.io/ | python3 -mjson.tool
{
    "jsonrpc": "2.0",
    "id": "0x1",
    "result": {
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0xe4e1c0",
        "gasUsed": "0xe9e4a",
        "hash": "0xedd87e1b070dc3ab67639f155a4bb9928c57786659e80b4363819196f364aa48",
        "logsBloom": "0x00000000030000000040000000021020000041000000002000000000040400000000020088000010000000000000000000040000000002101000000001000000000000000000004080000000080040000080020000000000000404000000100000000000280000000000000000000002000000141108000200800000100000200000002040082a0904000080500004000001200000000002000000080000000400000002000000000001001a004000000000004000100000040100000000000000000000820000000000001010021010000800000002000000000000000001001200002000000000000040000000000000000001000000400040000050000000",
        "miner": "0x0000000000000000000000000000000088888888",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x14b6ae",
        "parentHash": "0xe87067b849776e2ee47bbe01d6b0311d512768c9f0d408fe2e7d8d4f46b0439d",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x1c04",
        "stateRoot": "0x2dc3dd927e62d26af397c32911f4e4d6b95fd62fed1a7f469cba36afbbd4ef83",
        "timestamp": "0x65670c20",
        "totalDifficulty": "0x0",
        "transactions": [
            "0x4a25f42d3477717a53079b36e4431272820ef3ef933ac705c5a05b2327d114ff",
            "0xed1fbf875076baa064611703bafb3d4d245cef678a05b199b0180a697127bfe8",
            "0x8f1be738f28cee8b4a5348b19d9c24b1bcfd23c4dd9fab9de6186e9e6a397b8d",
            "0x5a1b64b0f23e9ea31373ef627361fc0ef26a421aae020d59abc21c940a1c56b3",
            "0xa4c690a7038dfe36bce1397886b09e87f46b19578e65121e017dda247ec8b63f"
        ],
        "transactionsRoot": "0x7e0af8da74441a99767c8f8b49b0268c53567dae3f316ed63040a8229a4c0af7",
        "uncles": []
    }
}

Running the following multiple times will return block not found most of the times, but sometimes will return a block.

$ curl -s -H 'Content-Type: application/json' -d '{"params":["0x151309e2bee057eff11500d83834c59edaa0defdceabddf8d27bcf8dbbf11aa3",false],"method":"eth_getBlockByHash","jsonrpc":"2.0","id":"0x1"}' https://sapphire.oasis.io/ | python3 -mjson.tool
{
    "jsonrpc": "2.0",
    "id": "0x1",
    "result": {
        "difficulty": "0x0",
        "extraData": "0x",
        "gasLimit": "0xe4e1c0",
        "gasUsed": "0x0",
        "hash": "0x151309e2bee057eff11500d83834c59edaa0defdceabddf8d27bcf8dbbf11aa3",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x0000000000000000000000000000000088888888",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x14b6ae",
        "parentHash": "0xc672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a",
        "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x486",
        "stateRoot": "0x2dc3dd927e62d26af397c32911f4e4d6b95fd62fed1a7f469cba36afbbd4ef83",
        "timestamp": "0x65670c2b",
        "totalDifficulty": "0x0",
        "transactions": [],
        "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
        "uncles": []
    }
}

Block retrieved via oasis CLI:

$ ./oasis paratime show 1357486
Network:        mainnet
ParaTime:       sapphire
Round:          1357486
Version:        0
Namespace:      000000000000000000000000000000000000000000000000f80306c9858e7279
Timestamp:      2023-11-29T10:02:19Z
Type:           1
Previous:       c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a
I/O root:       c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a
State root:     2dc3dd927e62d26af397c32911f4e4d6b95fd62fed1a7f469cba36afbbd4ef83
Messages (out): c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a
Messages (in):  c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a
Transactions:   0

Previous block doesn't exist:

$ ./oasis paratime show 1357485
Network:        mainnet
Error: roothash: block not found
CedarMist commented 11 months ago

From what I can see this has been resolved.