Skip to content

Commit

Permalink
Showing 6 changed files with 19 additions and 12 deletions.
3 changes: 0 additions & 3 deletions libraries/chain/contracts/evt_org.cpp
Original file line number Diff line number Diff line change
@@ -15,9 +15,6 @@ void
initialize_evt_org(token_database& token_db, const genesis_state& genesis) {
// Add reserved everiToken foundation group
if(!token_db.exists_group(".everiToken")) {
auto strkey = (std::string)public_key_type();
printf("%s\n", strkey.c_str());

const char* def = R"(
{
"name": ".everiToken",
11 changes: 8 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
@@ -435,7 +435,7 @@ struct controller_impl {

auto trace = trx_context.trace;
try {
trx_context.init_for_deferred_trx();
trx_context.init_for_delay_trx();
trx_context.exec();
trx_context.finalize();

@@ -1135,12 +1135,17 @@ controller::proposed_producers() const {
}

bool
controller::skip_auth_check()const {
controller::skip_auth_check() const {
return my->replaying && !my->conf.force_all_checks && !my->in_trx_requiring_checks;
}

bool
controller::contracts_console()const {
controller::loadtest_mode() const {
return my->conf.loadtest_mode;
}

bool
controller::contracts_console() const {
return my->conf.contracts_console;
}

5 changes: 3 additions & 2 deletions libraries/chain/include/evt/chain/controller.hpp
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ class controller {
uint64_t reversible_cache_size = chain::config::default_reversible_cache_size;
bool read_only = false;
bool force_all_checks = false;
bool loadtest_mode = false;
bool contracts_console = false;

genesis_state genesis;
@@ -134,7 +135,7 @@ class controller {
int64_t set_proposed_producers(vector<producer_key> producers);

bool skip_auth_check() const;

bool loadtest_mode() const;
bool contracts_console() const;

chain_id_type get_chain_id() const;
@@ -171,4 +172,4 @@ class controller {
}} // namespace evt::chain

FC_REFLECT(evt::chain::controller::config,
(blocks_dir)(state_dir)(tokendb_dir)(state_size)(reversible_cache_size)(read_only)(force_all_checks)(contracts_console)(genesis))
(blocks_dir)(state_dir)(tokendb_dir)(state_size)(reversible_cache_size)(read_only)(force_all_checks)(loadtest_mode)(contracts_console)(genesis))
2 changes: 1 addition & 1 deletion libraries/chain/include/evt/chain/transaction_context.hpp
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ class transaction_context {

void init_for_implicit_trx();
void init_for_input_trx(uint32_t num_signatures);
void init_for_deferred_trx();
void init_for_delay_trx();

void exec();
void finalize();
8 changes: 5 additions & 3 deletions libraries/chain/transaction_context.cpp
Original file line number Diff line number Diff line change
@@ -39,14 +39,16 @@ void
transaction_context::init_for_input_trx(uint32_t num_signatures) {
auto& t = trx.trx;
is_input = true;
control.validate_expiration(t);
control.validate_tapos(t);
if(!control.loadtest_mode()) {
control.validate_expiration(t);
control.validate_tapos(t);
}
init();
record_transaction(trx.id, t.expiration); /// checks for dupes
}

void
transaction_context::init_for_deferred_trx() {
transaction_context::init_for_delay_trx() {
trace->is_delay = true;
init();
}
2 changes: 2 additions & 0 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
@@ -130,6 +130,7 @@ chain_plugin::set_program_options(options_description& cli, options_description&
("extract-genesis-json", bpo::value<bfs::path>(), "extract genesis_state from blocks.log as JSON, write into specified file, and exit")
("fix-reversible-blocks", bpo::bool_switch()->default_value(false), "recovers reversible block database if that database is in a bad state")
("force-all-checks", bpo::bool_switch()->default_value(false), "do not skip any checks that can be skipped while replaying irreversible blocks")
("loadtest-mode", bpo::bool_switch()->default_value(false), "special for load-testing, skip expiration and reference block checks")
("replay-blockchain", bpo::bool_switch()->default_value(false), "clear chain state database and token database and replay all blocks")
("hard-replay-blockchain", bpo::bool_switch()->default_value(false), "clear chain state database and token database, recover as many blocks as possible from the block log, and then replay those blocks")
("delete-all-blocks", bpo::bool_switch()->default_value(false), "clear chain state database, token database and block log")
@@ -215,6 +216,7 @@ chain_plugin::plugin_initialize(const variables_map& options) {
my->chain_config->reversible_cache_size = options.at("reversible-blocks-db-size-mb").as<uint64_t>() * 1024 * 1024;

my->chain_config->force_all_checks = options.at("force-all-checks").as<bool>();
my->chain_config->loadtest_mode = options.at("loadtest-mode").as<bool>();
my->chain_config->contracts_console = options.at("contracts-console").as<bool>();

if(options.count("extract-genesis-json") || options.at("print-genesis-json").as<bool>()) {

0 comments on commit af8b67c

Please sign in to comment.