You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Description
When we switched from the old gas price estimation crate to a new one
built on top of alloy we lost a key optimization. The old gas price
estimation updated the gas price in a background task so the total
number of RPC requests was constant while they scale with the number of
connected solvers and such for the new logic.
For example on mainnet this causes the driver to spend a third of its
RPC requests on gas price computation which is obviously insane.
<img width="1187" height="304" alt="Screenshot 2026-06-29 at 09 10 08"
src="https://github.com/user-attachments/assets/087a847b-6cb5-413e-ae94-681e1f1dad57"
/>
# Changes
Implements a background task for the alloy based gas price estimator
which updates the gas price once for every new block.
To break up a circular dependency when creating the `Ethereum` instance
in the driver I needed to move the creation of the gas price estimator
into `Ethereum::new()` which in turn required a few other changes.
## How to test
Added unit test
Also deployed this temporarily to prod BNB and the time to convert the
DTO to the domain types dropped from ~200ms to 3ms because we don't have
any RPC calls on the hot path anymore.
<img width="1599" height="819" alt="Screenshot 2026-06-30 at 08 26 10"
src="https://github.com/user-attachments/assets/c4d00479-5826-45de-87b1-d94ff829baf1"
/>
0 commit comments