Для разработчиков / JSON-RPC

Ошибки и ограничения

Всё несут пять кодов ошибок. Обрабатывать как следует стоит -32005, потому что он означает ограничение, а не ошибку, - тот же самый запрос пройдёт позже.

Пять кодов

КодValue
-32602Invalid paramsa malformed address, block tag, filter id or topic filter
-32601Method not found or not availablean unregistered name, or one refused by design such as eth_sendTransaction
-32000Executiona revert, a decode failure, a signature failure, or a consensus rejection
-32005Limita rate limit, a full queue, a timeout, a size cap or a filter cap - every row on this page
-32603Internala write-ahead-log or coordinator failure; also every non-send error when you are on the WebSocket transport

Операционно важно различие между -32000 и -32005. Ошибка исполнения - это факт о вашей транзакции, и повтор ничего не изменит; ошибка ограничения - это факт о текущей нагрузке узла, и тот же самый запрос пройдёт, как только появится место.

Никакого error.data

Причины revert ваша библиотека декодировать не сможет

A revert arrives as message text - "execution reverted: 0x<returndata>" - and error.data is absent.

Libraries decode custom errors and revert strings out of error.data, so on this chain they cannot. ethers and viem will both surface the raw message instead of a decoded error. If you need the reason, parse the hex out of the message yourself and decode it against your own ABI.

Обходной путь - на странице отличий.

Sending a transaction

ОграничениеЗначениеПеременнаяПри нарушении
Raw transaction sizechecked on the hex string BEFORE decoding, so an oversized transaction is a limit error rather than a decode error128 KiBконстанта компиляции-32005
Admission queuequeued transactions across all senders4,096 totalADMISSION_CAPACITY-32005 "sequencer admission queue is full"
Per sendercompile-time, so one sender cannot fill the queue with unfillable nonces64константа компиляции-32005
Execution waitthe coordinator's own deadline is 5 s; the call waits until the transaction executes or this expires6 sконстанта компиляции-32005 "transaction timed out waiting for execution"
Per execution batchMAX_ADMIT_PER_BATCH - a throughput mechanism, not a caller-visible limit512константа компиляции-

Expensive reads

ОграничениеЗначениеПеременнаяПри нарушении
Token bucket burstguards eth_call, eth_estimateGas and eth_getLogs together256HEAVY_READ_BURST-32005 "rate limit exceeded for expensive read methods"
Refill rateprocess-wide and shared by every caller - explicitly a backstop, not per-client limiting128/sHEAVY_READ_PER_SEC-
eth_getLogs spana span of 5,000 or more is refused outrightunder 5,000 blocksконстанта компиляции-32005 "log block range is too wide"
eth_getLogs matchesnarrow the filter or walk the range in windows10,000константа компиляции-32005 "eth_getLogs matched too many logs"

The HTTP listener

ОграничениеЗначениеПеременнаяПри нарушении
Connections512RPC_MAX_CONNECTIONS-
Request bodythe public vhost caps a request at 1 MiB before this applies, and 1 MiB of JSON-RPC batch is already thousands of calls2 MiBRPC_MAX_REQUEST_BYTES-
Response body16 MiBRPC_MAX_RESPONSE_BYTES-
Batch lengthsplit a larger batch client-side32RPC_MAX_BATCH-
Keep-aliveTCP_NODELAY is on30 sRPC_KEEP_ALIVE_SECS-

Filters

ОграничениеЗначениеПеременнаяПри нарушении
Filters per node1,024MAX_FILTERS-32005 "filter limit reached"
Buffer per filterthe OLDEST entries are trimmed when you stop polling, so a slow poller loses the beginning of its backlog rather than the end1,024 entriesMAX_FILTER_BUFFER-
Idle expirymeasured since the last poll, and expiry is silent - the next poll answers -32602 "filter not found"300 sFILTER_TTL_SECS-32602

Два значения, которые не настройки

MIN_GAS_PRICE (1 wei) и EXECUTION_SPEC (Cancun) выглядят настройками и намеренно являются константами времени компиляции.

Both are compile-time constants rather than environment variables, and that is a correctness requirement rather than an oversight. Either one made operator-tunable would let a replica reject or re-price a transaction the leader had accepted, and derivation would halt on the divergence. Pinning the hardfork also means a revm upgrade cannot silently change gas accounting underneath an already-settled chain.

Как правильно обходиться с ограничениями

Ограничения скорости на клиента нет, заголовка с остатком бюджета тоже, так что клиент не может само-притормозить по сигналу - он обязан быть аккуратным по построению. Важны три вещи:

  • Отступайте на -32005, не повторяйте сразу. Ведро тяжёлых чтений общее для всех вызывающих, так что плотный цикл повторов - самый быстрый способ держать его пустым для всех, включая вас самих.
  • Нарезайте диапазоны eth_getLogs окнами меньше 5000 блоков и ожидайте предел совпадений в 10 000. В сети, которая хранит около двух минут блоков, практический предел, с которым вы столкнётесь первым, - хранение, а не длина диапазона.
  • Держите пакеты в пределах 32. Сверх этого пакет отвергается, а не обрезается.
javascript
// RPC_URL: https://rpc.picklechain.xyz on the public testnet, or a node of your own.
async function call(body, attempt = 0) {
  const res = await fetch(RPC_URL, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify(body),
  });
  const json = await res.json();

  // -32005 is a limit, not a mistake: the same request works later.
  if (json.error?.code === -32005 && attempt < 5) {
    await new Promise((r) => setTimeout(r, 2 ** attempt * 250));
    return call(body, attempt + 1);
  }
  return json;
}