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

op-reth outputs bad data for "eth_getTransactionReceipt" method #10462

Closed
1 task done
AntonieDavid opened this issue Aug 22, 2024 · 6 comments · Fixed by #10615 or #10664
Closed
1 task done

op-reth outputs bad data for "eth_getTransactionReceipt" method #10462

AntonieDavid opened this issue Aug 22, 2024 · 6 comments · Fixed by #10615 or #10664
Assignees
Labels
A-op-reth Related to Optimism and op-reth A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior

Comments

@AntonieDavid
Copy link

AntonieDavid commented Aug 22, 2024

Describe the bug

I've been testing the op-reth client on base mainnet and found a big difference when comparing the results from the node running on op-reth to the ones from a node running op-geth.
for simplicity, the main difference is the l1Fee value, which should be identical and also the reth node is missing some params l1BaseFeeScalar/l1BlobBaseFee/l1BlobBaseFeeScalar and also there is l1FeeScalar this parameter in op-reth which isn't present in the op-geth result.

Steps to reproduce

payload for that request: {"method": "eth_getTransactionReceipt", "params": ["0xca564948e3e825f65731424da063240eec34ba921dd117ac5d06b8c2e0b2d962"], "id": 52, "jsonrpc": "2.0"}
op-reth service file flags/description:
ExecStart=/usr/local/bin/op-reth node \ --ws --ws.port=8546 --ws.addr=0.0.0.0 --ws.origins="*" \ --http --http.port=8545 --http.addr=0.0.0.0 \ --http.corsdomain="*" \ --authrpc.addr=0.0.0.0 \ --authrpc.jwtsecret=/node/data/secret.jwt \ --authrpc.port=8551 \ --datadir=/node/data/reth/ \ --rollup.sequencer-http=https://mainnet-sequencer.base.org \ --http.api=admin,debug,eth,net,trace,web3,rpc,reth,ots,eth-call-bundle \ --ws.api=admin,debug,eth,net,trace,web3,rpc,reth,ots,eth-call-bundle \ --metrics 0.0.0.0:6060 \ --chain base \ --rpc.gascap 18446744073709551615 \ --rpc.max-connections 429496729 \ --rpc.max-logs-per-response 0 \ --rpc.max-subscriptions-per-connection 10000 \ --rollup.disable-tx-pool-gossip

Node logs

`
output from the op-reth client:
{
  "jsonrpc": "2.0",
  "result": {
    "status": "0x1",
    "cumulativeGasUsed": "0xc74f5e",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "type": "0x2",
    "transactionHash": "0xca564948e3e825f65731424da063240eec34ba921dd117ac5d06b8c2e0b2d962",
    "transactionIndex": "0x3e",
    "blockHash": "0x70a8a64a0f8b141718f60e49c30f027cb9e4f91753d5f13a48d8e1ad263c08bf",
    "blockNumber": "0x1185e55",
    "gasUsed": "0x5208",
    "effectiveGasPrice": "0x31b41b",
    "from": "0x889ebdac39408782b5165c5185c1a769b4dd3ce6",
    "to": "0x7449061f45d7b39b3b80b4159286cd8682f60a3c",
    "contractAddress": null,
    "l1Fee": "0x84aaa7",
    "l1FeeScalar": "0.000004",
    "l1GasPrice": "0x50f928b4",
    "l1GasUsed": "0x640"
  },
  "id": 52
}


output from the op-geth client:
{
  "jsonrpc": "2.0",
  "id": 52,
  "result": {
    "blockHash": "0x70a8a64a0f8b141718f60e49c30f027cb9e4f91753d5f13a48d8e1ad263c08bf",
    "blockNumber": "0x1185e55",
    "contractAddress": null,
    "cumulativeGasUsed": "0xc74f5e",
    "effectiveGasPrice": "0x31b41b",
    "from": "0x889ebdac39408782b5165c5185c1a769b4dd3ce6",
    "gasUsed": "0x5208",
    "l1BaseFeeScalar": "0x8dd",
    "l1BlobBaseFee": "0x1",
    "l1BlobBaseFeeScalar": "0x101c12",
    "l1Fee": "0x125f723f3",
    "l1GasPrice": "0x50f928b4",
    "l1GasUsed": "0x640",
    "logs": [],
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x1",
    "to": "0x7449061f45d7b39b3b80b4159286cd8682f60a3c",
    "transactionHash": "0xca564948e3e825f65731424da063240eec34ba921dd117ac5d06b8c2e0b2d962",
    "transactionIndex": "0x3e",
    "type": "0x2"
  }
}

Platform(s)

Linux (x86)

What version/commit are you on?

op-reth --version reth Version: 1.0.3 Commit SHA: 390f30aadebcdd509e72cc04327c3b854de076a6 Build Timestamp: 2024-08-05T23:59:17.371843433Z Build Features: jemalloc,optimism Build Profile: maxperf

What database version are you on?

op-reth db version
2024-08-22T18:23:51.766359Z INFO Initialized tracing, debug log directory: /root/.cache/reth/logs/optimism
Error: Datadir does not exist: "/root/.local/share/reth/optimism"

Location:
/root/reth/crates/cli/commands/src/db/mod.rs:71:9

Which chain / network are you on?

base mainnet

What type of node are you running?

Archive (default)

What prune config do you use, if any?

No response

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

source "$HOME/.cargo/env" && RUSTFLAGS="-C target-cpu=native" cargo build --profile maxperf --features jemalloc,asm-keccak,optimism --bin op-reth

Code of Conduct

  • I agree to follow the Code of Conduct
@AntonieDavid AntonieDavid added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Aug 22, 2024
@emhane emhane added A-rpc Related to the RPC implementation and removed S-needs-triage This issue needs to be labelled labels Aug 25, 2024
@emhane
Copy link
Member

emhane commented Aug 28, 2024

trait method EthTransaction::transaction_receipt needs an override in impl EthTransactions for OpEthApi<N>

@emhane emhane self-assigned this Aug 28, 2024
@emhane
Copy link
Member

emhane commented Aug 28, 2024

at second look, it appears the reth code is correct, and bugs are caused by op-alloy. ref alloy-rs/op-alloy#53.

@emhane
Copy link
Member

emhane commented Aug 29, 2024

l1FeeScalar shouldn't be set after ecotone, so we're probably mistakenly still setting this for fjord. we need new types to contain in op receipt envelopes, this type safety will help us setting these fields correctly, issue open alloy-rs/op-alloy#54

@emhane
Copy link
Member

emhane commented Aug 29, 2024

l1_fee computation is off
op-reth: "l1Fee": "0x84aaa7"
op-geth: "l1Fee": "0x125f723f3"

this bug also caught by new unit test #10620

@emhane
Copy link
Member

emhane commented Sep 2, 2024

seems like there is a new func for calculating l1Fee and L1GasUsed since Fjord

@AntonieDavid
Copy link
Author

thanks for addressing parts of the issue, waiting for the l1Fee/L1GasUsed functions to be updated

@emhane emhane added the A-op-reth Related to Optimism and op-reth label Sep 3, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-op-reth Related to Optimism and op-reth A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
Archived in project
2 participants