Skip to content

avoid fetch storages already in db#898

Merged
xlc merged 4 commits intomasterfrom
improve-fetch
Mar 27, 2025
Merged

avoid fetch storages already in db#898
xlc merged 4 commits intomasterfrom
improve-fetch

Conversation

@xlc
Copy link
Copy Markdown
Member

@xlc xlc commented Mar 27, 2025

closes #897

this don't eliminate getKeysPaged call which requires we store fetch ranged in db but should significantly reduce RPC requests with a prefetched db

@xlc xlc requested a review from ermalkaleci March 27, 2025 00:11
const newBatch: HexString[] = []

for (const key of batch) {
const res = await this.#db.queryStorage(this.#at, key)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it will be better if we add additional api to check existing keys in batches

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it is not too slow to make 1000 requests to sqlite but yeah we can improve it #899

@xlc xlc merged commit c6bb60f into master Mar 27, 2025
5 checks passed
@xlc xlc deleted the improve-fetch branch March 27, 2025 08:50
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.

Prefetch storages becomes useless by background storage fetch

2 participants