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

logIndex changes after block becomes safe #7751

Open
varasev opened this issue Nov 12, 2024 · 1 comment
Open

logIndex changes after block becomes safe #7751

varasev opened this issue Nov 12, 2024 · 1 comment

Comments

@varasev
Copy link
Contributor

varasev commented Nov 12, 2024

On Nethermind 1.27.0 (and Sepolia chain) we discovered the following behaviour: eth_getFilterChanges returns incorrect logIndex for logs in unfinalized blocks. After block is finalized, the logIndex becomes correct. We don't see the same on Erigon.

For example, I caught that for this transaction and a log with topic 0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32 the output was as follows:

  "address" => "0x65ea1489741a5d72ffdd8e6485b216bbdcc15af3",
  "blockHash" => "0xa262b5b296c8fd026516a815a0070096e4285535199af1349f695d47ee24fec4",
  "blockNumber" => "0x6bbf94",
  "data" => "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020d00000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000038d7ea4c680000000000000077f2e00d764ad0b0001000000000000000000000000000000000000000000000000000000113fa70000000000000000000000005f5a404a5edabcdd80db05e8e54a78c9ebf000c2000000000000000000000000420000000000000000000000000000000000001000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c41635f5fd000000000000000000000000ecb06f2cc720626619821efee4bda42898b39c42000000000000000000000000ecb06f2cc720626619821efee4bda42898b39c4200000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b73757065726272696467650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "logIndex" => "0xbc85a",
  "removed" => false,
  "topics" => ["0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32", "0x0000000000000000000000001295245d202724dc28a2b688952cb56c882c3380", "0x0000000000000000000000004200000000000000000000000000000000000007", "0x0000000000000000000000000000000000000000000000000000000000000000"],
  "transactionHash" => "0xb7f1fe65f346fb79515153c0f080fc2bb62cf8a1e33fcf0366ca0b6c83d3b8af",
  "transactionIndex" => "0x49",
  "transactionLogIndex" => "0x2"

After block is finalized, eth_getLogs returned another (correct) value:

  "address" => "0x65ea1489741a5d72ffdd8e6485b216bbdcc15af3",
  "blockHash" => "0xa262b5b296c8fd026516a815a0070096e4285535199af1349f695d47ee24fec4",
  "blockNumber" => "0x6bbf94",
  "data" => "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000020d00000000000000000000000000000000000000000000000000038d7ea4c6800000000000000000000000000000000000000000000000000000038d7ea4c680000000000000077f2e00d764ad0b0001000000000000000000000000000000000000000000000000000000113fa70000000000000000000000005f5a404a5edabcdd80db05e8e54a78c9ebf000c2000000000000000000000000420000000000000000000000000000000000001000000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000030d4000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c41635f5fd000000000000000000000000ecb06f2cc720626619821efee4bda42898b39c42000000000000000000000000ecb06f2cc720626619821efee4bda42898b39c4200000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b73757065726272696467650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "logIndex" => "0x6e",
  "removed" => false,
  "topics" => ["0xb3813568d9991fc951961fcb4c784893574240a28925604d09fc577c55bb7c32", "0x0000000000000000000000001295245d202724dc28a2b688952cb56c882c3380", "0x0000000000000000000000004200000000000000000000000000000000000007", "0x0000000000000000000000000000000000000000000000000000000000000000"],
  "transactionHash" => "0xb7f1fe65f346fb79515153c0f080fc2bb62cf8a1e33fcf0366ca0b6c83d3b8af",
  "transactionIndex" => "0x49",
  "transactionLogIndex" => "0x2"
@varasev
Copy link
Contributor Author

varasev commented Nov 13, 2024

Also, eth_newFilter with toBlock parameter equal to safe scans logs prior to the latest block, not the safe one.

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