From c3551b4a2d2527ec7c8aedbcd8bc48463ab8a32a Mon Sep 17 00:00:00 2001 From: Ran Mishael Date: Mon, 11 Mar 2024 11:48:35 +0100 Subject: [PATCH] PRT-Adding-gas-verifications-to-cosmos #1291 --- cookbook/specs/spec_add_cosmossdk.json | 63 +++++++++++++++++++ cookbook/specs/spec_add_evmos.json | 27 ++++++++ .../pre_setups/init_evmos_only_with_node.sh | 3 +- 3 files changed, 91 insertions(+), 2 deletions(-) diff --git a/cookbook/specs/spec_add_cosmossdk.json b/cookbook/specs/spec_add_cosmossdk.json index 999a37dbb8..5db2398379 100644 --- a/cookbook/specs/spec_add_cosmossdk.json +++ b/cookbook/specs/spec_add_cosmossdk.json @@ -2035,6 +2035,21 @@ } ], "verifications": [ + { + "name": "minimum-gas-price", + "parse_directive": { + "function_template": "", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "minimumGasPrice", + "=" + ], + "parser_func": "PARSE_DICTIONARY" + }, + "api_name": "/cosmos/base/node/v1beta1/config" + } + }, { "name": "chain-id", "parse_directive": { @@ -3606,6 +3621,24 @@ }, "extra_compute_units": 0 }, + { + "name": "cosmos.base.node.v1beta1.Service/Config", + "block_parsing": { + "parser_arg": [ + "latest" + ], + "parser_func": "DEFAULT" + }, + "compute_units": 10, + "enabled": true, + "category": { + "deterministic": false, + "local": false, + "subscription": false, + "stateful": 0 + }, + "extra_compute_units": 0 + }, { "name": "cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", "block_parsing": { @@ -3691,6 +3724,21 @@ } ], "verifications": [ + { + "name": "minimum-gas-price", + "parse_directive": { + "function_template": "", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "minimumGasPrice", + "=" + ], + "parser_func": "PARSE_DICTIONARY" + }, + "api_name": "cosmos.base.node.v1beta1.Service.Config" + } + }, { "name": "chain-id", "parse_directive": { @@ -4338,6 +4386,21 @@ } ], "verifications": [ + { + "name": "minimum-gas-price", + "parse_directive": { + "function_template": "{\"jsonrpc\":\"2.0\",\"method\":\"abci_query\",\"params\":{\"path\":\"/cosmos.base.node.v1beta1.Service/Config\", \"height\":\"0\", \"data\":\"\",\"proof\":\"true\"},\"id\":1}", + "function_tag": "VERIFICATION", + "result_parsing": { + "parser_arg": [ + "0", + "response", + "value" + ], + "parser_func": "PARSE_CANONICAL" + } + } + }, { "name": "chain-id", "parse_directive": { diff --git a/cookbook/specs/spec_add_evmos.json b/cookbook/specs/spec_add_evmos.json index b5cc1efef1..086355c007 100644 --- a/cookbook/specs/spec_add_evmos.json +++ b/cookbook/specs/spec_add_evmos.json @@ -847,6 +847,15 @@ "inheritance_apis": [], "parse_directives": [], "verifications": [ + { + "name": "minimum-gas-price", + "values": [ + { + "expected_value": "50000000000.000000000000000000aevmos", + "severity": "Warning" + } + ] + }, { "name": "chain-id", "values": [ @@ -1698,6 +1707,15 @@ "inheritance_apis": [], "parse_directives": [], "verifications": [ + { + "name": "minimum-gas-price", + "values": [ + { + "expected_value": "50000000000.000000000000000000aevmos", + "severity": "Warning" + } + ] + }, { "name": "chain-id", "values": [ @@ -1738,6 +1756,15 @@ "inheritance_apis": [], "parse_directives": [], "verifications": [ + { + "name": "minimum-gas-price", + "values": [ + { + "expected_value": "CiQ1MDAwMDAwMDAwMC4wMDAwMDAwMDAwMDAwMDAwMDBhZXZtb3M", + "severity": "Warning" + } + ] + }, { "name": "chain-id", "values": [ diff --git a/scripts/pre_setups/init_evmos_only_with_node.sh b/scripts/pre_setups/init_evmos_only_with_node.sh index 6126acf6d4..de6301393f 100755 --- a/scripts/pre_setups/init_evmos_only_with_node.sh +++ b/scripts/pre_setups/init_evmos_only_with_node.sh @@ -42,8 +42,7 @@ PROVIDER1_LISTENER="127.0.0.1:2220" lavad tx subscription buy DefaultPlan $(lavad keys show user1 -a) -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE wait_next_block -lavad tx pairing stake-provider "EVMOS" $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" 1 $(operator_address) -y --from servicer1 --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE - +lavad tx pairing stake-provider "EVMOS" $PROVIDERSTAKE "$PROVIDER1_LISTENER,1" 1 $(operator_address) -y --from servicer1 --delegate-limit $PROVIDERSTAKE --provider-moniker "dummyMoniker" --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE # lavad tx project set-policy $(lavad keys show user1 -a)-admin ./cookbook/projects/policy_all_chains_with_addon.yml -y --from user1 --gas-adjustment "1.5" --gas "auto" --gas-prices $GASPRICE sleep_until_next_epoch