Summary
EthFilters created via eth_newFilter, eth_newBlockFilter, and eth_newPendingTransactionFilter are never cleaned up. They live until the user calls eth_uninstallFilter or the node restarts. Clients routinely abandon filters (poll a few times, disconnect, never uninstall), so abandoned filters accumulate and hold resources indefinitely.
Lotus also expire idle filters on a TTL, we don't.
Completion Criteria
We should add a periodic sweep that removes filters inactive for longer than a configurable timeout.
- Config —
EventsConfig / env vars
- Configurable TTL (default ~5 min, matching geth) and sweep interval (e.g. 60s).
Additional Links & Resources
- Lotus expires filters via a
lastTaken timestamp + a periodic sweep
Summary
EthFilterscreated viaeth_newFilter,eth_newBlockFilter, andeth_newPendingTransactionFilterare never cleaned up. They live until the user callseth_uninstallFilteror the node restarts. Clients routinely abandon filters (poll a few times, disconnect, never uninstall), so abandoned filters accumulate and hold resources indefinitely.Lotus also expire idle filters on a TTL, we don't.
Completion Criteria
We should add a periodic sweep that removes filters inactive for longer than a configurable timeout.
last_usedtimestamp per filter, bumped whenever the filter is polled (eth_getFilterChanges/eth_getFilterLogs), updated under the store lock so the sweep can't evict a filter that was just polled.EthEventHandlerthat wakes everysweep_intervaland uninstalls every filter longer thanTTL,EventsConfig/ env varsAdditional Links & Resources
lastTakentimestamp + a periodic sweep