You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice catch! I think there is a bug in the code that the removed field is not being checked. As you can tell from the screenshot I pasted, the duplicated log's only difference is the blockHash field because of reorged block. According to the https://www.quicknode.com/docs/ethereum/eth_getLogs, the removed field is a boolean value indicating if the log was removed from the blockchain due to a chain reorganization. So, I think we should check the removed field to avoid duplicated logs, but now all the logs' removed field is false. I'll try to find a way to fix this.
A temporary solution is to add the blockhash to the filter and ensure the blockhash is always the conical one.
For example the first 2 logs below:
Request:
{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"],"fromBlock":"0x4d7ffe","toBlock":"0x4d7ffe"}],"id":1}
Response:
{
"jsonrpc": "2.0",
"result": [
{
"address": "0x46275d29113f065c2aac262f34c7a3d8a8b7377d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000efb73e47099485c72b7678cb59fb0da7dacf173f",
"0x000000000000000000000000a4ffac7a5da311d724ed47393848f694baee7930",
"0x00000000000000000000000000000000000000000000000000000000000007ab"
],
"data": "0x",
"blockHash": "0x7f6fc143909105b45f8c2ae11ac554f8f1c4dd03d30ac66161fca000dd60ff01",
"blockNumber": "0x4d7ffe",
"transactionHash": "0xb9d05f6af4f709ddf719186c3f4b735de1468c8698c00291b667c92804d238fc",
"transactionIndex": "0x0",
"logIndex": "0x0",
"transactionLogIndex": "0x0",
"removed": false
},
{
"address": "0x46275d29113f065c2aac262f34c7a3d8a8b7377d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000efb73e47099485c72b7678cb59fb0da7dacf173f",
"0x000000000000000000000000a4ffac7a5da311d724ed47393848f694baee7930",
"0x00000000000000000000000000000000000000000000000000000000000007ab"
],
"data": "0x",
"blockHash": "0xfb94d9057ba08fe9dadb15470fa91d7d7d61dcf0c010a94ce6cd4cc4c43e2c9f",
"blockNumber": "0x4d7ffe",
"transactionHash": "0xb9d05f6af4f709ddf719186c3f4b735de1468c8698c00291b667c92804d238fc",
"transactionIndex": "0x0",
"logIndex": "0x0",
"transactionLogIndex": "0x0",
"removed": false
},
The text was updated successfully, but these errors were encountered: