Skip to content

ReadinessCheck accepts negative minPeers/maxBlocksBehind values, causing incorrect health #10451

@Nakshatra480

Description

@Nakshatra480

The /readiness health check endpoint does not validate that the minPeers and maxBlocksBehind query parameters are non-negative integers. Negative values are silently accepted, producing semantically incorrect health responses:

  • minPeers=-N → always reports healthy (even with 0 peers)
  • maxBlocksBehind=-N → always reports unhealthy (even when fully synced)

Expected Behaviour

Negative values should be rejected with an appropriate error message in the diagnostic response, consistent with how NumberFormatException is already handled for non-numeric inputs.

Acceptance Criteria

  • minPeers rejects negative values and reports peersOk = false with error detail
  • maxBlocksBehind rejects negative values and reports syncOk = false with error detail
  • Unit tests cover both negative value cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions