Skip to content

chore(blockstore): add an LRU cache to the API blockstore wrapper#12878

Merged
rvagg merged 2 commits intomasterfrom
rvagg/apiblockstorecache
Feb 11, 2025
Merged

chore(blockstore): add an LRU cache to the API blockstore wrapper#12878
rvagg merged 2 commits intomasterfrom
rvagg/apiblockstorecache

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Feb 7, 2025

I've been relying on NewAPIBlockstore a lot lately for lotus-shed commands, miscellaneous things to inspect state mainly, where I don't want to stop my node to mount it as the blockstore. But realised that a lot of the fetches are for the same small blocks because we have a lot of things like THE empty partition, THE empty deadline, THE empty HAMT. It turns out that putting a simple LRU in there makes it so much faster to do simple iteration and checking when you're hitting these things.

This is mainly used in lotus-shed, but it has a few uses in the lotus command, specifically for some things under lotus filplus, lotus miner info and lotus multisig. The spcli commands also use this a little.

@rvagg rvagg added the skip/changelog This change does not require CHANGELOG.md update label Feb 7, 2025
@rvagg rvagg requested a review from masih February 7, 2025 02:35
Copy link
Copy Markdown
Member

@masih masih left a comment

Choose a reason for hiding this comment

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

No blockers.

Comment thread blockstore/api.go Outdated
Comment thread blockstore/api.go Outdated
Comment thread blockstore/api.go Outdated
Comment thread blockstore/api.go Outdated
Comment thread blockstore/api.go Outdated
Comment thread blockstore/api.go
Comment thread blockstore/api.go
Comment thread blockstore/api.go Outdated
@rvagg rvagg merged commit f77a835 into master Feb 11, 2025
@rvagg rvagg deleted the rvagg/apiblockstorecache branch February 11, 2025 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: ☑️ Done (Archive)

Development

Successfully merging this pull request may close these issues.

2 participants