devshardctl: ParseProtocolVersion rejects route v4 (noisy rotation fallback log) #1542
enhancement good first issue Priority: Low devshards
Summary
When the gateway serves DEVSHARD_ROUTE_PREFIX=/devshard/v4, escrow autorotation logs a fallback on every create:
escrow_rotation_protocol_version_fallback route_prefix="/devshard/v4" version="v4" reason=unparseable_protocol error=unknown protocol version "v4"
This is cosmetic: rotation create/settle still succeed. The empty local protocol_version stamp is not used for settlement (settlement uses StateRootAndProtocolVersion from the session SM, e.g. v4).
It clutters testnet/gateway logs and makes health checks harder to read.
Root cause
rotationEscrowProtocolVersion()indevshard/cmd/devshardctl/escrow_rotator.goderives a registry protocol stamp from the route version segment.ParseProtocolVersionindevshard/types/domain.goonly acceptsv1/v2/v3."v4"hits the default branch → log + return"".
Observed impact
- Does not fail escrow rotation (fallback log is followed by
escrow_rotation_created). - Does not affect settlement / state roots.
- Only leaves gateway DB
protocol_versionempty instead of a parsed enum.
Suggested fix (small)
Either:
- Add
ProtocolV4/"v4"toParseProtocolVersion(and tests), if v4 should be a real protocol stamp; or - Stop treating unknown route majors as an error-level fallback (silent empty stamp / explicit config), if route name and protocol enum are intentionally decoupled.
Also worth aligning compose healthcheck (curl vs image wget) separately — not required for this issue.
Test plan
- Unit:
ParseProtocolVersion("v4")(or chosen behavior) covered - With
DEVSHARD_ROUTE_PREFIX=/devshard/v4, autorotation creates escrows withoutunparseable_protocolspam - Settlement still carries
state_root_and_protocol_version=v4as today
🔄 Auto-synced from Issue #1542 every hour.