Skip to content

Conversation

@antonis19
Copy link
Member

cherry-pick of #16946

Fixes: #16026


@antonis19 antonis19 requested a review from Copilot September 2, 2025 13:19
Copy link
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 updates the integration command to use Polygon services when initializing the consensus engine, aligning with the main Ethereum backend architecture. It modifies the block reader setup to accept explicit parameters instead of node configuration objects and integrates proper Polygon bridge and Heimdall services.

  • Refactors setUpBlockReader to SetUpBlockReader with explicit parameters
  • Integrates Polygon bridge and Heimdall services in the consensus engine initialization
  • Removes duplicate service creation and consolidates initialization logic

Reviewed Changes

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

File Description
eth/backend.go Updates function signature and call to use explicit dbReadConcurrency parameter
cmd/integration/commands/stages.go Refactors to use SetUpBlockReader and integrates Polygon services in consensus engine

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
cfg.Dirs = dirs
allSn, borSn, agg, _, _, _, err := allSnapshots(ctx, db, logger)
dbReadConcurrency := runtime.GOMAXPROCS(-1) * 16
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

The magic number 16 should be defined as a named constant to explain its purpose and make it easier to maintain.

Copilot uses AI. Check for mistakes.
Comment on lines +1485 to +1491
if !config.WithoutHeimdall {
heimdallClient = heimdall.NewHttpClient(config.HeimdallURL, logger, poshttp.WithApiVersioner(ctx))
bridgeClient = bridge.NewHttpClient(config.HeimdallURL, logger, poshttp.WithApiVersioner(ctx))
} else {
heimdallClient = heimdall.NewIdleClient(config.Miner)
bridgeClient = bridge.NewIdleClient()
}
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

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

This client initialization logic is duplicated from the main backend. Consider extracting this into a shared function to avoid code duplication.

Copilot uses AI. Check for mistakes.
@antonis19 antonis19 merged commit 9120d77 into main Sep 3, 2025
15 checks passed
@antonis19 antonis19 deleted the fix-bor-integration branch September 3, 2025 09:49
antonis19 added a commit that referenced this pull request Sep 11, 2025
yperbasis pushed a commit that referenced this pull request Sep 12, 2025
NazariiDenha pushed a commit that referenced this pull request Oct 24, 2025
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.

spanId not found while executing stage_custom_trace

3 participants