Skip to content

[M-01] Fix Non-atomic Reorg Cleanup in DeleteLogsAndBlocksAfter#421

Merged
dhaidashenko merged 1 commit intodevelopfrom
fix/PLEX-2777-M-01-Non-atomic-DeleteLogsAndBlocksAfter
Apr 14, 2026
Merged

[M-01] Fix Non-atomic Reorg Cleanup in DeleteLogsAndBlocksAfter#421
dhaidashenko merged 1 commit intodevelopfrom
fix/PLEX-2777-M-01-Non-atomic-DeleteLogsAndBlocksAfter

Conversation

@dhaidashenko
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 14, 2026 12:36
@dhaidashenko dhaidashenko requested a review from a team as a code owner April 14, 2026 12:36
@github-actions
Copy link
Copy Markdown
Contributor

👋 dhaidashenko, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown
Contributor

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-evm

View full report

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a transactional correctness bug in the log poller ORM where reorg cleanup deletes could run outside the intended database transaction, making the cleanup non-atomic.

Changes:

  • Ensure DeleteLogsAndBlocksAfter executes its DELETE statements using the transactional ORM datasource (orm.ds) inside Transact.
  • Add a regression test that detects accidental execution on the outer connection pool datasource.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/logpoller/orm.go Switch DELETE execution from o.ds to transactional orm.ds within Transact to guarantee atomic cleanup.
pkg/logpoller/orm_test.go Add a datasource wrapper + test to confirm DeleteLogsAndBlocksAfter uses the transactional datasource (no pool ExecContext calls).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhaidashenko dhaidashenko enabled auto-merge (squash) April 14, 2026 18:00
@dhaidashenko dhaidashenko merged commit f6d1995 into develop Apr 14, 2026
38 checks passed
@dhaidashenko dhaidashenko deleted the fix/PLEX-2777-M-01-Non-atomic-DeleteLogsAndBlocksAfter branch April 14, 2026 18:07
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.

4 participants