Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis pull request updates the Go toolchain to 1.25.x, migrates golangci-lint config to v2 schema, replaces uses of Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
pkg/fetchers/signing_info.go (1)
154-163:⚠️ Potential issue | 🟡 MinorSkip consumer signing-info lookups when
ConsensusAddressis missing.This path still calls
GetConsumerAssignedKeywithvalidator.ConsensusAddressunconditionally. For validators that legitimately omit that field, the fetcher turns an optional config value into an RPC error and noisy logs instead of just skipping the consumer lookup.Based on learnings, the `ConsensusAddress` in the `Validator` struct is not a required field, and its absence should be handled as a warning, not an error.Suggested fix
func (q *SigningInfoFetcher) processConsumerChain( ctx context.Context, validator config.Validator, rpc *tendermint.RPC, providerRPC *tendermint.RPC, chain *config.ConsumerChain, ) { defer q.wg.Done() if chain.BechConsensusPrefix == "" || chain.BechValidatorPrefix == "" { return } + if validator.ConsensusAddress == "" { + return + } // 1. Fetching assigned key. assignedKey, queryInfo, err := providerRPC.GetConsumerAssignedKey(🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/fetchers/signing_info.go` around lines 154 - 163, The code currently calls providerRPC.GetConsumerAssignedKey with validator.ConsensusAddress even when that field is empty; update the fetch path in signing_info.go to check validator.ConsensusAddress (from the Validator struct) before attempting the consumer lookup, and if it's empty simply log a warning and return/skip the consumer-specific work instead of calling GetConsumerAssignedKey (so avoid generating RPC errors/noisy logs); ensure the early-return happens before variables assignedKey/queryInfo/err are used.
🧹 Nitpick comments (2)
.golangci.yml (1)
42-45: Redundant staticcheck configuration.
staticcheckis disabled on line 28, but you're still providing settings for it on lines 42-45. This configuration is redundant and can be removed to reduce confusion.🧹 Suggested cleanup
- staticcheck: - checks: - - all - - -SA1019🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.golangci.yml around lines 42 - 45, Remove the redundant staticcheck configuration block (the "staticcheck:" key and its nested "checks:" list) since staticcheck is already disabled earlier; either delete this block entirely or consolidate it into the earlier staticcheck configuration if you intended to enable specific checks.pkg/fetchers/has_to_validate.go (1)
108-114: Fix the error message to match the RPC being called.This branch handles
GetValidatorConsumerChains, not node info. The current log text will mislabel failures during triage.📝 Proposed fix
if err != nil { q.Logger.Error(). Err(err). Str("chain", chainName). - Msg("Error querying node info") + Msg("Error querying validator consumer chains") return }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/fetchers/has_to_validate.go` around lines 108 - 114, The log message in the error branch inside the GetValidatorConsumerChains handling is incorrect—it's saying "Error querying node info"; update the Msg text in the q.Logger.Error() call to accurately reflect the RPC being invoked (e.g., "Error calling GetValidatorConsumerChains" or "Error querying validator consumer chains") while keeping the existing Err(err) and Str("chain", chainName) context; locate the branch in has_to_validate.go that calls GetValidatorConsumerChains and replace the misleading message with the corrected one.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/actions.yaml:
- Line 10: The workflow's go-version key is set to an invalid value '^1.25.8'
which will break CI; update the go-version entry (the "go-version" key) to a
valid released Go version (for example '1.21' or '1.22') or use a supported
pattern like '1.x' so the setup-go action resolves to a real release; ensure all
jobs that reference "go-version" use the same corrected value.
- Line 30: The workflow currently references uses:
golangci/golangci-lint-action@v9 which enables v2 config schema validation and
Node 24 runtime; before upgrading, either run golangci-lint migrate to update
.golangci.yml and add version: "2", or pin the action to a known v1.x tag, or
add the action input verify: false to temporarily disable validation; also
confirm your runners are compatible with Node 24 if you keep `@v9`. Use the string
uses: golangci/golangci-lint-action@v9 as the location to apply one of these
changes.
In @.github/workflows/release.yaml:
- Line 26: The workflow references an invalid Go version "go-version: 1.25" and
outdated actions; update the Go version to a valid release that matches go.mod
(e.g., "go-version: 1.20" or the version declared in go.mod) and bump the action
versions to newer releases by replacing uses of actions/checkout and
actions/setup-go with actions/checkout@v4 and actions/setup-go@v5 respectively
so the workflow uses a valid Go toolchain and current action releases.
In `@go.mod`:
- Around line 3-5: The go.mod currently declares "go 1.25.8" but the toolchain
is set to "toolchain go1.22.1", which is older and will break builds; fix by
making the toolchain version equal or newer than the module Go version (e.g.,
update "toolchain go1.22.1" to "toolchain go1.25.8" or a newer toolchain), or
alternatively lower the "go 1.25.8" directive to match the intended toolchain;
adjust the "go 1.25.8" and "toolchain go1.22.1" entries accordingly so they are
consistent.
---
Outside diff comments:
In `@pkg/fetchers/signing_info.go`:
- Around line 154-163: The code currently calls
providerRPC.GetConsumerAssignedKey with validator.ConsensusAddress even when
that field is empty; update the fetch path in signing_info.go to check
validator.ConsensusAddress (from the Validator struct) before attempting the
consumer lookup, and if it's empty simply log a warning and return/skip the
consumer-specific work instead of calling GetConsumerAssignedKey (so avoid
generating RPC errors/noisy logs); ensure the early-return happens before
variables assignedKey/queryInfo/err are used.
---
Nitpick comments:
In @.golangci.yml:
- Around line 42-45: Remove the redundant staticcheck configuration block (the
"staticcheck:" key and its nested "checks:" list) since staticcheck is already
disabled earlier; either delete this block entirely or consolidate it into the
earlier staticcheck configuration if you intended to enable specific checks.
In `@pkg/fetchers/has_to_validate.go`:
- Around line 108-114: The log message in the error branch inside the
GetValidatorConsumerChains handling is incorrect—it's saying "Error querying
node info"; update the Msg text in the q.Logger.Error() call to accurately
reflect the RPC being invoked (e.g., "Error calling GetValidatorConsumerChains"
or "Error querying validator consumer chains") while keeping the existing
Err(err) and Str("chain", chainName) context; locate the branch in
has_to_validate.go that calls GetValidatorConsumerChains and replace the
misleading message with the corrected one.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9a0b6786-85f3-4087-80d3-be58bf41e1d1
📒 Files selected for processing (70)
.github/workflows/actions.yaml.github/workflows/release.yaml.gitignore.golangci.ymlcmd/cosmos-validators-exporter.gocmd/cosmos-validators-exporter_test.gogo.modpkg/app.gopkg/app_test.gopkg/config/chain.gopkg/config/config.gopkg/config/consumer_chain.gopkg/controller/controller.gopkg/fetchers/balance.gopkg/fetchers/balance_test.gopkg/fetchers/commission.gopkg/fetchers/commission_test.gopkg/fetchers/consumer_commission.gopkg/fetchers/consumer_commission_test.gopkg/fetchers/consumer_info.gopkg/fetchers/consumer_info_test.gopkg/fetchers/consumer_validators.gopkg/fetchers/consumer_validators_test.gopkg/fetchers/delegations.gopkg/fetchers/delegations_test.gopkg/fetchers/fetcher.gopkg/fetchers/has_to_validate.gopkg/fetchers/has_to_validate_test.gopkg/fetchers/inflation.gopkg/fetchers/inflation_test.gopkg/fetchers/node_info.gopkg/fetchers/node_info_test.gopkg/fetchers/price.gopkg/fetchers/price_test.gopkg/fetchers/rewards.gopkg/fetchers/rewards_test.gopkg/fetchers/self_delegation.gopkg/fetchers/self_delegation_test.gopkg/fetchers/signing_info.gopkg/fetchers/signing_info_test.gopkg/fetchers/slashing_params.gopkg/fetchers/slashing_params_test.gopkg/fetchers/staking_params.gopkg/fetchers/staking_params_test.gopkg/fetchers/stub.gopkg/fetchers/supply.gopkg/fetchers/supply_test.gopkg/fetchers/unbonds.gopkg/fetchers/unbonds_test.gopkg/fetchers/validators.gopkg/fetchers/validators_test.gopkg/generators/active_set_tokens_test.gopkg/generators/single_validator_info.gopkg/generators/single_validator_info_test.gopkg/generators/validator_active.gopkg/generators/validator_active_test.gopkg/generators/validator_commission_rate.gopkg/generators/validator_commission_rate_test.gopkg/generators/validator_rank.gopkg/generators/validator_rank_test.gopkg/generators/validators_info.gopkg/generators/validators_info_test.gopkg/http/http.gopkg/http/http_test.gopkg/logger/logger.gopkg/price_fetchers/coingecko/coingecko.gopkg/state/state.gopkg/tendermint/rpc.gopkg/tracing/tracer.gopkg/utils/utils.go
💤 Files with no reviewable changes (1)
- .gitignore
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
=======================================
Coverage 99.85% 99.86%
=======================================
Files 68 68
Lines 2840 2868 +28
=======================================
+ Hits 2836 2864 +28
Misses 2 2
Partials 2 2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Style