Improve feeHistory performance #5108
Labels
A-rpc
Related to the RPC implementation
C-enhancement
New feature or request
D-good-first-issue
Nice and easy! A great choice to get started
Describe the feature
currently the feeHistory implementation is very expensive:
it reads the entire recent header range:
reth/crates/rpc/rpc/src/eth/api/fees.rs
Line 94 in a6bee72
and if reward percentiles are provided it computes the reward percentiles based on the request input:
reth/crates/rpc/rpc/src/eth/api/fees.rs
Lines 108 to 111 in a6bee72
There are two improvements we can make here:
reth/crates/rpc/rpc/src/eth/api/fees.rs
Lines 104 to 106 in a6bee72
Another improvement we could do is approximating the reward percentiles by computing the rewards with a certain resolution
Additional context
reth/crates/rpc/rpc/src/eth/gas_oracle.rs
Lines 96 to 98 in a6bee72
The text was updated successfully, but these errors were encountered: