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

gasUsed value in eth_getTransactionReceipt response is different between zkEVM client and cdk-erigon client for some chain. #1007

Closed
akramhussein opened this issue Aug 21, 2024 · 2 comments · Fixed by #1048

Comments

@akramhussein
Copy link

System information

Erigon version:

Tested with the following versions:

Snapshot used:

https://static.okex.org/cdn/chain/xlayer/snapshot/xlayer-mainnet-snap-202408110200.tar.gz

OS & Version:

Linux, Ubuntu 22.04.4 LTS

Commit hash: NA

Erigon Command (with flags/config):

Config .yaml file:

datadir: /data/erigon-data/xlayer-mainnet
chain: xlayer-mainnet
http: true
private.api.addr: localhost:9091
zkevm.l2-chain-id: 196
zkevm.l2-sequencer-rpc-url: https://rpc.xlayer.tech
zkevm.l2-datastreamer-url: stream.xlayer.tech:8800
zkevm.l1-chain-id: 1
zkevm.l1-rpc-url: <redacted>

zkevm.address-sequencer: "0xAF9d27ffe4d51eD54AC8eEc78f2785D7E11E5ab1"
zkevm.address-zkevm: "0x2B0ee28D4D51bC9aDde5E58E295873F61F4a0507"
zkevm.address-admin: "0x14509f825e550745CFF827a9bDCCB4C3ad3FFd36"
zkevm.address-rollup: "0x2B0ee28D4D51bC9aDde5E58E295873F61F4a0507"
zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb"

zkevm.l1-rollup-id: 3
zkevm.l1-first-block: 19218658
zkevm.l1-block-range: 2000
zkevm.l1-query-delay: 1000
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

externalcl: true
http.api: [eth, debug, net, trace, web3, erigon, zkevm]
http.addr: 0.0.0.0
http.port: 8545
http.vhosts: any
http.corsdomain: any
ws: true

Chain/Network:

X Layer / Mainnet

Background

X Layer is migrating from zkEVM to cdk-erigon architecture.

Roadmap can be seen here (search Erigon)

X Layer Deployment Instructions explains how to use both RPC clients.

Problem existed as far back as April client and snapshot from then too.

Expected behaviour

When querying eth_getTransactionReceipt, the gasUsed value on different clients (zkEVM vs cdk-erigon) should return the same value.

Actual behaviour

When querying eth_getTransactionReceipt, the gasUsed value on different clients (zkEVM vs cdk-erigon) the value differs.

Steps to reproduce the behaviour

  1. Build, run client and sync xlayer (see versions above) and deployment Instructions which covers both clients.

  2. Once synced, run the following query for the zkEVM rpc and the cdk-erigon RPC

Query

curl {node_url} \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params": ["0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8"],"id":1}'

zkEVM Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "cumulativeGasUsed": "0x17ecd5",
    "logsBloom": "0x00000000000000000000000004000008000000000000000000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000000002000000000000001000000000000000000000000400000020000000000000000000800000000000000000000000000000000020000000000010000000040000000000000000481000000000000000000010000000000801000000000200000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
    "logs": [
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0xc797025feeeaf2cd924c99e9205acb8ec04d5cad21c41ce637a38fb6dee6016a",
          "0x0000000000000000000000000000000000000000000000000000000000000de8"
        ],
        "data": "0x000000000000000000000000000000000000000000000000000000003d2f73c00000000000000000000000002f1bf1b4f84f163befdde172b9cd1e53fb19afa30000000000000000000000000000000000000000000000000000000066ba16de0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000000001cd7d12081c2708f32d0a8cc1b07d728b8726dbc724aaac1521b2b234968e000000000000000000000000000000000000000000000000000000000094c106000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000003cfaf640000000000000000000000000000000000000000000000000000000003d22ab60000000000000000000000000000000000000000000000000000000003d22ab60000000000000000000000000000000000000000000000000000000003d28fe05000000000000000000000000000000000000000000000000000000003d28fe05000000000000000000000000000000000000000000000000000000003d2f73c0000000000000000000000000000000000000000000000000000000003d3714e0000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000000000000a0305070206090100040800000000000000000000000000000000000000000000",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x1",
        "removed": false
      },
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271",
          "0x0000000000000000000000000000000000000000000000000000000000000de8",
          "0x0000000000000000000000000000000000000000000000000000000000000000"
        ],
        "data": "0x0000000000000000000000000000000000000000000000000000000066ba16de",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x2",
        "removed": false
      },
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f",
          "0x000000000000000000000000000000000000000000000000000000003d2f73c0",
          "0x0000000000000000000000000000000000000000000000000000000000000de8"
        ],
        "data": "0x0000000000000000000000000000000000000000000000000000000066ba16e8",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x3",
        "removed": false
      }
    ],
    "status": "0x1",
    "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
    "transactionIndex": "0x1",
    "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
    "blockNumber": "0x3b259d",
    "gasUsed": "0x1ca9a",
    "from": "0x23190741b0f2d14337d62f61abdbaea1a5db726f",
    "to": "0x2f1bf1b4f84f163befdde172b9cd1e53fb19afa3",
    "contractAddress": null,
    "type": "0x0",
    "effectiveGasPrice": "0x1a7c9fd80"
  }
}

cdk-erigon RPC Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
    "blockNumber": "0x3b259d",
    "contractAddress": null,
    "cumulativeGasUsed": "0x17ecd5",
    "effectiveGasPrice": "0x1a7c9fd80",
    "from": "0x23190741b0f2d14337d62f61abdbaea1a5db726f",
    "gasUsed": "0x17ecd5",
    "logs": [
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0xc797025feeeaf2cd924c99e9205acb8ec04d5cad21c41ce637a38fb6dee6016a",
          "0x0000000000000000000000000000000000000000000000000000000000000de8"
        ],
        "data": "0x000000000000000000000000000000000000000000000000000000003d2f73c00000000000000000000000002f1bf1b4f84f163befdde172b9cd1e53fb19afa30000000000000000000000000000000000000000000000000000000066ba16de0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000000001cd7d12081c2708f32d0a8cc1b07d728b8726dbc724aaac1521b2b234968e000000000000000000000000000000000000000000000000000000000094c106000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000003cfaf640000000000000000000000000000000000000000000000000000000003d22ab60000000000000000000000000000000000000000000000000000000003d22ab60000000000000000000000000000000000000000000000000000000003d28fe05000000000000000000000000000000000000000000000000000000003d28fe05000000000000000000000000000000000000000000000000000000003d2f73c0000000000000000000000000000000000000000000000000000000003d3714e0000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000003d384a7b000000000000000000000000000000000000000000000000000000000000000a0305070206090100040800000000000000000000000000000000000000000000",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x1",
        "removed": false
      },
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271",
          "0x0000000000000000000000000000000000000000000000000000000000000de8",
          "0x0000000000000000000000000000000000000000000000000000000000000000"
        ],
        "data": "0x0000000000000000000000000000000000000000000000000000000066ba16de",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x2",
        "removed": false
      },
      {
        "address": "0x040089390690ae36dfc17fe534519882b343fa09",
        "topics": [
          "0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f",
          "0x000000000000000000000000000000000000000000000000000000003d2f73c0",
          "0x0000000000000000000000000000000000000000000000000000000000000de8"
        ],
        "data": "0x0000000000000000000000000000000000000000000000000000000066ba16e8",
        "blockNumber": "0x3b259d",
        "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
        "transactionIndex": "0x1",
        "blockHash": "0x0e1526a2b57cb20b62f73353a62c183ea032cd6930263ca7d31cad78c67cce94",
        "logIndex": "0x3",
        "removed": false
      }
    ],
    "logsBloom": "0x00000000000000000000000004000008000000000000000000000000000000000000000000000000000000000000000000000000000200020000000000000000000000000000000000000000002000000000000001000000000000000000000000400000020000000000000000000800000000000000000000000000000000020000000000010000000040000000000000000481000000000000000000010000000000801000000000200000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000",
    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x1",
    "to": "0x2f1bf1b4f84f163befdde172b9cd1e53fb19afa3",
    "transactionHash": "0xf6ec83499e054262d746beea4ecadf10e90ad3e902ed9b2220d707c6ab5e4bd8",
    "transactionIndex": "0x1",
    "type": "0x0"
  }
}
  1. Results Observed
  • zkEVM = "gasUsed": "0x1ca9a",
  • cdk-erigon = "gasUsed": "0x17ecd5",

Backtrace

Not applicable

@giskook
Copy link

giskook commented Aug 27, 2024

I think this check for forkid8 is useless. BTW X Layer lauched at forkid.9
#1035

@V-Staykov V-Staykov linked a pull request Aug 28, 2024 that will close this issue
@akramhussein
Copy link
Author

@V-Staykov @giskook thanks for looking into this and fixing it so quickly 🙏

Do you happen to know how frequently (or when) a new release is cut?

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 a pull request may close this issue.

2 participants