Skip to content

feat: Implement DoS protection for bulk contract operations#447

Open
kryputh wants to merge 1 commit intorinafcode:mainfrom
kryputh:issue-238-bulk-operation-dos-limits
Open

feat: Implement DoS protection for bulk contract operations#447
kryputh wants to merge 1 commit intorinafcode:mainfrom
kryputh:issue-238-bulk-operation-dos-limits

Conversation

@kryputh
Copy link
Copy Markdown
Contributor

@kryputh kryputh commented Apr 26, 2026

Overview

This PR addresses Issue #238 by implementing robust protection against Denial of Service (DoS) attacks targeting bulk operations. It introduces batch size constraints, gas budget monitoring, and per-caller rate limiting across all critical modules.

Changes

  • bulk_limits.rs: New module defining MAX_BATCH_SIZE, MAX_GAS_BUDGET, and rate-limiting logic.
  • Bridge: Limited validator signature counts and added rate limiting to bridge_out.
  • Emergency: Limited the number of chains that can be paused/resumed in a single transaction.
  • Message Passing: Added gas budget checks to check_timeouts to prevent iteration-based DoS.
  • Tokenization: Capped the number of tags allowed during NFT minting and updates.
  • Escrow: Limited the number of signers permitted for new escrows.
  • Reporting & BFT: Integrated gas guards into all loops that iterate over stored maps (validators, proposals, report templates, etc.).

Verification

  • Verified code structure and logic flow across all modified modules.
  • Implemented unit tests within bulk_limits.rs for batch checking and rate-limit reset logic.

Closes #238

@Xhristin3
Copy link
Copy Markdown
Contributor

@kryputh resolve conflicts.

@kryputh
Copy link
Copy Markdown
Contributor Author

kryputh commented Apr 27, 2026

Sure I will do that soon

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.

Fix potential denial of service in bulk operations

2 participants