提交 e9fa825b 编写于 作者: A arhag

remove unneeded configuration parameters #2960

Also reduce default_max_transaction_cpu_usage to half of default_max_block_cpu_usage.
上级 984ce364
......@@ -97,13 +97,6 @@
{"name":"max_block_cpu_usage", "type": "uint64"},
{"name":"target_block_cpu_usage_pct", "type": "uint32"},
{"name":"max_transaction_cpu_usage", "type":"uint32"},
{"name":"base_per_transaction_cpu_usage", "type":"uint32"},
{"name":"base_per_action_cpu_usage", "type":"uint32"},
{"name":"base_setcode_cpu_usage", "type":"uint32"},
{"name":"per_signature_cpu_usage", "type":"uint32"},
{"name":"cpu_usage_leeway", "type":"uint32"},
{"name":"context_free_discount_cpu_usage_num", "type":"uint32"},
{"name":"context_free_discount_cpu_usage_den", "type":"uint32"},
{"name":"max_transaction_lifetime", "type":"uint32"},
{"name":"deferred_trx_expiration_window", "type":"uint32"},
{"name":"max_transaction_delay", "type":"uint32"},
......
......@@ -17,13 +17,6 @@ namespace eosio {
uint32_t max_block_cpu_usage;
uint32_t target_block_cpu_usage_pct;
uint32_t max_transaction_cpu_usage;
uint32_t base_per_transaction_cpu_usage;
uint32_t base_per_action_cpu_usage;
uint32_t base_setcode_cpu_usage;
uint32_t per_signature_cpu_usage;
uint32_t cpu_usage_leeway;
uint32_t context_free_discount_cpu_usage_num;
uint32_t context_free_discount_cpu_usage_den;
uint32_t max_transaction_lifetime;
uint32_t deferred_trx_expiration_window;
......@@ -39,9 +32,7 @@ namespace eosio {
(context_free_discount_net_usage_num)(context_free_discount_net_usage_den)
(max_block_cpu_usage)(target_block_cpu_usage_pct)
(max_transaction_cpu_usage)(base_per_transaction_cpu_usage)
(base_per_action_cpu_usage)(base_setcode_cpu_usage)(per_signature_cpu_usage)(cpu_usage_leeway)
(context_free_discount_cpu_usage_num)(context_free_discount_cpu_usage_den)
(max_transaction_cpu_usage)
(max_transaction_lifetime)(deferred_trx_expiration_window)(max_transaction_delay)
(max_inline_action_size)(max_inline_action_depth)
......
......@@ -28,13 +28,6 @@ struct chain_config {
uint32_t max_block_cpu_usage; ///< the maxiumum cpu usage in instructions for a block
uint32_t target_block_cpu_usage_pct; ///< the target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling
uint32_t max_transaction_cpu_usage; ///< the maximum objectively measured cpu usage that the chain will allow regardless of account limits
uint32_t base_per_transaction_cpu_usage; ///< the base amount of cpu usage billed for a transaction to cover incidentals
uint32_t base_per_action_cpu_usage; ///< the base amount of cpu usage billed for an action to cover incidentals
uint32_t base_setcode_cpu_usage; ///< the base amount of cpu usage billed for a setcode action to cover compilation/etc
uint32_t per_signature_cpu_usage; ///< the cpu usage billed for every signature on a transaction
uint32_t cpu_usage_leeway;
uint32_t context_free_discount_cpu_usage_num; ///< the numerator for the discount on cpu usage of context-free actions
uint32_t context_free_discount_cpu_usage_den; ///< the denominator for the discount on cpu usage of context-free actions
uint32_t max_transaction_lifetime; ///< the maximum number of seconds that an input transaction's expiration can be ahead of the time of the block in which it is first included
uint32_t deferred_trx_expiration_window; ///< the number of seconds after the time a deferred transaction can first execute until it expires
......@@ -56,12 +49,6 @@ struct chain_config {
<< "Max Block CPU Usage: " << c.max_block_cpu_usage << ", "
<< "Target Block CPU Usage Percent: " << ((double)c.target_block_cpu_usage_pct / (double)config::percent_1) << "%, "
<< "Max Transaction CPU Usage: " << c.max_transaction_cpu_usage << ", "
<< "Base Per-Transaction CPU Usage: " << c.base_per_transaction_cpu_usage << ", "
<< "Base Per-Action CPU Usage: " << c.base_per_action_cpu_usage << ", "
<< "Base Setcode CPU Usage: " << c.base_setcode_cpu_usage << ", "
<< "Per-Signature CPU Usage: " << c.per_signature_cpu_usage << ", "
<< "CPU Usage Leeway: " << c.cpu_usage_leeway << ", "
<< "Context-Free Action CPU Usage Discount: " << (double)c.context_free_discount_cpu_usage_num * 100.0 / (double)c.context_free_discount_cpu_usage_den << "% , "
<< "Max Transaction Lifetime: " << c.max_transaction_lifetime << ", "
<< "Deferred Transaction Expiration Window: " << c.deferred_trx_expiration_window << ", "
......@@ -84,9 +71,7 @@ FC_REFLECT(eosio::chain::chain_config,
(context_free_discount_net_usage_num)(context_free_discount_net_usage_den)
(max_block_cpu_usage)(target_block_cpu_usage_pct)
(max_transaction_cpu_usage)(base_per_transaction_cpu_usage)
(base_per_action_cpu_usage)(base_setcode_cpu_usage)(per_signature_cpu_usage)(cpu_usage_leeway)
(context_free_discount_cpu_usage_num)(context_free_discount_cpu_usage_den)
(max_transaction_cpu_usage)
(max_transaction_lifetime)(deferred_trx_expiration_window)(max_transaction_delay)
(max_inline_action_size)(max_inline_action_depth)
......
......@@ -65,31 +65,17 @@ const static uint32_t transaction_id_net_usage = 32; // 32
const static uint32_t default_max_block_cpu_usage = 100'000; /// max block cpu usage in microseconds
const static uint32_t default_target_block_cpu_usage_pct = 5 * percent_1; /// target 1000 TPS
const static uint32_t default_max_transaction_cpu_usage = default_max_block_cpu_usage;
const static uint32_t default_max_transaction_cpu_usage = default_max_block_cpu_usage / 2;
const static uint32_t default_min_transaction_cpu_usage_us = 100; /// 10000 TPS equiv
const static uint32_t default_base_per_transaction_cpu_usage = 512; // TODO: is this reasonable?
const static uint32_t default_base_per_action_cpu_usage = 1024;
const static uint32_t default_base_setcode_cpu_usage = 2 * 1024 * 1024; /// overbilling cpu usage for setcode to cover incidental
const static uint32_t default_per_signature_cpu_usage = 100 * 1024; // TODO: is this reasonable?
const static uint32_t default_cpu_usage_leeway = 2048; // TODO: is this reasonable?
const static uint32_t default_context_free_discount_cpu_usage_num = 20;
const static uint32_t default_context_free_discount_cpu_usage_den = 100;
const static uint32_t default_max_trx_lifetime = 60*60; // 1 hour
const static uint32_t default_deferred_trx_expiration_window = 10*60; // 10 minutes
//static const uint32_t deferred_trx_expiration_window_ms = 10*60*1000l; // TODO: make 10 minutes configurable by system
const static uint32_t default_max_trx_delay = 45*24*3600; // 45 days
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 base_check_authorization_cpu_per_authorization = 64; // TODO: is this reasonable?
const static uint32_t base_authority_checker_cpu_per_permission = 128; // TODO: is this reasonable?
const static uint32_t resource_processing_cpu_overhead_per_billed_account = 256; // TODO: is this reasonable?
const static uint32_t determine_payers_cpu_overhead_per_authorization = 64; // TODO: is this reasonable?
const static uint32_t ram_usage_validation_overhead_per_account = 64; // TODO: is this reasonable?
const static uint32_t fixed_net_overhead_of_packed_trx = 16; // TODO: is this reasonable?
const static uint32_t fixed_overhead_shared_vector_ram_bytes = 16; ///< overhead accounts for fixed portion of size of shared_vector field
......
......@@ -28,13 +28,6 @@ struct genesis_state {
.max_block_cpu_usage = config::default_max_block_cpu_usage,
.target_block_cpu_usage_pct = config::default_target_block_cpu_usage_pct,
.max_transaction_cpu_usage = config::default_max_transaction_cpu_usage,
.base_per_transaction_cpu_usage = config::default_base_per_transaction_cpu_usage,
.base_per_action_cpu_usage = config::default_base_per_action_cpu_usage,
.base_setcode_cpu_usage = config::default_base_setcode_cpu_usage,
.per_signature_cpu_usage = config::default_per_signature_cpu_usage,
.cpu_usage_leeway = config::default_cpu_usage_leeway,
.context_free_discount_cpu_usage_num = config::default_context_free_discount_cpu_usage_num,
.context_free_discount_cpu_usage_den = config::default_context_free_discount_cpu_usage_den,
.max_transaction_lifetime = config::default_max_trx_lifetime,
.deferred_trx_expiration_window = config::default_deferred_trx_expiration_window,
......
......@@ -151,7 +151,7 @@ namespace eosio { namespace testing {
transaction_trace_ptr push_reqauth( account_name from, const vector<permission_level>& auths, const vector<private_key_type>& keys );
transaction_trace_ptr push_reqauth(account_name from, string role, bool multi_sig = false);
// use when just want any old non-context free action
transaction_trace_ptr push_dummy(account_name from, const string& v = "blah");
transaction_trace_ptr push_dummy(account_name from, const string& v = "blah", uint32_t billed_cpu_time_us = DEFAULT_BILLED_CPU_TIME_US );
transaction_trace_ptr transfer( account_name from, account_name to, asset amount, string memo, account_name currency );
transaction_trace_ptr transfer( account_name from, account_name to, string amount, string memo, account_name currency );
transaction_trace_ptr issue( account_name to, string amount, account_name currency );
......
......@@ -399,7 +399,7 @@ namespace eosio { namespace testing {
}
transaction_trace_ptr base_tester::push_dummy(account_name from, const string& v) {
transaction_trace_ptr base_tester::push_dummy(account_name from, const string& v, uint32_t billed_cpu_time_us) {
// use reqauth for a normal action, this could be anything
variant pretty_trx = fc::mutable_variant_object()
("actions", fc::variants({
......@@ -430,7 +430,7 @@ namespace eosio { namespace testing {
set_transaction_headers(trx);
trx.sign( get_private_key( from, "active" ), chain_id_type() );
return push_transaction( trx );
return push_transaction( trx, fc::time_point::maximum(), billed_cpu_time_us );
}
......
......@@ -463,13 +463,6 @@ fc::variant regproducer_variant(const account_name& producer,
("max_block_cpu_usage", config::default_max_block_cpu_usage)
("target_block_cpu_usage_pct", config::default_target_block_cpu_usage_pct)
("max_transaction_cpu_usage", config::default_max_transaction_cpu_usage)
("base_per_transaction_cpu_usage", config::default_base_per_transaction_cpu_usage)
("base_per_action_cpu_usage", config::default_base_per_action_cpu_usage)
("base_setcode_cpu_usage", config::default_base_setcode_cpu_usage)
("per_signature_cpu_usage", config::default_per_signature_cpu_usage)
("cpu_usage_leeway", config::default_cpu_usage_leeway)
("context_free_discount_cpu_usage_num", config::default_context_free_discount_cpu_usage_num)
("context_free_discount_cpu_usage_den", config::default_context_free_discount_cpu_usage_den)
("max_transaction_lifetime", config::default_max_trx_lifetime)
("deferred_trx_expiration_window", config::default_deferred_trx_expiration_window)
("max_transaction_delay", config::default_max_trx_delay)
......@@ -718,7 +711,7 @@ bool port_used(uint16_t port) {
void try_port( uint16_t port, uint32_t duration ) {
using namespace std::chrono;
auto start_time = duration_cast<std::chrono::milliseconds>( system_clock::now().time_since_epoch() ).count();
while ( !port_used(port)) {
while ( !port_used(port)) {
if (duration_cast<std::chrono::milliseconds>( system_clock::now().time_since_epoch()).count() - start_time > duration ) {
std::cerr << "Unable to connect to keosd, if keosd is running please kill the process and try again.\n";
throw connection_exception(fc::log_messages{FC_LOG_MESSAGE(error, "Unable to connect to keosd")});
......@@ -839,7 +832,7 @@ struct create_account_subcommand {
add_standard_transaction_options(createAccount);
createAccount->set_callback([this] {
if( !active_key_str.size() )
if( !active_key_str.size() )
active_key_str = owner_key_str;
public_key_type owner_key, active_key;
try {
......
......@@ -651,10 +651,6 @@ BOOST_FIXTURE_TEST_CASE(checktime_pass_tests, TESTER) { try {
} FC_LOG_AND_RETHROW() }
BOOST_AUTO_TEST_CASE(checktime_fail_tests) { try {
// TODO: This is an extremely fragile test. It needs improvements:
// 1) compilation of the smart contract should probably not count towards the CPU time of a transaction that first uses it;
// 2) checktime should eventually switch to a deterministic metric which should hopefully fix the inconsistencies
// of this test succeeding/failing on different machines (for example, succeeding on our local dev machines but failing on Jenkins).
TESTER t;
t.produce_blocks(2);
......@@ -669,7 +665,7 @@ BOOST_AUTO_TEST_CASE(checktime_fail_tests) { try {
t.control->get_resource_limits_manager().get_account_limits( N(testapi), x, net, cpu );
wdump((net)(cpu));
auto call_test = [](TESTER& test, auto ac, uint32_t billed_cpu_time_us, uint8_t max_cpu_usage_ms ) {
auto call_test = [](TESTER& test, auto ac, uint32_t billed_cpu_time_us /*, uint8_t max_cpu_usage_ms */ ) {
signed_transaction trx;
auto pl = vector<permission_level>{{N(testapi), config::active_name}};
......@@ -679,7 +675,7 @@ BOOST_AUTO_TEST_CASE(checktime_fail_tests) { try {
trx.actions.push_back(act);
test.set_transaction_headers(trx);
trx.max_cpu_usage_ms = max_cpu_usage_ms;
//trx.max_cpu_usage_ms = max_cpu_usage_ms;
auto sigs = trx.sign(test.get_private_key(N(testapi), "active"), chain_id_type());
trx.get_signature_keys(chain_id_type() );
auto res = test.push_transaction( trx, fc::time_point::now() + fc::milliseconds(200), billed_cpu_time_us );
......@@ -689,16 +685,23 @@ BOOST_AUTO_TEST_CASE(checktime_fail_tests) { try {
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("test_checktime", "checktime_failure")>{},
5000, 0 ),
5000 ),
deadline_exception, is_deadline_exception );
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("test_checktime", "checktime_failure")>{},
0, 50 ),
0 ),
tx_cpu_usage_exceeded, is_tx_cpu_usage_exceeded );
uint32_t time_left_in_block_us = config::default_max_block_cpu_usage - config::default_min_transaction_cpu_usage_us;
std::string dummy_string = "nonce";
uint32_t increment = config::default_max_transaction_cpu_usage / 3;
for( auto i = 0; time_left_in_block_us > 2*increment; ++i ) {
t.push_dummy( N(testapi), dummy_string + std::to_string(i), increment );
time_left_in_block_us -= increment;
}
BOOST_CHECK_EXCEPTION( call_test( t, test_api_action<TEST_METHOD("test_checktime", "checktime_failure")>{},
0, 0 ),
block_cpu_usage_exceeded, is_block_cpu_usage_exceeded ); // Because the onblock uses up some of the CPU
0 ),
block_cpu_usage_exceeded, is_block_cpu_usage_exceeded );
BOOST_REQUIRE_EQUAL( t.validate(), true );
} FC_LOG_AND_RETHROW() }
......
......@@ -167,7 +167,7 @@ public:
set_transaction_headers(trx);
asset cpu = asset::from_string("80.0000 EOS");
asset net = asset::from_string("80.0000 EOS");
asset ram = asset::from_string("1.0000 EOS");
asset ram = asset::from_string("1.0000 EOS");
for (const auto& a: accounts) {
authority owner_auth( get_public_key( a, "owner" ) );
......@@ -185,7 +185,7 @@ public:
("receiver", a)
("quant", ram) )
);
trx.actions.emplace_back( get_action( N(eosio), N(delegatebw), vector<permission_level>{ {creator, config::active_name} },
mvo()
("from", creator)
......@@ -196,7 +196,7 @@ public:
)
);
}
set_transaction_headers(trx);
trx.sign( get_private_key( creator, "active" ), chain_id_type() );
return push_transaction( trx );
......@@ -277,13 +277,6 @@ public:
("max_block_cpu_usage", 10000000 + n )
("target_block_cpu_usage_pct", 10 + n )
("max_transaction_cpu_usage", 1000000 + n )
("base_per_transaction_cpu_usage", 100 + n)
("base_per_action_cpu_usage", 100 + n)
("base_setcode_cpu_usage", 100 + n)
("per_signature_cpu_usage", 100 + n)
("cpu_usage_leeway", 2048 + n )
("context_free_discount_cpu_usage_num", 1 + n )
("context_free_discount_cpu_usage_den", 100 + n )
("max_transaction_lifetime", 3600 + n)
("deferred_trx_expiration_window", 600 + n)
("max_transaction_delay", 10*86400+n)
......@@ -482,7 +475,7 @@ BOOST_FIXTURE_TEST_CASE( buysell, eosio_system_tester ) try {
BOOST_REQUIRE_EQUAL( true, total["ram_bytes"].as_uint64() == init_bytes );
BOOST_REQUIRE_EQUAL( asset::from_string("100000999.9993 EOS"), get_balance( "alice1111111" ) );
} FC_LOG_AND_RETHROW()
} FC_LOG_AND_RETHROW()
BOOST_FIXTURE_TEST_CASE( stake_unstake, eosio_system_tester ) try {
//issue( "eosio", "1000.0000 EOS", config::system_account_name );
......@@ -1397,9 +1390,9 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t
BOOST_REQUIRE_EQUAL(0, prod["last_claim_time"].as<uint64_t>());
const asset initial_supply = get_token_supply();
const asset initial_balance = get_balance(N(defproducera));
BOOST_REQUIRE_EQUAL(success(), push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera")));
const auto global_state = get_global_state();
const uint64_t claim_time = global_state["last_pervote_bucket_fill"].as_uint64();
const asset pervote_bucket = global_state["pervote_bucket"].as<asset>();
......@@ -1411,12 +1404,12 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t
BOOST_REQUIRE_EQUAL(claim_time, prod["last_claim_time"].as<uint64_t>());
const int32_t secs_between_fills = static_cast<int32_t>((claim_time - initial_claim_time) / 1000000);
BOOST_REQUIRE_EQUAL(0, initial_pervote_bucket.amount);
BOOST_REQUIRE_EQUAL(int64_t( (initial_supply.amount * secs_between_fills * ((4.879-1.0)/100.0)) / (52*7*24*3600) ),
savings.amount - initial_savings.amount);
int64_t block_payments = int64_t( initial_supply.amount * produced_blocks * (0.25/100.0) / (52*7*24*3600*2) );
int64_t from_pervote_bucket = int64_t( initial_supply.amount * secs_between_fills * (0.75/100.0) / (52*7*24*3600) );
......@@ -1431,7 +1424,7 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t
const int64_t max_supply_growth = int64_t( (initial_supply.amount * secs_between_fills * (4.879/100.0)) / (52*7*24*3600) );
BOOST_REQUIRE(max_supply_growth >= supply.amount - initial_supply.amount);
}
{
BOOST_REQUIRE_EQUAL(error("condition: assertion failed: already claimed rewards within a day"),
push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera")));
......@@ -1461,7 +1454,7 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t
BOOST_REQUIRE_EQUAL(success(),
push_action(N(defproducera), N(claimrewards), mvo()("owner", "defproducera")));
const auto global_state = get_global_state();
const uint64_t claim_time = global_state["last_pervote_bucket_fill"].as_uint64();
const asset pervote_bucket = global_state["pervote_bucket"].as<asset>();
......@@ -1492,7 +1485,7 @@ BOOST_FIXTURE_TEST_CASE(producer_pay, eosio_system_tester, * boost::unit_test::t
const int64_t max_supply_growth = int64_t( (initial_supply.amount * secs_between_fills * (4.879/100.0)) / (52*7*24*3600) );
BOOST_REQUIRE(max_supply_growth >= supply.amount - initial_supply.amount);
}
// defproducerb tries to claim rewards but he's not on the list
{
BOOST_REQUIRE_EQUAL(error("condition: assertion failed: account name is not in producer list"),
......@@ -1539,8 +1532,8 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
auto defproducera_info = get_producer_info( N(defproducera) );
wdump((defproducera_info));
BOOST_REQUIRE_EQUAL(0, defproducera_info["total_votes"].as<double>());
ilog( "------ get defproducerz ----------" );
auto defproducerz_info = get_producer_info( N(defproducerz) );
wdump((defproducerz_info));
......@@ -1630,12 +1623,12 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
total_votes += vote_shares[i];
}
std::for_each(vote_shares.begin(), vote_shares.end(), [total_votes](double& x) { x /= total_votes; });
BOOST_TEST(double(1) == std::accumulate(vote_shares.begin(), vote_shares.end(), double(0)));
BOOST_TEST(double(3./57.) == vote_shares.front());
BOOST_TEST(double(1./57.) == vote_shares.back());
}
{
const uint32_t prod_index = 2;
const auto prod_name = producer_names[prod_index];
......@@ -1647,9 +1640,9 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
const asset initial_savings = initial_global_state["savings"].as<asset>();
const asset initial_supply = get_token_supply();
const asset initial_balance = get_balance(prod_name);
BOOST_REQUIRE_EQUAL(success(), push_action(prod_name, N(claimrewards), mvo()("owner", prod_name)));
const auto global_state = get_global_state();
const uint64_t claim_time = global_state["last_pervote_bucket_fill"].as_uint64();
const asset pervote_bucket = global_state["pervote_bucket"].as<asset>();
......@@ -1661,11 +1654,11 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
BOOST_REQUIRE_EQUAL(int64_t( (initial_supply.amount * secs_between_fills * (cont_rate - standby_rate - block_rate)) / secs_per_year ),
savings.amount - initial_savings.amount);
int64_t block_payments = int64_t( initial_supply.amount * produced_blocks * block_rate / blocks_per_year );
int64_t expected_pervote_bucket = int64_t( initial_pervote_bucket.amount + initial_supply.amount * secs_between_fills * standby_rate / secs_per_year );
int64_t expected_pervote_bucket = int64_t( initial_pervote_bucket.amount + initial_supply.amount * secs_between_fills * standby_rate / secs_per_year );
int64_t from_pervote_bucket = int64_t( vote_shares[prod_index] * expected_pervote_bucket );
if (from_pervote_bucket >= 100 * 10000) {
BOOST_REQUIRE_EQUAL(block_payments + from_pervote_bucket, balance.amount - initial_balance.amount);
BOOST_REQUIRE_EQUAL(expected_pervote_bucket - from_pervote_bucket, pervote_bucket.amount);
......@@ -1695,7 +1688,7 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
}
// wait to 23 hours which is not enough for producers to get deactivated
// payment calculations don't change. By now, pervote_bucket has grown enough
// payment calculations don't change. By now, pervote_bucket has grown enough
// that a producer's share is more than 100 tokens
produce_block(fc::seconds(23 * 3600));
......@@ -1748,12 +1741,12 @@ BOOST_FIXTURE_TEST_CASE(multiple_producer_pay, eosio_system_tester, * boost::uni
push_action(prod_name, N(claimrewards), mvo()("owner", prod_name)));
}
// wait two more hours, now most producers haven't produced in a day and will
// wait two more hours, now most producers haven't produced in a day and will
// be deactivated
produce_block(fc::seconds(2 * 3600));
produce_blocks(8 * 21 * 12);
{
bool all_newly_elected_produced = true;
for (uint32_t i = 21; i < producer_names.size(); ++i) {
......@@ -1801,7 +1794,7 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, eosio_system_tester) try {
N(defproduceru),N(defproducerv),N(defproducerw),N(defproducerx),N(defproducery),N(defproducerz)};
setup_producer_accounts(producer_names);
for (auto a:producer_names)
for (auto a:producer_names)
regproducer(a);
BOOST_REQUIRE_EQUAL(0, get_producer_info( N(defproducera) )["total_votes"].as<double>());
......@@ -1846,7 +1839,7 @@ BOOST_FIXTURE_TEST_CASE(producer_onblock_check, eosio_system_tester) try {
("producers", vector<account_name>(producer_names.begin(), producer_names.begin()+21))
)
);
BOOST_REQUIRE_EQUAL(success(), push_action(N(producvoterc), N(voteproducer), mvo()
("voter", "producvoterc")
("proxy", name(0).to_string())
......@@ -2147,12 +2140,6 @@ fc::mutable_variant_object config_to_variant( const eosio::chain::chain_config&
( "max_block_cpu_usage", config.max_block_cpu_usage )
( "target_block_cpu_usage_pct", config.target_block_cpu_usage_pct )
( "max_transaction_cpu_usage", config.max_transaction_cpu_usage )
( "base_per_transaction_cpu_usage", config.base_per_transaction_cpu_usage )
( "base_per_action_cpu_usage", config.base_per_action_cpu_usage )
( "base_setcode_cpu_usage", config.base_setcode_cpu_usage )
( "per_signature_cpu_usage", config.per_signature_cpu_usage )
( "context_free_discount_cpu_usage_num", config.context_free_discount_cpu_usage_num )
( "context_free_discount_cpu_usage_den", config.context_free_discount_cpu_usage_den )
( "max_transaction_lifetime", config.max_transaction_lifetime )
( "deferred_trx_expiration_window", config.deferred_trx_expiration_window )
( "max_transaction_delay", config.max_transaction_delay )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册