Skip to content

Add runtime log level control via gRPC admin service#3062

Merged
masih merged 12 commits intomainfrom
masih/seid-log-level
Mar 13, 2026
Merged

Add runtime log level control via gRPC admin service#3062
masih merged 12 commits intomainfrom
masih/seid-log-level

Conversation

@masih
Copy link
Collaborator

@masih masih commented Mar 12, 2026

Add a way to view and change log levels on a running node without restarting it. A small gRPC admin server listens on localhost only and exposes three RPCs: SetLogLevel, GetLogLevel, and ListLoggers. It builds on seilog's existing support for per-logger and glob-based pattern matching.

Once enabled, you can control logging through the CLI; for example:

seid log level set "x/evm/*" debug           # glob pattern
seid log level set x/evm/state warn.         # exact logger
seid log level set "*" info                  # all loggers
seid log level get x/evm/state               # explicit logger
seid log level list                          # all loggers
seid log level list x/evm                    # filter by prefix

To enable it, add this to app.toml:

[admin_server]
admin_enabled = true
admin_address = "127.0.0.1:9095"

Note:

  • the feature is disabled by default,
  • the address must be a loopback address (127.0.0.1 or ::1); anything else is rejected to avoid security foot-guns
  • level changes are in-memory only and won't survive a restart.

Add a way to view and change log levels on a running node without
restarting it. A small gRPC admin server listens on localhost only and
exposes three RPCs: SetLogLevel, GetLogLevel, and ListLoggers. It builds
on seilog's existing support for per-logger and glob-based pattern
matching.

Once enabled, you can control logging through the CLI; for example:

```
seid log level set "x/evm/*" debug       # glob pattern
seid log level set x/evm/state warn      # exact logger
seid log level set "*" info               # all loggers
seid log level get x/evm/state
seid log level list                       # all loggers
seid log level list x/evm                # filter by prefix
```

To enable it, add this to `app.toml`:

```
[admin]
admin_enabled = true
admin_address = "127.0.0.1:9095"
```

Note:
* the feature is disabled by default,
* the address must be a loopback address (127.0.0.1 or ::1); anything
  else is rejected to avoid security foot-guns
* level changes are in-memory only and won't survive a restart.
@github-actions
Copy link

github-actions bot commented Mar 12, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 13, 2026, 9:00 AM

@masih masih marked this pull request as ready for review March 12, 2026 21:25
@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.54%. Comparing base (84d6405) to head (a46a1f6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3062   +/-   ##
=======================================
  Coverage   58.54%   58.54%           
=======================================
  Files        2076     2076           
  Lines      171482   171482           
=======================================
  Hits       100396   100396           
  Misses      62172    62172           
  Partials     8914     8914           
Flag Coverage Δ
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
app/app.go 70.59% <ø> (ø)
cmd/seid/cmd/app_config.go 100.00% <ø> (ø)
cmd/seid/cmd/root.go 0.00% <ø> (ø)
🚀 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.

@masih masih enabled auto-merge March 13, 2026 08:59
@masih masih added this pull request to the merge queue Mar 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
@masih masih added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 8e28aa1 Mar 13, 2026
38 checks passed
@masih masih deleted the masih/seid-log-level branch March 13, 2026 09:46
blindchaser added a commit that referenced this pull request Mar 13, 2026
This commit was inadvertently reverted by the squash-merge of #3039.
Restores ReceiptStoreConfig in app.toml, readReceiptStoreConfig(),
BackendTypeName(), receipt config tests, and init_test.go.

Conflicts resolved:
- app_config.go: kept both ReceiptStore (from #3035) and Admin (from #3062)
- receipt_store.go: kept BackendTypeName but used #3050's slog convention
- parquet_store_test.go: kept #3053's deterministic pruning test fix

Made-with: Cursor
github-merge-queue bot pushed a commit that referenced this pull request Mar 13, 2026
## Summary

The squash-merge of #3039 (`feat(flatkv): add read-only LoadVersion for
state sync`) inadvertently reverted changes from 5 previously-merged
PRs. The `yiren/flatkv-readonly` branch had accumulated stale versions
of files through merge-from-main commits, and when the final
squash-merge landed, those stale versions overwrote the newer code on
`main`.

### PRs reverted by #3039 and restored in this PR

| PR | Title | Key changes lost |
|---|---|---|
| **#2810** | fix(giga): check whether txs follow Giga ordering |
`firstCosmosSeen` tx ordering check, `len(evmEntries) > 0` /
`len(v2Entries) > 0` guards in `ProcessTXsWithOCCGiga` |
| **#3035** | Add receiptdb config option in app.toml |
`ReceiptStoreConfig` in app.toml, `readReceiptStoreConfig()`,
`BackendTypeName()`, receipt config tests |
| **#3043** | Add config to enable lattice hash | `EnableLatticeHash`
config, composite store lattice hash support |
| **#3021** | Background Transaction Generation | `block.go`,
`block_builder.go` for cryptosim benchmark |
| **#3046** | Add console logger and fix memiavl config for benchmark |
`BlocksPerCommit=1`, `SnapshotInterval=1000`,
`SnapshotMinTimeInterval=60` |

### Conflict resolutions

Since several PRs landed after #3039 (notably #3050 slog migration,
#3053 flaky test fix, #3062 admin service), cherry-picks required manual
conflict resolution:

- **`app/app.go`** (#2810): Kept #2810's structural changes, used
`logger.Error` (from #3050) instead of `ctx.Logger().Error`
- **`cmd/seid/cmd/app_config.go`** (#3035): Kept both `ReceiptStore`
(from #3035) and `Admin` (from #3062)
- **`sei-db/ledger_db/receipt/receipt_store.go`** (#3035): Restored
`BackendTypeName` but dropped logger param (superseded by #3050 slog)
- **`sei-db/ledger_db/receipt/parquet_store_test.go`** (#3035): Kept
#3053's deterministic pruning test fix
- **`sei-db/state_db/sc/composite/store_test.go`** (#3043): Merged all
three needed imports
- **`sei-db/common/logger/logger.go`** (#3046): Kept deletion from
#3050; `consoleLogger` is no longer needed with slog
- **`sei-db/state_db/bench/wrappers/db_implementations.go`** (#3046):
Kept #3050's no-logger-param API

---------

Signed-off-by: Cody Littley <cody.littley@seinetwork.io>
Co-authored-by: Cody Littley <56973212+cody-littley@users.noreply.github.com>
Co-authored-by: Cody Littley <cody.littley@seinetwork.io>
yzang2019 added a commit that referenced this pull request Mar 16, 2026
* main:
  fix(giga): match v2 correctness checks (#3071)
  Added clone method to canned random (#3076)
  Helper files for the flatKV cache implementation (#3072)
  fix: restore PRs inadvertently reverted by #3039 squash-merge (#3070)
  Refine logging to avoid printing expensive objects on hot path (#3066)
  Fix flaky tendermint syncer test (#3065)
  Add runtime log level control via gRPC admin service (#3062)
  chore: dcoument run RPC suite on legacy vs giga (#3041)
  chore: self-contained revert tests, contract reorg, and failure analysis (#3033)
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.

4 participants