提交 09d645b3 编写于 作者: B Bart Wyatt

- set more reasonabler defaults considering the max trx cpu usage was less...

- set more reasonabler defaults considering the max trx cpu usage was less than the setcode penalty... the smartest contract is the one that does not have to exist
- fixed incorrect usage of flat_set::erase
上级 0fc72fec
......@@ -343,8 +343,9 @@ static void record_locks_for_data_access(transaction_trace& trace, flat_set<shar
}
// remove read locks for write locks taken by other actions
trace.read_locks.erase(trace.write_locks.begin(), trace.write_locks.end());
read_locks.erase(trace.write_locks.begin(), trace.write_locks.end());
std::for_each(trace.write_locks.begin(), trace.write_locks.end(), [&]( const shard_lock& l){
trace.read_locks.erase(l); read_locks.erase(l);
});
read_locks.insert(trace.read_locks.begin(), trace.read_locks.end());
write_locks.insert(trace.write_locks.begin(), trace.write_locks.end());
......@@ -1072,11 +1073,11 @@ void chain_controller::update_resource_usage( transaction_trace& trace, const tr
// enforce that the system controlled per tx limits are not violated
EOS_ASSERT(trace.cpu_usage <= chain_configuration.max_transaction_cpu_usage,
tx_resource_exhausted, "Transaction exceeds the maximum cpu usage [used: ${used}, max: ${max}]",
("usage", trace.cpu_usage)("max", chain_configuration.max_transaction_cpu_usage));
("used", trace.cpu_usage)("max", chain_configuration.max_transaction_cpu_usage));
EOS_ASSERT(trace.net_usage <= chain_configuration.max_transaction_net_usage,
tx_resource_exhausted, "Transaction exceeds the maximum net usage [used: ${used}, max: ${max}]",
("usage", trace.net_usage)("max", chain_configuration.max_transaction_net_usage));
("used", trace.net_usage)("max", chain_configuration.max_transaction_net_usage));
// determine the accounts to bill
set<std::pair<account_name, permission_name>> authorizations;
......
......@@ -46,7 +46,7 @@ static const uint32_t block_size_average_window_ms = 60*1000l;
const static uint32_t default_max_block_size = 1024 * 1024; /// at 500ms blocks and 200byte trx, this enables ~10,000 TPS burst
const static uint32_t default_target_block_size = default_max_block_size / 10; /// we target 1000 TPS
const static uint32_t default_max_block_cpu_usage = 10 * 1024 * 1024; /// at 500ms blocks and 2000instr trx, this enables ~10,000 TPS burst
const static uint32_t default_max_block_cpu_usage = 100 * 1024 * 1024; /// at 500ms blocks and 20000instr trx, this enables ~10,000 TPS burst
const static uint32_t default_target_block_cpu_usage = default_max_block_cpu_usage / 10; /// target 1000 TPS
const static uint64_t default_max_storage_size = 10 * 1024;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册