-
Notifications
You must be signed in to change notification settings - Fork 485
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
Reduce RAM consumption for ForceProcessing requests #5090
Conversation
O(N) to O(1) in case of processing requests, also reduced storage space requirements for alternative approach
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.
Recommend checking hive test
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.
think about unit tests :)
do | ||
{ | ||
blocksToBeAddedToMain.Add(toBeProcessed); | ||
iterations++; | ||
if (!options.ContainsFlag(ProcessingOptions.ForceProcessing)) |
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.
can we create a variable for that?
bool notReachedTheReorgBoundary = (options & ProcessingOptions.Trace) == ProcessingOptions.Trace | ||
&& (branchingPoint.Number > (_blockTree.Head?.Header.Number ?? 0)); |
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.
better naming needed, now notReachedTheReorgBoundary
is actually trace Or notReachedTheReorgBoundary
@LukaszRozmej @OlegJakushkin How about those unit tests which should be added? |
This reverts commit 44ba349.
Reduces RAM consumption for ForceProcessing requests. Keeping original flow and logic that can be updated in the future.
Changes
Minimal flag checks
Types of changes
flag checks added
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Covered by existing tests