batched_calls_limit

Constant v120 → current u32

Limits batch size to prevent excessive transaction weight and potential DoS.

Current Value

10922
Relevant for: developerswallets

The Big Picture

Batching saves gas but has limits. This constant tells you the maximum calls per batch. For large operations, split across multiple transactions.

Why This Matters

If you're building a wallet or dApp that batches operations, you need to respect this limit. Exceeding it means your transaction will fail.

Example

With batched_calls_limit of 10922, you can batch up to 10922 calls. For 20000 operations, you'll need at least 2 transactions.

Common Questions

Why is there a limit?
Large batches consume lots of block weight. The limit ensures batches fit within block constraints and prevents DoS attacks.
What happens if I exceed the limit?
The transaction fails with TooManyCalls error. No calls execute, but you still pay fees.

From Chain Metadata

The limit on the number of batched calls.

Use Cases

  • Check limit before constructing batches
  • Design batch-based workflows
  • Calculate maximum operations per transaction

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Query batched_calls_limit constant
const value = api.consts[stringCamelCase("Utility")][stringCamelCase("batched_calls_limit")];
console.log("batched_calls_limit:", value.toHuman());

Type Information

Type
u32
Byte Size
4 bytes
Encoding
fixed
Raw Hex
0xaa2a0000

Runtime Info

Pallet
Utility
First Version
v120
Latest Version
v120
Current Runtime
v393