Skip to content

Conversation

@benesjan
Copy link
Contributor

@benesjan benesjan commented Jan 6, 2026

As Martin mentioned here makes sense to have the reorg handling be atomic. In this PR I tackle that.

Note that this PR doesn't need to be in stack with #19443 but #19451 depends on both so putting this one into stack was the only way to unblock myself working on #19451.

Copy link
Contributor Author

benesjan commented Jan 6, 2026

// Update the header to the last block.
const newHeader = await this.node.getBlockHeader(event.block.number);
if (!newHeader) {
this.log.error(`Block header not found for block number ${event.block.number} during chain prune`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just logging out an error here if the new header is not found seemed incorrect as this would result in an inconsistent PXE state. For this reason I now throw an error here.

@benesjan benesjan force-pushed the 01-06-refactor_atomic_reorg_handling branch from 3ab2740 to cefb7ca Compare January 7, 2026 17:56
@benesjan benesjan requested a review from mverzilli January 7, 2026 21:39
@benesjan benesjan marked this pull request as draft January 9, 2026 03:26
@benesjan benesjan force-pushed the 01-06-refactor_atomic_reorg_handling branch from cefb7ca to eba9c04 Compare January 9, 2026 03:26
@benesjan benesjan changed the base branch from next to graphite-base/19364 January 9, 2026 03:27
@benesjan benesjan force-pushed the 01-06-refactor_atomic_reorg_handling branch from eba9c04 to e5f9c22 Compare January 9, 2026 03:27
@benesjan benesjan changed the base branch from graphite-base/19364 to 01-08-refactor_dropping_notehashleafindexmap January 9, 2026 03:27
@benesjan benesjan marked this pull request as ready for review January 9, 2026 03:29
Copy link
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just consider using some Promise.all where possible/sensible

@AztecBot AztecBot force-pushed the 01-08-refactor_dropping_notehashleafindexmap branch 2 times, most recently from 83a369a to 1e1c8b8 Compare January 12, 2026 13:41
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock, but you should probably address my feedback. Thanks!

Base automatically changed from 01-08-refactor_dropping_notehashleafindexmap to next January 12, 2026 14:15
@benesjan benesjan marked this pull request as draft January 12, 2026 15:20
@benesjan benesjan force-pushed the 01-06-refactor_atomic_reorg_handling branch from e5f9c22 to 44d8dd8 Compare January 12, 2026 15:22
@benesjan benesjan added the ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure label Jan 12, 2026
@benesjan benesjan marked this pull request as ready for review January 12, 2026 16:15
@benesjan benesjan enabled auto-merge January 12, 2026 16:15
@AztecBot
Copy link
Collaborator

AztecBot commented Jan 12, 2026

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/36bfd99b726df49c�36bfd99b726df49c8;;�): yarn-project/end-to-end/scripts/run_test.sh web3signer src/composed/web3signer/e2e_multi_validator_node_key_store.test.ts (37s) (code: 1) (\033Jan Beneš\033: refactor: atomic reorg handling (#19364))
\033FLAKED\033 (8;;http://ci.aztec-labs.com/90ae679d9391023c�90ae679d9391023c8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/gossip_network.test.ts (443s) (code: 1) group:e2e-p2p-epoch-flakes (\033Jan Beneš\033: refactor: atomic reorg handling (#19364))

@AztecBot AztecBot force-pushed the 01-06-refactor_atomic_reorg_handling branch from 1a8468f to a61be37 Compare January 12, 2026 17:59
As Martin mentioned [here](#19327 (comment)) makes sense to have the reorg handling be atomic. In this PR I tackle that.

Note that this PR doesn't need to be in stack with #19443 but #19451 depends on both so putting this one into stack was the only way to unblock myself working on #19451.
@AztecBot AztecBot force-pushed the 01-06-refactor_atomic_reorg_handling branch from a61be37 to 911b2b3 Compare January 12, 2026 18:02
@benesjan benesjan added this pull request to the merge queue Jan 12, 2026
Merged via the queue into next with commit 1596ab9 Jan 12, 2026
17 checks passed
@benesjan benesjan deleted the 01-06-refactor_atomic_reorg_handling branch January 12, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants