Skip to content

Conversation

rudy-6-4
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the cla-signed label Jul 10, 2025
@rudy-6-4 rudy-6-4 changed the base branch from main to release/0.7.x July 10, 2025 15:18
Copilot

This comment was marked as outdated.

@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch 4 times, most recently from 819e4f3 to f866b22 Compare July 13, 2025 13:35
@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch 2 times, most recently from 7d63331 to 0bdd7f4 Compare July 23, 2025 10:37
@rudy-6-4 rudy-6-4 requested a review from Copilot July 23, 2025 14:55
Copilot

This comment was marked as outdated.

@rudy-6-4 rudy-6-4 requested a review from antoniupop July 24, 2025 07:45
@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch from 0bdd7f4 to 5e7f08c Compare July 24, 2025 07:57
@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch 3 times, most recently from 759fc25 to 1917224 Compare July 28, 2025 15:06
@rudy-6-4 rudy-6-4 requested a review from Copilot July 28, 2025 15:14
Copy link

@Copilot 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 implements blockchain reorganization (reorg) detection and handling for the fhevm-listener service. The changes add the ability to detect when the blockchain has reorganized and ensure no events are lost during these reorganizations.

  • Adds comprehensive reorg detection using block history tracking
  • Implements missing ancestor block retrieval during reorgs
  • Adds integration tests for reorg scenarios with event emission and validation

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
integration_test.rs Adds reorg simulation tests and modifies event emission to support reorg testing scenarios
mod.rs Implements core reorg detection logic with block history tracking and missing ancestor retrieval
block_history.rs New module for maintaining blockchain history to detect reorganizations
Cargo.toml Adds anyhow dependency for error handling
coprocessor-cargo-tests.yml Adds CI test for reorg scenarios

@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch from 1917224 to b7298a0 Compare July 28, 2025 17:04
Copy link
Collaborator

@antoniupop antoniupop left a comment

Choose a reason for hiding this comment

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

LGTM! If we can have a retry mechanism, for the catchup in case of missing block I think it's fine.

Copy link
Collaborator

@dartdart26 dartdart26 left a comment

Choose a reason for hiding this comment

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

Code looks OK, but I cannot verify if it works correctly just by looking at it, so it is hard for me to give good feedback. Nevertheless, I will approve and we can try test and see if it works in real conditions.

@rudy-6-4 rudy-6-4 force-pushed the rudy/release/reorgs branch from b7298a0 to 415d75a Compare July 29, 2025 13:25
@rudy-6-4
Copy link
Contributor Author

I have added retry for get_block and get_current_block

@rudy-6-4 rudy-6-4 merged commit 85411a6 into release/0.7.x Jul 29, 2025
66 of 67 checks passed
@rudy-6-4 rudy-6-4 deleted the rudy/release/reorgs branch July 29, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants