Skip to content

Commit

Permalink
Merge pull request #1833 from AntelopeIO/gh_1764_main
Browse files Browse the repository at this point in the history
[5.0 -> main] Undo the temporary switch to mapped mode when loading a snapshot in mapped_private mode
  • Loading branch information
greg7mdp authored Oct 26, 2023
2 parents 452f3ea + 9cd4c88 commit db254c5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,6 @@ struct controller_impl {
ilog( "Snapshot loaded, lib: ${lib}", ("lib", head->block_num) );

init(std::move(check_shutdown));
if (conf.revert_to_private_mode)
db.revert_to_private_mode();
auto snapshot_load_time = (fc::time_point::now() - snapshot_load_start_time).to_seconds();
ilog( "Finished initialization from snapshot (snapshot load time was ${t}s)", ("t", snapshot_load_time) );
} catch (boost::interprocess::bad_alloc& e) {
Expand Down
1 change: 0 additions & 1 deletion libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ namespace eosio { namespace chain {
bool disable_replay_opts = false;
bool contracts_console = false;
bool allow_ram_billing_in_notify = false;
bool revert_to_private_mode = false;
uint32_t maximum_variable_signature_length = chain::config::default_max_variable_signature_length;
bool disable_all_subjective_mitigations = false; //< for developer & testing purposes, can be configured using `disable-all-subjective-mitigations` when `EOSIO_DEVELOPER` build option is provided
uint32_t terminate_at_block = 0;
Expand Down
7 changes: 0 additions & 7 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,13 +927,6 @@ void chain_plugin_impl::plugin_initialize(const variables_map& options) {

chain_config->db_map_mode = options.at("database-map-mode").as<pinnable_mapped_file::map_mode>();

// when loading a snapshot, all the state will be modified, so temporarily use the `mapped` mode instead
// of `mapped_private` to lower memory requirements.
if (snapshot_path && chain_config->db_map_mode == pinnable_mapped_file::mapped_private) {
chain_config->db_map_mode = pinnable_mapped_file::mapped;
chain_config->revert_to_private_mode = true; // revert to `mapped_private` mode after loading snapshot.
}

#ifdef EOSIO_EOS_VM_OC_RUNTIME_ENABLED
if( options.count("eos-vm-oc-cache-size-mb") )
chain_config->eosvmoc_config.cache_size = options.at( "eos-vm-oc-cache-size-mb" ).as<uint64_t>() * 1024u * 1024u;
Expand Down

0 comments on commit db254c5

Please sign in to comment.