Skip to content

Remove unwire references#505

Open
clauBv23 wants to merge 2 commits intomainfrom
remove-unwire-references
Open

Remove unwire references#505
clauBv23 wants to merge 2 commits intomainfrom
remove-unwire-references

Conversation

@clauBv23
Copy link
Contributor

No description provided.

@clauBv23 clauBv23 requested a review from Copilot February 11, 2026 15:23
@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

⚠️ No Changeset found

Latest commit: a3992ae

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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

Adjusts the “unwire” config loading flow to tolerate missing unwire config files, and replaces the concrete mainnet unwire config with a template.

Changes:

  • loadUnwireConfig now returns undefined when the unwire YAML file doesn’t exist.
  • Mainnet graph builders short-circuit to an empty graph when no unwire config is present.
  • Removes unwire.asset.yml and adds a template-unwire.asset.yml placeholder.

Reviewed changes

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

Show a summary per file
File Description
packages/stg-evm-v2/devtools/config/utils/unwire.config.utils.ts Makes unwire config loading optional when the YAML file is absent
packages/stg-evm-v2/devtools/config/mainnet/01/messaging-asset-removal.config.ts Skips building the messaging-asset-removal graph when no unwire config exists
packages/stg-evm-v2/devtools/config/mainnet/01/chainsConfig/unwire/unwire.asset.yml Removes the concrete mainnet unwire config file
packages/stg-evm-v2/devtools/config/mainnet/01/chainsConfig/unwire/template-unwire.asset.yml Adds a template YAML to guide creation of an unwire config
packages/stg-evm-v2/devtools/config/mainnet/01/asset.unwire.config.ts Skips building the asset unwire graph when no unwire config exists

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

Comment on lines +24 to +29
export function loadUnwireConfig(baseDir: string): ResolvedUnwireConfig | undefined {
const configPath = resolveUnwireConfigPath(baseDir)
if (!fs.existsSync(configPath)) {
return undefined
}

Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

loadUnwireConfig now returns undefined on a missing file, which is a silent/optional-load behavior that doesn’t match the API name. Consider renaming to something like tryLoadUnwireConfig, or alternatively keep loadUnwireConfig as “must exist” (throw with a clear message) and introduce a separate optional loader to avoid surprising callers.

Suggested change
export function loadUnwireConfig(baseDir: string): ResolvedUnwireConfig | undefined {
const configPath = resolveUnwireConfigPath(baseDir)
if (!fs.existsSync(configPath)) {
return undefined
}
export function tryLoadUnwireConfig(baseDir: string): ResolvedUnwireConfig | undefined {
const configPath = resolveUnwireConfigPath(baseDir)
if (!fs.existsSync(configPath)) {
return undefined
}
return loadUnwireConfig(baseDir)
}
export function loadUnwireConfig(baseDir: string): ResolvedUnwireConfig {
const configPath = resolveUnwireConfigPath(baseDir)
if (!fs.existsSync(configPath)) {
throw new Error(`Unwire config file not found at ${configPath}`)
}

Copilot uses AI. Check for mistakes.
const { tokenName, disconnectChains, remainingChains } = loadUnwireConfig(__dirname)
const unwireConfig = loadUnwireConfig(__dirname)
if (!unwireConfig) {
return { contracts: [], connections: [] }
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Returning an empty graph when the unwire config is missing can make the task appear to succeed while doing nothing, which is easy to miss. Prefer failing fast with a clear error (e.g., pointing at chainsConfig/unwire/template-unwire.asset.yml as the expected template) or at least emitting an explicit warning so operators know the run was a no-op.

Suggested change
return { contracts: [], connections: [] }
throw new Error(
`Missing unwire config for directory "${__dirname}". ` +
'Please create an unwire config based on "chainsConfig/unwire/template-unwire.asset.yml".'
)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1


const unwireConfig = loadUnwireConfig(__dirname)
if (!unwireConfig) {
return { contracts: [], connections: [] }
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

Same as asset.unwire.config.ts: this silently produces a no-op graph when the config is missing. Consider throwing a descriptive error (or at minimum logging a warning) so CI/operators don’t mistakenly interpret an empty plan as a successful removal run.

Suggested change
return { contracts: [], connections: [] }
throw new Error(
`Missing unwire config for messaging asset removal in directory: ${__dirname}. ` +
'This would produce an empty (no-op) graph, which is disallowed. ' +
'Ensure an unwire config is present or fix the config path.'
)

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@@ -0,0 +1,10 @@
# Asset mesh unwire config (mainnet)
# This file is used by asset.unwire.config.ts and messaging-asset-removal.config.ts
asset: eurc/usdc/usdt/eth
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The template’s asset value looks like a literal slash-separated token (eurc/usdc/usdt/eth), which will be parsed as a single string and likely fail downstream if someone forgets to replace it. Consider changing it to a clearer placeholder (e.g., asset: <token> plus a comment listing allowed values) to reduce accidental misconfiguration.

Suggested change
asset: eurc/usdc/usdt/eth
# Replace <token> with a single asset symbol. Allowed values: eurc, usdc, usdt, eth.
asset: <token>

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@ravinagill15 ravinagill15 left a comment

Choose a reason for hiding this comment

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

Let's add changeset

const { tokenName, disconnectChains, remainingChains } = loadUnwireConfig(__dirname)
const unwireConfig = loadUnwireConfig(__dirname)
if (!unwireConfig) {
return { contracts: [], connections: [] }
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1


const unwireConfig = loadUnwireConfig(__dirname)
if (!unwireConfig) {
return { contracts: [], connections: [] }
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

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