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

use query storage helper #1051

Merged
merged 9 commits into from
Nov 29, 2024
Merged

use query storage helper #1051

merged 9 commits into from
Nov 29, 2024

Conversation

shunjizhan
Copy link
Collaborator

@shunjizhan shunjizhan commented Nov 11, 2024

Change

Using api to query storage still has the memory issue polkadot-js/api#5981, so we switch back to the original query storage helper, but removed all cache for storage query. This is because there was a bug in the cache, and as we mentioned in #1039, caching storage won't be too useful.

We still keep the blockHash => { blockNumber, Header, BlockData } cache introduced in #1039 , which are commonly used. We keep the apiAt cache as well, which can speed up runtime calls.

fix #1059

Although there is a small inconsistency when querying system.account compared to apiAt.query, it does not affect our use case (we have been using this for a long time anyways). But in the future it would be nice to make it better, maybe @ntduan can take a look at #1060 when you got a chance?

Test

all tests still pass (except the skipped one for storage query helper)

@shunjizhan shunjizhan requested review from xlc and zjb0807 November 29, 2024 05:46
@shunjizhan shunjizhan marked this pull request as ready for review November 29, 2024 05:47
Copy link
Member

@zjb0807 zjb0807 left a comment

Choose a reason for hiding this comment

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

I don't seem to see the changes related to #1052

@shunjizhan
Copy link
Collaborator Author

yeah #1052 is not related, it might be some docker issue, let's keep that issue open for now

@shunjizhan shunjizhan merged commit 521e9fa into master Nov 29, 2024
14 checks passed
@shunjizhan shunjizhan deleted the use-query-storage-helper branch November 29, 2024 06:27
Copy link

codecov bot commented Nov 29, 2024

Codecov Report

Attention: Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.15%. Comparing base (ce8fd1d) to head (30b256a).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
packages/eth-providers/src/utils/queryStoarge.ts 95.23% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1051      +/-   ##
==========================================
+ Coverage   74.51%   78.15%   +3.63%     
==========================================
  Files          55       56       +1     
  Lines        3178     2737     -441     
  Branches      808      624     -184     
==========================================
- Hits         2368     2139     -229     
+ Misses        786      585     -201     
+ Partials       24       13      -11     
Files with missing lines Coverage Δ
packages/eth-providers/src/base-provider.ts 83.53% <100.00%> (+10.66%) ⬆️
packages/eth-providers/src/utils/parseBlock.ts 95.40% <100.00%> (-0.21%) ⬇️
packages/eth-providers/src/utils/queryStoarge.ts 95.23% <95.23%> (ø)

... and 4 files with indirect coverage changes

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.

JavaScript heap out of memory on v2.9.4
2 participants