From b3169b1f3fc1657bab67db31fe47fb1c9b4c809f Mon Sep 17 00:00:00 2001 From: John Jones Date: Fri, 28 Sep 2018 10:41:02 -0500 Subject: [PATCH 1/4] account_statistics, account_transaction_history objects to 64bit --- libraries/app/api.cpp | 4 ++-- libraries/app/include/graphene/app/api.hpp | 4 ++-- libraries/chain/include/graphene/chain/account_object.hpp | 4 ++-- .../chain/include/graphene/chain/operation_history_object.hpp | 4 ++-- libraries/plugins/account_history/account_history_plugin.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 50b0f57b0d..dbe6043e50 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -384,9 +384,9 @@ namespace graphene { namespace app { vector history_api::get_relative_account_history( const std::string account_id_or_name, - uint32_t stop, + uint64_t stop, unsigned limit, - uint32_t start) const + uint64_t start) const { FC_ASSERT( _app.chain_database() ); const auto& db = *_app.chain_database(); diff --git a/libraries/app/include/graphene/app/api.hpp b/libraries/app/include/graphene/app/api.hpp index 2eeab2f37a..08a4da7d57 100644 --- a/libraries/app/include/graphene/app/api.hpp +++ b/libraries/app/include/graphene/app/api.hpp @@ -173,9 +173,9 @@ namespace graphene { namespace app { * @return A list of operations performed by account, ordered from most recent to oldest. */ vector get_relative_account_history( const std::string account_id_or_name, - uint32_t stop = 0, + uint64_t stop = 0, unsigned limit = 100, - uint32_t start = 0) const; + uint64_t start = 0) const; vector get_fill_order_history( asset_id_type a, asset_id_type b, uint32_t limit )const; vector get_market_history( asset_id_type a, asset_id_type b, uint32_t bucket_seconds, diff --git a/libraries/chain/include/graphene/chain/account_object.hpp b/libraries/chain/include/graphene/chain/account_object.hpp index 02cadc09cb..b610fc7f5e 100644 --- a/libraries/chain/include/graphene/chain/account_object.hpp +++ b/libraries/chain/include/graphene/chain/account_object.hpp @@ -53,9 +53,9 @@ namespace graphene { namespace chain { */ account_transaction_history_id_type most_recent_op; /** Total operations related to this account. */ - uint32_t total_ops = 0; + uint64_t total_ops = 0; /** Total operations related to this account that has been removed from the database. */ - uint32_t removed_ops = 0; + uint64_t removed_ops = 0; /** * When calculating votes it is necessary to know how much is stored in orders (and thus unavailable for diff --git a/libraries/chain/include/graphene/chain/operation_history_object.hpp b/libraries/chain/include/graphene/chain/operation_history_object.hpp index 0bad41f4f7..3aeaab1923 100644 --- a/libraries/chain/include/graphene/chain/operation_history_object.hpp +++ b/libraries/chain/include/graphene/chain/operation_history_object.hpp @@ -92,7 +92,7 @@ namespace graphene { namespace chain { static const uint8_t type_id = impl_account_transaction_history_object_type; account_id_type account; /// the account this operation applies to operation_history_id_type operation_id; - uint32_t sequence = 0; /// the operation position within the given account + uint64_t sequence = 0; /// the operation position within the given account account_transaction_history_id_type next; //std::pair account_op()const { return std::tie( account, operation_id ); } @@ -121,7 +121,7 @@ namespace graphene { namespace chain { ordered_unique< tag, composite_key< account_transaction_history_object, member< account_transaction_history_object, account_id_type, &account_transaction_history_object::account>, - member< account_transaction_history_object, uint32_t, &account_transaction_history_object::sequence> + member< account_transaction_history_object, uint64_t, &account_transaction_history_object::sequence> > >, ordered_unique< tag, diff --git a/libraries/plugins/account_history/account_history_plugin.cpp b/libraries/plugins/account_history/account_history_plugin.cpp index e3ff7a1f10..5d38ec70e2 100644 --- a/libraries/plugins/account_history/account_history_plugin.cpp +++ b/libraries/plugins/account_history/account_history_plugin.cpp @@ -66,7 +66,7 @@ class account_history_plugin_impl flat_set _tracked_accounts; bool _partial_operations = false; primary_index< operation_history_index >* _oho_index; - uint32_t _max_ops_per_account = -1; + uint64_t _max_ops_per_account = -1; private: /** add one history record, then check and remove the earliest history record */ void add_account_history( const account_id_type account_id, const operation_history_id_type op_id ); @@ -298,7 +298,7 @@ void account_history_plugin::plugin_initialize(const boost::program_options::var my->_partial_operations = options["partial-operations"].as(); } if (options.count("max-ops-per-account")) { - my->_max_ops_per_account = options["max-ops-per-account"].as(); + my->_max_ops_per_account = options["max-ops-per-account"].as(); } } From f30d43c6a3ee266c5c8fc7d591cdd68653cc3f98 Mon Sep 17 00:00:00 2001 From: John Jones Date: Fri, 28 Sep 2018 10:59:38 -0500 Subject: [PATCH 2/4] Use size_t instead of uint32_t --- libraries/app/api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index dbe6043e50..f63581996f 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -141,7 +141,7 @@ namespace graphene { namespace app { { /// we need to ensure the database_api is not deleted for the life of the async operation auto capture_this = shared_from_this(); - for( uint32_t trx_num = 0; trx_num < b.transactions.size(); ++trx_num ) + for( std::size_t trx_num = 0; trx_num < b.transactions.size(); ++trx_num ) { const auto& trx = b.transactions[trx_num]; auto id = trx.id(); From cf332cd5fffcb3bb0620bddd342045934e6a4770 Mon Sep 17 00:00:00 2001 From: John Jones Date: Fri, 28 Sep 2018 11:10:36 -0500 Subject: [PATCH 3/4] Fix warning --- libraries/app/api.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index f63581996f..dbe6043e50 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -141,7 +141,7 @@ namespace graphene { namespace app { { /// we need to ensure the database_api is not deleted for the life of the async operation auto capture_this = shared_from_this(); - for( std::size_t trx_num = 0; trx_num < b.transactions.size(); ++trx_num ) + for( uint32_t trx_num = 0; trx_num < b.transactions.size(); ++trx_num ) { const auto& trx = b.transactions[trx_num]; auto id = trx.id(); From 26e863ff696fa9c0af188afabd0ebff1cf179a4b Mon Sep 17 00:00:00 2001 From: John Jones Date: Tue, 9 Oct 2018 16:30:36 -0500 Subject: [PATCH 4/4] bump db_version --- libraries/chain/include/graphene/chain/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/chain/include/graphene/chain/config.hpp b/libraries/chain/include/graphene/chain/config.hpp index ecdfc00656..1ef28a0c67 100644 --- a/libraries/chain/include/graphene/chain/config.hpp +++ b/libraries/chain/include/graphene/chain/config.hpp @@ -121,7 +121,7 @@ #define GRAPHENE_RECENTLY_MISSED_COUNT_INCREMENT 4 #define GRAPHENE_RECENTLY_MISSED_COUNT_DECREMENT 3 -#define GRAPHENE_CURRENT_DB_VERSION "BTS2.17" +#define GRAPHENE_CURRENT_DB_VERSION "BTS2.18" #define GRAPHENE_IRREVERSIBLE_THRESHOLD (70 * GRAPHENE_1_PERCENT)