Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/improve fee history performance #5182

Merged
merged 43 commits into from
Nov 27, 2023

Conversation

allnil
Copy link
Contributor

@allnil allnil commented Oct 25, 2023

Draft PR to optimize fee_history()

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for this draft,

I don't want to integrate the feehistory in the ethstatecache, this should be limited to state data only.

instead we want a separate type that handles this similar to the gasoracle. that only tracks Hash to Fees, this one is accessed when the endpoint is called, if entry is missing we fetch the missing block from the state cache, compute the entry, then insert it.

eventually we can preinsert on new blocks.

crates/rpc/rpc/src/eth/cache/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/cache/mod.rs Outdated Show resolved Hide resolved
@mattsse mattsse linked an issue Oct 27, 2023 that may be closed by this pull request
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great progress, this is really starting to take form.

left some suggestions.
the most complex part will be the static percentiles approximation

crates/rpc/rpc-builder/src/lib.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
@allnil allnil marked this pull request as ready for review November 20, 2023 22:31
@allnil allnil requested a review from mattsse November 22, 2023 10:30
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great, really happy with how this turned out.

only have last structural nits.

I'll merge these after today's alpha release so we have enough time to test this a bit more before shipping it in the next

crates/rpc/rpc/src/eth/api/mod.rs Outdated Show resolved Hide resolved
@allnil allnil requested a review from Evalir as a code owner November 22, 2023 19:28
@allnil allnil requested a review from mattsse November 22, 2023 19:30
@mattsse mattsse added this pull request to the merge queue Nov 27, 2023
Merged via the queue into paradigmxyz:main with commit 563a683 Nov 27, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve feeHistory performance
2 participants