For the complete documentation index, see llms.txt. This page is also available as Markdown.

JSON-RPC 支持

Rome EVM 端点使用标准的 Ethereum JSON-RPC。Foundry、Hardhat、ethers、viem 和 MetaMask 在 Rome 上的工作方式与在任何 EVM 链上一样。本页面列出受支持的内容以及少量值得了解的 Rome 特有行为。

支持的方法

核心(状态与执行): eth_chainId, eth_blockNumber, eth_getBalance, eth_getCode, eth_getStorageAt, eth_getTransactionCount, eth_call, eth_estimateGas, eth_gasPrice, eth_maxPriorityFeePerGas, eth_feeHistory.

区块与交易: eth_getBlockByNumber, eth_getBlockByHash, eth_getBlockReceipts, eth_getTransactionByHash, eth_getTransactionReceipt, eth_sendRawTransaction,以及按索引/计数的变体。

日志与过滤器: eth_getLogs, eth_newFilter, eth_newBlockFilter, eth_getFilterChanges, eth_getFilterLogs, eth_uninstallFilter.

WebSocket 订阅: eth_subscribe / eth_unsubscribe (newHeads, logs)。参见 WebSocket 订阅.

Net / web3: net_version, net_listening, net_peerCount, web3_clientVersion.

不支持

debug_traceTransaction / trace_* (交易追踪), eth_getProof, eth_createAccessList, eth_blobBaseFee (不支持 blob 交易), txpool_* (无公开内存池)。 newPendingTransactions 订阅请求会被接受,但不会产生任何事件。

Rome 特有行为

Gas 源自 Solana——请估算,不要硬编码

Rome 以 Solana 计算单元计量执行,并以 EVM gas 的形式呈现。实际影响如下:

  • 始终让你的工具自动估算 gas。 forge create, cast,以及 Hardhat 的调用 eth_estimateGas 会在链上自动获取正确的值。

  • 不要硬编码 21000 用于原生转账。 向尚不存在的地址转账的成本会超过 21000(因为会创建收款账户)。估算会处理这一点;而硬编码的 21000 gas 限制会在收款方为新地址时失败。

forge script --broadcast 需要 --skip-simulation

forge script 会将其广播 gas 限制设置为来自 本地 模拟的值,这对 Rome 的 gas 模型来说通常会配置不足。添加 --skip-simulation 以便 Foundry 使用该链的 eth_estimateGas 代替:

forge create, cast send,而 Hardhat 不受影响——它们已经会在链上估算。

eth_getLogs 存在范围上限(约 12,000 个区块)

与 Infura、Alchemy 以及其他生产级 RPC 一样, eth_getLogs 会拒绝过宽的区块范围(错误 -32005)。请限制查询范围:

一个 queryFilter 如果不带范围参数,会扫描全部历史并超过上限——请显式传入 fromBlock/toBlock。基于收据的事件断言(例如等待交易完成并读取其日志)不受影响。

费用

eth_gasPrice 会返回真实的、由预言机导出的价格;钱包(包括 MetaMask)会使用它并显示正确的费用。提交的 fee 字段会被宽松接受——无论是 legacy 还是 EIP-1559 交易,使用标准工具默认值都能正常落链。

最后更新于

这有帮助吗?