Skip to content
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(rpc): Add invalidateblock and reconsiderblock RPC methods #9266

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

arya2
Copy link
Contributor

@arya2 arya2 commented Feb 18, 2025

Motivation

This PR adds the invalidateblock and reconsiderblock RPC methods to enable more ergonomic integration testing with side chains and chain re-organizations.

This PR is a draft as it's still missing tests.

Closes #8848
Closes #8847
Closes #8846
Closes #8845
Closes #8844
Closes #8843

Depends-On: #9260.

Solution

  • Updates non-finalized block write channel message type to an enum with Invalidate and Reconsider variants
  • Adds state requests to send those messages to the channel
  • Handles the messages in the block write task by calling invalidate_block() or reconsider_block() and updating the chain channels

Related changes:

  • Refactors block write task into a struct (feedback on how to improve it further would be appreciated)

Tests

This PR still needs tests.

Follow-up Work

PR Author's Checklist

  • The PR name will make sense to users.
  • The PR provides a CHANGELOG summary.
  • The solution is tested.
  • The documentation is up to date.
  • The PR has a priority label.

PR Reviewer's Checklist

  • The PR Author's checklist is complete.
  • The PR resolves the issue.

…r` variants to use as non-finalized block write sender message type.

Adds a match statement invalidating or reconsidering blocks in the non-finalized state, updating the chain channels, and continuing to check for the next message when the Invalidate or Reconsider messages are received.
@arya2 arya2 added S-blocked Status: Blocked on other tasks C-cleanup Category: This is a cleanup A-rpc Area: Remote Procedure Call interfaces A-state Area: State / database changes P-Medium ⚡ labels Feb 18, 2025
@arya2 arya2 self-assigned this Feb 18, 2025
@github-actions github-actions bot added the C-feature Category: New features label Feb 18, 2025
@arya2 arya2 requested a review from upbqdn February 18, 2025 06:15
@mpguerra mpguerra removed the request for review from a team March 6, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Area: Remote Procedure Call interfaces A-state Area: State / database changes C-cleanup Category: This is a cleanup C-feature Category: New features P-Medium ⚡ S-blocked Status: Blocked on other tasks
Projects
None yet
2 participants