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

Reorg Support: Handling of orphaned blocks #617

Draft
wants to merge 16 commits into
base: reorg-support
Choose a base branch
from

Conversation

kuba-4chain
Copy link
Collaborator

@kuba-4chain kuba-4chain commented Oct 22, 2024

Description of Changes

  1. Handling of orphaned blocks was implemented
    • for each incoming block, a check is performed for orphaned chains that may be missing that block as a parent
    • if an orphaned chain is found and there is a fork of chains - the tip of that orphaned chain is being verified against the tip of current longest chain, instead of the incoming block
  2. Unused orphadyned field was removed from database.
  3. A transaction and a table lock (for table blocks) was introduced for block processing, so that only one block can be processed at a time. This allows for a simpler logic of this already quite complicated flow and avoids a lot of concurrency errors.
  4. An integration test was refactored and updated to check most of possible edge cases regarding orphaned blocks handling.

Linked Issues / Tickets

#ARCO-199

Testing Procedure

Describe the tests you've added or any testing steps you've taken.

  • I have added new unit tests
  • All tests pass locally
  • I have tested manually in my local environment

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have updated CHANGELOG.md with my changes

@kuba-4chain kuba-4chain marked this pull request as draft October 22, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant