Skip to content

ChainID for legacy transactions in RPC #9372

@MarekM25

Description

@MarekM25
>>  {"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["safe",true]}
<<  {"jsonrpc":"2.0","result":{"difficulty":"0x0","extraData":"0x","gasLimit":"0x47e7c40","gasUsed":"0x54a92","hash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","logsBloom":"0x00000000008000000000000000000040000000000000000000000000800000000000000008000000000000000000000000000000000000000000000000000000000000000000000000004000000000020200000000000000000000000000002000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0x0000000000000000000000000000000000000000","mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000","nonce":"0x0000000000000000","number":"0x2d","parentHash":"0xab97b6b403066d2f4b270171bd532cc489510c1e07df609718dfc875cace60f1","receiptsRoot":"0x2c86b2791cdd088d3c3e9d6225f71724d3e8c67bdd13cd6208831058cee1043f","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","size":"0x633","stateRoot":"0x67b58d6bd3c58396b464d3ae8f8a7e2e8ebf912b203ece9bf8a89063a79265bd","timestamp":"0x1c2","baseFeePerGas":"0x5763d64","transactions":[{"type":"0x0","nonce":"0x9a","to":null,"from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x0","input":"0x600d380380600d6000396000f336156009575f355f555b305f525f5460205260405ff3","gasPrice":"0x5763d65","v":"0x18e5bb3abd109f","r":"0x551fe45ccebb0318196e31dbc60da87c43dc60b8fb01afb3286693fa09878730","s":"0x40d33e9afecfe1516b045d61a3272bddbc83f482a7f2c749311248b50fe62e81","hash":"0x2fbbd036996c7487316c92b9e5798edb98fd57f32a6c1075e904a734821e1cd2","transactionIndex":"0x0","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0x11c32"},{"type":"0x4","authorizationList":[{"chainId":"0xc72dd9d5e883e","nonce":"0x0","address":"0x58f8fe237b593c19546e1e758a2544561d04bfe0","yParity":"0x1","s":"0x1d1225f76d6faac3d904c0635193e83d3867c101b2e6f6c9bb7b1fdeeed923ab","r":"0xec6caeb1b7071f1b3ae36aeaa7bf0eaecb8e006e83b3e50d792870ea95af4c59"}],"maxPriorityFeePerGas":"0x1","maxFeePerGas":"0x5763d65","accessList":[],"yParity":"0x1","chainId":"0xc72dd9d5e883e","nonce":"0x9b","to":"0x0000000000000000000000000000000000000000","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x0","input":"0x","gasPrice":"0x5763d65","v":"0x1","r":"0x8ae3402e4f63751c895532b94aee0f7b6b8ff5d0b0a689f6d63b3dbd19d69059","s":"0x2e63e4d140b0d282d56289b34f3df82cbcb2f3aa385f5438a423584fe0c2b467","hash":"0x16f6724ad864e7664c367893cae3e176d362bea3a47495cec3b246555a7228da","transactionIndex":"0x1","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0xb3b0"},{"type":"0x0","nonce":"0x9c","to":"0xeda8645ba6948855e3b3cd596bbb07596d59c603","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x0","input":"0x696e766f6b6564","gasPrice":"0x5763d65","v":"0x18e5bb3abd10a0","r":"0xfea7e18c82a1270f142572533bc2e6e33d6d41a3f1303403dd0a90dd7a4f35d","s":"0x4a4ab6c5bb4c31c3a5f8991ae45bad2303c45923404571f7b4c66adbd03b7936","hash":"0xddf234c5f149d2d1a4d01276d42e38a6234bfa7b987c49ba889b028b429aac8f","transactionIndex":"0x2","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0x11170"},{"type":"0x2","maxPriorityFeePerGas":"0x2","maxFeePerGas":"0x5763d65","accessList":[],"yParity":"0x1","chainId":"0xc72dd9d5e883e","nonce":"0x9d","to":"0x00000961ef480eb55e80d19ad83579a64c007002","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x3b9aca00","input":"0xb917cfdc0d25b72d55cf94db328e1629b7f4fde2c30cdacf873b664416f76a0c7f7cc50c9f72a3cb84be88144cde91250000000000000d80","gasPrice":"0x5763d65","v":"0x1","r":"0x5f8b300cf80f7fb7e511460fa1a803278b47223f2c0a82857c5c0e5f7c900d23","s":"0x290bf2495235a106352786403ed937df8385a2356472569020fd952913690ec9","hash":"0x3d3d02e1bdc39a6eab20f7b44ed299ca61eb1d642806bfa07e3a7ee8edd700e5","transactionIndex":"0x3","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0x249f0"},{"type":"0x1","accessList":[{"address":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","storageKeys":["0x0000000000000000000000000000000000000000000000000000000000000000","0xe8481f0a1ea7b2528784efff1d1b33cbd66ac97ebe2ae35c7997cacb2863430b"]}],"yParity":"0x0","chainId":"0xc72dd9d5e883e","nonce":"0x9e","to":"0x7dcd17433742f4c0ca53122ab541d0ba67fc27df","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x2","input":"0x6b3b937565afc29f656d6974","gasPrice":"0x5763d65","v":"0x0","r":"0x84f8b48ac6fbf39054c7794e6ff4e16a3bacbd0964b53d4d03ff668e7eda365","s":"0x2e4e86f2f5fbb8dad4ee8907eee4488f70c75bb646522b5197c4dcdc29ea31bf","hash":"0x195a09414344f56e7a202d1493b258b2394b9b93811ce4ee96212a7d34ffb04f","transactionIndex":"0x4","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0x186a0"},{"type":"0x1","accessList":[],"yParity":"0x1","chainId":"0xc72dd9d5e883e","nonce":"0x9f","to":"0x4340ee1b812acb40a1eb561c019c327b243b92df","from":"0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f","value":"0x1","input":"0x","gasPrice":"0x5763d65","v":"0x1","r":"0xec839e20a6f8ff0fb1043022e5816454191436ba7f6607bf6efe6517fdd1e2dd","s":"0x7903b3dd48963c0404f99807fd89cde2b66091c32178f66920120cb10981019","hash":"0xdf66bea01c5cf47b48ec11453822d751a5daaf1d16959772c2196c5ab8cf8438","transactionIndex":"0x5","blockHash":"0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1","blockNumber":"0x2d","gas":"0x5208"}],"transactionsRoot":"0xc541c333ff4a96a17d3601f7d628ea27ecf4597a11077e5d9d1c4dbed6c7f401","uncles":[],"withdrawals":[],"withdrawalsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","blobGasUsed":"0x0","excessBlobGas":"0x0","parentBeaconBlockRoot":"0x4b118bd31ed2c4eeb81dc9e3919e9989994333fe36f147c2930f12c53f0d3c78","requestsHash":"0x57cac3e52cdcd73e52bd9e54956e0eae370f00ed41f68edc78266bdb46c3a543"},"id":1}
response differs from expected (-- client, ++ test):
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "baseFeePerGas": "0x5763d64",
    "blobGasUsed": "0x0",
    "difficulty": "0x0",
    "excessBlobGas": "0x0",
    "extraData": "0x",
    "gasLimit": "0x47e7c40",
    "gasUsed": "0x54a92",
    "hash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
    "logsBloom": "0x00000000008000000000000000000040000000000000000000000000800000000000000008000000000000000000000000000000000000000000000000000000000000000000000000004000000000020200000000000000000000000000002000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "miner": "0x0000000000000000000000000000000000000000",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000",
    "number": "0x2d",
    "parentBeaconBlockRoot": "0x4b118bd31ed2c4eeb81dc9e3919e9989994333fe36f147c2930f12c53f0d3c78",
    "parentHash": "0xab97b6b403066d2f4b270171bd532cc489510c1e07df609718dfc875cace60f1",
    "receiptsRoot": "0x2c86b2791cdd088d3c3e9d6225f71724d3e8c67bdd13cd6208831058cee1043f",
    "requestsHash": "0x57cac3e52cdcd73e52bd9e54956e0eae370f00ed41f68edc78266bdb46c3a543",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x633",
    "stateRoot": "0x67b58d6bd3c58396b464d3ae8f8a7e2e8ebf912b203ece9bf8a89063a79265bd",
    "timestamp": "0x1c2",
    "transactions": [
      {
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        ++ "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0x11c32",
        "gasPrice": "0x5763d65",
        "hash": "0x2fbbd036996c7487316c92b9e5798edb98fd57f32a6c1075e904a734821e1cd2",
        "input": "0x600d380380600d6000396000f336156009575f355f555b305f525f5460205260405ff3",
        "nonce": "0x9a",
        "r": "0x551fe45ccebb0318196e31dbc60da87c43dc60b8fb01afb3286693fa09878730",
        "s": "0x40d33e9afecfe1516b045d61a3272bddbc83f482a7f2c749311248b50fe62e81",
        "to": null,
        "transactionIndex": "0x0",
        "type": "0x0",
        "v": "0x18e5bb3abd109f",
        "value": "0x0"
      },
      {
        "accessList": [],
        "authorizationList": [
          {
            "address": "0x58f8fe237b593c19546e1e758a2544561d04bfe0",
            "chainId": "0xc72dd9d5e883e",
            "nonce": "0x0",
            "r": "0xec6caeb1b7071f1b3ae36aeaa7bf0eaecb8e006e83b3e50d792870ea95af4c59",
            "s": "0x1d1225f76d6faac3d904c0635193e83d3867c101b2e6f6c9bb7b1fdeeed923ab",
            "yParity": "0x1"
          }
        ],
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0xb3b0",
        "gasPrice": "0x5763d65",
        "hash": "0x16f6724ad864e7664c367893cae3e176d362bea3a47495cec3b246555a7228da",
        "input": "0x",
        "maxFeePerGas": "0x5763d65",
        "maxPriorityFeePerGas": "0x1",
        "nonce": "0x9b",
        "r": "0x8ae3402e4f63751c895532b94aee0f7b6b8ff5d0b0a689f6d63b3dbd19d69059",
        "s": "0x2e63e4d140b0d282d56289b34f3df82cbcb2f3aa385f5438a423584fe0c2b467",
        "to": "0x0000000000000000000000000000000000000000",
        "transactionIndex": "0x1",
        "type": "0x4",
        "v": "0x1",
        "value": "0x0",
        "yParity": "0x1"
      },
      {
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        ++ "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0x11170",
        "gasPrice": "0x5763d65",
        "hash": "0xddf234c5f149d2d1a4d01276d42e38a6234bfa7b987c49ba889b028b429aac8f",
        "input": "0x696e766f6b6564",
        "nonce": "0x9c",
        "r": "0xfea7e18c82a1270f142572533bc2e6e33d6d41a3f1303403dd0a90dd7a4f35d",
        "s": "0x4a4ab6c5bb4c31c3a5f8991ae45bad2303c45923404571f7b4c66adbd03b7936",
        "to": "0xeda8645ba6948855e3b3cd596bbb07596d59c603",
        "transactionIndex": "0x2",
        "type": "0x0",
        "v": "0x18e5bb3abd10a0",
        "value": "0x0"
      },
      {
        "accessList": [],
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0x249f0",
        "gasPrice": "0x5763d65",
        "hash": "0x3d3d02e1bdc39a6eab20f7b44ed299ca61eb1d642806bfa07e3a7ee8edd700e5",
        "input": "0xb917cfdc0d25b72d55cf94db328e1629b7f4fde2c30cdacf873b664416f76a0c7f7cc50c9f72a3cb84be88144cde91250000000000000d80",
        "maxFeePerGas": "0x5763d65",
        "maxPriorityFeePerGas": "0x2",
        "nonce": "0x9d",
        "r": "0x5f8b300cf80f7fb7e511460fa1a803278b47223f2c0a82857c5c0e5f7c900d23",
        "s": "0x290bf2495235a106352786403ed937df8385a2356472569020fd952913690ec9",
        "to": "0x00000961ef480eb55e80d19ad83579a64c007002",
        "transactionIndex": "0x3",
        "type": "0x2",
        "v": "0x1",
        "value": "0x3b9aca00",
        "yParity": "0x1"
      },
      {
        "accessList": [
          {
            "address": "0x7dcd17433742f4c0ca53122ab541d0ba67fc27df",
            "storageKeys": [
              "0x0000000000000000000000000000000000000000000000000000000000000000",
              "0xe8481f0a1ea7b2528784efff1d1b33cbd66ac97ebe2ae35c7997cacb2863430b"
            ]
          }
        ],
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0x186a0",
        "gasPrice": "0x5763d65",
        "hash": "0x195a09414344f56e7a202d1493b258b2394b9b93811ce4ee96212a7d34ffb04f",
        "input": "0x6b3b937565afc29f656d6974",
        "nonce": "0x9e",
        "r": "0x84f8b48ac6fbf39054c7794e6ff4e16a3bacbd0964b53d4d03ff668e7eda365",
        "s": "0x2e4e86f2f5fbb8dad4ee8907eee4488f70c75bb646522b5197c4dcdc29ea31bf",
        "to": "0x7dcd17433742f4c0ca53122ab541d0ba67fc27df",
        "transactionIndex": "0x4",
        "type": "0x1",
        "v": "0x0",
        "value": "0x2",
        "yParity": "0x0"
      },
      {
        "accessList": [],
        "blockHash": "0xaf51811799f22260e5b4e1f95504dae760505f102dcb2e9ca7d897d8a40124a1",
        "blockNumber": "0x2d",
        "chainId": "0xc72dd9d5e883e",
        "from": "0x7435ed30a8b4aeb0877cef0c6e8cffe834eb865f",
        "gas": "0x5208",
        "gasPrice": "0x5763d65",
        "hash": "0xdf66bea01c5cf47b48ec11453822d751a5daaf1d16959772c2196c5ab8cf8438",
        "input": "0x",
        "nonce": "0x9f",
        "r": "0xec839e20a6f8ff0fb1043022e5816454191436ba7f6607bf6efe6517fdd1e2dd",
        "s": "0x7903b3dd48963c0404f99807fd89cde2b66091c32178f66920120cb10981019",
        "to": "0x4340ee1b812acb40a1eb561c019c327b243b92df",
        "transactionIndex": "0x5",
        "type": "0x1",
        "v": "0x1",
        "value": "0x1",
        "yParity": "0x1"
      }
    ],
    "transactionsRoot": "0xc541c333ff4a96a17d3601f7d628ea27ecf4597a11077e5d9d1c4dbed6c7f401",
    "uncles": [],
    "withdrawals": [],
    "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
  }
}

Hive expects the chainId to be returned for legacy transactions as well.

So we have to add ChainId to LegacyTransactionForRpc if this is null in transaction.ChainId we should read it from signature?.ChainId

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions