Skip to content

skip inspector building if it needs additional fields - #1136

Open
FelixFan1992 wants to merge 2 commits into
mainfrom
fix-reader
Open

skip inspector building if it needs additional fields#1136
FelixFan1992 wants to merge 2 commits into
mainfrom
fix-reader

Conversation

@FelixFan1992

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings July 28, 2026 22:22
@FelixFan1992
FelixFan1992 requested a review from a team as a code owner July 28, 2026 22:22
@changeset-bot

changeset-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 09633b2

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

@github-actions

Copy link
Copy Markdown

👋 FelixFan1992, 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!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adjusts MCMS inspector construction to avoid failing inspector creation across an environment when some chains (notably Sui) cannot be built with empty chain metadata.

Changes:

  • Reworked McmsInspectors to build inspectors per-chain and skip chains that error during construction.
  • Updated/expanded the function’s doc comment to explain why certain chains are skipped (and how missing inspectors surface later).
  • Added a unit test to validate that chains requiring extra metadata (Sui) are skipped while EVM inspectors are still returned.

Reviewed changes

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

File Description
engine/cld/mcms/proposalutils/inspectors.go Switches from bulk inspector construction to per-chain BuildInspector with skip-on-error behavior and updated docs.
engine/cld/mcms/proposalutils/inspectors_test.go Adds coverage ensuring metadata-dependent chains (Sui) are skipped without failing inspector generation for supported chains.

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

Comment on lines +51 to +55
// Chains that require chain-specific metadata the framework does not hold, such
// as Sui which needs AdditionalFields populated from onchain MCMS state, are
// skipped rather than failing the whole set. Proposal building only consumes
// inspectors for chains that have batch operations, so a skipped chain that is
// later needed still surfaces as a missing-inspector error.
Comment on lines +67 to +69
if err != nil {
continue
}
Copilot AI review requested due to automatic review settings July 28, 2026 22:33
@FelixFan1992 FelixFan1992 changed the title fix inspector skip inspector building if it needs additional fields Jul 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (1)

engine/cld/mcms/proposalutils/inspectors.go:69

  • McmsInspectors currently continues on any BuildInspector error. This means genuine configuration/runtime failures (e.g., missing client, RPC issues) will be silently dropped and the function will still return nil error, even though the doc comment implies only chains requiring extra metadata (e.g., Sui) should be skipped. Consider restricting the skip to known cases (e.g., by chain family == Sui, or by matching a specific error from mcmschainwrappers) and returning an error for unexpected failures so callers can diagnose misconfiguration.
		inspector, err := mcmschainwrappers.BuildInspector(
			&chainAccessor,
			mcmstypes.ChainSelector(chainSelector),
			mcmstypes.TimelockActionSchedule,
			mcmstypes.ChainMetadata{},
		)
		if err != nil {
			continue
		}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comments suppressed due to low confidence (1)

engine/cld/mcms/proposalutils/inspectors.go:70

  • McmsInspectors now silently ignores all BuildInspector errors and still returns nil error, which can hide real failures (e.g., misconfigured chain access / RPC issues) and make it hard to debug why an inspector is missing. At minimum, log when a chain is skipped (guarding against env.Logger == nil) so callers have some visibility into skipped selectors and underlying errors.
	inspectors := make(map[uint64]mcmssdk.Inspector)
	for chainSelector := range env.BlockChains.All() {
		inspector, err := mcmschainwrappers.BuildInspector(
			&chainAccessor,
			mcmstypes.ChainSelector(chainSelector),
			mcmstypes.TimelockActionSchedule,
			mcmstypes.ChainMetadata{},
		)
		if err != nil {
			continue
		}
		inspectors[chainSelector] = inspector

@gustavogama-cll

Copy link
Copy Markdown
Contributor

sorry @FelixFan1992 but I don't think this is the direction we should head. Let us align on the path forward on the slack thread, but I believe you have been able to execute the changeset without modifying CLDF.

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