forked from cerc-io/plugeth
e50aeac4d0
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. |
||
---|---|---|
.. | ||
internal/tracetest | ||
js | ||
logger | ||
native | ||
api_test.go | ||
api.go | ||
tracers_test.go | ||
tracers.go | ||
tracker_test.go | ||
tracker.go |