-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add invalidate block method and invalidated_blocks field to NonFinalizedState #9167
base: main
Are you sure you want to change the base?
Add invalidate block method and invalidated_blocks field to NonFinalizedState #9167
Conversation
…se in vectors.rs. Updates non finalized state to track invalidated_blocks
…date-block-method-to-nonfinalizedstate
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.
Thank you for getting this done.
This looks excellent. I left some optional suggestions, but none of them are blockers so feel free to resolve them without making changes if you'd like this to merge as-is.
… values with Arc. Optimizies invalidate_block fn to return early if root has hash of desired block.
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.
Thank you for the updates!
I left a suggestion for refactoring the methods, but if you'd prefer to keep it as-is, the only blocker is updating the invalidated_blocks
field before returning early in NonFinalizedState.invalidate_block()
.
…Refactors invalidate_block in NonFinalizedState.
I refactored the functions with the suggested changes |
Motivation
This PR implements a new method invalidate_block to invalidate a block based on the block::Hash along with the blocks descendants. This PR closes the following issue: #8840 , #8841
Specifications & References
Reference: #8634
Solution
Tests
Follow-up Work
PR Author's Checklist
PR Reviewer's Checklist