Skip to content

Commit

Permalink
Merge pull request #70 from worldwide-asset-exchange/skip-all-checks
Browse files Browse the repository at this point in the history
skip checks for txs, so as to access estimations easily
  • Loading branch information
porkchop authored Jan 19, 2022
2 parents 3bb09f6 + fd6e190 commit d3144fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ struct controller_impl {
EOS_ASSERT( (s == controller::block_status::irreversible || s == controller::block_status::validated),
block_validate_exception, "invalid block status for replay" );
emit( self.pre_accepted_block, b );
const bool skip_validate_signee = !conf.force_all_checks;
const bool skip_validate_signee = conf.skip_all_checks || !conf.force_all_checks;

auto bsp = std::make_shared<block_state>(
*head,
Expand Down Expand Up @@ -3047,7 +3047,7 @@ bool controller::light_validation_allowed(bool replay_opts_disabled_by_policy) c


bool controller::skip_auth_check() const {
return light_validation_allowed(my->conf.force_all_checks);
return my->conf.skip_all_checks || light_validation_allowed(my->conf.force_all_checks);
}

bool controller::skip_db_sessions( block_status bs ) const {
Expand Down
1 change: 1 addition & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ namespace eosio { namespace chain {
uint32_t max_nonprivileged_inline_action_size = chain::config::default_max_nonprivileged_inline_action_size;
bool read_only = false;
bool force_all_checks = false;
bool skip_all_checks = false;
bool disable_replay_opts = false;
bool contracts_console = false;
bool allow_ram_billing_in_notify = false;
Expand Down
3 changes: 3 additions & 0 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
"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")
("skip-all-checks", bpo::bool_switch()->default_value(false),
"skip all checks that can be skipped while processing blocks")
("disable-replay-opts", bpo::bool_switch()->default_value(false),
"disable optimizations that specifically target replay")
("replay-blockchain", bpo::bool_switch()->default_value(false),
Expand Down Expand Up @@ -769,6 +771,7 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
my->chain_config->wasm_runtime = *my->wasm_runtime;

my->chain_config->force_all_checks = options.at( "force-all-checks" ).as<bool>();
my->chain_config->skip_all_checks = options.at( "skip-all-checks" ).as<bool>();
my->chain_config->disable_replay_opts = options.at( "disable-replay-opts" ).as<bool>();
my->chain_config->contracts_console = options.at( "contracts-console" ).as<bool>();
my->chain_config->allow_ram_billing_in_notify = options.at( "disable-ram-billing-notify-checks" ).as<bool>();
Expand Down

0 comments on commit d3144fb

Please sign in to comment.