-
Notifications
You must be signed in to change notification settings - Fork 197
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
Pruning bugfix #4160
Pruning bugfix #4160
Conversation
Codecov Report
@@ Coverage Diff @@
## rc/2022-june #4160 +/- ##
================================================
+ Coverage 75.27% 75.31% +0.03%
================================================
Files 617 618 +1
Lines 82418 82451 +33
================================================
+ Hits 62043 62099 +56
+ Misses 15685 15659 -26
- Partials 4690 4693 +3
Continue to review full report at Codecov.
|
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.
👍
GJ implementing this
state/pruningHandler.go
Outdated
} | ||
|
||
// NewPruningHandler returns a new instance of pruningHandler with the given parameters | ||
func NewPruningHandler(isPruningEnabled bool) *pruningHandler { |
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.
Why not creating 2 constructors instead of one that requires a bool passing?
Something like:
NewEnabledPruningHandler
NewDisabledPruningHandler
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.
Was thinking that if in the future we add more options, the number of constructors will grow exponentially 😄
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.
Ok, valid point.
Then, can we define a type for that constructor (in the same state/pruningHandler.go) file
type PruningHandlerOperation bool
const EnableDataRemoval PruningHandlerOperation = true
const DisableDataRemoval PruningHandlerOperation = false
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.
process/block/metablock.go
Outdated
pruningQueueSize := arguments.Config.StateTriesConfig.PeerStatePruningQueueSize | ||
pruningDelay := uint32(pruningQueueSize * pruningDelayMultiplier) | ||
if pruningDelay < defaultPruningDelay { | ||
log.Warn("using default pruning delay", "peer state pruning queue size", pruningQueueSize) |
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.
I think this will be used also on the metachain's user account. Suggestion to change the message accordingly.
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
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.
System test passed.
@@ Log scanner @@
pruning-bugfix
================================================================================
- Known Warnings 9
- New Warnings 0
- Known Errors 0
- New Errors 0
- Panics 0
================================================================================
After a node restarts, delay the trie nodes removal from db in order to give the evictionWaitingList enough time to build the pruning history.