From f2078f72368c947c6b64a48ef52b553b5046198c Mon Sep 17 00:00:00 2001 From: arhag Date: Wed, 23 May 2018 22:52:29 -0400 Subject: [PATCH] remove max_generated_transaction_count #3343 --- contracts/eosio.system/eosio.system.abi | 3 +-- contracts/eosiolib/privileged.hpp | 4 +--- libraries/chain/include/eosio/chain/chain_config.hpp | 7 ++----- libraries/chain/include/eosio/chain/config.hpp | 1 - libraries/chain/include/eosio/chain/genesis_state.hpp | 1 - programs/bios-boot-tutorial/genesis.json | 5 ++--- programs/cleos/main.cpp | 3 +-- unittests/eosio.system_tests.cpp | 11 +++++------ unittests/eosio_system_tester.hpp | 3 +-- 9 files changed, 13 insertions(+), 25 deletions(-) diff --git a/contracts/eosio.system/eosio.system.abi b/contracts/eosio.system/eosio.system.abi index 51371505d..dcf903eba 100644 --- a/contracts/eosio.system/eosio.system.abi +++ b/contracts/eosio.system/eosio.system.abi @@ -239,8 +239,7 @@ {"name":"max_transaction_delay", "type":"uint32"}, {"name":"max_inline_action_size", "type":"uint32"}, {"name":"max_inline_action_depth", "type":"uint16"}, - {"name":"max_authority_depth", "type":"uint16"}, - {"name":"max_generated_transaction_count", "type":"uint32"} + {"name":"max_authority_depth", "type":"uint16"} ] },{ diff --git a/contracts/eosiolib/privileged.hpp b/contracts/eosiolib/privileged.hpp index a42d831e4..d89f10f08 100644 --- a/contracts/eosiolib/privileged.hpp +++ b/contracts/eosiolib/privileged.hpp @@ -25,7 +25,6 @@ namespace eosio { uint32_t max_inline_action_size; uint16_t max_inline_action_depth; uint16_t max_authority_depth; - uint32_t max_generated_transaction_count; EOSLIB_SERIALIZE( blockchain_parameters, (max_block_net_usage)(target_block_net_usage_pct) @@ -36,8 +35,7 @@ namespace eosio { (max_transaction_cpu_usage)(min_transaction_cpu_usage) (max_transaction_lifetime)(deferred_trx_expiration_window)(max_transaction_delay) - (max_inline_action_size)(max_inline_action_depth) - (max_authority_depth)(max_generated_transaction_count) + (max_inline_action_size)(max_inline_action_depth)(max_authority_depth) ) }; diff --git a/libraries/chain/include/eosio/chain/chain_config.hpp b/libraries/chain/include/eosio/chain/chain_config.hpp index b41d9faa2..7f62ff111 100644 --- a/libraries/chain/include/eosio/chain/chain_config.hpp +++ b/libraries/chain/include/eosio/chain/chain_config.hpp @@ -36,7 +36,6 @@ struct chain_config { uint32_t max_inline_action_size; ///< maximum allowed size (in bytes) of an inline action uint16_t max_inline_action_depth; ///< recursion depth limit on sending inline actions uint16_t max_authority_depth; ///< recursion depth limit for checking if an authority is satisfied - uint32_t max_generated_transaction_count; ///< the number of generated transactions per action (TODO: implement?) void validate()const; @@ -59,8 +58,7 @@ struct chain_config { << "Max Transaction Delay: " << c.max_transaction_delay << ", " << "Max Inline Action Size: " << c.max_inline_action_size << ", " << "Max Inline Action Depth: " << c.max_inline_action_depth << ", " - << "Max Authority Depth: " << c.max_authority_depth << ", " - << "Max Generated Transaction Count: " << c.max_generated_transaction_count << "\n"; + << "Max Authority Depth: " << c.max_authority_depth << "\n"; } }; @@ -78,7 +76,6 @@ FC_REFLECT(eosio::chain::chain_config, (max_transaction_cpu_usage)(min_transaction_cpu_usage) (max_transaction_lifetime)(deferred_trx_expiration_window)(max_transaction_delay) - (max_inline_action_size)(max_inline_action_depth) - (max_authority_depth)(max_generated_transaction_count) + (max_inline_action_size)(max_inline_action_depth)(max_authority_depth) ) diff --git a/libraries/chain/include/eosio/chain/config.hpp b/libraries/chain/include/eosio/chain/config.hpp index 1f8cd67e4..83f75ac50 100644 --- a/libraries/chain/include/eosio/chain/config.hpp +++ b/libraries/chain/include/eosio/chain/config.hpp @@ -79,7 +79,6 @@ const static uint32_t default_max_trx_delay = 45*24*3600; // const static uint32_t default_max_inline_action_size = 4 * 1024; // 4 KB const static uint16_t default_max_inline_action_depth = 4; const static uint16_t default_max_auth_depth = 6; -const static uint32_t default_max_gen_trx_count = 16; const static uint32_t min_net_usage_delta_between_base_and_max_for_trx = 10*1024; // Should be large enough to allow recovery from badly set blockchain parameters without a hard fork diff --git a/libraries/chain/include/eosio/chain/genesis_state.hpp b/libraries/chain/include/eosio/chain/genesis_state.hpp index 4ca58cfd6..568641640 100644 --- a/libraries/chain/include/eosio/chain/genesis_state.hpp +++ b/libraries/chain/include/eosio/chain/genesis_state.hpp @@ -36,7 +36,6 @@ struct genesis_state { .max_inline_action_size = config::default_max_inline_action_size, .max_inline_action_depth = config::default_max_inline_action_depth, .max_authority_depth = config::default_max_auth_depth, - .max_generated_transaction_count = config::default_max_gen_trx_count, }; time_point initial_timestamp = fc::time_point::from_iso_string( "2018-03-02T12:00:00" ); diff --git a/programs/bios-boot-tutorial/genesis.json b/programs/bios-boot-tutorial/genesis.json index 43745b909..79c4bfd2a 100644 --- a/programs/bios-boot-tutorial/genesis.json +++ b/programs/bios-boot-tutorial/genesis.json @@ -18,8 +18,7 @@ "max_transaction_delay": 3888000, "max_inline_action_size": 4096, "max_inline_action_depth": 4, - "max_authority_depth": 6, - "max_generated_transaction_count": 16 + "max_authority_depth": 6 }, "initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000" -} \ No newline at end of file +} diff --git a/programs/cleos/main.cpp b/programs/cleos/main.cpp index da8e487ee..65e3973b2 100644 --- a/programs/cleos/main.cpp +++ b/programs/cleos/main.cpp @@ -480,7 +480,6 @@ fc::variant regproducer_variant(const account_name& producer, ("max_inline_action_size", config::default_max_inline_action_size) ("max_inline_depth", config::default_max_inline_action_depth) ("max_authority_depth", config::default_max_auth_depth) - ("max_generated_transaction_count", config::default_max_gen_trx_count) ("max_storage_size", max_storage_size) ("percent_of_max_inflation_rate", percent_of_max_inflation_rate) ("storage_reserve_ratio", storage_reserve_ratio); @@ -1054,7 +1053,7 @@ struct list_producers_subcommand { weight = 1; printf("%-13s %-54s %-59s %s\n", "Producer", "Producer key", "Url", "Scaled votes"); for ( auto& row : result.rows ) - printf("%-13.13s %-54.54s %-59.59s %1.4f\n", + printf("%-13.13s %-54.54s %-59.59s %1.4f\n", row["owner"].as_string().c_str(), row["producer_key"].as_string().c_str(), row["url"].as_string().c_str(), diff --git a/unittests/eosio.system_tests.cpp b/unittests/eosio.system_tests.cpp index 489091ae6..19f52c4c0 100644 --- a/unittests/eosio.system_tests.cpp +++ b/unittests/eosio.system_tests.cpp @@ -43,7 +43,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try { // alice buys ram for 10000000.0000, 0.5% = 50000.0000 got to ramfee // after fee 9950000.0000 got to bought bytes // when selling back bought bytes, pay 0.5% fee and get back 99.5% of 9950000.0000 = 9900250.0000 - // expected account after that is 90000998.0050 + 9900250.0000 = 99901248.0050 with a difference + // expected account after that is 90000998.0050 + 9900250.0000 = 99901248.0050 with a difference // of order 0.0001 due to rounding errors BOOST_REQUIRE_EQUAL( success(), buyram( "alice1111111", "alice1111111", core_from_string("10000000.0000") ) ); BOOST_REQUIRE_EQUAL( core_from_string("90000998.0050"), get_balance( "alice1111111" ) ); @@ -202,12 +202,12 @@ BOOST_FIXTURE_TEST_CASE( stake_unstake_with_transfer, eosio_system_tester ) try BOOST_REQUIRE_EQUAL( core_from_string("700.0000"), get_balance( "alice1111111" ) ); edump((get_balance( "eosio.stake" ))); - + produce_block( fc::hours(3*24-1) ); produce_blocks(1); BOOST_REQUIRE_EQUAL( core_from_string("700.0000"), get_balance( "alice1111111" ) ); //after 3 days funds should be released - + produce_block( fc::hours(1) ); produce_blocks(1); @@ -2155,8 +2155,7 @@ fc::mutable_variant_object config_to_variant( const eosio::chain::chain_config& ( "max_transaction_delay", config.max_transaction_delay ) ( "max_inline_action_size", config.max_inline_action_size ) ( "max_inline_action_depth", config.max_inline_action_depth ) - ( "max_authority_depth", config.max_authority_depth ) - ( "max_generated_transaction_count", config.max_generated_transaction_count ); + ( "max_authority_depth", config.max_authority_depth ); } BOOST_FIXTURE_TEST_CASE( elect_producers /*_and_parameters*/, eosio_system_tester ) try { @@ -2273,7 +2272,7 @@ BOOST_FIXTURE_TEST_CASE( buyname, eosio_system_tester ) try { //wlog( "verify dan cannot create test.fail" ); BOOST_REQUIRE_THROW( create_accounts_with_resources( { N(test.fail) }, N(dan) ), fc::exception ); // dan shouldn't be able to do this - create_accounts_with_resources( { N(goodgoodgood) }, N(dan) ); /// 12 char names should succeed + create_accounts_with_resources( { N(goodgoodgood) }, N(dan) ); /// 12 char names should succeed } FC_LOG_AND_RETHROW() BOOST_FIXTURE_TEST_CASE( multiple_namebids, eosio_system_tester ) try { diff --git a/unittests/eosio_system_tester.hpp b/unittests/eosio_system_tester.hpp index 3dbd1cf81..78f6d5d89 100644 --- a/unittests/eosio_system_tester.hpp +++ b/unittests/eosio_system_tester.hpp @@ -46,7 +46,7 @@ public: produce_blocks( 2 ); - create_accounts({ N(eosio.token), N(eosio.ram), N(eosio.ramfee), N(eosio.stake), + create_accounts({ N(eosio.token), N(eosio.ram), N(eosio.ramfee), N(eosio.stake), N(eosio.bpay), N(eosio.vpay), N(eosio.saving) }); produce_blocks( 100 ); @@ -302,7 +302,6 @@ public: ("max_inline_action_size", 4096 + n) ("max_inline_action_depth", 4 + n) ("max_authority_depth", 6 + n) - ("max_generated_transaction_count", 10 + n) ("max_ram_size", (n % 10 + 1) * 1024 * 1024) ("ram_reserve_ratio", 100 + n); } -- GitLab