Skip to content

fix(logging): demote per-mint bank log to Debug (mock_balances top-off spam) - #3729

Merged
bdchatham merged 1 commit into
mainfrom
fix/mock-balances-funding-log-spam
Jul 8, 2026
Merged

bdchatham merged 1 commit into
mainfrom
fix/mock-balances-funding-log-spam

Conversation

@bdchatham

Copy link
Copy Markdown
Contributor

Problem

On mock_balances builds, every account top-off emits an Info log — minted coins from module account — once per funded sender. On a seiload chain funding thousands of fresh accounts, this floods node logs with lines that carry no signal (the amount is always the fixed 100 ETH top-off).

This wasn't always the case: topOffAccount used to suppress the bank keeper's mint log by swapping a NopLogger onto the context. The package-level slog migration (#3050) removed ctx-scoped loggers, and with them the suppression — silently re-enabling the spam. The stale (use NopLogger to suppress log spam) comment in mock_balances.go still pointed at the old mechanism.

Change

  • Demote the bank keepers' per-mint minted coins from module account log from Info to Debug, in both copies (sei-cosmos/x/bank/keeper, giga/deps/xbank/keeper). Per-mint logging is a Debug-level concern; upstream cosmos-sdk made the same move.
  • Drop the stale NopLogger comment and the now-dead ctx := s.ctx alias in both mock_balances.go top-off paths.

Production visibility is unaffected: block minting already logs Minted coins at Info from x/mint/keeper/hooks.go, so the bank-level line was duplicative there; the event emission (NewCoinMintEvent) is unchanged.

Verification

  • go build ./giga/deps/xbank/... ./sei-cosmos/x/bank/... passes
  • go build -tags mock_balances ./x/evm/state/... ./giga/deps/xevm/state/... ./app/... passes
  • go test -tags mock_balances ./app/ -run TestMempoolBalanceFloor passes

🤖 Generated with Claude Code

…ff spam

Every mock_balances account top-off logs "minted coins from module
account" at Info, once per funded sender — on a seiload chain that is a
log line per fresh account. The mock path used to suppress this with a
ctx NopLogger, but the package-level slog migration (#3050) removed
ctx-scoped loggers, silently re-enabling the spam.

Demote the bank keepers' per-mint Info log to Debug in both copies
(sei-cosmos/x/bank, giga/deps/xbank). Block-mint visibility is
unaffected: x/mint already logs "Minted coins" at Info per release.
Also drop the now-stale NopLogger comment and dead ctx alias in the
mock_balances top-off.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Logging-only change with no mint, supply, or event behavior changes; default Info logs lose per-mint bank lines that were often noise.

Overview
Reduces Info-level log spam when many module mints run in a row (notably mock_balances EVM top-offs), without changing mint semantics or events.

In sei-cosmos/x/bank/keeper and giga/deps/xbank/keeper, the createCoins message minted coins from module account is demoted from Info to Debug. NewCoinMintEvent emission is unchanged; scheduled inflation still surfaces at Info via x/mint/keeper/hooks.go (Minted coins).

In both mock_balances topOffAccount implementations, the obsolete NopLogger comment is removed and mint/send calls use s.ctx directly instead of a local ctx alias.

Reviewed by Cursor Bugbot for commit 4d857cb. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJul 8, 2026, 10:51 PM

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A small, low-risk logging change: demotes the bank keeper's per-mint "minted coins from module account" log from Info to Debug in both copies, and removes a now-stale NopLogger comment plus a dead ctx := s.ctx alias in both mock_balances.go top-off paths. No correctness, security, or performance concerns found.

Findings: 0 blocking | 2 non-blocking | 0 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • Cursor's second-opinion review file (cursor-review.md) was empty — that pass produced no output. Codex reported no material findings.
  • Both the sei-cosmos and giga/deps copies of the bank keeper, and both mock_balances.go copies, were kept in sync — good. The change is a duplication-prone edit across vendored trees; worth double-checking no third copy of this log line exists that should also be demoted for consistency.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Straightforward log-level demotion and dead-code cleanup — production behavior unchanged.

Extended reasoning...

Overview

This PR demotes the per-mint minted coins from module account log from Info to Debug in both bank keeper copies (sei-cosmos/x/bank/keeper/keeper.go, giga/deps/xbank/keeper/keeper.go), and removes a stale (use NopLogger to suppress log spam) comment plus the now-dead ctx := s.ctx local alias in both mock_balances.go top-off paths. The event emission (NewCoinMintEvent) is unchanged.

Security risks

None. This is a logging verbosity change plus dead-variable cleanup — no auth, crypto, permissions, or state-transition logic is touched. The mint-event emission that downstream indexers/consumers rely on is preserved.

Level of scrutiny

Low. Two of the four files are gated behind the mock_balances build tag (test/benchmark-only, explicitly refused on pacific-1 mainnet), and the other two are a one-line Info→Debug swap on an already-duplicative log line (block-level Minted coins is still emitted at Info from x/mint/keeper/hooks.go).

Other factors

Bug hunters found nothing. Author verified builds with and without the mock_balances tag, plus a targeted test run. The change matches the upstream cosmos-sdk direction for this log line.

@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.93%. Comparing base (242a9c2) to head (4d857cb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3729      +/-   ##
==========================================
- Coverage   59.84%   58.93%   -0.92%     
==========================================
  Files        2278     2191      -87     
  Lines      189134   179314    -9820     
==========================================
- Hits       113195   105672    -7523     
+ Misses      65862    64367    -1495     
+ Partials    10077     9275     -802     
Flag Coverage Δ
sei-chain-pr 74.91% <100.00%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
giga/deps/xbank/keeper/keeper.go 44.08% <100.00%> (ø)
sei-cosmos/x/bank/keeper/keeper.go 80.70% <100.00%> (ø)

... and 87 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bdchatham
bdchatham enabled auto-merge July 8, 2026 22:50
@bdchatham
bdchatham added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit a7c881d Jul 8, 2026
70 of 71 checks passed
@bdchatham
bdchatham deleted the fix/mock-balances-funding-log-spam branch July 8, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants