Block limit exceeded (1010) when deploying contracts with many circuits

A developer in #dev-chat is hitting “1010: Transaction would exhaust the block limits” when deploying a contract with many circuits on undeployed.

What’s happening:

The node computes transaction cost across 5 dimensions (readTime, computeTime, blockUsage, bytesWritten, bytesChurned), normalizes each against the block limits, then maps the maximum to a Substrate weight. If the weight exceeds the block capacity, Substrate rejects with InvalidTransaction::ExhaustsResources (error 1010).

Source path: pallets/midnight/src/lib.rs:590 (get_tx_weight) → ledger/…/mod.rs:582
(get_transaction_cost) → cost.normalize(limits) in base-crypto/src/cost_model.rs:261 → Substrate frame_executive weight check.

Questions for the Compact team:

  1. Is there a recommended way to split a contract with many circuits into multiple smaller deployments?
  2. Are the current bytesWritten limits expected to increase, or are they intentionally tight?
  3. Is there tooling or a Compact-level diagnostic that can estimate transaction size before deployment, so devs can catch this earlier than the 1010 at submission time?
  4. Any guidance on what “many circuits” realistically means in terms of hitting these limits? (e.g., rough circuit count or contract complexity thresholds)
1 Like