-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: seed forking handler with unconfirmed blocks to improve startup …
…stability (#505) ### Description If Chainhook restarts in the middle of a reorg taking place, it doesn't have any context for choosing the canonical fork. Then when block collisions take place, Chainhook fails to process the new blocks, causing gaps in the blocks Chainhook has available for evaluation. This PR seeds the stacks block indexer with unconfirmed blocks on startup, so that Chainhook has the necessary context to handle a reorg. Most of the PR is to add two tests: - I've added some new functionality to our very thorough indexer tests - In addition to providing the blocks to be mined and the order to mine them, we also now allow providing some "unconfirmed" blocks to seed the block pool with. - I've added some test cases that reproduce what caused outages on the Platform's Chainhook node - I've added a new service test that: - Verifies that unconfirmed blocks are stored on restart - Verifies that those blocks are used to seed the block pool, and that a reorg is handled correctly. I committed these tests _before_ adding the fix, so you can confirm the fix by checking out the commits with the new tests (96d8249b239e53a877a98ff493ef7ae3571aca37 and 9aad55e2a88bf5b75c3e49d079c5967b7a8cf0e3), seeing that the tests break, then pulling the last commit to see that the fix works. Fixes #487
- Loading branch information
1 parent
5a7d64e
commit a84fc4c
Showing
14 changed files
with
851 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.