go-ethereum/eth
Daniel Liu 51f4757eed
eth/traces: add state limit #25812 (#1300)
This PR introduces a new mechanism in chain tracer for preventing creating too many trace states.

The workflow of chain tracer can be divided into several parts:

- state creator generates trace state in a thread
- state tracer retrieves the trace state and applies the tracing on top in another thread
- state collector gathers all result from state tracer and stream to users

It's basically a producer-consumer model here, while if we imagine that the state producer generates states too fast, then it will lead to accumulate lots of unused states in memory. Even worse, in path-based state scheme it will only keep the latest 128 states in memory, and the newly generated state will invalidate the oldest one by marking it as stale.

The solution for fixing it is to limit the speed of state generation. If there are over 128 states un-consumed in memory, then the creation will be paused until the states are be consumed properly.

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
2025-09-09 07:03:24 +08:00
..
bft add syncinfo pool (#1236) 2025-07-28 01:43:41 -07:00
downloader core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
ethconfig all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
fetcher all: simplify timestamps to uint64 #19372 (#1318) 2025-08-08 10:33:37 +08:00
filters eth/filters: eth_getLogs fast exit for invalid block range #28386 (#1389) 2025-08-31 15:40:48 +08:00
gasprice eth/gasprice: sanity check ratio values (#31270) 2025-03-14 08:04:02 +08:00
hooks Consecutive penalty upgrade (#1053) 2025-06-25 01:12:56 -07:00
tracers eth/traces: add state limit #25812 (#1300) 2025-09-09 07:03:24 +08:00
util feat: add TIPEpochHalving, better style 2025-03-25 22:16:35 +08:00
api.go eth: rework chain tracer #25143 #25715 #29162 (#1294) 2025-09-09 00:06:07 +08:00
api_backend.go eth: rework chain tracer #25143 #25715 #29162 (#1294) 2025-09-09 00:06:07 +08:00
api_test.go core, eth, trie: rework preimage store #25287 (#1099) 2025-08-29 05:22:44 +08:00
backend.go all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
backend_test.go Move consensus hooks to its own package 2021-10-10 16:04:32 +11:00
bloombits.go core, eth, params: make indexer configurable (#17188) 2025-03-10 15:41:53 +08:00
handler.go eth: skip VerifyHeader in traceBlock to fix #1185 (#1265) 2025-07-26 18:18:50 +08:00
handler_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
helper_test.go core: move genesis alloc types to core/types (#29003) 2025-01-24 16:54:12 +08:00
metrics.go metrics, cmd/XDC: change init-process of metrics (#30814) 2024-12-13 14:00:14 +08:00
peer.go all: use github.com/deckarep/golang-set/v2 (generic set) (#26159) 2025-01-24 16:54:11 +08:00
protocol.go core: remove unused error from TxPool.Pending (#23720) 2024-11-01 11:36:53 +08:00
protocol_test.go eth: set networkID to chainId by default (#28250) 2025-02-17 09:17:31 +08:00
state_accessor.go eth: rework chain tracer #25143 #25715 #29162 (#1294) 2025-09-09 00:06:07 +08:00
sync.go core: remove unused error from TxPool.Pending (#23720) 2024-11-01 11:36:53 +08:00
sync_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00