Skip to content

fix(deployment): Embbed ChainDefinition instead of partially copying it#1907

Open
rodrigombsoares wants to merge 3 commits intomainfrom
fix-partial-configs
Open

fix(deployment): Embbed ChainDefinition instead of partially copying it#1907
rodrigombsoares wants to merge 3 commits intomainfrom
fix-partial-configs

Conversation

@rodrigombsoares
Copy link
Collaborator

Summary

Embed lanes.ChainDefinition in the per-chain input for ConfigureChainsForLanesFromTopology instead of partially copying its fields.

Features

  • ChainConfigForLanesFromTopology embedded ChainDefinition
  • Rename PartialChainConfig

Testing

go test ./v1_7_0/changesets/... -run ConfigureChainsForLanesFromTopology (from deployment/).

Copilot AI review requested due to automatic review settings March 26, 2026 00:44
@rodrigombsoares rodrigombsoares requested review from a team as code owners March 26, 2026 00:44
@github-actions
Copy link

👋 rodrigombsoares, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

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 refactors ConfigureChainsForLanesFromTopology’s per-chain input to embed lanes.ChainDefinition instead of duplicating selected fields, updating the changeset and its tests accordingly.

Changes:

  • Replace PartialChainConfig with ChainConfigForLanesFromTopology that embeds lanes.ChainDefinition.
  • Rename the per-chain remote mapping from RemoteChains to RemoteLanes to avoid confusion with CommitteeVerifierInputConfig.RemoteChains.
  • Update configure_committee_verifiers_test.go to construct inputs using the embedded ChainDefinition.

Reviewed changes

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

File Description
deployment/v1_7_0/changesets/configure_committee_verifiers.go Introduces the embedded ChainDefinition input type and updates lane construction logic accordingly.
deployment/v1_7_0/changesets/configure_committee_verifiers_test.go Updates tests to use the new config type and renamed fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +36 to +37
// embedded lanes.ChainDefinition for that chain, CommitteeVerifierInputConfig resolved via topology,
// and RemoteLanes (remote selector → remote lane endpoint), separate from CommitteeVerifierInputConfig.RemoteChains.
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The doc comment says "CommitteeVerifierInputConfig resolved via topology", but the input CommitteeVerifiers slice is still provided by the caller; only the signature quorum config is resolved from topology inside Apply. Please reword this comment to avoid implying the entire input is derived from topology.

Suggested change
// embedded lanes.ChainDefinition for that chain, CommitteeVerifierInputConfig resolved via topology,
// and RemoteLanes (remote selector → remote lane endpoint), separate from CommitteeVerifierInputConfig.RemoteChains.
// embedded lanes.ChainDefinition for that chain, caller-provided CommitteeVerifierInputConfig values
// (with signature quorum configuration resolved via topology inside Apply), and RemoteLanes (remote
// selector → remote lane endpoint), separate from CommitteeVerifierInputConfig.RemoteChains.

Copilot uses AI. Check for mistakes.
Comment on lines +122 to +124
chainA := chain.ChainDefinition
chainA.CommitteeVerifiers = committeeVerifiers

Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

chainA := chain.ChainDefinition copies any caller-provided ChainDefinition.CommitteeVerifiers, but then overwrites it with the computed committeeVerifiers. Because ChainDefinition is now part of the public input type, a caller can set ChainDefinition.CommitteeVerifiers and have it silently ignored. Consider adding validation that chain.ChainDefinition.CommitteeVerifiers is empty (and/or making the input field name explicitly different) so misconfiguration fails fast.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll leave it like this for now until a bigger refactor gets in place.

tt-cll
tt-cll previously approved these changes Mar 26, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rodrigombsoares rodrigombsoares requested a review from tt-cll March 26, 2026 01:34
@github-actions
Copy link

Metric fix-partial-configs main
Coverage 70.1% 69.8%

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.

3 participants