-
Notifications
You must be signed in to change notification settings - Fork 205
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
Migrate data trie #4962
Migrate data trie #4962
Conversation
…grate-data-trie # Conflicts: # go.mod # go.sum
Codecov ReportBase: 70.86% // Head: 70.86% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## feat/balance-data-tries #4962 +/- ##
=========================================================
Coverage 70.86% 70.86%
=========================================================
Files 666 666
Lines 86513 86642 +129
=========================================================
+ Hits 61309 61402 +93
- Misses 20595 20615 +20
- Partials 4609 4625 +16
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
trie/patriciaMerkleTrie.go
Outdated
return errors.ErrNilTrieMigrator | ||
} | ||
|
||
if newVersion > core.MaxValidTrieNodeVersion || oldVersion > core.MaxValidTrieNodeVersion { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will raise backward-compatible issues when we will have another implementation. Suggestion to completely replace the core.MaxValidTrieNodeVersion with a specialized component that is epoch-aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
trie/patriciaMerkleTrie.go
Outdated
return fmt.Errorf("%w: newVersion %v, oldVersion %v", errors.ErrInvalidTrieNodeVersion, newVersion, oldVersion) | ||
} | ||
|
||
if newVersion == core.NotSpecified && oldVersion == core.AutoBalanceEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be a function that will handle all the incompatible values that we might have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted all the version checks in a new func.
process/gasCost.go
Outdated
@@ -28,6 +28,8 @@ type BuiltInCost struct { | |||
ESDTNFTAddUri uint64 | |||
ESDTNFTUpdateAttributes uint64 | |||
ESDTNFTMultiTransfer uint64 | |||
TrieLoad uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a little bit misleading name. This is actually TrieLoadPerLeaf
cost. Also the next Store cost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for TrieStorePerLeaf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to TrieLoadPerNode
and TrieStorePerLoad
process/gasCost.go
Outdated
@@ -28,6 +28,8 @@ type BuiltInCost struct { | |||
ESDTNFTAddUri uint64 | |||
ESDTNFTUpdateAttributes uint64 | |||
ESDTNFTMultiTransfer uint64 | |||
TrieLoad uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for TrieStorePerLeaf
# Conflicts: # go.mod # go.sum # testscommon/trie/trieStub.go # trie/patriciaMerkleTrie_test.go
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?