Skip to content

security(registry): add max batch size limit to batch_register_issuers (#132)#150

Closed
Micheal-Blessed wants to merge 2 commits into
TrusTrove:mainfrom
Micheal-Blessed:feat/132-registry-batch-size-limit
Closed

security(registry): add max batch size limit to batch_register_issuers (#132)#150
Micheal-Blessed wants to merge 2 commits into
TrusTrove:mainfrom
Micheal-Blessed:feat/132-registry-batch-size-limit

Conversation

@Micheal-Blessed

Copy link
Copy Markdown

Summary

Enforce MAX_BATCH_SIZE=100 on batch_register_issuers to prevent gas exhaustion and DoS.

Changes

  • errors.rs: add BatchTooLarge=5 variant to RegistryError
  • lib.rs: add MAX_BATCH_SIZE constant and early length check with clear panic message
  • test.rs: add test that 101 entries triggers BatchTooLarge panic
  • Delete stale registry test snapshots

Closes #132

TrusTrove#132)

Define MAX_BATCH_SIZE = 100 and panic with BatchTooLarge error
when the input vector exceeds this limit to prevent gas exhaustion
and DoS attacks from oversized batch registration.

Changes:
- errors.rs: add BatchTooLarge = 5 variant to RegistryError
- lib.rs: add MAX_BATCH_SIZE constant and early length check
- test.rs: add test_batch_register_issuers_exceeds_max_panics
- Delete stale test snapshots (regenerated on next test run)

Closes TrusTrove#132
Resolved conflicts:
- errors.rs: adopt BatchSizeExceeded naming from upstream
- lib.rs: batch size 50 with BatchSizeExceeded error, keep MAX_BATCH_SIZE constant
- Snapshots: accept upstream versions
@drips-wave

drips-wave Bot commented Jul 1, 2026

Copy link
Copy Markdown

@Micheal-Blessed Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Micheal-Blessed

Copy link
Copy Markdown
Author

@K1NGD4VID please review and merge

@K1NGD4VID

Copy link
Copy Markdown
Contributor

Resolve Merge Conflict @Micheal-Blessed

@K1NGD4VID K1NGD4VID closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security(registry): add max limit to batch_register_issuers

2 participants