Skip to content

lint: Enable channelcheck linter - #5056

Merged
djb15 merged 4 commits into
wormhole-foundation:mainfrom
pleasew8t:enable-channelcheck-linter
Nov 3, 2026
Merged

djb15 merged 4 commits into
wormhole-foundation:mainfrom
pleasew8t:enable-channelcheck-linter

Conversation

@pleasew8t

Copy link
Copy Markdown
Contributor

NOTE This PR was ported from @mdulin2's PR at 4875, which became a bit tangled in merge conflicts.

This is part two of integrating the channel linter into the repository. Part one added the custom linter flow, and the channel linter; this enables the channel linter.

In general, three types of changes were made:

  • Made the channel non-blocking by using the WriteToChannelWithoutBlocking helper. Done on errC and metric channel writes mostly.
  • Added ctx.Done() to the select for smoother shutdown.
  • Add nolint:channelcheck with an explanation on why the current setup is correct.

It should be noted that msgC is made as an exception to the channelcheck linter because it should always be a blocking write. With the addition of the nolint linter, we can't add nolint:channelcheck with a comment there. So, I left the original Note on channel capacity comment as is.

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

Spent a good amount of time reviewing this, I do think the logical changes are reasonable but I'd like another reviewer to feel the same. Generally there is a minority of changes here from blocking to non-blocking on the error channels, and I believe they're all shared by numerous senders, so going to non-blocking makes sense.

Comment thread node/pkg/telemetry/loki.go Resolved
@djb15
djb15 force-pushed the enable-channelcheck-linter branch from 6f4a90d to 7e54391 Compare October 27, 2026 22:39
@djb15
djb15 requested a review from jmgilman as a code owner October 27, 2026 22:39
djb15
djb15 previously approved these changes Oct 27, 2026

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

Approving. Just fixed a small merge conflict in spy.go

Comment thread node/cmd/spy/spy.go Dismissed

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

Left two comments. The likelihood of the potential issue is very low. If we agree and accept it, I can discard and approve

Comment thread node/pkg/watchers/evm/watcher.go Resolved
Comment thread node/pkg/watchers/evm/watcher.go Resolved
@djb15
djb15 requested a review from bemic November 2, 2026 23:03
@djb15
djb15 force-pushed the enable-channelcheck-linter branch from d5aa04c to ca40486 Compare November 3, 2026 14:27

@evan-gray evan-gray 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.

did my best to review all these, though I'm not intimately familiar with all the code paths.

Comment thread node/pkg/watchers/evm/watcher.go Resolved
Comment thread node/pkg/watchers/evm/watcher.go Resolved

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

Reapproving. Only the last commit is from me and based on feedback from @bemic

@djb15
djb15 merged commit f520bad into wormhole-foundation:main Nov 3, 2026
51 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.

5 participants