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

Prefill GetTipsetByHeight skiplist cache on lotus startup #10955

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Jun 5, 2023

Context
The GetTipsetByHeight method internally maintains a skiplist to more efficiently lookup a tipsets at a given height.

When users call a RPC method that call this method (for example eth_getBlockByNumber) then if this skiplist is not already cached then the user needs to wait until this skiplist is populated in the background which can take 10 minutes or longer.

Instead, lets just always populate and fully prefill this skiplist in the background as soon as lotus starts up (only when EnableEthRPC is set). This will not fix the issue, but it will be more likely to give better user experience.

Test plan

Compiled and restarted Lotus and observed the skiplist was generated on startup

2023-06-05T17:43:59.757-0500	INFO	modules	modules/ethmodule.go:61	Start prefilling GetTipsetByHeight cache
...
2023-06-05T17:44:41.722-0500	INFO	modules	modules/ethmodule.go:66	Prefilling GetTipsetByHeight done in 41.965361958s

@fridrik01 fridrik01 force-pushed the prefill-skiplist-on-lotus-startup branch from 41f4ad5 to d3fed20 Compare June 6, 2023 13:13
@fridrik01 fridrik01 marked this pull request as ready for review June 6, 2023 13:16
@fridrik01 fridrik01 requested a review from a team as a code owner June 6, 2023 13:16
@arajasek
Copy link
Contributor

arajasek commented Jun 6, 2023

./scripts/fiximports should make CI green

@fridrik01 fridrik01 force-pushed the prefill-skiplist-on-lotus-startup branch from d3fed20 to a27e0a8 Compare June 6, 2023 20:17
@fridrik01 fridrik01 merged commit 7fea179 into master Jun 6, 2023
88 of 93 checks passed
@fridrik01 fridrik01 deleted the prefill-skiplist-on-lotus-startup branch June 6, 2023 20:29
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.

None yet

2 participants