Menu

1 / 2

Contract size limits on Midnight: what breaks when your dApp grows too complex

DEV Community·Harrie·6 months ago
#BIj0hEeo
Reading 0:00
15s threshold

You write a clean contract. It works. Then you add governance. Then staking. Then rewards. Then you deploy and hit a wall.

Midnight has real limits on contract complexity. They don't all surface the same way — some kill deployment, some kill individual transactions, and some just make users wait while proofs grind. This article covers all three, with compiler-verified contracts showing what actually works.

All three contracts compile against the latest Compact compiler. Verified CI run: IamHarrie-Labs/compact-size-limits-guide

The three limits

Lace's 13-circuit deployment limit is a hard cap enforced by the wallet at deploy time. Exceed 13 exported circuits and deployment is rejected. This is wallet-level, not protocol-level, which means it could change with a wallet update — but for now, 13 is the number.

Block weight limits (error 1010) are a runtime problem. Midnight blocks measure transactions across five dimensions: readTime, computeTime, blockUsage, bytesWritten, and bytesChurned.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.