RPC Optimization

Avoid Unnecessary Calls

Some values are static or change infrequently on c8ntinuum. Consider hardcoding:

Batch Calls

Use Multicall3 (pre-deployed at 0xcA11bde05977b3631167028862bE2a173976CA11) to aggregate multiple read calls into a single RPC request:

Use JSON-RPC Batching Carefully

The documented EVM JSON-RPC batch limit is 2000 requests, with a maximum batch response size of 50000000 bytes. Keep batches well below those limits and make them retryable. In ethers v6, JsonRpcProvider sends concurrent requests as one JSON-RPC batch (tune it with the batchMaxCount and batchStallTime provider options):
If you build batches by hand, POST a JSON array in which every request has jsonrpc: "2.0" and a unique id.

Gas Optimization

  • Use eth_estimateGas for complex transactions
  • A plain CTM transfer (no calldata) to an address that has no code, is not a precompile, and has no EIP-7702 delegation uses exactly 21000 gas. For contracts, precompiles, smart-contract wallets, or delegated EOAs, use eth_estimateGas
  • Keep gasLimit close to the estimate: every EVM transaction is charged at least 50% of its gas limit. See Gas
  • Set reasonable maxFeePerGas — read the base fee from the latest block’s baseFeePerGas (or eth_feeHistory) and the tip from eth_maxPriorityFeePerGas, then use about 2 × baseFeePerGas + tip (the ethers v6 getFeeData() heuristic). eth_gasPrice returns the base fee plus the suggested tip, not the base fee alone

Nonce Management

For applications submitting multiple transactions in rapid succession:
  • Track nonces locally rather than querying eth_getTransactionCount for each tx
  • Submit transactions concurrently with incrementing nonces
  • Handle nonce gaps — c8ntinuum supports nonce gap queuing, but sequential submission is more reliable

Indexing

For historical data queries, use an indexer rather than RPC:
  • On-chain event logs are available via eth_getLogs; keep each request within the 10000 block and 10000 log caps
  • For complex queries (token transfers, DEX trades, balances over time), use a dedicated indexer
  • See Indexers for SubQuery/The Graph guidance and current provider status

Smart Contract Best Practices

  • Use OpenZeppelin contracts for standard patterns
  • When interacting with c8ntinuum precompiles, pass amounts in base ctm units (18 decimals, the same scale as wei). See Tokens
  • Test on a local node before deploying to mainnet — run ./local_node.sh from a checkout of the c8ntinuum node source for a local instance. The node source will be published in a public GitHub repository (repository TBA). See Local Development