foundry icon indicating copy to clipboard operation
foundry copied to clipboard

make "cast run" faster

Open eyalc900 opened this issue 5 months ago • 4 comments

Component

Cast

Describe the feature you would like

Running cast run is painfully slow, since it performs an RPC call for each storage access. But in most cases, it can run much, much faster: Many RPC providers support debug_traceTransaction. Using the prestateTracer , the entire storage tree used by a transaction can be fetched at once. Only if this trace command fails, the cast run should resort to the slot-by-slot access.

Additional context

No response

eyalc900 avatar Dec 02 '25 15:12 eyalc900

yeah this is true, but not everyone has access to he debug_ namespace

but definitely something we should support actually

mattsse avatar Dec 02 '25 15:12 mattsse

The prestateTracer has better support by providers than the generic JavaScript tracer. It is also used for building access lists, and in general, much lighter to execute (as it is native, and can't run arbitrary code)

eyalc900 avatar Dec 02 '25 23:12 eyalc900

has better support by providers than the generic JavaScript tracer

this is true, but also not relevant here?

mattsse avatar Dec 03 '25 11:12 mattsse

what I mean is that general tracing support is limited, but native (and specifically prestateTracer) is quite widely supported

eyalc900 avatar Dec 03 '25 12:12 eyalc900