chore(lint): clear scoped golangci-lint + buf BRIDGE-surface findings#125
Merged
mateeullahmalik merged 1 commit intomasterfrom Apr 28, 2026
Merged
chore(lint): clear scoped golangci-lint + buf BRIDGE-surface findings#125mateeullahmalik merged 1 commit intomasterfrom
mateeullahmalik merged 1 commit intomasterfrom
Conversation
- Delete dead state-machine helpers in x/supernode/v1/keeper:
* metrics_state.go: markStorageFull, recoverFromStorageFull (audit module
does these inline in x/audit/v1/keeper/state.go and enforcement.go;
helpers were never wired up).
* metrics_validation.go: lastNonDegradedState (zero call sites).
- Delete unused x/action/v1 simulation scaffolding:
* helpers.go: generateRandomOtiValues (unused stub).
* module/simulation.go: 6 op_weight_msg_* / defaultWeightMsg* consts
(no scaffolded simulation hooks reference them).
- Fix ineffassign in x/supernode/v1/simulation/update_supernode.go:
drop dead 'updateAccount = false' branch (supernodeAccount is already
empty in that path, so the flag was redundant).
- errcheck cleanup in scoped tests: wrap k.SetAction / k.SetParams /
k.SetSuperNode in require.NoError(t, ...). Behavior preserved; tests
now fail loudly on store errors instead of silently swallowing them.
- staticcheck SA1019 cleanup:
* Replace deprecated sdk.WrapSDKContext(ctx) with ctx (5 sites in
msg_server_report_supernode_metrics_test.go).
* Replace deprecated rand.Seed in crypto_test.go with
rand.New(rand.NewSource(...)).
* Annotate module.HasInvariants / sdk.InvariantRegistry usage with
//nolint:staticcheck — SDK v0.50 still requires HasInvariants and
only drops it when x/crisis is removed.
- buf lint: add doc comments on BRIDGE-surface enums/messages
(HashAlgo, RewardDistribution, SuperNodeState, SuperNodeStateRecord).
No wire-affecting renames.
Verification:
- golangci-lint run ./x/action/v1/... ./x/supernode/v1/... -> 0 issues
- go test ./x/action/v1/... ./x/supernode/v1/... -count=1 -> PASS
- go test ./tests/integration/everlight ./tests/e2e/everlight ./app/upgrades/v1_12_0 ./tests/integration/action/... -> PASS
- make build (lumerad) -> OK
No state-machine, no schema, no on-chain behavior changes.
Note: the dead helpers in metrics_state.go/metrics_validation.go are
deleted rather than re-wired because audit-module enforcement already
performs STORAGE_FULL/POSTPONED transitions inline. Routing both
modules through one set of helpers is a separate, larger SSoT refactor
not in scope for this lint cleanup.
Reviewed all 20 changed files. No issues found. All changes are mechanical lint fixes, dead code removal (verified zero call sites), errcheck wrapping in tests, and proto doc comments with no wire-format impact. LGTM. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
mateeullahmalik
added a commit
that referenced
this pull request
Apr 28, 2026
The previous attempt failed CI with: Error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.9) Root cause: golangci-lint v1.64.8 (the latest v1.x release) is itself compiled against Go 1.24. When it loads a module whose go.mod declares `go 1.25.9` (Lumera's case), it refuses with the version-mismatch error above. Removing the `go:` pin from .golangci.yml didn't help because v1 reads the version from go.mod when the config doesn't override it. The fix is to bump to golangci-lint v2.x, which is built with Go 1.25+. v2 ships a breaking config-schema change, so this commit also rewrites .golangci.yml to the v2 schema: - Add `version: "2"` at top level. - Move `linters.disable-all: true` -> `linters.default: none`. - Move `linters-settings` -> `linters.settings`. - Move `issues.exclude-rules` -> `linters.exclusions.rules`. - Drop `exclude-use-default: false` (replaced by `exclusions.generated: lax`). Same rule set, same exclusions, same effective behavior. Pinned to v2.0.2 (first stable v2.x release). Verified locally: the new config loads cleanly under v2.0.2 and reports the expected baseline findings on master (which #125 cleans). No change to the workflow's diff-only semantics: still filter_mode=added, reporter=github-pr-review, fail_level=error.
mateeullahmalik
added a commit
that referenced
this pull request
Apr 28, 2026
v2.0.2 was itself built with Go 1.24 — same root cause as v1.64.8 but a release later. golangci-lint refuses any config whose targeted Go version is higher than the binary's own build version, regardless of whether that target comes from go.mod or .golangci.yml. v2.11.4 is built with Go 1.26.1 (>= our chain's Go 1.25.9), so the version guard passes. Verified locally: config loads, linter runs, exits 0 with the expected master-baseline findings (which #125 cleans).
akobrin1
added a commit
that referenced
this pull request
May 1, 2026
Brings master's LEP-6 audit storage-truth scaffolding (#117), recent devnet test fixes (#123, #124), and scoped lint cleanup (#125) onto the evm branch. Conflict resolutions: - .gitignore: union of both sides, deduped, fixed .codex/.agents (file vs dir) - devnet/go.mod: master's lumera-only replace, kept evm's local sdk-go replace (devnet evmigration tests use BuildAndSignTxWithOptions only on local sdk-go); cosmos-sdk pinned to evm's v0.53.6. - supernode-setup.sh: folded master's EVERLIGHT_TEST_TARGET host_reporter bypass into evm's start_supernode_process abstraction so all call sites honor the env var. - audit_peer_ports / audit_recovery system tests: kept evm's wider epoch windows + multi-node assignment-aware reporting (the EVM-integrated binary is slower; tighter epochs flake). - distribution_freshness / query_get_reward_eligibility tests: kept evm's Bech32-prefixed config constants (master's lcfg.ValidatorAddressPrefix doesn't compile on evm). - metrics_state.go / metrics_validation.go: kept evm's reserved STORAGE_FULL helpers (markStorageFull, recoverFromStorageFull, lastNonDegradedState) for follow-up audit-enforcement wiring. - testutil/cryptotestutils → testutil/crypto: rewrote 3 master-side import paths to evm's renamed directory. - Dropped master's duplicate indexOfModule from lep6_module_order_test.go in favor of the existing helper in app/evm_test.go. Lint cleanup applied to bring `make lint` to 0 issues: - defer it.Close() → defer func() { _ = it.Close() }() across audit module. - gofmt -w on master-side test/sim files. - Removed unused //nolint:staticcheck directives on HasInvariants. - Marked reserved declarations (maxAuditEpochLookback, globalAuditKeeper) with //nolint:unused. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drops the scoped
golangci-lintcount from 25 → 0 and clears the BRIDGE-surfacebuf lintfindings the Everlight gate report flagged. No state-machine, schema, or on-chain behavior changes.Triggered by the post-Everlight gate report (2026-04-28): functional Everlight evidence was already green (
PASS: 35 FAIL: 0 SKIP: 5on devnet, two clean iterations) butOVERALL: FAILon code-quality.Scoped lint: 25 → 0
x/supernode/v1/keeper/metrics_state.goandmetrics_validation.gomarkStorageFull,recoverFromStorageFull,lastNonDegradedState. The audit module already performs STORAGE_FULL/POSTPONED transitions inline inx/audit/v1/keeper/state.goandenforcement.go.x/action/v1/simulation/helpers.goandmodule/simulation.gogenerateRandomOtiValuesand 6opWeightMsg*/defaultWeightMsg*consts.x/supernode/v1/simulation/update_supernode.goupdateAccount = falsebranch.*_test.goand 1 supernode testk.SetAction/k.SetParams/k.SetSuperNodeinrequire.NoError(t, ...). Tests now fail on store errors instead of silently swallowing them.sdk.WrapSDKContextrand.Seedrand.New(rand.NewSource(...)).module.HasInvariants/sdk.InvariantRegistry//nolint:staticcheckwith rationale: SDK v0.50 still requiresHasInvariants; deprecation only resolves whenx/crisisis dropped.buf lint: BRIDGE surfaces commented
Added doc comments to
HashAlgo,RewardDistribution,SuperNodeState,SuperNodeStateRecord.Out of scope:
SUPER_NODE_STATE_*prefix andfield_lower_snake_case(actionID → action_id) findings — those are wire-incompatible renames touching every existing client.Verification
Devnet (
make -f Makefile.devnet devnet-tests-everlight) was green on master before this PR (2 consecutive iterations, FAIL=0) and these are scoped lint changes only — no devnet behavioral impact expected.Risks
Minimal. All deletions are dead code (verified via repo-wide grep for call sites). errcheck/SA1019 changes are mechanical and behavior-preserving. The only behavioral change is positive: tests will fail on swallowed store errors instead of continuing.
Rollback
Single revert. No migration, no upgrade handler, no on-chain effect.
Note on the deleted helpers
metrics_state.gopreviously shippedmarkStorageFull/recoverFromStorageFullwhilex/audit/v1/keeper/state.go:57+enforcement.go:464performed the same transitions inline. That was a duplicated, drift-prone state-machine surface. Deleting the unused helpers removes the ambiguity. Routing both modules through a single set of helpers (restoring SSoT for SuperNode state transitions) is a worthwhile follow-up but is a larger refactor not in scope here.