Description
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
Addbefore the registry grows beyond the selected limit. - Bound the number of entries that
ProposeCommitmentmay 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:
- Implement UpdateVerifierRegistry #209 implements registry updates.
- Implement ProposeCommitment #212 selects verifiers when a commitment is proposed.
- Reconsider verifier bonding and registry admission flow #250 decides how verifier registration, admission, removal, and re-addition work together.
Outcome
Every registry operation has a known storage and compute limit, and a cluster cannot grow its registry until normal commitment processing becomes unusable.
Activity