Skip to content

devshardctl: ParseProtocolVersion rejects route v4 (noisy rotation fallback log) #1542

Open @maria-mitina opened 2026-08-04 15:58 UTC 0 comments Updated 2026-08-04 15:58 UTC
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() in devshard/cmd/devshardctl/escrow_rotator.go derives a registry protocol stamp from the route version segment.
  • ParseProtocolVersion in devshard/types/domain.go only accepts v1 / 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_version empty instead of a parsed enum.

Suggested fix (small)

Either:

  1. Add ProtocolV4 / "v4" to ParseProtocolVersion (and tests), if v4 should be a real protocol stamp; or
  2. 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 without unparseable_protocol spam
  • Settlement still carries state_root_and_protocol_version=v4 as today

🔄 Auto-synced from Issue #1542 every hour.