Storage Limits
Makechain enforces per-account storage limits to prevent unbounded state growth. Each account has storage units (default: 1 for free tier), and limits scale with units.
Per Storage Unit (Yearly)
| Resource | Limit |
|---|---|
| Projects | 10 |
| Commit metadata per project | 10,000 |
| Refs per project | 200 |
| Collaborators per project | 50 |
| Keys per account | 50 |
| Verifications per account | 50 |
| DA storage | 1 GB |
Enforcement
Limits are enforced at state transition time:
- Projects:
PROJECT_CREATEandFORKcheckproject_count < storage_units * 10before incrementing.PROJECT_REMOVEdecrements the count, freeing capacity for new projects. - Refs:
REF_UPDATEchecksref_count < 200when creating a new ref. Updating an existing ref doesn't change the count.REF_DELETEdecrements. - Collaborators:
COLLABORATOR_ADDcheckscollaborator_count < 50when adding a new collaborator. Permission updates don't change the count. - Commits:
COMMIT_BUNDLEalways appends commits, then triggers auto-pruning if the count exceeds 10,000. - Keys:
KEY_ADDcheckskey_count < 50when adding a new key.KEY_REMOVEdecrements. - Verifications:
VERIFICATION_ADDchecksverification_count < 50when adding a new verification.VERIFICATION_REMOVEdecrements.
Commit Pruning
When a project exceeds its commit metadata limit, the oldest unprotected commits are pruned from consensus state:
A commit referenced by any active ref is never pruned. The ref's head commit and its entire parent chain (reachable via parent links) are protected.
Pruning Algorithm
- Build the protected set: BFS from all active ref heads through parent links
- Enumerate all commits; collect those not in the protected set
- Sort unprotected commits by
indexed_atascending (oldest first) - Delete oldest unprotected commits until at or below the limit
What This Means in Practice
- Head commits for every branch/tag are always retained
- Intermediate commits on active branches are retained
- Commits on deleted branches with no remaining ref are pruned first
- Full commit history remains recoverable from the DA layer — pruning only removes
CommitMetafrom validator state
Error Types
| Error | Trigger |
|---|---|
StorageLimitExceeded | Project count at capacity |
RefLimitExceeded | Ref count at 200 |
CollaboratorLimitExceeded | Collaborator count at 50 |
KeyLimitExceeded | Key count at 50 |
VerificationLimitExceeded | Verification count at 50 |