From 0177b9835749ffdcbe567ac72dc08f3ab58f4fde Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 29 Jan 2025 11:48:52 -0600 Subject: [PATCH] Make eos-vm-oc-whitelist option multitoken to match other whitelist options. Also add info level log of the configured eos-vm-oc-whitelist accounts on startup. --- plugins/chain_plugin/chain_plugin.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/chain_plugin/chain_plugin.cpp b/plugins/chain_plugin/chain_plugin.cpp index fca4141b8d..b1c380a2b9 100644 --- a/plugins/chain_plugin/chain_plugin.cpp +++ b/plugins/chain_plugin/chain_plugin.cpp @@ -363,7 +363,7 @@ void chain_plugin::set_program_options(options_description& cli, options_descrip "'auto' - EOS VM OC tier-up is enabled for eosio.* accounts, read-only trxs, and except on producers applying blocks.\n" "'all' - EOS VM OC tier-up is enabled for all contract execution.\n" "'none' - EOS VM OC tier-up is completely disabled.\n") - ("eos-vm-oc-whitelist", bpo::value>()->composing()->default_value(std::vector{{"xsat"}}), + ("eos-vm-oc-whitelist", bpo::value>()->composing()->multitoken()->default_value(std::vector{{"xsat"}}), "EOS VM OC tier-up whitelist account suffixes for tier-up runtime 'auto'.") #endif ("enable-account-queries", bpo::value()->default_value(false), "enable queries to find accounts by various metadata.") @@ -533,6 +533,15 @@ void chain_plugin_impl::plugin_initialize(const variables_map& options) { LOAD_VALUE_SET( options, "trusted-producer", chain_config->trusted_producers ); + if (!chain_config->eos_vm_oc_whitelist_suffixes.empty()) { + const auto& wl = chain_config->eos_vm_oc_whitelist_suffixes; + std::string s = std::accumulate(std::next(wl.begin()), wl.end(), + wl.begin()->to_string(), + [](std::string a, account_name b) -> std::string { + return std::move(a) + ", " + b.to_string(); + }); + ilog("eos-vm-oc-whitelist accounts: ${a}", ("a", s)); + } if( options.count( "action-blacklist" )) { const std::vector& acts = options["action-blacklist"].as>(); auto& list = chain_config->action_blacklist;