# SPDX-License-Identifier: CC-BY-NC-SA-4.0 # # The Ethereum JSON-RPC interface, as a Spectral ruleset. # # GENERATED by scripts/build-ruleset.py from the measured profile. Do not hand-edit: the # core-method rules below exist because 21 public endpoints were # called and these methods answered on a majority of them. Re-probe, rebuild, and the rules # follow the evidence. # # Point it at an OpenRPC document — Spectral lints any JSON or YAML, so no format needs # declaring — and it reports whether the provider advertises the interoperable core. # # WHAT THIS DOES NOT CHECK # - Whether the endpoint actually serves what its document advertises. For JSON-RPC that # is the interesting question, and only a probe answers it: run # scripts/probe-adopters.py, which calls every method and reads the result. # - Chain semantics. Two endpoints can both serve eth_call and disagree about state. # - Subscriptions. eth_subscribe is a WebSocket transport concern, not an OpenRPC one. # - Batch requests, which are a transport framing feature with nothing to lint. # # Built-in functions only, so it runs unchanged in the browser validator. rules: eth-core-eth-blocknumber: description: >- eth_blockNumber is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_blockNumber is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_blockNumber required: [name] eth-core-eth-chainid: description: >- eth_chainId is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_chainId is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_chainId required: [name] eth-core-eth-estimategas: description: >- eth_estimateGas is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_estimateGas is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_estimateGas required: [name] eth-core-eth-gasprice: description: >- eth_gasPrice is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_gasPrice is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_gasPrice required: [name] eth-core-eth-getblockbynumber: description: >- eth_getBlockByNumber is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getBlockByNumber is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getBlockByNumber required: [name] eth-core-eth-getblocktransactioncountbynumber: description: >- eth_getBlockTransactionCountByNumber is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getBlockTransactionCountByNumber is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getBlockTransactionCountByNumber required: [name] eth-core-eth-gettransactioncount: description: >- eth_getTransactionCount is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getTransactionCount is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getTransactionCount required: [name] eth-core-net-version: description: >- net_version is core: 20 of 21 probed public endpoints served it (95.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "net_version is not declared. It is served by 95.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: net_version required: [name] eth-core-eth-call: description: >- eth_call is core: 19 of 21 probed public endpoints served it (90.5%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_call is not declared. It is served by 90.5% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_call required: [name] eth-core-eth-feehistory: description: >- eth_feeHistory is core: 19 of 21 probed public endpoints served it (90.5%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_feeHistory is not declared. It is served by 90.5% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_feeHistory required: [name] eth-core-eth-getbalance: description: >- eth_getBalance is core: 19 of 21 probed public endpoints served it (90.5%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getBalance is not declared. It is served by 90.5% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getBalance required: [name] eth-core-eth-getcode: description: >- eth_getCode is core: 19 of 21 probed public endpoints served it (90.5%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getCode is not declared. It is served by 90.5% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getCode required: [name] eth-core-eth-getlogs: description: >- eth_getLogs is core: 19 of 21 probed public endpoints served it (90.5%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getLogs is not declared. It is served by 90.5% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getLogs required: [name] eth-core-eth-accounts: description: >- eth_accounts is core: 18 of 21 probed public endpoints served it (85.7%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_accounts is not declared. It is served by 85.7% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_accounts required: [name] eth-core-eth-getfilterchanges: description: >- eth_getFilterChanges is core: 18 of 21 probed public endpoints served it (85.7%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getFilterChanges is not declared. It is served by 85.7% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getFilterChanges required: [name] eth-core-eth-maxpriorityfeepergas: description: >- eth_maxPriorityFeePerGas is core: 18 of 21 probed public endpoints served it (85.7%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_maxPriorityFeePerGas is not declared. It is served by 85.7% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_maxPriorityFeePerGas required: [name] eth-core-eth-newblockfilter: description: >- eth_newBlockFilter is core: 17 of 21 probed public endpoints served it (81.0%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_newBlockFilter is not declared. It is served by 81.0% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_newBlockFilter required: [name] eth-core-eth-uninstallfilter: description: >- eth_uninstallFilter is core: 17 of 21 probed public endpoints served it (81.0%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_uninstallFilter is not declared. It is served by 81.0% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_uninstallFilter required: [name] eth-core-eth-syncing: description: >- eth_syncing is core: 16 of 21 probed public endpoints served it (76.2%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_syncing is not declared. It is served by 76.2% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_syncing required: [name] eth-core-eth-getproof: description: >- eth_getProof is core: 14 of 21 probed public endpoints served it (66.7%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_getProof is not declared. It is served by 66.7% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_getProof required: [name] eth-core-eth-createaccesslist: description: >- eth_createAccessList is core: 12 of 21 probed public endpoints served it (57.1%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_createAccessList is not declared. It is served by 57.1% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_createAccessList required: [name] eth-core-eth-blobbasefee: description: >- eth_blobBaseFee is core: 11 of 21 probed public endpoints served it (52.4%). A document that does not advertise it is not describing the interoperable Ethereum JSON-RPC surface. message: "eth_blobBaseFee is not declared. It is served by 52.4% of public endpoints." severity: error documentationUrl: https://apicommons.org/standards/blockchain/#core given: "$" then: field: methods function: schema functionOptions: schema: type: array contains: type: object properties: name: const: eth_blobBaseFee required: [name] eth-jsonrpc-is-an-openrpc-document: description: >- The document must declare an `openrpc` version. JSON-RPC has a specification format of its own, and a profile published as anything else cannot be consumed by OpenRPC tooling. message: "No `openrpc` version declared — this is not an OpenRPC document." severity: error documentationUrl: https://spec.open-rpc.org/ given: "$" then: function: schema functionOptions: schema: type: object required: [openrpc] eth-jsonrpc-method-names-are-namespaced: description: >- Every JSON-RPC method name carries a namespace prefix — eth_, net_, debug_, txpool_. An unprefixed name collides across namespaces the moment two specifications meet on one endpoint, which on an EVM node they always do. message: "Method name is not namespaced — expected a prefix such as `eth_`." severity: warn documentationUrl: https://apicommons.org/standards/blockchain/ given: "$.methods[*].name" then: function: pattern functionOptions: match: "^[a-z0-9]+_[A-Za-z0-9_]+$" eth-jsonrpc-does-not-advertise-engine: description: >- The engine namespace is the consensus-layer API, spoken between a node's execution and consensus clients over an authenticated port. No public endpoint should serve it, and none of the probed endpoints did. A public profile advertising it is either describing an internal surface or exposing one. message: "This document advertises an `engine_` method on a public profile." severity: warn documentationUrl: https://apicommons.org/standards/blockchain/#vendor given: "$.methods[?(@.name && @.name.match(/^engine_/))]" then: function: falsy