Skip to content

Commit

Permalink
allow synchronous OC mode w/o compile time option
Browse files Browse the repository at this point in the history
  • Loading branch information
spoonincode committed Jan 26, 2025
1 parent 909603c commit 158f3d3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
5 changes: 0 additions & 5 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ foreach(RUNTIME ${EOSIO_WASM_RUNTIMES})
target_compile_definitions(eosio_chain PUBLIC "EOSIO_${RUNTIMEUC}_RUNTIME_ENABLED")
endforeach()

if(EOSVMOC_ENABLE_DEVELOPER_OPTIONS)
message(WARNING "EOS VM OC Developer Options are enabled; these are NOT supported")
target_compile_definitions(eosio_chain PUBLIC EOSIO_EOS_VM_OC_DEVELOPER)
endif()

install( TARGETS eosio_chain
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} COMPONENT dev EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} COMPONENT dev EXCLUDE_FROM_ALL
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/wasm_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ std::istream& operator>>(std::istream& in, wasm_interface::vm_type& runtime) {
runtime = eosio::chain::wasm_interface::vm_type::eos_vm;
else if (s == "eos-vm-jit")
runtime = eosio::chain::wasm_interface::vm_type::eos_vm_jit;
else if (s == "eos-vm-oc")
else if (s == "forced-eos-vm-oc")
runtime = eosio::chain::wasm_interface::vm_type::eos_vm_oc;
else
in.setstate(std::ios_base::failbit);
Expand Down
13 changes: 2 additions & 11 deletions plugins/chain_plugin/chain_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
delim = ", ";
#endif

#ifdef EOSIO_EOS_VM_OC_DEVELOPER
wasm_runtime_opt += delim + "\"eos-vm-oc\"";
wasm_runtime_desc += "\"eos-vm-oc\" : Unsupported. Instead, use one of the other runtimes along with the option eos-vm-oc-enable.\n";
#endif
wasm_runtime_opt += ")\n" + wasm_runtime_desc;

std::string default_wasm_runtime_str= eosio::chain::wasm_interface::vm_type_string(eosio::chain::config::default_wasm_runtime);
Expand Down Expand Up @@ -288,13 +284,8 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip
"the location of the protocol_features directory (absolute path or relative to application config dir)")
("checkpoint", bpo::value<vector<string>>()->composing(), "Pairs of [BLOCK_NUM,BLOCK_ID] that should be enforced as checkpoints.")
("wasm-runtime", bpo::value<eosio::chain::wasm_interface::vm_type>()->value_name("runtime")->notifier([](const auto& vm){
#ifndef EOSIO_EOS_VM_OC_DEVELOPER
//throwing an exception here (like EOS_ASSERT) is just gobbled up with a "Failed to initialize" error :(
if(vm == wasm_interface::vm_type::eos_vm_oc) {
elog("EOS VM OC is a tier-up compiler and works in conjunction with the configured base WASM runtime. Enable EOS VM OC via 'eos-vm-oc-enable' option");
EOS_ASSERT(false, plugin_exception, "");
}
#endif
if(vm == wasm_interface::vm_type::eos_vm_oc)
wlog("forced-eos-vm-oc mode is not supported. It is for development purposes only");
})->default_value(eosio::chain::config::default_wasm_runtime, default_wasm_runtime_str), wasm_runtime_opt.c_str()
)
("profile-account", boost::program_options::value<vector<string>>()->composing(),
Expand Down
2 changes: 1 addition & 1 deletion tests/read_only_trx_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
appArgs.add(flag="--read-only-threads", type=int, help="number of read-only threads", default=0)
appArgs.add(flag="--num-test-runs", type=int, help="number of times to run the tests", default=1)
appArgs.add(flag="--eos-vm-oc-enable", type=str, help="specify eos-vm-oc-enable option", default="auto")
appArgs.add(flag="--wasm-runtime", type=str, help="if set to eos-vm-oc, must compile with EOSIO_EOS_VM_OC_DEVELOPER", default="eos-vm-jit")
appArgs.add(flag="--wasm-runtime", type=str, help="if wanting eos-vm-oc, must use 'forced-eos-vm-oc'", default="eos-vm-jit")

args=TestHelper.parse_args({"-p","-n","-d","-s","--nodes-file","--seed"
,"--activate-if","--dump-error-details","-v","--leave-running"
Expand Down

0 comments on commit 158f3d3

Please sign in to comment.