bor icon indicating copy to clipboard operation
bor copied to clipboard

eth_newFilter does not return bor logs

Open quickchase opened this issue 2 years ago • 5 comments

Re-Opening due to closure of #519

Yeah, I saw the code and creating new filter doesn't have support for bor logs yet.

If you take this request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getLogs",
  "params": [
    {
      "fromBlock": "0x1FCB880",
      "toBlock": "0x1FCB880",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
      ]
    }
  ]
}

Looking at the logs that it returns, you can see 0x28f5d28babc3a64650745f5b8fa6580f1b1aab3a4f9d84786bd225fa7be852cf as the final output in the array.

However, if you create an eth_newFilter with the same request and then request the logs from the filter, it's missing...

e.g.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_newFilter",
  "params": [
    {
      "fromBlock": "0x1FCB880",
      "toBlock": "0x1FCB880",
      "topics": [
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
      ]
    }
  ]
}

Followed by:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_getFilterLogs",
  "params": [
    "0xid"
  ]
}

It will not return 0x28f5d28babc3a64650745f5b8fa6580f1b1aab3a4f9d84786bd225fa7be852cf

quickchase avatar Sep 30 '22 14:09 quickchase

Hi @quickchase, so the eth_newFilter API can be used to retrieve logs when the state changes. This method cannot be used to fetch logs that are already stored in the state.

As eth_getLogs is returning the desired output, this means that the logs are already stored in the state, therefore eth_newFilter is not returning them.

Hope this helps.

pratikspatil024 avatar Oct 03 '22 04:10 pratikspatil024

Wouldn't the other logs that are returned already be in the same "state" as the missing bor log? They're all old logs, they're all in the same "state"

quickchase avatar Oct 03 '22 14:10 quickchase

https://github.com/maticnetwork/bor/issues/519#issuecomment-1260776664

We are working on this. Sorry, forgot to update here.

pratikspatil024 avatar Oct 03 '22 16:10 pratikspatil024

@quickchase This will be taken as a feature request and team will work on it as soon as they have some bandwidth, As of now I can confirm that eth_newFilter doesn't have support for bor logs.

Let me know if we can close the issue here. Thank You

0xKrishna avatar Oct 06 '22 05:10 0xKrishna

How can I track the issue (feature request) if not via github issue?

quickchase avatar Oct 06 '22 10:10 quickchase

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Oct 21 '22 00:10 github-actions[bot]

Still an issue

quickchase avatar Oct 21 '22 00:10 quickchase

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Nov 06 '22 00:11 github-actions[bot]

Still an issue

quickchase avatar Nov 06 '22 00:11 quickchase

@quickchase this issue has been resolved and should be reflected in future releases.

0xsharma avatar Nov 21 '22 12:11 0xsharma