Skip to content

Commit

Permalink
Merge pull request #1209 from AntelopeIO/GH-1173-rm-option
Browse files Browse the repository at this point in the history
Remove disable-subjective-billing option
  • Loading branch information
heifner authored May 24, 2023
2 parents d215122 + bad4bb4 commit 0615a25
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
2 changes: 0 additions & 2 deletions docs/01_nodeos/03_plugins/producer_plugin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ Config Options for eosio::producer_plugin:
transaction queue. Exceeding this value
will subjectively drop transaction with
resource exhaustion.
--disable-subjective-billing arg (=1) Disable subjective CPU billing for
API/P2P transactions
--disable-subjective-account-billing arg
Account which is excluded from
subjective CPU billing
Expand Down
16 changes: 4 additions & 12 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,8 +862,6 @@ void producer_plugin::set_program_options(
"ratio between incoming transactions and deferred transactions when both are queued for execution")
("incoming-transaction-queue-size-mb", bpo::value<uint16_t>()->default_value( 1024 ),
"Maximum size (in MiB) of the incoming transaction queue. Exceeding this value will subjectively drop transaction with resource exhaustion.")
("disable-subjective-billing", bpo::value<bool>()->default_value(true),
"Disable subjective CPU billing for API/P2P transactions")
("disable-subjective-account-billing", boost::program_options::value<vector<string>>()->composing()->multitoken(),
"Account which is excluded from subjective CPU billing")
("disable-subjective-p2p-billing", bpo::value<bool>()->default_value(true),
Expand Down Expand Up @@ -989,19 +987,13 @@ void producer_plugin::plugin_initialize(const boost::program_options::variables_

my->_incoming_defer_ratio = options.at("incoming-defer-ratio").as<double>();

bool disable_subjective_billing = options.at("disable-subjective-billing").as<bool>();
my->_disable_subjective_p2p_billing = options.at("disable-subjective-p2p-billing").as<bool>();
my->_disable_subjective_api_billing = options.at("disable-subjective-api-billing").as<bool>();
dlog( "disable-subjective-billing: ${s}, disable-subjective-p2p-billing: ${p2p}, disable-subjective-api-billing: ${api}",
("s", disable_subjective_billing)("p2p", my->_disable_subjective_p2p_billing)("api", my->_disable_subjective_api_billing) );
if( !disable_subjective_billing ) {
my->_disable_subjective_p2p_billing = my->_disable_subjective_api_billing = false;
} else if( !my->_disable_subjective_p2p_billing || !my->_disable_subjective_api_billing ) {
disable_subjective_billing = false;
}
if( disable_subjective_billing ) {
dlog( "disable-subjective-p2p-billing: ${p2p}, disable-subjective-api-billing: ${api}",
("p2p", my->_disable_subjective_p2p_billing)("api", my->_disable_subjective_api_billing) );
if( my->_disable_subjective_p2p_billing && my->_disable_subjective_api_billing ) {
chain.get_mutable_subjective_billing().disable();
ilog( "Subjective CPU billing disabled" );
ilog( "Subjective CPU billing disabled" );
} else if( !my->_disable_subjective_p2p_billing && !my->_disable_subjective_api_billing ) {
ilog( "Subjective CPU billing enabled" );
} else {
Expand Down
2 changes: 1 addition & 1 deletion plugins/producer_plugin/test/test_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(state_dir) {
"--data-dir", temp_dir_str.c_str(),
"--state-dir", custom_state_dir_str.c_str(),
"--config-dir", temp_dir_str.c_str(),
"-p", "eosio", "-e", "--max-transaction-time", "475", "--disable-subjective-billing=true" };
"-p", "eosio", "-e" };
app->initialize<chain_plugin, producer_plugin>( argv.size(), (char**) &argv[0] );
app->startup();
plugin_promise.set_value( {app->find_plugin<producer_plugin>(), app->find_plugin<chain_plugin>()} );
Expand Down
6 changes: 2 additions & 4 deletions plugins/producer_plugin/test/test_read_only_trx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ BOOST_AUTO_TEST_CASE(with_1_read_only_threads) {
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=100000",
"--read-only-read-window-time-us=40000",
"--disable-subjective-billing=true" };
"--read-only-read-window-time-us=40000" };
test_trxs_common(specific_args);
}

Expand All @@ -195,8 +194,7 @@ BOOST_AUTO_TEST_CASE(with_8_read_only_threads) {
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=100000",
"--read-only-read-window-time-us=40000",
"--disable-subjective-billing=true" };
"--read-only-read-window-time-us=40000" };
test_trxs_common(specific_args);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/producer_plugin/test/test_trx_full.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(producer) {
fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug);
std::vector<const char*> argv =
{"test", "--data-dir", temp_dir_str.c_str(), "--config-dir", temp_dir_str.c_str(),
"-p", "eosio", "-e", "--disable-subjective-billing=true" };
"-p", "eosio", "-e", "--disable-subjective-p2p-billing=true" };
app->initialize<chain_plugin, producer_plugin>( argv.size(), (char**) &argv[0] );
app->startup();
plugin_promise.set_value(
Expand Down
3 changes: 2 additions & 1 deletion tests/performance_tests/performance_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ def setupClusterConfig(args) -> ClusterConfig:
blockLogRetainBlocks=args.block_log_retain_blocks,
chainStateDbSizeMb=args.chain_state_db_size_mb, abiSerializerMaxTimeMs=990000)

producerPluginArgs = ProducerPluginArgs(disableSubjectiveBilling=args.disable_subjective_billing,
producerPluginArgs = ProducerPluginArgs(disableSubjectiveApiBilling=args.disable_subjective_billing,
disableSubjectiveP2pBilling=args.disable_subjective_billing,
cpuEffortPercent=args.cpu_effort_percent,
producerThreads=args.producer_threads, maxTransactionTime=-1)
httpPluginArgs = HttpPluginArgs(httpMaxBytesInFlightMb=args.http_max_bytes_in_flight_mb, httpMaxInFlightRequests=args.http_max_in_flight_requests,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_snapshot_scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE(snapshot_scheduler_test) {
fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug);
std::vector<const char*> argv =
{"test", "--data-dir", temp.c_str(), "--config-dir", temp.c_str(),
"-p", "eosio", "-e", "--disable-subjective-billing=true"};
"-p", "eosio", "-e"};
app->initialize<chain_plugin, producer_plugin>(argv.size(), (char**) &argv[0]);
app->startup();
plugin_promise.set_value(
Expand Down

0 comments on commit 0615a25

Please sign in to comment.