diff --git a/cookbook/spec_add_polygon.json b/cookbook/spec_add_polygon.json index 919dba8d64..b659832c5e 100644 --- a/cookbook/spec_add_polygon.json +++ b/cookbook/spec_add_polygon.json @@ -1,11 +1,11 @@ { "proposal": { - "title": "Add Specs: polygon", - "description": "Adding new specification support for relaying polygon data on Lava", + "title": "Add Specs: Polygon", + "description": "Adding new specification support for relaying Polygon data on Lava", "specs": [ { "index": "POLYGON1", - "name": "Polygon Mainnet", + "name": "polygon mainnet", "enabled": true, "reliability_threshold": 268435455, "data_reliability_enabled": true, @@ -263,7 +263,1363 @@ "parser_func": "EMPTY" }, "compute_units": "10", - "enabled": false, + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": true, + "subscription": true, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_accounts", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_blockNumber", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ], + "parsing": { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_blockNumber\",\"params\":[],\"id\":1}", + "function_tag": "getBlockNumber", + "result_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + } + } + }, + { + "name": "eth_subscribe", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": true, + "subscription": true, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_unsubscribe", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": true, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_feeHistory", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_maxPriorityFeePerGas", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_createAccessList", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getTransactionReceipt", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getCompilers", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getWork", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_compileLLL", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getUncleByBlockHashAndIndex", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getUncleByBlockNumberAndIndex", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getTransactionByBlockHashAndIndex", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getTransactionByBlockNumberAndIndex", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getUncleCountByBlockHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getUncleCountByBlockNumber", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "web3_clientVersion", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "web3_sha3", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "15", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getBlockByNumber", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "16", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ], + "parsing": { + "function_tag": "getBlockByNumber", + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"eth_getBlockByNumber\",\"params\":[\"0x%x\", false],\"id\":1}", + "result_parsing": { + "parser_arg": [ + "0", + "hash" + ], + "parser_func": "PARSE_CANONICAL" + } + } + }, + { + "name": "eth_getStorageAt", + "block_parsing": { + "parser_arg": [ + "2" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "17", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getTransactionByHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "17", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_gasPrice", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "19", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getBalance", + "block_parsing": { + "parser_arg": [ + "1" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "19", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getCode", + "block_parsing": { + "parser_arg": [ + "1" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "19", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_sign", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_signTransaction", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_sendTransaction", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getFilterChanges", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_newBlockFilter", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_newFilter", + "block_parsing": { + "parser_arg": [ + "0", + "toBlock" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_newPendingTransactionFilter", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getBlockTransactionCountByHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getBlockTransactionCountByNumber", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getBlockByHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "21", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getTransactionCount", + "block_parsing": { + "parser_arg": [ + "1" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "26", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_call", + "block_parsing": { + "parser_arg": [ + "1" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "26", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getFilterLogs", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "75", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": true, + "subscription": true, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_getLogs", + "block_parsing": { + "parser_arg": [ + "0", + "toBlock" + ], + "parser_func": "PARSE_CANONICAL" + }, + "compute_units": "75", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_estimateGas", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "87", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_sendRawTransaction", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "250", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getAuthor", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getCurrentValidators", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getSignersAtHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getRootHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + } + ] + }, + { + "index": "POLYGON1T", + "name": "polygon testnet", + "enabled": true, + "reliability_threshold": 268435455, + "data_reliability_enabled": true, + "block_distance_for_finalized_data": 1, + "blocks_in_finalization_proof": 3, + "average_block_time": "2000", + "allowed_block_lag_for_qos_sync": "30", + "apis": [ + { + "name": "rpc_modules", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "net_version", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_chainId", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_syncing", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_protocolVersion", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_mining", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_hashrate", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "eth_coinbase", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "net_listening", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "net_peerCount", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "1", + "enabled": true, "api_interfaces": [ { "category": { @@ -278,6 +1634,30 @@ } ] }, + { + "name": "eth_uninstallFilter", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "10", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": false, + "local": true, + "subscription": true, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, { "name": "eth_accounts", "block_parsing": { @@ -345,13 +1725,13 @@ "parser_func": "EMPTY" }, "compute_units": "10", - "enabled": false, + "enabled": true, "api_interfaces": [ { "category": { "deterministic": false, - "local": false, - "subscription": false, + "local": true, + "subscription": true, "stateful": 0 }, "interface": "jsonrpc", @@ -369,12 +1749,12 @@ "parser_func": "EMPTY" }, "compute_units": "10", - "enabled": false, + "enabled": true, "api_interfaces": [ { "category": { "deterministic": false, - "local": false, + "local": true, "subscription": false, "stateful": 0 }, @@ -1197,13 +2577,13 @@ "parser_func": "EMPTY" }, "compute_units": "75", - "enabled": false, + "enabled": true, "api_interfaces": [ { "category": { "deterministic": false, - "local": false, - "subscription": false, + "local": true, + "subscription": true, "stateful": 0 }, "interface": "jsonrpc", @@ -1284,10 +2664,106 @@ "extra_compute_units": "0" } ] + }, + { + "name": "bor_getAuthor", + "block_parsing": { + "parser_arg": [ + "0" + ], + "parser_func": "PARSE_BY_ARG" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getCurrentValidators", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getSignersAtHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] + }, + { + "name": "bor_getRootHash", + "block_parsing": { + "parser_arg": [ + "" + ], + "parser_func": "EMPTY" + }, + "compute_units": "20", + "enabled": true, + "api_interfaces": [ + { + "category": { + "deterministic": true, + "local": false, + "subscription": false, + "stateful": 0 + }, + "interface": "jsonrpc", + "type": "GET", + "extra_compute_units": "0" + } + ] } ] } ] }, "deposit": "10000000ulava" -} \ No newline at end of file +} diff --git a/relayer/test_client.go b/relayer/test_client.go index 6739683024..573fdc2f03 100644 --- a/relayer/test_client.go +++ b/relayer/test_client.go @@ -93,8 +93,10 @@ func TestClient( testErrors = testclients.JunoTests(ctx, chainProxy, privKey, apiInterface) case "COS5": testErrors = testclients.CosmoshubTests(ctx, chainProxy, privKey, apiInterface, sentry, clientCtx) - case "STRK": - testErrors = testclients.StarknetTests(ctx, chainID, "http://127.0.0.1:3345/1", chainProxy, privKey, testDuration) + case "STRK", "STRKT": + testErrors = testclients.StarknetTests(ctx, chainID, "http://127.0.0.1:3347/1", chainProxy, privKey, testDuration) + case "POLYGON1", "POLYGON1T": + testErrors = testclients.PolygonTests(ctx, chainID, "http://127.0.0.1:3351/1", chainProxy, privKey, testDuration) } if testErrors != nil { diff --git a/relayer/testclients/polygon_tests.go b/relayer/testclients/polygon_tests.go new file mode 100644 index 0000000000..e79de33eb3 --- /dev/null +++ b/relayer/testclients/polygon_tests.go @@ -0,0 +1,54 @@ +package testclients + +import ( + "context" + "net/http" + "time" + + "github.com/lavanet/lava/utils" + + "github.com/btcsuite/btcd/btcec" + "github.com/lavanet/lava/relayer/chainproxy" +) + +const ( + // JSONRPC_ETH_BLOCKNUMBER (defined in relayer/testclients/test_utils.go) + // JSONRPC_ETH_GETBALANCE (defined in relayer/testclients/test_utils.go) + // JSONRPC_ETH_NEWFILTER (defined in relayer/testclients/test_utils.go) + JSONRPC_BOR_GETAUTHOR = `{"jsonrpc":"2.0","method":"bor_getAuthor","params":["0x1000"],"id":1}` + JSONRPC_BOR_GETCURRENTVALIDATORS = `{"jsonrpc":"2.0","method":"bor_getCurrentValidators","id":1}` + JSONRPC_BOR_GETSIGNERSATHASH = `{"jsonrpc":"2.0","method":"bor_getSignersAtHash","params":["0x29fa73e3da83ddac98f527254fe37002e052725a88904bac14f03e919e1e2876"],"id":1}` + JSONRPC_BOR_GETROOTHASH = `{"jsonrpc":"2.0","method":"bor_getRootHash","params":[1024,1026],"id":1}` + // [NOT SUPPORTED] JSONRPC_BOR_GETCURRENTPROPOSER = `{"jsonrpc":"2.0","method":"bor_getCurrentProposer","id":1}` + // [NOT SUPPORTED] JSONRPC_ETH_GETROOTHASH = `{"jsonrpc":"2.0","method":"eth_getRootHash","params":[1024,1026],"id":1}` +) + +var polygon_tests = []struct{ name, payload string }{ + {"eth_blockNumber", JSONRPC_ETH_BLOCKNUMBER}, + {"eth_getBalance", JSONRPC_ETH_GETBALANCE}, + {"eth_newFilter", JSONRPC_ETH_NEWFILTER}, + {"bor_getAuthor", JSONRPC_BOR_GETAUTHOR}, + {"bor_getCurrentValidators", JSONRPC_BOR_GETCURRENTVALIDATORS}, + {"bor_getSignersAtHash", JSONRPC_BOR_GETSIGNERSATHASH}, + {"bor_getRootHash", JSONRPC_BOR_GETROOTHASH}, + // [NOT SUPPORTED] { "bor_getCurrentProposer", JSONRPC_BOR_GETCURRENTPROPOSER }, + // [NOT SUPPORTED] { "eth_getRootHash", JSONRPC_ETH_GETROOTHASH }, +} + +func PolygonTests(ctx context.Context, chainID string, rpcURL string, chainProxy chainproxy.ChainProxy, privKey *btcec.PrivateKey, testDuration time.Duration) error { + utils.LavaFormatInfo("Starting "+chainID+" Tests", nil) + + for start := time.Now(); time.Since(start) < testDuration; { + for j := 0; j < 10; j++ { + for _, t := range polygon_tests { + reply, _, err := chainproxy.SendRelay(ctx, chainProxy, privKey, rpcURL, t.payload, http.MethodGet, "polygon_test") + if err != nil { + return utils.LavaFormatError("error "+t.name, err, nil) + } + prettyPrintReply(*reply, "JSONRPC_"+t.name) + } + } + time.Sleep(1 * time.Second) + } + return nil +}