Skip to content

Bound verifier registry size and selection cost #254

Description

@snawaz

Goal

Put a clear limit on verifier registry size and on the work needed to select a verifier.

Why

VerifierRegistry stores every verifier in one growing Vec. UpdateVerifierRegistry can keep adding entries, and ProposeCommitment may scan the whole list before it finds an eligible verifier.

Without a limit, the registry can become too large or too expensive to scan in one transaction. The program should reject growth before it reaches a size that later instructions cannot handle.

Design Decisions

Choose and document:

  • the maximum verifier count for the MVP;
  • whether the limit is a program constant or part of cluster config;
  • whether a hard cap is enough or the registry needs pages;
  • whether Merkle membership is useful for a later design; and
  • how removal and re-addition affect the round-robin cursor.

The simplest acceptable MVP may be a tested hard cap. Paging or Merkle membership should be added only when the expected verifier count requires the extra complexity.

Scope

  • Measure the worst-case cost of selecting a verifier from the proposed maximum count.
  • Reject Add before the registry grows beyond the selected limit.
  • Bound the number of entries that ProposeCommitment may scan in one call.
  • Keep round-robin selection correct at the end of the registry and after membership changes.
  • Define who pays any additional account rent.
  • Add tests for the last allowed entry, one entry above the limit, no eligible verifier, and cursor wraparound.
  • Update the implementation notes with the selected limit and storage design.

Related work:

Outcome

Every registry operation has a known storage and compute limit, and a cluster cannot grow its registry until normal commitment processing becomes unusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions