-
Notifications
You must be signed in to change notification settings - Fork 282
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
TransactionIndex changes based on the RPC request #521
Comments
Hi team, would you have an ETA for somebody taking a look at this issue? Thanks! |
Also might be related, there is a bug in rpc where if I get block with transactions and then I do eth_getTransactionReceipt for each tx, there are transaction_index mismatch sometimes so for example the log inside the tx receipt has tx_index as 1 but when I do getBlockByNumber, that tx has index 0. This bug happens on tx 0x27fa98452dcca7714bc89c571e6460936e73feaca2b4a40acb4666b609b4a670 on our node for example but happens on different transactions/blocks on different providers. |
@cll-gg , @ozgrakkurt , which version exactly (go-opera commit) do you use? I've tried the case on our rpc ($URL in https://rpc.ftm.tools/, https://rpc.fantom.network/, https://rpc.eu-north-1.gateway.fm/v4/fantom/non-archival/mainnet ) echo "- EXAMPLE 1"
echo "--- By block:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash":"0x0003b336000008bd319e42ed2b7fd2d7f74a90cf5e3ac169c54546abbce57aa6"}],
"id":1}' \
| jq '.result | .[] | select(.transactionHash == "0x6780bd14d08bf0064a7ba90a327f1dd356637a7a6b50fa463745adee56629edc") | .transactionIndex'
echo "--- By topics:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock":"0x4234f52", "toBlock": "0x4234f52",
"topics":[["0x0559884fd3a460db3073b7fc896cc77986f16e378210ded43186175bf646fc5f", "0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271", "0xf6a97944f31ea060dfde0566e4167c1a1082551e64b60ecb14d599a9d023d451"]]}],
"id":1}' \
| jq '.result | .[] | .transactionIndex'
echo "--- By tx:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x6780bd14d08bf0064a7ba90a327f1dd356637a7a6b50fa463745adee56629edc"],
"id":1}' \
| jq '.result.logs | .[] | .transactionIndex'
echo "- EXAMPLE 2"
echo "--- By block:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"blockHash":"0x0003f2f000000e4405461909e9a2fdb9e46858037a629bd4eed9ad01e8d0fb88"}],
"id":1}' \
| jq '.result | .[] | select(.transactionHash == "0x27fa98452dcca7714bc89c571e6460936e73feaca2b4a40acb4666b609b4a670") | .transactionIndex'
echo "--- By topics:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"fromBlock":"0x46a1b45", "toBlock": "0x46a1b45",
"topics":[["0xe9149e1b5059238baed02fa659dbf4bd932fbcf760a431330df4d934bc942f37"]]}],
"id":1}' \
| jq '.result | .[] | .transactionIndex'
echo "--- By tx:"
curl ${URL} \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x27fa98452dcca7714bc89c571e6460936e73feaca2b4a40acb4666b609b4a670"],
"id":1}' \
| jq '.result.logs | .[] | .transactionIndex' |
@rus-alex: sorry for the late response. Here's the version of the chain client for which I've observed the issue again roughly 2 hours ago:
The issue seems to be resolving after some time, e.g. I saw our application retrieve the following mismatch but I can't reproduce this manually 2 hours later:
When I try to reproduce it manually, the first |
@rus-alex, to be honest, I'm just using curl against a bespoke RPC endpoint, I'm not sure about its configuration. |
Describe the bug
When doing a
eth_getLogs
request in one way, the returnedtransactionIndex
field gets a different value than when doing theeth_getLogs
request in a different way. Everything else (block hash, transaction hash, log index, etc.) stays the same.Unfortunately, it doesn't seem to happen for each log or transaction.
To Reproduce
Steps to reproduce the behavior:
0x6780bd14d08bf0064a7ba90a327f1dd356637a7a6b50fa463745adee56629edc
in block0x0003b336000008bd319e42ed2b7fd2d7f74a90cf5e3ac169c54546abbce57aa6
(number69422930
):69422930
, which are the logs in transaction0x6780bd14d08bf0064a7ba90a327f1dd356637a7a6b50fa463745adee56629edc
:Expected behavior
The same transactionIndex should be returned.
If you remove the
.transactionIndex
from thejq
command then it's clear that the returned objects are exactly the same except for the transactionIndex.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: