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

[trie] Introduce GenericTrieNode as replacement of GenericUpdatedTrieNode #12496

Merged
merged 2 commits into from
Nov 25, 2024

Conversation

shreyan-gupta
Copy link
Contributor

This PR introduces the GenericTrieNode which is a generalization on top of GenericUpdatedTrieNode where the nodes need not be an update type node.

This is useful in scenarios where we are not dealing with just updates, for example generalizing iterators over tries etc.

Along with this change this PR renames GenericUpdatedNodeId to UpdatedNodeId which is more appropriate as for both memtries and store tries we have UpdatedNodeId as usize.

@shreyan-gupta shreyan-gupta requested a review from a team as a code owner November 21, 2024 16:48
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 93.54839% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.85%. Comparing base (9e4933b) to head (e8ee3b4).
Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
core/store/src/trie/mod.rs 66.66% 3 Missing ⚠️
core/store/src/trie/ops/interface.rs 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12496      +/-   ##
==========================================
+ Coverage   69.84%   69.85%   +0.01%     
==========================================
  Files         838      838              
  Lines      169410   169429      +19     
  Branches   169410   169429      +19     
==========================================
+ Hits       118323   118356      +33     
+ Misses      45840    45820      -20     
- Partials     5247     5253       +6     
Flag Coverage Δ
backward-compatibility 0.16% <0.00%> (-0.01%) ⬇️
db-migration 0.16% <0.00%> (-0.01%) ⬇️
genesis-check 1.29% <0.00%> (-0.01%) ⬇️
linux 69.16% <93.54%> (-0.01%) ⬇️
linux-nightly 69.43% <93.54%> (+<0.01%) ⬆️
macos 51.02% <93.54%> (+0.01%) ⬆️
pytests 1.60% <0.00%> (-0.01%) ⬇️
sanity-checks 1.40% <0.00%> (-0.01%) ⬇️
unittests 69.68% <93.54%> (+0.01%) ⬆️
upgradability 0.21% <0.00%> (-0.01%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Longarithm Longarithm left a comment

Choose a reason for hiding this comment

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

Wow, this is great.
Once we get rid of old trie node structs, can we remove the prefix "Generic" from structs? This word doesn't tell anything because <> already show that struct is generic.

@shreyan-gupta
Copy link
Contributor Author

Wow, this is great. Once we get rid of old trie node structs, can we remove the prefix "Generic" from structs? This word doesn't tell anything because <> already show that struct is generic.

Yes, will do once we can remove the current version of trie nodes.

@shreyan-gupta shreyan-gupta added this pull request to the merge queue Nov 25, 2024
Merged via the queue into master with commit 9407fe9 Nov 25, 2024
28 checks passed
@shreyan-gupta shreyan-gupta deleted the shreyan/trie/generic_trie_node branch November 25, 2024 19:06
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.

2 participants