RPC error -32602: invalid conditional options: <field>: <reason>

Last updated:

At a glance

Error details
PropertyValue
Applies toRobinhood Chain (chain ID 4663)
JSON-RPC code-32602
Rejected byTriport, before any upstream call
Supported optionsblockNumberMin, blockNumberMax, timestampMin, timestampMax, knownAccounts

Cause

The proxy validates the shape of the conditional options before forwarding anything. Only blockNumberMin, blockNumberMax, timestampMin, timestampMax and knownAccounts are accepted; an unknown field or a malformed value is rejected locally with this message. Triport validates the option names and shapes only — it never evaluates the conditions themselves.

Solution

  1. Read the <field> and <reason> in the message: it names the exact option that failed validation.
  2. Keep only the five supported options. Number bounds accept a hex quantity or a decimal number; send hex.
  3. Take blockNumberMin and blockNumberMax from the l1BlockNumber field of eth_getBlockByNumber, not from eth_blockNumber: the bounds are compared with the parent-chain block number.
  4. Remember that a JSON-RPC batch containing this method is dispatched per item, so one bad element does not invalidate the others.

Example

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32602,
    "message": "invalid conditional options: blockNumberMax: must be a non-negative hex or decimal number"
  }
}

FAQ

Does Triport check whether my conditions hold?
No. It validates the option names and shapes; the chain evaluates the conditions. A condition that does not hold comes back from the chain as -32003, for example BlockNumberMax condition not met, not as this error.
Is gas spent on this rejection?
No. The request never reaches an upstream, so nothing is spent.