Skip to content

2045 - fix rollback tests#2049

Merged
kderme merged 5 commits intomasterfrom
2045-fix-rollback-tests
Mar 14, 2026
Merged

2045 - fix rollback tests#2049
kderme merged 5 commits intomasterfrom
2045-fix-rollback-tests

Conversation

@Cmdv
Copy link
Copy Markdown
Contributor

@Cmdv Cmdv commented Dec 15, 2025

Description

This fixes #2045 #2050

Fixed two bugs in db-sync:

Bug 1: ChainSync client hang after genesis fallback
After re-intersecting at genesis, clientTip wasn't reset to Origin, causing the pipeline policy to think the client was ahead of the server and stop requesting blocks.
Fix: Reset clientTip to Origin when re-intersecting at genesis.

Bug 2: Missing database fallback for intersection points
When no ledger state snapshots are available after restart, getLatestPoints had no intersection points to sync from.
Fix: Query database for recent blocks when no snapshots are available.

Checklist

  • Commit sequence broadly makes sense
  • Commits have useful messages
  • New tests are added if needed and existing tests are updated
  • Any changes are noted in the changelog
  • Code is formatted with fourmolu on version 0.17.0.0 (which can be run with scripts/fourmolize.sh)
  • Self-reviewed the diff

Migrations

  • The pr causes a breaking change of type a,b or c
  • If there is a breaking change, the pr includes a database migration and/or a fix process for old values, so that upgrade is possible
  • Resyncing and running the migrations provided will result in the same database semantically

If there is a breaking change, especially a big one, please add a justification here. Please elaborate
more what the migration achieves, what it cannot achieve or why a migration is not possible.

@Cmdv Cmdv requested a review from a team as a code owner December 15, 2025 21:08
@Cmdv Cmdv force-pushed the 2045-fix-rollback-tests branch from 0a44feb to b168f55 Compare January 2, 2026 13:43
@Cmdv Cmdv force-pushed the 2045-fix-rollback-tests branch 2 times, most recently from 93414e1 to 5a932ab Compare February 20, 2026 15:42
@Cmdv Cmdv force-pushed the 2045-fix-rollback-tests branch 2 times, most recently from 5c0c116 to 5748817 Compare March 10, 2026 10:12
@kderme kderme force-pushed the 2045-fix-rollback-tests branch from 5748817 to c5df1e6 Compare March 10, 2026 22:31
@kderme kderme force-pushed the 2045-fix-rollback-tests branch from c5df1e6 to 06a4cc9 Compare March 10, 2026 22:42
@kderme
Copy link
Copy Markdown
Contributor

kderme commented Mar 11, 2026

I removed the DBSync fixes. I think they were not necessery, tests pass without them and one of them was introducing an issue. I also made sure the block after a rollback is a new one, so deletion is always triggered on the DBSync side. Finaly I added DBSYNC_TEST_LOG env variable for an easy way to enable tests.

@kderme kderme merged commit 6cedcdf into master Mar 14, 2026
21 checks passed
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.

Rollback tests don't really rollback

2 participants