-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat(state): Implements reconsider_block method #9260
base: main
Are you sure you want to change the base?
feat(state): Implements reconsider_block method #9260
Conversation
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! This looks good, I left a suggestion for some cleanup, but there are no blockers to merging this as-is if preferred.
This pull request has been removed from the queue for the following reason: Pull request #9260 has been dequeued, merge conditions unmatch:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
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 is looking great, thank you for adding the IndexMap
.
There's one small issue around adding chains to the non-finalized state with roots below the finalized tip, but otherwise this PR looks ready to merge.
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!! 🎉 🎉 🎉
@Mergifyio update |
❌ Mergify doesn't have permission to updateFor security reasons, Mergify can't update this pull request. Try updating locally. |
@elijahhampton could you do a rebase off main? |
Yes |
b6b119d
to
b6b0474
Compare
@elijahhampton the order of commits and the overall diff still don't look right, let me know if you'd like some help with the rebase via direct commits to this branch or on a fork. |
@arya2 Hey, if you don't mind, please and thank you. |
…m validate_and_commit if a candidate block's hash is in the map of invalidated blocks. Stores invalidated_blocks by height and clears when finalizing. Checks against non finalized tip hash to create a new chain if parnt_chain doesn't exist. Renames ReconsiderError variant NonPreviouslyInvalidatedBlock to MissingInvalidatedBlock.
…). Removes unused ReconsiderError variant. Opts to refuse block consideration if parent_chain does not exist. Adds db handle to reconsider_block function. Edits max blocks constant documentation
…ized blocks only before checking parent_chain.
b6b0474
to
d71f7ec
Compare
@Mergifyio refresh |
✅ Pull request refreshed |
@mergify refresh |
✅ Pull request refreshed |
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
Motivation
The changes create and test a reconsider_block method to later be integrated into the zebra RPC. This method reconsiders previously invalidated_blocks into a chain that exist in the chain_set. Closes #8842.
Specifications & References
NonFinalizedState
via RPC methods #8634reconsider_block()
method to theNonFinalizedState
for validating/committing a previously invalidated block and its invalidated descendents #8842Solution
reconsider_block
method toNonFinalizedState
that allows previously invalidated blocks to be reconsidered and re-inserted into the chain.Tests
Follow-up Work
PR Author's Checklist
PR Reviewer's Checklist