optimism icon indicating copy to clipboard operation
optimism copied to clipboard

Pre-regenesis data is wronged.

Open yj0x0x opened this issue 2 years ago • 6 comments

Describe the bug A clear and concise description of what the bug is.

Generation 1 has some error about block data. I have ran geth version 1.9.10.

Please see below.

{
    "jsonrpc": "2.0",
    "id": "1",
    "result": {
        "difficulty": "0x2",
        "extraData": "0xd98301090a846765746889676f312e31342e3135856c696e7578000000000000d043a1b7d6c5829a64c86365297ba0a9c84dab9663d8fe08864c644b63ab7e0f618de4206949f153caa3f284e16e9b73f9f32938bb0102c8b879fd774bf3023c01",
        "gasLimit": "0x895440",
        "gasUsed": "0x85320",
        "hash": "0x03fd183a9bf92bf8bffd7a4ebe247cda9789afcca8222ff83de0b212cb14d3fc",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "miner": "0x0000000000000000000000000000000000000000",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x8",
        "parentHash": "0xe3bf85d11c6914403a2ff2cb1f2729e5fea7c5f80c16eb7d957a6f4e6a16604e",
        "receiptsRoot": "0x9ab4de6f5c1b25021461addb9cc2eeee9c62e62c2a6a4a73e1c6f6f734e6748d",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x9ce",
        "stateRoot": "0x3dec333b895e09767bde3a54692ca3fe677ed8936768ec4cfed316825c962cd4",
        "timestamp": "0x60012497",
        "totalDifficulty": "0x11",
        "transactions": [
            {
                "blockHash": "0x03fd183a9bf92bf8bffd7a4ebe247cda9789afcca8222ff83de0b212cb14d3fc",
                "blockNumber": "0x8",
                "from": "0x17ec8597ff92c3f44523bdc65bf0f1be632917ff",
                "gas": "0x89543f",
                "gasPrice": "0x0",
                "hash": "0x4cca34a38e05bf47aab831a64b113a380117c0c7f8bdebfa702cd9049bcc9a02",
                "input": "0x60806040523480156100195760008061001661001f565b50505b5061008d565b632a2a7adb598160e01b8152600481016020815285602082015260005b8681101561005a57808601518160408401015260208101905061003c565b506020828760640184336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b505050565b61067e8061009c6000396000f3fe6080604052348015610019576000806100166103d1565b50505b506004361061006b5760003560e01c80631034f4bf1461007957806334eafb11146100b057806335f5de8f146100ce5780633fa4f2451461011857806358825b1014610136578063d737d0c71461016d575b6000806100766103d1565b50505b6100ae60048036036020811015610098576000806100956103d1565b50505b81019080803590602001909291905050506101b7565b005b6100b86101ca565b6040518082815260200191505060405180910390f35b6100d66101d7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610120610204565b6040518082815260200191505060405180910390f35b61016b60048036036020811015610155576000806101526103d1565b50505b8101908080359060200190929190505050610211565b005b6101756103a5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b80600281906101c461043f565b50505050565b60036101d46104a4565b81565b60016000906101e46104a4565b906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600261020e6104a4565b81565b5a61021a610507565b6000806101000a8161022a6104a4565b8173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179061026661043f565b5050505a610272610507565b73ffffffffffffffffffffffffffffffffffffffff16636e296e456040518163ffffffff1660e01b815260040160206040518083038186806102b2610564565b1580156102c7576000806102c46103d1565b50505b505a6102d16105c7565b50505050501580156102f0573d6000803e3d60006102ed6103d1565b50505b505050506040513d602081101561030f5760008061030c6103d1565b50505b8101908080519060200190929190505050600160006101000a816103316104a4565b8173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179061036d61043f565b505050806002819061037d61043f565b505050600360008161038d6104a4565b8092919060010191905061039f61043f565b50505050565b600080906103b16104a4565b906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b632a2a7adb598160e01b8152600481016020815285602082015260005b8681101561040c5780860151816040840101526020810190506103ee565b506020828760640184336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b505050565b6322bd64c0598160e01b8152836004820152846024820152600081604483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b60005b604081101561049f57600081830152602081019050610485565b505050565b6303daa959598160e01b8152836004820152602081602483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b6040811015610502576000818301526020810190506104e8565b505050565b6373509064598160e01b8152602081600483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b604081101561055f57600081830152602081019050610545565b505050565b638435035b598160e01b8152836004820152602081602483336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b8051935060005b60408110156105c2576000818301526020810190506105a8565b505050565b638540661f598160e01b8152836004820152846024820152606060448201528660648201526084810160005b8881101561060e5780880151818301526020810190506105f3565b506060828960a40184336000905af158600e01573d6000803e3d6000fd5b3d6001141558600a015760016000f35b815160408301513d6000853e8b8b82606087013350600060045af15059845b81811015610672576000815260208101905061065b565b50829c5050505050505056",
                "nonce": "0x3",
                "to": null,
                "transactionIndex": "0x0",
                "value": "0x0",
                "v": "0x38",
                "r": "0x990753719cb6f877756a9c5880dc9c18fb45b6ce0bd9eeb034eb822cd1507531",
                "s": "0x146008c3357e93ce5399a00c59c655afedb6d520b3e218143d8ce830d7f2d733"
            }
        ],
        "transactionsRoot": "0x310858842a7c26915f852c43a9a58feddd447d0810fe5e8f5b42a2546204e6c5",
        "uncles": []
    }
}

Transaction hash 0x4cca34a38e05bf47aab831a64b113a380117c0c7f8bdebfa702cd9049bcc9a02. that's fine But transaction Receipt is strange.

{

    "result": {
        "blockHash": "0x648e8a8b3255d537c356cfd82cf852e761124a6ebe92d3d5e98e7abaa79671c5",
        "blockNumber": "0xb",
        "contractAddress": "0x94ba4d5ebb0e05a50e977ffbf6e1a1ee3d89299c",
        "cumulativeGasUsed": "0x105822",
        "from": "0x17ec8597ff92c3f44523bdc65bf0f1be632917ff",
        "gasUsed": "0x105822",
        "logs": [
            {
                "address": "0x4200000000000000000000000000000000000006",
                "topics": [
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
                    "0x00000000000000000000000017ec8597ff92c3f44523bdc65bf0f1be632917ff",
                    "0x0000000000000000000000004200000000000000000000000000000000000005"
                ],
                "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "blockNumber": "0xb",
                "transactionHash": "0x4cca34a38e05bf47aab831a64b113a380117c0c7f8bdebfa702cd9049bcc9a02",
                "transactionIndex": "0x0",
                "blockHash": "0x648e8a8b3255d537c356cfd82cf852e761124a6ebe92d3d5e98e7abaa79671c5",
                "logIndex": "0x0",
                "removed": false
            }
        ],
        "logsBloom": "0x00000000000000000000000000000000000000000000000000040000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008010000000000000010000000000000000000000400000000000000000000000000008000000000000010000000000010000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000",
        "status": "0x1",
        "to": null,
        "transactionHash": "0x4cca34a38e05bf47aab831a64b113a380117c0c7f8bdebfa702cd9049bcc9a02",
        "transactionIndex": "0x0"
    }
}

Block number is 0xb not 0x8. Anyone please explain to me that why this difference happened?

Second question. this is related with Generation 2, 3's query debug_traceBlockByHash. There is the transaction in specific block, But error return like below. Generation 2 data. Block height 3 query return;

{
    "result": {
        "difficulty": "0x2",
        "extraData": "0xd98301090a846765746889676f312e31342e3135856c696e75780000000000006d4c60a574f302610da5421c3117523049783cd12deff51a5b5bdae88977d4733573ccd4ba0ff965159ad1b9998a93d92adc46a310499ac9205f476e5a253b7b01",
        "gasLimit": "0x895440",
        "gasUsed": "0x6ad00",
        "hash": "0xef93d2c078e4fe0eabddb64183b46befff45a8d05424b6a72f3ad5df40e7f938",
        "logsBloom": "0x00000000000000000000000000000000000000000000000000040000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008000000000000000010000000000000000000000400000000000000010000000000008010000000000000000000000010000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000",
        "miner": "0x0000000000000000000000000000000000000000",
        "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "nonce": "0x0000000000000000",
        "number": "0x3",
        "parentHash": "0xcf075830733b8592f1cad9e5c41ede849916f4b79d328dd84c23a8aa70178d81",
        "receiptsRoot": "0xa47b1eeb5df2b261a0b8b61dac50a68f064945a68cea20dc53b75b3692b6903f",
        "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "size": "0x308",
        "stateRoot": "0xcb2d04569b3818534c135dac71d4a61b32c1c11895eae7607ff0aab54d38a431",
        "timestamp": "0x6071036a",
        "totalDifficulty": "0x7",
        "transactions": [
            {
                "blockHash": "0xef93d2c078e4fe0eabddb64183b46befff45a8d05424b6a72f3ad5df40e7f938",
                "blockNumber": "0x3",
                "from": "0x648e3e8101bfab7bf5997bd007fb473786019159",
                "gas": "0x3722",
                "gasPrice": "0x0",
                "hash": "0x0aff5127cae2ea345494994eec4f64a17baf29cf1bfc4773468e7fcfaf8ccbbc",
                "input": "0x400ada75000000000000000000000000648e3e8101bfab7bf5997bd007fb4737860191590000000000000000000000000000000000000000000000000000000000000000",
                "nonce": "0x9",
                "to": "0x4200000000000000000000000000000000000002",
                "transactionIndex": "0x0",
                "value": "0x0",
                "v": "0x37",
                "r": "0xb6d1a60e11f76691f5feaba693b33fad1b6b2dafe1510c608ab3ca08f8528ef3",
                "s": "0x19bd167b71787d556cf358baa14750ef4426108c5273b4ce8216203d36fe46e1"
            }
        ],
        "transactionsRoot": "0xa664d5928e8a341bcc1cef160203e1b77a03a60338b1cd25f549eb1433727dfd",
        "uncles": []
    }
}

But debug_traceBlockByHash return like below.

{
    "jsonrpc": "2.0",
    "id": "1",
    "error": {
        "code": -32000,
        "message": "out of gas"
    }
}

Is it possible to return ouf of gas message?

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

System Specs:

  • OS:
  • Package Version (or commit hash):

Additional context Add any other context about the problem here.

yj0x0x avatar Nov 09 '22 09:11 yj0x0x

Are you running a legacy DB against a vanilla Geth node?

smartcontracts avatar Nov 10 '22 04:11 smartcontracts

@smartcontracts Yes. Need to run l2geth?

yj0x0x avatar Nov 10 '22 04:11 yj0x0x

that was mentioned that v1.9.10 geth.

https://community.optimism.io/docs/useful-tools/explorers/#pre-23-june-2021-history

yj0x0x avatar Nov 10 '22 04:11 yj0x0x

Trace transaction won't work on vanilla geth because the execution of L2Geth was different. Might be hard to trace pre-regenesis blocks unfortunately. It's definitely possible but requires running a bunch of old code and possibly fixing bugs along the way.

Receipt issue is more interesting. I have a suspicion the old node was doing some custom logic when returning the receipt but I didn't write that code so I don't know for sure.

smartcontracts avatar Nov 11 '22 02:11 smartcontracts

Then those pre-regenesis data published to the ethereum mainnet??

yj0x0x avatar Nov 11 '22 11:11 yj0x0x

@smartcontracts Ping

yj0x0x avatar Dec 08 '22 04:12 yj0x0x