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

Incorrect transactionIndex in logs for eth.getTransactionReceipt #3298

Closed
kkeolmusae opened this issue Feb 19, 2024 · 0 comments
Closed

Incorrect transactionIndex in logs for eth.getTransactionReceipt #3298

kkeolmusae opened this issue Feb 19, 2024 · 0 comments

Comments

@kkeolmusae
Copy link

kkeolmusae commented Feb 19, 2024

System information

  • zkEVM Node version: v0.5.11-RC14
  • OS & Version: MAC
  • Commit hash: (if develop)
  • Network: Mainnet

Expected behaviour

I expected the transactionIndex in the logs of eth.getTransactionReceipt to correctly reflect the index of the corresponding transaction.

Actual behaviour

The transactionIndex in the logs of eth.getTransactionReceipt is consistently reported as 0, but it should be the actual index of the transaction, which in this case is 1.

Steps to reproduce the behaviour

  1. Connecting to zkEVM RPC
./geth attach https://zkevm-rpc.com
  1. Retrieve the transaction receipt using eth.getTransactionReceipt.
> eth.getTransactionReceipt("0x16771f0b6cc88ff69ab530a2576ffa805d5012b9b4fb5ef8b501c391e4e9f690")
  1. Check the transactionIndex in the logs.
{
  blockHash: "0x4bc9dfa77c4b23d207be02f539313ea56a7e812be54fda580f95e13b9ae50ee1",
  blockNumber: 10040841,
  contractAddress: null,
  cumulativeGasUsed: 75522,
  effectiveGasPrice: 1921562500,
  from: "0x0c561a55772c3d2f42bb8d45497f095649776942",
  gasUsed: 75522,
  logs: [{
      address: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
      blockHash: "0x4bc9dfa77c4b23d207be02f539313ea56a7e812be54fda580f95e13b9ae50ee1",
      blockNumber: 10040841,
      data: "0x00000000000000000000000000000000000000000000000000000000002849bc",
      logIndex: 0,
      removed: false,
      topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000ece7244a0e861c841651401fc22cee577fee90af", "0x000000000000000000000000ada6e69781399990d42becb1a9427955ffa73bdc"],
      transactionHash: "0x16771f0b6cc88ff69ab530a2576ffa805d5012b9b4fb5ef8b501c391e4e9f690",
      transactionIndex: 0
  }, {
      address: "0xece7244a0e861c841651401fc22cee577fee90af",
      blockHash: "0x4bc9dfa77c4b23d207be02f539313ea56a7e812be54fda580f95e13b9ae50ee1",
      blockNumber: 10040841,
      data: "0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000002849bc",
      logIndex: 1,
      removed: false,
      topics: ["0x8595f614655883bce3496fde65b1ff62bb8b336cc93d72a91cd2f61f1566872f", "0x0000000000000000000000000c561a55772c3d2f42bb8d45497f095649776942", "0x0000000000000000000000000000000000000000000000000000000000000000"],
      transactionHash: "0x16771f0b6cc88ff69ab530a2576ffa805d5012b9b4fb5ef8b501c391e4e9f690",
      transactionIndex: 0
  }, {
      address: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
      blockHash: "0x4bc9dfa77c4b23d207be02f539313ea56a7e812be54fda580f95e13b9ae50ee1",
      blockNumber: 10040841,
      data: "0x00000000000000000000000000000000000000000000000000000000002849bc",
      logIndex: 2,
      removed: false,
      topics: ["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x000000000000000000000000ada6e69781399990d42becb1a9427955ffa73bdc", "0x0000000000000000000000000c561a55772c3d2f42bb8d45497f095649776942"],
      transactionHash: "0x16771f0b6cc88ff69ab530a2576ffa805d5012b9b4fb5ef8b501c391e4e9f690",
      transactionIndex: 0
  }],
  logsBloom: "0x00000000400000000000000000000800000000000001000000004000000000000000000000008000400000000000000000000000000800000000000000000000000000000000000000000008004000000000000000001004000000000000000000000000020000000000000000000800000000000000000000000010000001000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000002000008000010000000000000000000000000000000080000000020000000000000000008000000000000000000000000000000100000000000000000",
  root: "0xc5ce6a595751661706a2093dde2ff2119cac8543c362c3370581e8579632036c",
  status: "0x1",
  to: "0xada6e69781399990d42becb1a9427955ffa73bdc",
  transactionHash: "0x16771f0b6cc88ff69ab530a2576ffa805d5012b9b4fb5ef8b501c391e4e9f690",
  transactionIndex: 1,
  type: "0x0"
}

Potential Issue

If the transactionIndex within the logs consistently shows 0 instead of the expected value (1 in this case), there might be an issue with how the transaction index is being recorded in the zkEVM node.

Backtrace

transactionReceipts.logs[*].transactionIndex should 1
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants