Open
Description
Describe the feature
Tracing is by far our largest latency performance bottleneck. Due to the complexities of getting custom native tracers installed on nodes (especially when using 3rd party RPCs), Rundler always uses a javascript tracer, causing the latency issue.
A different approach to this would be to do tracing locally using revm.
How this would work:
- Gather all of the required storage slot values using the native
prestateTracer
on the normal RPC. This should be supported by all 3rd party RPCs. - Load the prestate into revm state builder on an empty database.
- Trace the call locally using a revm inspector.
Some caveats:
- Precompile support. Our local EVM would require all of the same precompiles as the network that we are simulating, and that we explicitly whitelist. Currently this is only RIP-7212, but the list might expand.
- Performance. Rundler is currently very light on CPU usage due to offloading all computation to nodes.
- We could implement this tracing functionality as another server task within Rundler that exposes a gRPC interface and could be horizontally scaled independently of the rest of Rundler.
Another approach could be to attempt to use revm on top of alloydb and remove the prestate tracing, but that may require too many network calls to be high performance.