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

Feat/scroll rpc #101

Closed
wants to merge 37 commits into from
Closed

Feat/scroll rpc #101

wants to merge 37 commits into from

Conversation

georgehao
Copy link
Member

No description provided.

Copy link

codspeed-hq bot commented Jan 8, 2025

CodSpeed Performance Report

Merging #101 will not alter performance

Comparing feat/scroll-rpc (60d16af) with scroll (88e9188)

Summary

✅ 77 untouched benchmarks

@georgehao
Copy link
Member Author

georgehao commented Jan 14, 2025

eth_getBlockReceipts

https://scrollscan.com/block/1292

curl http://127.0.0.1:8545 -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBlockReceipts","params":["0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b"],"id":1,"jsonrpc":"2.0"}' | jq -S

scroll reth result:

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": [
    {
      "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
      "blockNumber": "0x50c",
      "contractAddress": null,
      "cumulativeGasUsed": "0x2055d",
      "effectiveGasPrice": "0x0",
      "from": "0x7885bcbd5cecef1336b5300fb5186a12ddd8c478",
      "gasUsed": "0x2055d",
      "l1Fee": "0x0",
      "logs": [
        {
          "address": "0x6ea73e05adc79974b931123675ea8f78ffdacdf0",
          "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
          "blockNumber": "0x50c",
          "blockTimestamp": "0x6525925c",
          "data": "0x000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000",
          "logIndex": "0x0",
          "removed": false,
          "topics": [
            "0x9e86c356e14e24e26e3ce769bf8b87de38e0faa0ed0ca946fa09659aa606bd2d",
            "0x000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d",
            "0x000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d"
          ],
          "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
          "transactionIndex": "0x0"
        },
        {
          "address": "0x781e90f1c8fc4611c9b7497c3b47f99ef6969cbc",
          "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
          "blockNumber": "0x50c",
          "blockTimestamp": "0x6525925c",
          "data": "0x",
          "logIndex": "0x1",
          "removed": false,
          "topics": [
            "0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c",
            "0xe50234c4cb000134929719d3ee03ac503c8e9b8593559b90f82a2df42166ba6b"
          ],
          "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
          "transactionIndex": "0x0"
        }
      ],
      "logsBloom": "0x00000000008000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000010000000000000000000200000000000000000000000000000000000800000000100000400000000000000000000800000000000000000008000000000000000000080000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000800040000000000000000000000000000000000000000000000000000010000000000000000002000000000000000000000000000000000000800000000008000000",
      "status": "0x1",
      "to": "0x781e90f1c8fc4611c9b7497c3b47f99ef6969cbc",
      "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
      "transactionIndex": "0x0",
      "type": "0x7e"
    }
  ]
}

The result has a additional blockTimestamp than scroll-geth, but I think it's ok

@georgehao
Copy link
Member Author

georgehao commented Jan 14, 2025

eth_getTransactionReceipt

L1 message relay https://scrollscan.com/tx/0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
    "blockNumber": "0x50c",
    "contractAddress": null,
    "cumulativeGasUsed": "0x2055d",
    "effectiveGasPrice": "0x0",
    "from": "0x7885bcbd5cecef1336b5300fb5186a12ddd8c478",
    "gasUsed": "0x2055d",
    "l1Fee": "0x0",
    "logs": [
      {
        "address": "0x6ea73e05adc79974b931123675ea8f78ffdacdf0",
        "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
        "blockNumber": "0x50c",
        "blockTimestamp": "0x6525925c",
        "data": "0x000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000",
        "logIndex": "0x0",
        "removed": false,
        "topics": [
          "0x9e86c356e14e24e26e3ce769bf8b87de38e0faa0ed0ca946fa09659aa606bd2d",
          "0x000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d",
          "0x000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d"
        ],
        "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
        "transactionIndex": "0x0"
      },
      {
        "address": "0x781e90f1c8fc4611c9b7497c3b47f99ef6969cbc",
        "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
        "blockNumber": "0x50c",
        "blockTimestamp": "0x6525925c",
        "data": "0x",
        "logIndex": "0x1",
        "removed": false,
        "topics": [
          "0x4641df4a962071e12719d8c8c8e5ac7fc4d97b927346a3d7a335b1f7517e133c",
          "0xe50234c4cb000134929719d3ee03ac503c8e9b8593559b90f82a2df42166ba6b"
        ],
        "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
        "transactionIndex": "0x0"
      }
    ],
    "logsBloom": "0x00000000008000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000010000000000000000000200000000000000000000000000000000000800000000100000400000000000000000000800000000000000000008000000000000000000080000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000800040000000000000000000000000000000000000000000000000000010000000000000000002000000000000000000000000000000000000800000000008000000",
    "status": "0x1",
    "to": "0x781e90f1c8fc4611c9b7497c3b47f99ef6969cbc",
    "transactionHash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
    "transactionIndex": "0x0",
    "type": "0x7e"
  }
}

Legacy Transaction recept https://scrollscan.com/tx/0xd29ff3a26a8f60ff0a9563fd998c6613137d773d531c8a5470bbb590b59b390a

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "blockHash": "0xcc83cabbecbb5bf030f6bfcc50bd5e8c8b2c014a9935edcf827a09e6bef12458",
    "blockNumber": "0x4ff",
    "contractAddress": null,
    "cumulativeGasUsed": "0x8975",
    "effectiveGasPrice": "0x17d78400",
    "from": "0xbe27c3acb9c61afdfd99b653c3f13fc7ce7c6f69",
    "gasUsed": "0x8975",
    "l1Fee": "0x2738a7365c92",
    "logs": [
      {
        "address": "0x5300000000000000000000000000000000000002",
        "blockHash": "0xcc83cabbecbb5bf030f6bfcc50bd5e8c8b2c014a9935edcf827a09e6bef12458",
        "blockNumber": "0x4ff",
        "blockTimestamp": "0x65258ffb",
        "data": "0x0000000000000000000000000000000000000000000000000000000235434557",
        "logIndex": "0x0",
        "removed": false,
        "topics": [
          "0x351fb23757bb5ea0546c85b7996ddd7155f96b939ebaa5ff7bc49c75f27f2c44"
        ],
        "transactionHash": "0xd29ff3a26a8f60ff0a9563fd998c6613137d773d531c8a5470bbb590b59b390a",
        "transactionIndex": "0x0"
      }
    ],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000100000000000000000000000000000000000000000000000000000000000000000000000001000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000",
    "status": "0x1",
    "to": "0x5300000000000000000000000000000000000002",
    "transactionHash": "0xd29ff3a26a8f60ff0a9563fd998c6613137d773d531c8a5470bbb590b59b390a",
    "transactionIndex": "0x0",
    "type": "0x0"
  }
}

The result has a additional blockTimestamp than scroll-geth, but I think it's ok

@georgehao
Copy link
Member Author

georgehao commented Jan 14, 2025

eth_getTransactionByBlockHashAndIndex

test the fill function

curl http://127.0.0.1:8545 -X POST -H "Content-Type: application/json" --data '{"method":"eth_getTransactionByBlockHashAndIndex","params":["0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b","0x0"],"id":1,"jsonrpc":"2.0"}'
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "blockHash": "0xa952a48274cfd4cae3b171396f30578ccaa6f79f0b2c74b55aa1fbf606b4fb5b",
    "blockNumber": "0x50c",
    "from": "0x7885bcbd5cecef1336b5300fb5186a12ddd8c478",
    "gas": "0x29040",
    "gasPrice": "0x0",
    "hash": "0x5b99fef214b4f17c6df9b7ea7df704893b69094bd894f42b4a18b5078e7efe00",
    "input": "0x8ef1332e0000000000000000000000007f2b8c31f88b6006c382775eea88297ec1e3e9050000000000000000000000006ea73e05adc79974b931123675ea8f78ffdacdf0000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000000000003c00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a4232e8748000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d000000000000000000000000ee12c640b0793cf514e42ea1c428bd5399545d4d000000000000000000000000000000000000000000000000016345785d8a00000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0",
    "queueIndex": "0x3c",
    "r": "0x0",
    "s": "0x0",
    "sender": "0x7885bcbd5cecef1336b5300fb5186a12ddd8c478",
    "to": "0x781e90f1c8fc4611c9b7497c3b47f99ef6969cbc",
    "transactionIndex": "0x0",
    "type": "0x7e",
    "v": "0x0",
    "value": "0x0",
    "yParity": "0x0"
  }
}

Compared with l2geth, scroll-reth have an additional yParity. I think it's ok for the new Signature.

@georgehao georgehao closed this Jan 14, 2025
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

Successfully merging this pull request may close these issues.

2 participants