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

debug API debug_traceTransaction incorrect gasCost #6969

Closed
1 task done
Savid opened this issue Mar 5, 2024 · 4 comments
Closed
1 task done

debug API debug_traceTransaction incorrect gasCost #6969

Savid opened this issue Mar 5, 2024 · 4 comments
Labels
A-execution Related to the Execution and EVM C-bug An unexpected or incorrect behavior M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity

Comments

@Savid
Copy link

Savid commented Mar 5, 2024

Describe the bug

When getting debug_tracetransaction it looks like there can be an int overflow on the gasCost values in structLogs.

Random mainnet transaction 0x48b7c61378bbd2fff08912109815161f5835735a0b6cbec9d0c7ef72b31619fb example;

      {
        "pc": 16097,
        "op": "SWAP1",
        "gas": 185740,
        "gasCost": 18446744073709548234,
        "stack": [
          "0xe5d7bde6",
          "0x42e",
          "0xe4",
          "0x464",
          "0x40",
          "0x4c4",
          "0x17e",
          "0x172f42fece2ac94403f",
          "0x0",
          "0xe4e369f1e00bc24",
          "0xcd02a882804f3eb0f2d80f94a04defcea038359f",
          "0x172f42fece2ac94403f",
          "0xe3cd110565f9aed",
          "0x67814c1b9165b52ccbfcd7cae98fe50f24744b24f1c2715f99382da6421b259",
          "0xe4",
          "0x0",
          "0x1fe5",
          "0x4c45bbec2ff7810ef4a77ad7bd4757c446fe4155",
          "0xcac5ab3dd18d859382d52bbbc008e0be40a6c38e",
          "0xcd02a882804f3eb0f2d80f94a04defcea038359f",
          "0x172f42fece2ac94403f",
          "0x244",
          "0x0",
          "0x0",
          "0x23b872dd00000000000000000000000000000000000000000000000000000000",
          "0x80",
          "0x1"
        ],
        "depth": 3,
        "refund": 4800
      }

Compared to geth

      {
        "pc": 16097,
        "op": "SWAP1",
        "gas": 84417,
        "gasCost": 3,
        "depth": 3,
        "stack": [
          "0xe5d7bde6",
          "0x42e",
          "0xe4",
          "0x464",
          "0x40",
          "0x4c4",
          "0x17e",
          "0x172f42fece2ac94403f",
          "0x0",
          "0xe4e369f1e00bc24",
          "0xcd02a882804f3eb0f2d80f94a04defcea038359f",
          "0x172f42fece2ac94403f",
          "0xe4e369f1e00bc1a",
          "0x67814c1b9165b52ccbfcd7cae98fe50f24744b24f1c2715f99382da6421b259",
          "0xe4",
          "0x0",
          "0x23db",
          "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "0xa88800cd213da5ae406ce248380802bd53b47647",
          "0x8b067ad41e45babe5bbb52fc2fe7f692f628b06",
          "0xe4e369f1e00bc1a",
          "0x244",
          "0x0",
          "0x0",
          "0x23b872dd00000000000000000000000000000000000000000000000000000000",
          "0xa0",
          "0x1"
        ],
        "refund": 30300
      }

reth.json

geth.json

Steps to reproduce

curl -X POST http://localhost:8545 \
  --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x48b7c61378bbd2fff08912109815161f5835735a0b6cbec9d0c7ef72b31619fb",{}],"id":1}' \
  -H "Content-Type: application/json"

Search for uint64 max "gasCost": 18446744073

Node logs

No response

Platform(s)

Linux (x86)

What version/commit are you on?

reth/v0.1.0-alpha.18-e24eadf/x86_64-unknown-linux-gnu

What database version are you on?

1

What type of node are you running?

Full via --full flag

What prune config do you use, if any?

No response

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@Savid Savid added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Mar 5, 2024
@jsvisa
Copy link
Contributor

jsvisa commented Mar 5, 2024

Maybe paradigmxyz/revm-inspectors#45 can fix this one

@mattsse
Copy link
Collaborator

mattsse commented Mar 5, 2024

this was most likely fixed by paradigmxyz/revm-inspectors#38

but it's possible that there's still an edge case so I keep this open and debug with newest release

@DaniPopes DaniPopes added A-execution Related to the Execution and EVM and removed S-needs-triage This issue needs to be labelled labels Mar 6, 2024
Copy link
Contributor

This issue is stale because it has been open for 21 days with no activity.

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Mar 28, 2024
@mattsse mattsse added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Mar 28, 2024
@onbjerg
Copy link
Collaborator

onbjerg commented Apr 22, 2024

Confirmed this to be working now, this is from our public instance:

curl -X POST 69.67.151.138:8545  \
        --data '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0x48b7c61378bbd2fff08912109815161f5835735a0b6cbec9d0c7ef72b31619fb",{}],"id":1}' \
        -H "Content-Type: application/json"
      {
        "pc": 16097,
        "op": "SWAP1",
        "gas": 189125,
        "gasCost": 3,
        "depth": 3,
        "stack": [
          "0xe5d7bde6",
          "0x42e",
          "0xe4",
          "0x464",
          "0x40",
          "0x4c4",
          "0x17e",
          "0x172f42fece2ac94403f",
          "0x0",
          "0xe4e369f1e00bc24",
          "0xcd02a882804f3eb0f2d80f94a04defcea038359f",
          "0x172f42fece2ac94403f",
          "0xe3cd110565f9aed",
          "0x67814c1b9165b52ccbfcd7cae98fe50f24744b24f1c2715f99382da6421b259",
          "0xe4",
          "0x0",
          "0x1fe5",
          "0x4c45bbec2ff7810ef4a77ad7bd4757c446fe4155",
          "0xcac5ab3dd18d859382d52bbbc008e0be40a6c38e",
          "0xcd02a882804f3eb0f2d80f94a04defcea038359f",
          "0x172f42fece2ac94403f",
          "0x244",
          "0x0",
          "0x0",
          "0x23b872dd00000000000000000000000000000000000000000000000000000000",
          "0x80",
          "0x1"
        ],
        "refund": 4800
      },

@onbjerg onbjerg closed this as completed Apr 22, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-execution Related to the Execution and EVM C-bug An unexpected or incorrect behavior M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity
Projects
Archived in project
Development

No branches or pull requests

5 participants