Why does the error "filter not found" appear?
- Filters are isolated to a given blockchain node and not part of the blockchain as such.
Filters are short-lived. A given filter expires if it's not utilized within 5 minutes. You need to make sure that you request eth_getFilterChanges before the filter expires. As long as you periodically poll eth_getFilterChanges within 5 minutes timeframes, the filter will not expire.
- We run an infrastructure of nodes that are handled by clusters for load-balancing purposes. Nodes are dropped from the infra whenever they fall behind the tip within a healthy threshold.
Filters are created in memory of the node you're connected to, so if that node gets dropped, you get reconnected to a different and healthy node which means that the previously created filter will not be available anymore.
Whether the filter expires because of the timeout (or) because of the changes in infrastructure on our end, the solution we propose to our customers is to implement an error handler whenever the error appears. You would have to simply recreate a new filter and move on from there.
Article is closed for comments.