Skip to content

fix(lib): log instead of silently swallowing errors in LogNonSigners - #564

Open
0xrlawrence wants to merge 1 commit into
canopy-network:mainfrom
0xrlawrence:fix/lognonsigners-silent-errors
Open

fix(lib): log instead of silently swallowing errors in LogNonSigners#564
0xrlawrence wants to merge 1 commit into
canopy-network:mainfrom
0xrlawrence:fix/lognonsigners-silent-errors

Conversation

@0xrlawrence

Copy link
Copy Markdown

Description

LogNonSigners has no return values, so these two assignments discarded the error entirely:

err = ErrInvalidSignerBitmap(e)
return

A malformed signer bitmap caused non-signer logging to stop with no trace at all — exactly the moment an operator would want a log line. The early NewValidatorSet failure returned silently for the same reason.

staticcheck flagged the dead assignments as SA4006.

Changes Made

  • All three error paths now log through the LoggerI the function already receives.
  • Removed the dead assignments to err.

Control flow is unchanged: the function still returns early on each error.

Testing

  • go build ./...
  • go test ./lib/ passes
  • staticcheck no longer reports SA4006 in lib/consensus.go

🤖 Generated with Claude Code

LogNonSigners has no return values, so the two 'err = ErrInvalidSignerBitmap(...)'
assignments followed by a bare return discarded the diagnosis entirely.
A malformed signer bitmap caused non-signer logging to stop with no trace,
which is exactly the moment an operator would want a log line. The early
NewValidatorSet failure returned silently for the same reason.

All three paths now log through the LoggerI the function already receives.
staticcheck flagged the dead assignments as SA4006.

Behaviour is otherwise unchanged: the function still returns early on
each error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant