5

According to the JSON RPC docs, filters timeout when they aren't polled with eth_getFilterChanges for a period of time.

eth_getFilterChanges(ID) seems to return the same result {"jsonrpc"=>"2.0", "id"=>1, "result"=>[]} regardless of whether a filter with the supplied ID exists or not.

Thus, it seems that eth_getFilterChanges is ambiguous and we have no way of knowing whether the filter has timed out or if it simply doesn't contain changes since the last poll.

I also checked the other filter related methods and didn't find any method that would allow to check the state (active or removed) of a filter.

How do we handle timeouts and what is the exact timeout period? How do we check the state of a filter? What am I missing?

3

Just checked. In current Geth (v1.5.7), eth_getFilterChanges returns

  • {"jsonrpc":"2.0","id":168,"result":[]} when there is no changes.
  • {"jsonrpc":"2.0","id":168,"error":{"code":-32000,"message":"filter not found"}} when filter id not exists e.g. after timeout

And according to source (https://github.com/ethereum/go-ethereum/blob/ac93a6ff6cd1200ab0fb67a5bd0c02cb70646632/eth/filters/api.go) timeout is 5 minutes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.