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

chore(core-state): autoIndex option #3985

Merged
merged 9 commits into from
Aug 28, 2020
Merged

Conversation

sebastijankuzner
Copy link
Contributor

@sebastijankuzner sebastijankuzner commented Aug 28, 2020

Summary

Implements autoIndex option on indexes. When autoIndex is enabled, WalletRepository.index(wallet) method will remove all known index entries by wallet and will reindex wallet, otherwise developer is responsible to manually use index, set or delete methods directly on index.

Disabling autoIndex option is useful in cases when index hold a lot of entries for the wallet and manual control over index will increase node performance.

Checklist

  • Tests (if necessary)
  • Ready to be merged

@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #3985 into develop will increase coverage by 1.75%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3985      +/-   ##
===========================================
+ Coverage    96.24%   98.00%   +1.75%     
===========================================
  Files          631      631              
  Lines        14577    14578       +1     
  Branches      1729     1729              
===========================================
+ Hits         14030    14287     +257     
+ Misses         387      131     -256     
  Partials       160      160              
Flag Coverage Δ
#functional 6.80% <0.00%> (?)
#integration 9.88% <0.00%> (-0.01%) ⬇️
#unit 96.17% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...re-magistrate-transactions/src/service-provider.ts 100.00% <ø> (ø)
.../core-state/src/wallets/indexers/wallet-indexes.ts 93.33% <ø> (ø)
packages/core-state/src/wallets/wallet-index.ts 100.00% <100.00%> (ø)
...ckages/core-state/src/wallets/wallet-repository.ts 92.08% <100.00%> (ø)
...re-test-framework/src/utils/transaction-factory.ts 98.86% <0.00%> (+2.84%) ⬆️
packages/core-database/src/utils/transform.ts 100.00% <0.00%> (+25.00%) ⬆️
...core-database/src/repositories/round-repository.ts 87.50% <0.00%> (+50.00%) ⬆️
...-framework/src/matchers/functional/vote-balance.ts 90.00% <0.00%> (+70.00%) ⬆️
...atabase/src/repositories/transaction-repository.ts 100.00% <0.00%> (+78.37%) ⬆️
...core-database/src/repositories/block-repository.ts 89.04% <0.00%> (+80.82%) ⬆️
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36878fc...d51f409. Read the comment docs.

Copy link
Contributor

@rainydio rainydio left a comment

Choose a reason for hiding this comment

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

All in all it makes perfect sense. If index isn't complicated (most cases), then you can rely on automatic re-indexing. Otherwise you'll have to call getIndex and do everything manually and carefully.

@air1one air1one merged commit 51d01a2 into develop Aug 28, 2020
@ghost ghost deleted the chore/core-state/performant-index branch August 28, 2020 14:12
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.

3 participants