-
Notifications
You must be signed in to change notification settings - Fork 660
Rudy/release/reorgs #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rudy/release/reorgs #551
Conversation
819e4f3
to
f866b22
Compare
7d63331
to
0bdd7f4
Compare
0bdd7f4
to
5e7f08c
Compare
coprocessor/fhevm-engine/fhevm-listener/src/cmd/block_history.rs
Outdated
Show resolved
Hide resolved
759fc25
to
1917224
Compare
There was a problem hiding this 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 |
coprocessor/fhevm-engine/fhevm-listener/tests/integration_test.rs
Outdated
Show resolved
Hide resolved
coprocessor/fhevm-engine/fhevm-listener/tests/integration_test.rs
Outdated
Show resolved
Hide resolved
1917224
to
b7298a0
Compare
There was a problem hiding this 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.
There was a problem hiding this 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.
coprocessor/fhevm-engine/fhevm-listener/src/cmd/block_history.rs
Outdated
Show resolved
Hide resolved
b7298a0
to
415d75a
Compare
I have added retry for get_block and get_current_block |
No description provided.