Skip to content

Conversation

@dai1975
Copy link
Contributor

@dai1975 dai1975 commented Sep 1, 2025

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:

  • main logic uses only prove=false query resut
  • move SetupHeadersForUpdate and ProveState to later part
  • SeupHeadersForUpdate and ProveState runs parallel per chain to avoid lost state because of later SetupHeadersForUpdate chain

I plan this series of pull-req constructs below and this is first part of it.

Daisuke Kanda added 6 commits August 29, 2025 16:49
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>
@dai1975 dai1975 changed the title Lo7181b 1 impl fix about lost blockchain state: 2nd PR: implements chain independent update Sep 1, 2025
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
@dai1975 dai1975 requested a review from Copilot September 3, 2025 10:22
Copy link

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 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.

@dai1975 dai1975 requested a review from siburu September 3, 2025 10:31
Daisuke Kanda added 4 commits September 4, 2025 02:25
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>
@dai1975 dai1975 marked this pull request as ready for review September 8, 2025 01:27
@dai1975 dai1975 requested a review from a team as a code owner September 8, 2025 01:27
Copy link
Contributor

@siburu siburu left a 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.

Daisuke Kanda added 2 commits September 10, 2025 01:36
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
Daisuke Kanda added 4 commits September 10, 2025 08:46
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>
Copy link
Contributor

@siburu siburu left a 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!!!

@siburu siburu merged commit f2e9f3c into hyperledger-labs:features/lo7181-2 Sep 16, 2025
9 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.

2 participants