cmd: enable errcheck across cmd/* CLI tooling and fix violations - #23630
Merged
AskAlexSharov merged 4 commits intoAug 29, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Enables errcheck across ten CLI packages and handles previously ignored errors.
Changes:
- Propagates database, state, output, and filesystem errors.
- Fixes import and snapshot-verification failure handling.
- Centralizes datadir unlock handling.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.golangci.yml |
Enables errcheck for migrated packages. |
cmd/capcli/cli.go |
Propagates snapshot and state errors. |
cmd/caplin/caplin1/run.go |
Checks database setup and initialization errors. |
cmd/evm/internal/t8ntool/execution.go |
Checks genesis state mutations. |
cmd/evm/internal/t8ntool/transition.go |
Handles dump and cleanup errors. |
cmd/evm/runner.go |
Handles state mutation and cleanup errors. |
cmd/evm/staterunner.go |
Reports temporary-directory cleanup failures. |
cmd/integration/commands/commitment.go |
Checks output synchronization. |
cmd/integration/commands/stages.go |
Explicitly handles intentional ignored errors. |
cmd/integration/commands/state_history.go |
Propagates history scan and unlock errors. |
cmd/rlpdump/main.go |
Propagates RLP list-finalization errors. |
cmd/rpcdaemon/cli/config.go |
Handles database-view and gRPC serving errors. |
cmd/rpcdaemon/health/health.go |
Reports response-write failures. |
cmd/utils/app/backtest_commitment_cmd.go |
Uses shared datadir unlock handling. |
cmd/utils/app/import_cmd.go |
Propagates database errors and simplifies missing-block detection. |
cmd/utils/app/snapshots_cmd.go |
Handles unlock and deletion errors. |
cmd/utils/app/squeeze_cmd.go |
Uses shared datadir unlock handling. |
cmd/utils/cmdtest/test_cmd.go |
Propagates stdin write errors and marks intentional ignores. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
… race, and test coverage
AskAlexSharov
approved these changes
Aug 29, 2026
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.
Continues the errcheck rollout for #22538 into ten
cmd/*packages:cmd/capcli,cmd/caplin/caplin1,cmd/evm(+internal/t8ntool),cmd/integration/commands,cmd/rlpdump,cmd/rpcdaemon/cli,cmd/rpcdaemon/health,cmd/utils/app,cmd/utils/cmdtest.Notable fixes beyond lint-satisfying:
missingBlocks(import tooling) calledheadBlock.NumberU64()right after a discardedchainDB.Viewcall - a failed view leftheadBlocknil, a live panic. Traced the surrounding branch to its original 2021 commit and confirmed it never actually differentiated behavior; removed the dead branch along with the now-unusedblockReaderparameter.capclilogged "Successfully checked" unconditionally even whenReadBlockBySlotfailed mid-loop, defeating the point of a checking tool.t8ntool's DumpToCollector(the tool's actual output) andMakePreState'sgenesis-account setters were silently discarded; the latter now panics consistently with the rest of that function instead of a mix of checked/unchecked calls.caplin1.OpenCaplinDatabase'sstartupRemoveAll/MkdirAll/genesisDb.Initializecalls were unchecked, risking either a skipped wipeout or aMustOpenpanic on a missing directory instead of a clear error.Deduplicated the
defer l.Unlock()datadir-flock pattern (copied ~15 times acrosssnapshots_cmd.go/squeeze_cmd.go/backtest_commitment_cmd.go) into a singleunlockDatadirhelper, matching the convention already established inbacktest_commitment_cmd.gorather than inventing a new one.