English version: /en/doc/compatibility/json-rpc-deviations.html
JSON-RPC Deviations
TL;DR
- 実装済みメソッドは限定される。
eth_getLogsは制約が強いが、blockHashは条件付き対応、topics[0]の OR配列は対応済み。- blockTagはメソッドごとに制約があり、
latest系に加えてearliest/QUANTITYを受理するが historical は多くが非対応。 eth_sendRawTransactionは submit API委譲で、実行成功は receipt で確認する。eth_feeHistoryは対応済み(blockCountは number/QUANTITY/10進文字列を受理)。eth_gasPriceはbase_fee単体ではなく、受理条件に寄せた推定値を返す。
適用範囲: 本ページはJSON-RPC差分の詳細。全体ポリシーは ../rpc/overview.md を正本とする。
メソッド別差分(要点)
eth_getBalancelatest/pending/safe/finalized/earliest/QUANTITYを受理- 実質 historical は
exec.state.unavailableまたはinvalid.block_range.out_of_window
eth_getTransactionCountlatest/pending/safe/finalized/earliest/QUANTITYを受理pendingは pending nonceearliestや過去block nonceは非対応(historical nonce未提供)
eth_getCodelatest/pending/safe/finalized/earliest/QUANTITYを受理- 実質 historical は
exec.state.unavailableまたはinvalid.block_range.out_of_window
eth_getStorageAtlatest/pending/safe/finalized/earliest/QUANTITYを受理- slotは QUANTITY/DATA(32 bytes) 受理
- 実質 historical は
exec.state.unavailableまたはinvalid.block_range.out_of_window
eth_call,eth_estimateGaslatest/pending/safe/finalized/earliest/QUANTITYを受理- historical execution は非対応(
exec.state.unavailable/invalid.block_range.out_of_window) - 未対応フィールドは
-32602
eth_getLogsblockHashは条件付き対応(fromBlock/toBlock併用不可、直近Nブロック走査で解決)address単一のみtopics[0]OR配列は対応(最大16件)topics[1+]条件は非対応- 範囲超過は
-32005
eth_feeHistoryblockCountはnumber/QUANTITY/ 10進文字列を受理blockCount <= 256pendingは現状latest同義
eth_maxPriorityFeePerGas- 観測データ不足時は
-32000(state unavailable)
- 観測データ不足時は
eth_gasPricemax(base_fee + max(推定priority,min_priority), min_gas_price)を返す
未対応メソッド
eth_getBlockByHasheth_newFilter/eth_getFilterChanges/eth_uninstallFiltereth_subscribe/eth_unsubscribeeth_pendingTransactions
エラー設計
-32602: invalid params-32000: state unavailable / execution failed-32001: resource not found(pruned含む)-32005: limit exceeded(logs)- (補足)submit内部エラーは
-32603が返る経路あり
落とし穴
- 標準ノード前提の
eth_getLogsfilter(address[]やtopics[1+])をそのまま投げる eth_sendRawTransactionだけで成功確定扱いにするeth_getLogsのblockHashが常に解決できる前提で使う(走査上限あり)
根拠
tools/rpc-gateway/src/handlers.tstools/rpc-gateway/README.mdcrates/ic-evm-rpc/src/lib.rs