-
Notifications
You must be signed in to change notification settings - Fork 33
fix about lost blockchain state: 2nd PR: implements chain independent update #176
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
fix about lost blockchain state: 2nd PR: implements chain independent update #176
Conversation
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
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 chain-independent updates to prevent lost blockchain state issues in relayer operations. The changes refactor the core relay logic to run SetupHeadersForUpdate and ProveState operations in parallel per chain instead of sequentially, addressing the problem where long header update times on one chain cause state queries to fail on another due to dropped old state.
Key changes:
- Parallel processing: Refactors relay operations to use goroutines for concurrent execution per chain direction
- Proof generation restructuring: Moves proof generation logic into separate functions that run concurrently
- Test infrastructure updates: Adds new test scripts and increases timeouts to support the async behavior
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/cases/tm2tm/scripts/test-tx-fakelost | New test script for transaction relay with simulated lost state conditions |
| tests/cases/tm2tm/scripts/test-service-fakelost | New test script for service relay with simulated lost state and timing validation |
| tests/cases/tm2tm/scripts/test-channel-upgrade | Updates timeouts and adds debug environment variables for channel upgrade tests |
| tests/cases/tm2tm/scripts/handshake | Adds debug environment variables for handshake operations |
| tests/cases/tm2tm/Makefile | Adds new test scripts to test suite |
| tests/cases/docker-compose-test.yaml | Increases channel upgrade timeout from 20s to 50s |
| log/slog.go | Adds new relative logging methods for channel and connection pairs |
| core/service.go | Refactors relay service to use parallel execution with errgroup |
| core/query.go | Extracts proof generation into separate reusable functions |
| core/provers.go | Adds documentation note about ProveHostConsensusState |
| core/naive-strategy.go | Refactors strategy methods to support directional relay operations |
| core/connection.go | Implements future-based concurrent proof generation for connection operations |
| core/channel.go | Implements future-based concurrent proof generation for channel operations |
| core/channel-upgrade.go | Updates channel upgrade logic to use concurrent proof generation |
| cmd/tx.go | Updates transaction commands to use new parallel relay structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
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.
@dai1975 Thank you for your great work. Basically OK, but I found some points to fix.
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
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.
@dai1975 LGTM, thank you very much!!!
In case of optimism-bsc relay, at optimism it takes long time to update headers and then failed in querying to bsc node because it drops old state.
This series of pull-req changes current logic to:
I plan this series of pull-req constructs below and this is first part of it.