go-ethereum/eth/filters
Mark Liu bfa97d5579 eth/filters: reduce lock scope in GetFilterChanges
GetFilterChanges held filtersMu for the entire call, including
pending-tx RPC formatting via NewRPCPendingTransaction. That blocks the
goroutines that append events to filters, and with unbuffered channels
the backpressure stalls event.Feed.Send — so polling clients see empty
results during high-throughput periods.

Copy the accumulated slices and nil the filter state under the lock,
then release it before doing any formatting. Same drain-on-read
semantics, just a shorter critical section.

- Move ChainConfig()/CurrentHeader() calls outside the lock — only the
  PendingTransactionsSubscription fullTx branch needs them
- Tests: drain semantics for logs, blocks, pending txs (fullTx and
  hash-only paths)

Related: #28838
Signed-off-by: Mark Liu <mark@prove.com.au>
2026-03-12 17:07:38 +11:00
..
api.go eth/filters: reduce lock scope in GetFilterChanges 2026-03-12 17:07:38 +11:00
api_test.go eth/filters: reduce lock scope in GetFilterChanges 2026-03-12 17:07:38 +11:00
filter.go rpc: add a rpc.rangelimit flag (#33163) 2026-01-17 14:34:08 +01:00
filter_system.go rpc: add a rpc.rangelimit flag (#33163) 2026-01-17 14:34:08 +01:00
filter_system_test.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
filter_test.go rpc: add a rpc.rangelimit flag (#33163) 2026-01-17 14:34:08 +01:00