diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 5b5fb589..eb117b32 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -248,9 +248,6 @@ class database_api_impl : public std::enable_shared_from_this // Account Role vector get_account_roles_by_owner(account_id_type owner) const; - // rng - vector get_random_number_ex(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates) const; - uint64_t get_random_number(uint64_t bound) const; //private: const account_object* get_account_from_string( const std::string& name_or_id, @@ -3192,31 +3189,6 @@ vector database_api_impl::get_account_roles_by_owner(accoun } return result; } -////////////////////////////////////////////////////////////////////// -// // -// Random numbers // -// // -////////////////////////////////////////////////////////////////////// - -vector database_api::get_random_number_ex(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates) const -{ - return my->get_random_number_ex(minimum, maximum, selections, duplicates); -} - -vector database_api_impl::get_random_number_ex(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates) const -{ - return _db.get_random_numbers(minimum, maximum, selections, duplicates); -} - -uint64_t database_api::get_random_number(uint64_t bound) const -{ - return my->get_random_number(bound); -} - -uint64_t database_api_impl::get_random_number(uint64_t bound) const { - vector v = get_random_number_ex(0, bound, 1, false); - return v.at(0); -} ////////////////////////////////////////////////////////////////////// // // diff --git a/libraries/app/include/graphene/app/database_api.hpp b/libraries/app/include/graphene/app/database_api.hpp index 80fe78dd..b6461635 100644 --- a/libraries/app/include/graphene/app/database_api.hpp +++ b/libraries/app/include/graphene/app/database_api.hpp @@ -943,26 +943,6 @@ class database_api ////////////////// vector get_account_roles_by_owner(account_id_type owner) const; - ///////////////////////////// - // Random number generator // - ///////////////////////////// - /** - * @brief Returns the random number - * @param minimum Lower bound of segment containing random number - * @param maximum Upper bound of segment containing random number - * @param selections Number of random numbers to return - * @param duplicates Allow duplicated numbers - * @return Vector containing random numbers from segment [minimum, maximum) - */ - vector get_random_number_ex(uint64_t minimum, uint64_t maximum, uint64_t selections, bool duplicates) const; - - /** - * @brief Returns the random number - * @param bound Upper bound of segment containing random number - * @return Random number from segment [0, bound) - */ - uint64_t get_random_number(uint64_t bound) const; - private: std::shared_ptr< database_api_impl > my; }; @@ -1155,7 +1135,4 @@ FC_API(graphene::app::database_api, // Account Roles (get_account_roles_by_owner) - // rngs - (get_random_number_ex) - (get_random_number) ) diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index c6af081d..caece984 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -207,7 +207,7 @@ void database::pay_sons() const auto& idx = get_index_type().indices().get(); auto son_obj = idx.find( s.owner ); auto son_weight = get_weight(_vote_tally_buffer[son_obj->vote_id]); - if( now < HARDFORK_NEXT_TIME ) { + if( now < HARDFORK_SON2_TIME ) { son_weight = get_weight_next_hf(_vote_tally_buffer[son_obj->vote_id]); } weighted_total_txs_signed += (s.txs_signed * son_weight); @@ -1954,7 +1954,7 @@ void database::perform_son_tasks() void update_son_asset(database& db) { - if( db.head_block_time() >= HARDFORK_NEXT_TIME ) + if( db.head_block_time() >= HARDFORK_SON2_TIME ) { const auto& gpo = db.get_global_properties(); const asset_object& btc_asset = gpo.parameters.btc_asset()(db); diff --git a/libraries/chain/hardfork.d/NEXT.hf b/libraries/chain/hardfork.d/NEXT.hf deleted file mode 100644 index 830a0790..00000000 --- a/libraries/chain/hardfork.d/NEXT.hf +++ /dev/null @@ -1,4 +0,0 @@ -// NEXT HARDFORK Wednesday, March 17, 2021 23:00:00 GMT -#ifndef HARDFORK_NEXT_TIME -#define HARDFORK_NEXT_TIME (fc::time_point_sec( 1615982400 )) -#endif diff --git a/libraries/chain/hardfork.d/SON2.hf b/libraries/chain/hardfork.d/SON2.hf new file mode 100644 index 00000000..fa7a9334 --- /dev/null +++ b/libraries/chain/hardfork.d/SON2.hf @@ -0,0 +1,4 @@ +// SON2 HARDFORK Friday, June 11, 2021 01:00:00 GMT +#ifndef HARDFORK_SON2_TIME +#define HARDFORK_SON2_TIME (fc::time_point_sec( 1623369600 )) +#endif diff --git a/libraries/fc b/libraries/fc index 48888392..fb27454c 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit 488883921936139e8734b99822d3a589afe80da1 +Subproject commit fb27454cdf1626e5e108e42848bd1bcfe60c9540 diff --git a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp index 2f439711..e93dd788 100644 --- a/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp +++ b/libraries/plugins/peerplays_sidechain/peerplays_sidechain_plugin.cpp @@ -134,7 +134,7 @@ void peerplays_sidechain_plugin_impl::plugin_set_program_options( cli.add_options()("bitcoin-wallet-password", bpo::value(), "Bitcoin wallet password"); cli.add_options()("bitcoin-private-key", bpo::value>()->composing()->multitoken()->DEFAULT_VALUE_VECTOR(std::make_pair("02d0f137e717fb3aab7aff99904001d49a0a636c5e1342f8927a4ba2eaee8e9772", "cVN31uC9sTEr392DLVUEjrtMgLA8Yb3fpYmTRj7bomTm6nn2ANPr")), "Tuple of [Bitcoin public key, Bitcoin private key] (may specify multiple times)"); - cli.add_options()("sidechain-retry-threshold", bpo::value()->default_value(15), "Sidechain retry throttling threshold"); + cli.add_options()("sidechain-retry-threshold", bpo::value()->default_value(150), "Sidechain retry throttling threshold"); cfg.add(cli); } diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 58d78228..457aa891 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -1957,32 +1957,6 @@ class wallet_api bool broadcast /* = false */ ); - /** Get random numbers - * @brief Returns the random number - * @param minimum Lower bound of segment containing random number - * @param maximum Upper bound of segment containing random number - * @param selections Number of random numbers to return - * @param duplicates Allow duplicated numbers - * @param broadcast true if you wish to broadcast the transaction - * @return the signed version of the transaction - * @return Vector containing random numbers from segment [minimum, maximum) - */ - vector get_random_number_ex(string account, - uint64_t minimum, - uint64_t maximum, - uint64_t selections, - bool duplicates, - bool broadcast); - - /** Get random number - * @brief Returns the random number - * @param bound Upper bound of segment containing random number - * @return Random number from segment [0, bound) - */ - uint64_t get_random_number(string account, - uint64_t bound, - bool broadcast); - order_book get_order_book( const string& base, const string& quote, unsigned limit = 50); asset get_total_matched_bet_amount_for_betting_market_group(betting_market_group_id_type group_id); @@ -2680,8 +2654,6 @@ FC_API( graphene::wallet::wallet_api, (propose_fee_change) (propose_dividend_asset_update) (approve_proposal) - (get_random_number_ex) - (get_random_number) (dbg_make_uia) (dbg_make_mia) (dbg_push_blocks) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 874e10b5..843c9cbc 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -3866,38 +3866,6 @@ public: return _remote_db->get_active_custom_account_authorities_by_operation(get_account(owner).id, operation_type); } - vector get_random_number_ex(string account, - uint64_t minimum, - uint64_t maximum, - uint64_t selections, - bool duplicates, - bool broadcast) - { - - vector v = _remote_db->get_random_number_ex(minimum, maximum, selections, duplicates); - - random_number_store_operation op; - op.account = get_account(account).id; - op.random_number = v; - op.data = ""; - - signed_transaction trx; - trx.operations.push_back(op); - set_operation_fees( trx, _remote_db->get_global_properties().parameters.current_fees ); - trx.validate(); - sign_transaction( trx, broadcast ); - - return v; - } - - uint64_t get_random_number(string account, - uint64_t bound, - bool broadcast) - { - vector v = get_random_number_ex(account, 0, bound, 1, false, broadcast); - return v.at(0); - } - void dbg_make_uia(string creator, string symbol) { asset_options opts; @@ -5444,23 +5412,6 @@ vector wallet_api::get_active_custom_account_authorities_by_operation return my->get_active_custom_account_authorities_by_operation(owner, operation_type); } -vector wallet_api::get_random_number_ex(string account, - uint64_t minimum, - uint64_t maximum, - uint64_t selections, - bool duplicates, - bool broadcast) -{ - return my->get_random_number_ex( account, minimum, maximum, selections, duplicates, broadcast ); -} - -uint64_t wallet_api::get_random_number(string account, - uint64_t bound, - bool broadcast) -{ - return my->get_random_number( account, bound, broadcast ); -} - global_property_object wallet_api::get_global_properties() const { return my->get_global_properties();