Skip to content

Contracts: Concurrent register vs max_cap race / off-by-one audit #742

Description

@joelpeace48-cell

Context

register enforces get_max_cap/get_participant_count. Under high concurrent submission near the
cap, off-by-one or read-modify-write ordering can let participant count exceed the cap or reject the
exact-Nth registrant incorrectly.

Scope

  • Audit the count increment vs cap check ordering for atomicity within a single invocation.
  • Define behavior at exactly cap (Nth allowed, N+1 rejected).
  • Add tests filling to the cap boundary.

Acceptance criteria

  • Count can never exceed max_cap.
  • Exact-cap registrant succeeds; next reverts with typed error.
  • Boundary tests added.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions