Skip to content

keeper: validate round IDs before queue persistence #173

Description

@karagozemin

Summary

Validate round IDs before the keeper queue persists or sorts them.

Why this matters

KeeperStore.addRound() currently accepts arbitrary strings. A value such as abc, -1, or 1.5 can be written to .keeper-store.json, after which listRounds() or the watch loop can throw while converting it to BigInt.

Scope

  • Add a small shared round-ID parser/normalizer for keeper queue operations.
  • Accept positive integer values supplied as bigint, safe integer number, or decimal string.
  • Reject zero, negative, fractional, empty, and non-numeric values before writing the store.
  • Use the same validation in the queue CLI for add and remove.
  • Do not change the persisted JSON shape.

Acceptance criteria

  • Invalid IDs produce a concise, actionable CLI error and non-zero exit.
  • Invalid IDs are never persisted.
  • Equivalent valid inputs such as 1, 1n, and "1" normalize to one queue entry.
  • Store unit tests cover valid, duplicate, zero, negative, fractional, and non-numeric inputs.
  • pnpm keeper:test and keeper typecheck pass.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26area: keeperPermissionless keeper servicebugSomething isn't workinggood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions