trufflesuite / ganache

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
2.62k stars 678 forks source link

Performance optimization for `eth_feeHistory` when forking in fallback mode. #3827

Open tenthirtyone opened 1 year ago

tenthirtyone commented 1 year ago

I spent some time exploring @davidmurdoch 's comment here.

There are potentially a lot of awaits in this loop that could be parallelized. I suspect that parallelizing them will lead to a massive speed up when requesting blocks on a forked network. I think it is worth the effort to look into the performance possibilities here.

When a large range of blocks or high number of transactions are involved responses when forking can take a long time. Although we can process requests concurrently, fallback mode currently relies on a socket connection that is reasonably consistent.

A better way would be batching tx receipt requests or trying the http handler over the socket handler.

Also, this issue is currently affected by the two open socket issues, #3476 & #3477