From d234381abae26602018cadf596e24f27fbb76099 Mon Sep 17 00:00:00 2001 From: pikatos Date: Tue, 30 Apr 2024 17:14:38 +0200 Subject: [PATCH 1/2] EVM/Node: add unsupported RPCs --- etherlink/bin_node/lib_dev/rpc_encodings.ml | 37 +++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/etherlink/bin_node/lib_dev/rpc_encodings.ml b/etherlink/bin_node/lib_dev/rpc_encodings.ml index 06a3bdd8d6e7..e70e298e95e5 100644 --- a/etherlink/bin_node/lib_dev/rpc_encodings.ml +++ b/etherlink/bin_node/lib_dev/rpc_encodings.ml @@ -775,17 +775,50 @@ let supported_methods : (module METHOD) list = let unsupported_methods : string list = [ + (* net *) "net_listening"; "net_peerCount"; + (* eth *) "eth_protocolVersion"; "eth_syncing"; "eth_coinbase"; "eth_mining"; "eth_hashrate"; - "eth_accounts"; "eth_sign"; "eth_signTransaction"; - "eth_sendTransaction"; + "eth_blobBaseFee"; + "eth_getProof"; + "eth_createAccessList"; + "eth_feeHistory"; + "eth_getBlockReceipts"; + "eth_getFilterChanges"; + "eth_getFilterLogs"; + "eth_newBlockFilter"; + "eth_newFilter"; + "eth_newPendingTransactionFilter"; + "eth_uninstallFilter"; + (* debug *) + "debug_getBadBlocks"; + "debug_getRawBlock"; + "debug_getRawHeader"; + "debug_getRawReceipts"; + "debug_getRawTransaction"; + (* engine *) + "engine_exchangeCapabilities"; + "engine_exchangeTransitionConfigurationV1"; + "engine_forkchoiceUpdatedV1"; + "engine_forkchoiceUpdatedV2"; + "engine_forkchoiceUpdatedV3"; + "engine_getPayloadBodiesByHashV1"; + "engine_getPayloadBodiesByRangeV1"; + "engine_getPayloadV1"; + "engine_getPayloadV2"; + "engine_getPayloadV3"; + "engine_getPayloadV4"; + "engine_newPayloadV1"; + "engine_newPayloadV2"; + "engine_newPayloadV3"; + "engine_newPayloadV4"; ] let map_method_name method_name = -- GitLab From 6d2e1fd36eaa086f53872d407fec17157d498267 Mon Sep 17 00:00:00 2001 From: pikatos Date: Tue, 14 May 2024 10:13:56 +0200 Subject: [PATCH 2/2] EVM/Tezt: test unsupported RPC method --- etherlink/tezt/tests/evm_rollup.ml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/etherlink/tezt/tests/evm_rollup.ml b/etherlink/tezt/tests/evm_rollup.ml index 60721421a0b4..64d4c1bc1da4 100644 --- a/etherlink/tezt/tests/evm_rollup.ml +++ b/etherlink/tezt/tests/evm_rollup.ml @@ -5389,6 +5389,24 @@ let test_proxy_read_only = ~error_msg:"Unexpected error message" ; unit +let test_unsupported_rpc = + register_both + ~tags:["evm"; "rpc"; "unsupported"] + ~title:"Unsupported RPC method" + @@ fun ~protocol:_ ~evm_setup:{evm_node; _} -> + let* protocol_version = + Evm_node.( + call_evm_rpc + evm_node + {method_ = "eth_protocolVersion"; parameters = `A []}) + in + Check.( + (JSON.(protocol_version |-> "error" |-> "message" |> as_string) + = "Method not supported") + string) + ~error_msg:"Expected unsupported method error." ; + unit + let register_evm_node ~protocols = test_originate_evm_kernel protocols ; test_kernel_root_hash_originate_absent protocols ; @@ -5491,7 +5509,8 @@ let register_evm_node ~protocols = test_tx_pool_transaction_size_exceeded protocols ; test_whitelist_is_executed protocols ; test_rpc_maxPriorityFeePerGas protocols ; - test_proxy_read_only protocols + test_proxy_read_only protocols ; + test_unsupported_rpc protocols let protocols = Protocol.all -- GitLab