File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change @@ -2659,17 +2659,22 @@ impl EthApi {
2659
2659
}
2660
2660
}
2661
2661
2662
- self . backend
2663
- . with_database_at ( Some ( block_request) , |mut state, block| {
2664
- if let Some ( overrides) = overrides {
2665
- state = Box :: new ( state:: apply_state_override (
2666
- overrides. into_iter ( ) . collect ( ) ,
2667
- state,
2668
- ) ?) ;
2669
- }
2670
- self . do_estimate_gas_with_state ( request, & state, block)
2671
- } )
2672
- . await ?
2662
+ // this can be blocking for a bit, especially in forking mode
2663
+ // <https://github.com/foundry-rs/foundry/issues/6036>
2664
+ self . on_blocking_task ( |this| async move {
2665
+ this. backend
2666
+ . with_database_at ( Some ( block_request) , |mut state, block| {
2667
+ if let Some ( overrides) = overrides {
2668
+ state = Box :: new ( state:: apply_state_override (
2669
+ overrides. into_iter ( ) . collect ( ) ,
2670
+ state,
2671
+ ) ?) ;
2672
+ }
2673
+ this. do_estimate_gas_with_state ( request, & state, block)
2674
+ } )
2675
+ . await ?
2676
+ } )
2677
+ . await
2673
2678
}
2674
2679
2675
2680
/// Estimates the gas usage of the `request` with the state.
You can’t perform that action at this time.
0 commit comments