From 4df7298a0d03d2229e425586bd8ec2ebc922c438 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Fri, 10 May 2019 13:15:15 +0200 Subject: [PATCH 01/44] Externalized some API templates --- libraries/app/api.cpp | 11 +++++++++++ libraries/app/database_api.cpp | 4 ++++ libraries/app/include/graphene/app/api.hpp | 12 ++++++++++++ libraries/app/include/graphene/app/database_api.hpp | 2 ++ libraries/wallet/include/graphene/wallet/wallet.hpp | 2 ++ libraries/wallet/wallet.cpp | 3 +++ 6 files changed, 34 insertions(+) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 29a4edf9..138e0560 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -40,8 +40,19 @@ #include #include +#include #include +template class fc::api; +template class fc::api; +template class fc::api; +template class fc::api; +template class fc::api; +template class fc::api; +template class fc::api; +template class fc::api; + + namespace graphene { namespace app { login_api::login_api(application& a) diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index c7d63ad5..b49e1b35 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -31,6 +31,8 @@ #include #include +#include +#include #include #include @@ -45,6 +47,8 @@ typedef std::map< std::pair, std::vector > market_queue_type; +template class fc::api; + namespace graphene { namespace app { class database_api_impl : public std::enable_shared_from_this diff --git a/libraries/app/include/graphene/app/api.hpp b/libraries/app/include/graphene/app/api.hpp index d40dde6e..9e468dca 100644 --- a/libraries/app/include/graphene/app/api.hpp +++ b/libraries/app/include/graphene/app/api.hpp @@ -357,7 +357,17 @@ namespace graphene { namespace app { graphene::chain::database& _db; graphene::app::database_api database_api; }; +} } // graphene::app +extern template class fc::api; +extern template class fc::api; +extern template class fc::api; +extern template class fc::api; +extern template class fc::api; +extern template class fc::api; +extern template class fc::api; + +namespace graphene { namespace app { /** * @brief The login_api class implements the bottom layer of the RPC API * @@ -419,6 +429,8 @@ namespace graphene { namespace app { }} // graphene::app +extern template class fc::api; + FC_REFLECT( graphene::app::network_broadcast_api::transaction_confirmation, (id)(block_num)(trx_num)(trx) ) FC_REFLECT( graphene::app::verify_range_result, diff --git a/libraries/app/include/graphene/app/database_api.hpp b/libraries/app/include/graphene/app/database_api.hpp index 00f51a44..378a4aea 100644 --- a/libraries/app/include/graphene/app/database_api.hpp +++ b/libraries/app/include/graphene/app/database_api.hpp @@ -715,6 +715,8 @@ private: } } +extern template class fc::api; + FC_REFLECT( graphene::app::order, (price)(quote)(base) ); FC_REFLECT( graphene::app::order_book, (base)(quote)(bids)(asks) ); FC_REFLECT( graphene::app::market_ticker, (base)(quote)(latest)(lowest_ask)(highest_bid)(percent_change)(base_volume)(quote_volume) ); diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index d6082564..7c1960ee 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -1927,6 +1927,8 @@ class wallet_api } } +extern template class fc::api; + FC_REFLECT( graphene::wallet::key_label, (label)(key) ) FC_REFLECT( graphene::wallet::blind_balance, (amount)(from)(to)(one_time_key)(blinding_factor)(commitment)(used) ) FC_REFLECT( graphene::wallet::blind_confirmation::output, (label)(pub_key)(decrypted_memo)(confirmation)(auth)(confirmation_receipt) ) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 27eac237..bdb756c2 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -89,6 +90,8 @@ # include #endif +template class fc::api; + #define BRAIN_KEY_WORD_COUNT 16 namespace graphene { namespace wallet { From 71d8bfd8439d7ca1386cd3b882c9a7d44dd01c65 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Sat, 11 May 2019 12:39:15 +0200 Subject: [PATCH 02/44] Externalize serialization of blocks, tx, ops --- .../include/graphene/chain/block_database.hpp | 2 ++ .../include/graphene/chain/protocol/block.hpp | 5 +++ .../graphene/chain/protocol/transaction.hpp | 5 +++ .../include/graphene/chain/protocol/types.hpp | 28 +++++++++++++++- libraries/chain/protocol/account.cpp | 3 ++ libraries/chain/protocol/asset_ops.cpp | 2 ++ libraries/chain/protocol/block.cpp | 5 +++ libraries/chain/protocol/custom.cpp | 2 ++ libraries/chain/protocol/operations.cpp | 1 + libraries/chain/protocol/proposal.cpp | 2 ++ libraries/chain/protocol/transaction.cpp | 4 +++ libraries/chain/protocol/transfer.cpp | 2 ++ .../chain/protocol/withdraw_permission.cpp | 2 ++ libraries/egenesis/egenesis_none.cpp | 2 ++ libraries/net/CMakeLists.txt | 1 + .../net/include/graphene/net/message.hpp | 18 +++++++---- .../include/graphene/net/peer_connection.hpp | 3 -- .../include/graphene/net/peer_database.hpp | 8 +++-- libraries/net/message.cpp | 32 +++++++++++++++++++ libraries/net/node.cpp | 1 + libraries/net/peer_connection.cpp | 2 +- libraries/net/peer_database.cpp | 11 +++++++ .../wallet/include/graphene/wallet/wallet.hpp | 6 ++-- libraries/wallet/wallet.cpp | 12 +++---- 24 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 libraries/net/message.cpp diff --git a/libraries/chain/include/graphene/chain/block_database.hpp b/libraries/chain/include/graphene/chain/block_database.hpp index d902cd1b..c5cf5df9 100644 --- a/libraries/chain/include/graphene/chain/block_database.hpp +++ b/libraries/chain/include/graphene/chain/block_database.hpp @@ -25,6 +25,8 @@ #include #include +#include + namespace graphene { namespace chain { class index_entry; diff --git a/libraries/chain/include/graphene/chain/protocol/block.hpp b/libraries/chain/include/graphene/chain/protocol/block.hpp index 46ac0f6d..ad5b0327 100644 --- a/libraries/chain/include/graphene/chain/protocol/block.hpp +++ b/libraries/chain/include/graphene/chain/protocol/block.hpp @@ -69,3 +69,8 @@ FC_REFLECT( graphene::chain::block_header, (extensions) ) FC_REFLECT_DERIVED( graphene::chain::signed_block_header, (graphene::chain::block_header), (witness_signature) ) FC_REFLECT_DERIVED( graphene::chain::signed_block, (graphene::chain::signed_block_header), (transactions) ) + + +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::block_header) +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::signed_block_header) +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::signed_block) diff --git a/libraries/chain/include/graphene/chain/protocol/transaction.hpp b/libraries/chain/include/graphene/chain/protocol/transaction.hpp index 95c39961..2a9909a5 100644 --- a/libraries/chain/include/graphene/chain/protocol/transaction.hpp +++ b/libraries/chain/include/graphene/chain/protocol/transaction.hpp @@ -230,3 +230,8 @@ FC_REFLECT( graphene::chain::transaction, (ref_block_num)(ref_block_prefix)(expi // Note: not reflecting signees field for backward compatibility; in addition, it should not be in p2p messages FC_REFLECT_DERIVED( graphene::chain::signed_transaction, (graphene::chain::transaction), (signatures) ) FC_REFLECT_DERIVED( graphene::chain::processed_transaction, (graphene::chain::signed_transaction), (operation_results) ) + + +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::transaction) +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::signed_transaction) +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::chain::processed_transaction) diff --git a/libraries/chain/include/graphene/chain/protocol/types.hpp b/libraries/chain/include/graphene/chain/protocol/types.hpp index c2c92ca3..8cd38ea5 100644 --- a/libraries/chain/include/graphene/chain/protocol/types.hpp +++ b/libraries/chain/include/graphene/chain/protocol/types.hpp @@ -33,7 +33,8 @@ #include #include #include -#include +#include +#include #include #include #include @@ -46,6 +47,31 @@ #include #include +#define GRAPHENE_EXTERNAL_SERIALIZATION(ext, type) \ +namespace fc { \ + ext template void from_variant( const variant& v, type& vo, uint32_t max_depth ); \ + ext template void to_variant( const type& v, variant& vo, uint32_t max_depth ); \ +namespace raw { \ + ext template void pack< datastream, type >( datastream& s, const type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \ + ext template void pack< datastream, type >( datastream& s, const type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \ + ext template void unpack< datastream, type >( datastream& s, type& tx, uint32_t _max_depth=FC_PACK_MAX_DEPTH ); \ +} } // fc::raw + +#define FC_REFLECT_DERIVED_NO_TYPENAME( TYPE, INHERITS, MEMBERS ) \ +namespace fc { \ +template<> struct reflector {\ + typedef TYPE type; \ + typedef fc::true_type is_defined; \ + typedef fc::false_type is_enum; \ + enum member_count_enum { \ + local_member_count = 0 BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_MEMBER_COUNT, +, MEMBERS ),\ + total_member_count = local_member_count BOOST_PP_SEQ_FOR_EACH( FC_REFLECT_BASE_MEMBER_COUNT, +, INHERITS )\ + }; \ + FC_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ +}; \ +} // fc + + namespace graphene { namespace chain { using namespace graphene::db; diff --git a/libraries/chain/protocol/account.cpp b/libraries/chain/protocol/account.cpp index cf592d5c..66dcdb90 100644 --- a/libraries/chain/protocol/account.cpp +++ b/libraries/chain/protocol/account.cpp @@ -24,6 +24,9 @@ #include #include #include + +#include + namespace graphene { namespace chain { /** diff --git a/libraries/chain/protocol/asset_ops.cpp b/libraries/chain/protocol/asset_ops.cpp index e4942aa4..9c551882 100644 --- a/libraries/chain/protocol/asset_ops.cpp +++ b/libraries/chain/protocol/asset_ops.cpp @@ -24,6 +24,8 @@ #include #include +#include + namespace graphene { namespace chain { /** diff --git a/libraries/chain/protocol/block.cpp b/libraries/chain/protocol/block.cpp index d32365dd..725ea3a7 100644 --- a/libraries/chain/protocol/block.cpp +++ b/libraries/chain/protocol/block.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include #include #include #include @@ -90,3 +91,7 @@ namespace graphene { namespace chain { } } } + +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::block_header) +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::signed_block_header) +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::signed_block) diff --git a/libraries/chain/protocol/custom.cpp b/libraries/chain/protocol/custom.cpp index b69243be..be03419f 100644 --- a/libraries/chain/protocol/custom.cpp +++ b/libraries/chain/protocol/custom.cpp @@ -23,6 +23,8 @@ */ #include +#include + namespace graphene { namespace chain { void custom_operation::validate()const diff --git a/libraries/chain/protocol/operations.cpp b/libraries/chain/protocol/operations.cpp index 40a37eba..57831b8f 100644 --- a/libraries/chain/protocol/operations.cpp +++ b/libraries/chain/protocol/operations.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/proposal.cpp b/libraries/chain/protocol/proposal.cpp index 069824af..bca0c416 100644 --- a/libraries/chain/protocol/proposal.cpp +++ b/libraries/chain/protocol/proposal.cpp @@ -25,6 +25,8 @@ #include #include +#include + namespace graphene { namespace chain { proposal_create_operation proposal_create_operation::committee_proposal(const chain_parameters& global_params, fc::time_point_sec head_block_time ) diff --git a/libraries/chain/protocol/transaction.cpp b/libraries/chain/protocol/transaction.cpp index a11e3335..e9e60d50 100644 --- a/libraries/chain/protocol/transaction.cpp +++ b/libraries/chain/protocol/transaction.cpp @@ -390,3 +390,7 @@ void signed_transaction::verify_authority( } FC_CAPTURE_AND_RETHROW( (*this) ) } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::transaction) +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::signed_transaction) +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::chain::processed_transaction) diff --git a/libraries/chain/protocol/transfer.cpp b/libraries/chain/protocol/transfer.cpp index 3dfe4eb7..3ec78237 100644 --- a/libraries/chain/protocol/transfer.cpp +++ b/libraries/chain/protocol/transfer.cpp @@ -23,6 +23,8 @@ */ #include +#include + namespace graphene { namespace chain { share_type transfer_operation::calculate_fee( const fee_parameters_type& schedule )const diff --git a/libraries/chain/protocol/withdraw_permission.cpp b/libraries/chain/protocol/withdraw_permission.cpp index 33b40c85..ec7b36f8 100644 --- a/libraries/chain/protocol/withdraw_permission.cpp +++ b/libraries/chain/protocol/withdraw_permission.cpp @@ -23,6 +23,8 @@ */ #include +#include + namespace graphene { namespace chain { void withdraw_permission_update_operation::validate()const diff --git a/libraries/egenesis/egenesis_none.cpp b/libraries/egenesis/egenesis_none.cpp index 825f7f83..c7a0dcdd 100644 --- a/libraries/egenesis/egenesis_none.cpp +++ b/libraries/egenesis/egenesis_none.cpp @@ -24,6 +24,8 @@ #include +#include + namespace graphene { namespace egenesis { using namespace graphene::chain; diff --git a/libraries/net/CMakeLists.txt b/libraries/net/CMakeLists.txt index 7aa617d7..955012e4 100644 --- a/libraries/net/CMakeLists.txt +++ b/libraries/net/CMakeLists.txt @@ -5,6 +5,7 @@ set(SOURCES node.cpp core_messages.cpp peer_database.cpp peer_connection.cpp + message.cpp message_oriented_connection.cpp) add_library( graphene_net ${SOURCES} ${HEADERS} ) diff --git a/libraries/net/include/graphene/net/message.hpp b/libraries/net/include/graphene/net/message.hpp index cfef1519..5557383b 100644 --- a/libraries/net/include/graphene/net/message.hpp +++ b/libraries/net/include/graphene/net/message.hpp @@ -22,12 +22,16 @@ * THE SOFTWARE. */ #pragma once +#include + +#include + #include #include #include -#include +#include #include -#include +#include namespace graphene { namespace net { @@ -108,10 +112,10 @@ namespace graphene { namespace net { } }; - - - } } // graphene::net -FC_REFLECT( graphene::net::message_header, (size)(msg_type) ) -FC_REFLECT_DERIVED( graphene::net::message, (graphene::net::message_header), (data) ) +FC_REFLECT_TYPENAME( graphene::net::message_header ) +FC_REFLECT_TYPENAME( graphene::net::message ) + +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::net::message_header) +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::net::message) diff --git a/libraries/net/include/graphene/net/peer_connection.hpp b/libraries/net/include/graphene/net/peer_connection.hpp index 6f9a4b20..5c5f40d5 100644 --- a/libraries/net/include/graphene/net/peer_connection.hpp +++ b/libraries/net/include/graphene/net/peer_connection.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -35,9 +34,7 @@ #include #include #include -#include #include -#include #include #include diff --git a/libraries/net/include/graphene/net/peer_database.hpp b/libraries/net/include/graphene/net/peer_database.hpp index d0a06dd9..ff7f4036 100644 --- a/libraries/net/include/graphene/net/peer_database.hpp +++ b/libraries/net/include/graphene/net/peer_database.hpp @@ -24,13 +24,14 @@ #pragma once #include +#include + #include #include #include #include #include #include -#include namespace graphene { namespace net { @@ -118,5 +119,6 @@ namespace graphene { namespace net { } } // end namespace graphene::net -FC_REFLECT_ENUM(graphene::net::potential_peer_last_connection_disposition, (never_attempted_to_connect)(last_connection_failed)(last_connection_rejected)(last_connection_handshaking_failed)(last_connection_succeeded)) -FC_REFLECT(graphene::net::potential_peer_record, (endpoint)(last_seen_time)(last_connection_disposition)(last_connection_attempt_time)(number_of_successful_connection_attempts)(number_of_failed_connection_attempts)(last_error) ) +FC_REFLECT_TYPENAME( graphene::net::potential_peer_record ) + +GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::net::potential_peer_record) diff --git a/libraries/net/message.cpp b/libraries/net/message.cpp new file mode 100644 index 00000000..74c04eba --- /dev/null +++ b/libraries/net/message.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019 BitShares Blockchain Foundation, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include + +#include + +FC_REFLECT_DERIVED_NO_TYPENAME( graphene::net::message_header, BOOST_PP_SEQ_NIL, (size)(msg_type) ) +FC_REFLECT_DERIVED_NO_TYPENAME( graphene::net::message, (graphene::net::message_header), (data) ) + +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::net::message_header) +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::net::message) diff --git a/libraries/net/node.cpp b/libraries/net/node.cpp index 14d93d50..d5ffa0ad 100644 --- a/libraries/net/node.cpp +++ b/libraries/net/node.cpp @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include diff --git a/libraries/net/peer_connection.cpp b/libraries/net/peer_connection.cpp index 4dd151b5..b77b34f9 100644 --- a/libraries/net/peer_connection.cpp +++ b/libraries/net/peer_connection.cpp @@ -25,8 +25,8 @@ #include #include #include -#include +#include #include #include diff --git a/libraries/net/peer_database.cpp b/libraries/net/peer_database.cpp index 2b20364e..76ae9c8c 100644 --- a/libraries/net/peer_database.cpp +++ b/libraries/net/peer_database.cpp @@ -274,3 +274,14 @@ namespace graphene { namespace net { } } } // end namespace graphene::net + +FC_REFLECT_ENUM( graphene::net::potential_peer_last_connection_disposition, + (never_attempted_to_connect) + (last_connection_failed)(last_connection_rejected) + (last_connection_handshaking_failed)(last_connection_succeeded) ) +FC_REFLECT_DERIVED_NO_TYPENAME( graphene::net::potential_peer_record, BOOST_PP_SEQ_NIL, + (endpoint)(last_seen_time)(last_connection_disposition) + (last_connection_attempt_time)(number_of_successful_connection_attempts) + (number_of_failed_connection_attempts)(last_error) ) + +GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::net::potential_peer_record) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 7c1960ee..c456f7e1 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -229,12 +229,13 @@ struct worker_vote_delta flat_set vote_abstain; }; -struct signed_block_with_info : public signed_block +struct signed_block_with_info { signed_block_with_info(); signed_block_with_info( const signed_block& block ); signed_block_with_info( const signed_block_with_info& block ) = default; + signed_block block; block_id_type block_id; public_key_type signing_key; vector< transaction_id_type > transaction_ids; @@ -1978,8 +1979,7 @@ FC_REFLECT( graphene::wallet::worker_vote_delta, (vote_abstain) ) -FC_REFLECT_DERIVED( graphene::wallet::signed_block_with_info, (graphene::chain::signed_block), - (block_id)(signing_key)(transaction_ids) ) +FC_REFLECT( graphene::wallet::signed_block_with_info, (block_id)(signing_key)(transaction_ids) ) FC_REFLECT_DERIVED( graphene::wallet::vesting_balance_object_with_info, (graphene::chain::vesting_balance_object), (allowed_withdraw)(allowed_withdraw_time) ) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index bdb756c2..2bbb9d9b 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -6191,13 +6191,13 @@ std::vector wallet_api::get_all_matched_bets_for_bettor(acco } // default ctor necessary for FC_REFLECT -signed_block_with_info::signed_block_with_info( const signed_block& block ) - : signed_block( block ) +signed_block_with_info::signed_block_with_info( const signed_block& _block ) + : block( _block ) { - block_id = id(); - signing_key = signee(); - transaction_ids.reserve( transactions.size() ); - for( const processed_transaction& tx : transactions ) + block_id = _block.id(); + signing_key = _block.signee(); + transaction_ids.reserve( _block.transactions.size() ); + for( const processed_transaction& tx : _block.transactions ) transaction_ids.push_back( tx.id() ); } From b3d6058485cc880f33104992c76030a8f4eb331a Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Tue, 14 May 2019 00:18:12 +0200 Subject: [PATCH 03/44] Externalized db objects --- libraries/chain/CMakeLists.txt | 1 + libraries/chain/account_object.cpp | 9 ++- libraries/chain/asset_object.cpp | 11 ++- .../include/graphene/chain/account_object.hpp | 8 ++- .../include/graphene/chain/asset_object.hpp | 62 +++++++++------- .../include/graphene/chain/balance_object.hpp | 2 + .../graphene/chain/block_summary_object.hpp | 4 ++ .../graphene/chain/budget_record_object.hpp | 17 ++--- .../include/graphene/chain/buyback_object.hpp | 2 + .../graphene/chain/chain_property_object.hpp | 4 +- .../chain/committee_member_object.hpp | 5 +- .../graphene/chain/confidential_object.hpp | 9 +-- .../include/graphene/chain/fba_object.hpp | 5 +- .../graphene/chain/global_property_object.hpp | 4 +- .../chain/immutable_chain_parameters.hpp | 7 +- .../include/graphene/chain/market_object.hpp | 4 ++ .../chain/operation_history_object.hpp | 9 +-- .../graphene/chain/proposal_object.hpp | 5 +- .../chain/special_authority_object.hpp | 2 + .../graphene/chain/transaction_object.hpp | 4 +- .../graphene/chain/vesting_balance_object.hpp | 6 +- .../chain/withdraw_permission_object.hpp | 2 + .../include/graphene/chain/witness_object.hpp | 4 +- .../chain/witness_schedule_object.hpp | 5 +- .../include/graphene/chain/worker_object.hpp | 5 +- libraries/chain/proposal_object.cpp | 4 +- libraries/chain/protocol/memo.cpp | 1 + libraries/chain/protocol/tournament.cpp | 1 + libraries/chain/small_objects.cpp | 71 +++++++++++++++++++ libraries/chain/vesting_balance_object.cpp | 6 ++ .../net/include/graphene/net/message.hpp | 4 +- libraries/net/message.cpp | 3 - libraries/net/node.cpp | 2 +- libraries/net/peer_connection.cpp | 3 +- 34 files changed, 212 insertions(+), 79 deletions(-) create mode 100644 libraries/chain/small_objects.cpp diff --git a/libraries/chain/CMakeLists.txt b/libraries/chain/CMakeLists.txt index a8d9e5db..649f641a 100644 --- a/libraries/chain/CMakeLists.txt +++ b/libraries/chain/CMakeLists.txt @@ -93,6 +93,7 @@ add_library( graphene_chain fba_object.cpp proposal_object.cpp vesting_balance_object.cpp + small_objects.cpp block_database.cpp diff --git a/libraries/chain/account_object.cpp b/libraries/chain/account_object.cpp index 466f7a6f..71ee28de 100644 --- a/libraries/chain/account_object.cpp +++ b/libraries/chain/account_object.cpp @@ -22,9 +22,9 @@ * THE SOFTWARE. */ #include -#include #include -#include + +#include #include namespace graphene { namespace chain { @@ -320,3 +320,8 @@ const account_balance_object* balances_by_account_index::get_account_balance( co } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_statistics_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::pending_dividend_payout_balance_for_holder_object ) diff --git a/libraries/chain/asset_object.cpp b/libraries/chain/asset_object.cpp index ea387932..88e5dfca 100644 --- a/libraries/chain/asset_object.cpp +++ b/libraries/chain/asset_object.cpp @@ -24,10 +24,9 @@ #include #include +#include #include -#include - using namespace graphene::chain; share_type asset_bitasset_data_object::max_force_settlement_volume(share_type current_supply) const @@ -296,3 +295,11 @@ void sweeps_vesting_balance_object::adjust_balance( const asset& delta ) FC_ASSERT( delta.asset_id == asset_id ); balance += delta.amount.value; } + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_dynamic_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_bitasset_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_dividend_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::total_distributed_dividend_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::lottery_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::sweeps_vesting_balance_object ) diff --git a/libraries/chain/include/graphene/chain/account_object.hpp b/libraries/chain/include/graphene/chain/account_object.hpp index 94a1b98e..5f24adeb 100644 --- a/libraries/chain/include/graphene/chain/account_object.hpp +++ b/libraries/chain/include/graphene/chain/account_object.hpp @@ -22,8 +22,9 @@ * THE SOFTWARE. */ #pragma once -#include +#include #include +#include #include namespace graphene { namespace chain { @@ -574,4 +575,7 @@ FC_REFLECT_DERIVED( graphene::chain::pending_dividend_payout_balance_for_holder_ (graphene::db::object), (owner)(dividend_holder_asset_type)(dividend_payout_asset_type)(pending_balance) ) - +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_statistics_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::pending_dividend_payout_balance_for_holder_object ) diff --git a/libraries/chain/include/graphene/chain/asset_object.hpp b/libraries/chain/include/graphene/chain/asset_object.hpp index cba33bb8..8978a6d1 100644 --- a/libraries/chain/include/graphene/chain/asset_object.hpp +++ b/libraries/chain/include/graphene/chain/asset_object.hpp @@ -22,10 +22,11 @@ * THE SOFTWARE. */ #pragma once +#include +#include +#include #include #include -#include -#include /** * @defgroup prediction_market Prediction Market @@ -38,11 +39,10 @@ */ namespace graphene { namespace chain { - class account_object; class database; class transaction_evaluation_state; using namespace graphene::db; - + /** * @brief tracks the asset information that changes frequently * @ingroup object @@ -118,9 +118,9 @@ namespace graphene { namespace chain { /// Convert an asset to a textual representation with symbol, i.e. "123.45 USD" string amount_to_pretty_string(const asset &amount)const { FC_ASSERT(amount.asset_id == id); return amount_to_pretty_string(amount.amount); } - + uint32_t get_issuer_num()const - { return issuer.instance.value; } + { return issuer.instance.value; } /// Ticker symbol for this asset, i.e. "USD" string symbol; /// Maximum number of digits after the decimal point (must be <= 12) @@ -138,7 +138,7 @@ namespace graphene { namespace chain { map< account_id_type, vector< uint16_t > > distribute_winners_part( database& db ); void distribute_sweeps_holders_part( database& db ); void end_lottery( database& db ); - + /// Current supply, fee pool, and collected fees are stored in a separate object as they change frequently. asset_dynamic_data_id_type dynamic_asset_data_id; /// Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true @@ -150,7 +150,7 @@ namespace graphene { namespace chain { optional dividend_data_id; asset_id_type get_id()const { return id; } - + void validate()const { // UIAs may not be prediction markets, have force settlement, or global settlements @@ -174,7 +174,7 @@ namespace graphene { namespace chain { { return db.get(dynamic_asset_data_id); } /** - * The total amount of an asset that is reserved for future issuance. + * The total amount of an asset that is reserved for future issuance. */ template share_type reserved( const DB& db )const @@ -254,7 +254,7 @@ namespace graphene { namespace chain { else return current_feed_publication_time + options.feed_lifetime_sec; } - + bool feed_is_expired_before_hardfork_615(time_point_sec current_time)const { return feed_expiration_time() >= current_time; } bool feed_is_expired(time_point_sec current_time)const @@ -378,7 +378,7 @@ namespace graphene { namespace chain { /// This field is reset any time the dividend_asset_options are updated fc::optional last_scheduled_payout_time; - /// The time payouts on this asset were last processed + /// The time payouts on this asset were last processed /// (this should be the maintenance interval at or after last_scheduled_payout_time) /// This can be displayed for the user fc::optional last_payout_time; @@ -405,7 +405,7 @@ namespace graphene { namespace chain { typedef generic_index asset_dividend_data_object_index; - // This tracks the balances in a dividend distribution account at the last time + // This tracks the balances in a dividend distribution account at the last time // pending dividend payouts were calculated (last maintenance interval). // At each maintenance interval, we will compare the current balance to the // balance stored here to see how much was deposited during that interval. @@ -434,9 +434,9 @@ namespace graphene { namespace chain { > > total_distributed_dividend_balance_object_multi_index_type; typedef generic_index total_distributed_dividend_balance_object_index; - - - + + + /** * @ingroup object */ @@ -445,17 +445,17 @@ namespace graphene { namespace chain { public: static const uint8_t space_id = implementation_ids; static const uint8_t type_id = impl_lottery_balance_object_type; - + asset_id_type lottery_id; asset balance; - + asset get_balance()const { return balance; } void adjust_balance(const asset& delta); }; - - + + struct by_owner; - + /** * @ingroup object_index */ @@ -468,13 +468,13 @@ namespace graphene { namespace chain { > > > lottery_balance_index_type; - + /** * @ingroup object_index */ typedef generic_index lottery_balance_index; - - + + class sweeps_vesting_balance_object : public abstract_object { public: @@ -486,7 +486,7 @@ namespace graphene { namespace chain { uint64_t balance; asset_id_type asset_id; time_point_sec last_claim_date; - + uint64_t get_balance()const { return balance; } void adjust_balance(const asset& delta); asset available_for_claim() const { return asset( balance / SWEEPS_VESTING_BALANCE_MULTIPLIER , asset_id ); } @@ -528,10 +528,10 @@ FC_REFLECT_DERIVED( graphene::chain::asset_bitasset_data_object, (graphene::db:: (asset_cer_updated) (feed_cer_updated) ) - + FC_REFLECT_DERIVED( graphene::chain::asset_dividend_data_object, (graphene::db::object), (options) - (last_scheduled_payout_time) + (last_scheduled_payout_time) (last_payout_time ) (last_scheduled_distribution_time) (last_distribution_time) @@ -561,3 +561,13 @@ FC_REFLECT_DERIVED( graphene::chain::lottery_balance_object, (graphene::db::obje FC_REFLECT_DERIVED( graphene::chain::sweeps_vesting_balance_object, (graphene::db::object), (owner)(balance)(asset_id)(last_claim_date) ) + + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_dynamic_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_bitasset_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_dividend_data_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::total_distributed_dividend_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::lottery_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::sweeps_vesting_balance_object ) + diff --git a/libraries/chain/include/graphene/chain/balance_object.hpp b/libraries/chain/include/graphene/chain/balance_object.hpp index 8d531d0c..38a1a649 100644 --- a/libraries/chain/include/graphene/chain/balance_object.hpp +++ b/libraries/chain/include/graphene/chain/balance_object.hpp @@ -73,3 +73,5 @@ namespace graphene { namespace chain { FC_REFLECT_DERIVED( graphene::chain::balance_object, (graphene::db::object), (owner)(balance)(vesting_policy)(last_claim_date) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::balance_object ) diff --git a/libraries/chain/include/graphene/chain/block_summary_object.hpp b/libraries/chain/include/graphene/chain/block_summary_object.hpp index f002c030..9f79d43e 100644 --- a/libraries/chain/include/graphene/chain/block_summary_object.hpp +++ b/libraries/chain/include/graphene/chain/block_summary_object.hpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #pragma once +#include #include namespace graphene { namespace chain { @@ -47,4 +48,7 @@ namespace graphene { namespace chain { } } + FC_REFLECT_DERIVED( graphene::chain::block_summary_object, (graphene::db::object), (block_id) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::block_summary_object ) diff --git a/libraries/chain/include/graphene/chain/budget_record_object.hpp b/libraries/chain/include/graphene/chain/budget_record_object.hpp index 49544793..e3f6d06e 100644 --- a/libraries/chain/include/graphene/chain/budget_record_object.hpp +++ b/libraries/chain/include/graphene/chain/budget_record_object.hpp @@ -23,7 +23,6 @@ */ #pragma once #include -#include #include namespace graphene { namespace chain { @@ -54,8 +53,6 @@ struct budget_record share_type supply_delta = 0; }; -class budget_record_object; - class budget_record_object : public graphene::db::abstract_object { public: @@ -68,8 +65,7 @@ class budget_record_object : public graphene::db::abstract_object buyback_index; } } // graphene::chain FC_REFLECT_DERIVED( graphene::chain::buyback_object, (graphene::db::object), (asset_to_buy) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::buyback_object ) diff --git a/libraries/chain/include/graphene/chain/chain_property_object.hpp b/libraries/chain/include/graphene/chain/chain_property_object.hpp index 3d2c82a6..3c7a77ff 100644 --- a/libraries/chain/include/graphene/chain/chain_property_object.hpp +++ b/libraries/chain/include/graphene/chain/chain_property_object.hpp @@ -27,8 +27,6 @@ namespace graphene { namespace chain { -class chain_property_object; - /** * Contains invariants which are set at genesis and never changed. */ @@ -48,3 +46,5 @@ FC_REFLECT_DERIVED( graphene::chain::chain_property_object, (graphene::db::objec (chain_id) (immutable_parameters) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::chain_property_object ) diff --git a/libraries/chain/include/graphene/chain/committee_member_object.hpp b/libraries/chain/include/graphene/chain/committee_member_object.hpp index 7b0d8e75..fe7968d3 100644 --- a/libraries/chain/include/graphene/chain/committee_member_object.hpp +++ b/libraries/chain/include/graphene/chain/committee_member_object.hpp @@ -29,8 +29,6 @@ namespace graphene { namespace chain { using namespace graphene::db; - class account_object; - /** * @brief tracks information about a committee_member account. * @ingroup object @@ -73,5 +71,8 @@ namespace graphene { namespace chain { using committee_member_index = generic_index; } } // graphene::chain + FC_REFLECT_DERIVED( graphene::chain::committee_member_object, (graphene::db::object), (committee_member_account)(vote_id)(total_votes)(url) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_object ) diff --git a/libraries/chain/include/graphene/chain/confidential_object.hpp b/libraries/chain/include/graphene/chain/confidential_object.hpp index f98e20a9..acdb0ba5 100644 --- a/libraries/chain/include/graphene/chain/confidential_object.hpp +++ b/libraries/chain/include/graphene/chain/confidential_object.hpp @@ -26,7 +26,6 @@ #include #include -#include #include #include @@ -50,8 +49,6 @@ class blinded_balance_object : public graphene::db::abstract_object - -#include - #include +#include namespace graphene { namespace chain { @@ -47,3 +44,5 @@ FC_REFLECT( graphene::chain::immutable_chain_parameters, (num_special_accounts) (num_special_assets) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::immutable_chain_parameters ) diff --git a/libraries/chain/include/graphene/chain/market_object.hpp b/libraries/chain/include/graphene/chain/market_object.hpp index b56f4e9c..4bd3e048 100644 --- a/libraries/chain/include/graphene/chain/market_object.hpp +++ b/libraries/chain/include/graphene/chain/market_object.hpp @@ -217,3 +217,7 @@ FC_REFLECT_DERIVED( graphene::chain::force_settlement_object, (graphene::db::object), (owner)(balance)(settlement_date) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::limit_order_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::call_order_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::force_settlement_object ) diff --git a/libraries/chain/include/graphene/chain/operation_history_object.hpp b/libraries/chain/include/graphene/chain/operation_history_object.hpp index d8b90b58..b35b171f 100644 --- a/libraries/chain/include/graphene/chain/operation_history_object.hpp +++ b/libraries/chain/include/graphene/chain/operation_history_object.hpp @@ -22,8 +22,10 @@ * THE SOFTWARE. */ #pragma once + #include #include + #include namespace graphene { namespace chain { @@ -94,9 +96,6 @@ namespace graphene { namespace chain { operation_history_id_type operation_id; uint32_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 ); } - //std::pair account_seq()const { return std::tie( account, sequence ); } }; struct by_id; @@ -132,6 +131,8 @@ typedef generic_index #include +#include namespace graphene { namespace chain { - + class database; /** * @brief tracks the approval of a partially approved transaction @@ -97,3 +98,5 @@ FC_REFLECT_DERIVED( graphene::chain::proposal_object, (graphene::chain::object), (expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals) (available_active_approvals)(required_owner_approvals)(available_owner_approvals) (available_key_approvals)(proposer)(fail_reason)) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_object ) diff --git a/libraries/chain/include/graphene/chain/special_authority_object.hpp b/libraries/chain/include/graphene/chain/special_authority_object.hpp index da9ecc5e..75093f3a 100644 --- a/libraries/chain/include/graphene/chain/special_authority_object.hpp +++ b/libraries/chain/include/graphene/chain/special_authority_object.hpp @@ -68,3 +68,5 @@ FC_REFLECT_DERIVED( (graphene::db::object), (account) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::special_authority_object ) diff --git a/libraries/chain/include/graphene/chain/transaction_object.hpp b/libraries/chain/include/graphene/chain/transaction_object.hpp index 4f76d6be..aaaa31f1 100644 --- a/libraries/chain/include/graphene/chain/transaction_object.hpp +++ b/libraries/chain/include/graphene/chain/transaction_object.hpp @@ -22,12 +22,10 @@ * THE SOFTWARE. */ #pragma once -#include #include #include #include -#include #include #include @@ -72,3 +70,5 @@ namespace graphene { namespace chain { } } FC_REFLECT_DERIVED( graphene::chain::transaction_object, (graphene::db::object), (trx)(trx_id) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transaction_object ) diff --git a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp index 56b0ac1a..b03b8f7b 100644 --- a/libraries/chain/include/graphene/chain/vesting_balance_object.hpp +++ b/libraries/chain/include/graphene/chain/vesting_balance_object.hpp @@ -38,8 +38,6 @@ namespace graphene { namespace chain { using namespace graphene::db; - class vesting_balance_object; - struct vesting_policy_context { vesting_policy_context( @@ -234,3 +232,7 @@ FC_REFLECT_DERIVED(graphene::chain::vesting_balance_object, (graphene::db::objec (policy) (balance_type) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::linear_vesting_policy ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::cdd_vesting_policy ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vesting_balance_object ) diff --git a/libraries/chain/include/graphene/chain/withdraw_permission_object.hpp b/libraries/chain/include/graphene/chain/withdraw_permission_object.hpp index 000573bd..a6fee0c5 100644 --- a/libraries/chain/include/graphene/chain/withdraw_permission_object.hpp +++ b/libraries/chain/include/graphene/chain/withdraw_permission_object.hpp @@ -114,3 +114,5 @@ FC_REFLECT_DERIVED( graphene::chain::withdraw_permission_object, (graphene::db:: (expiration) (claimed_this_period) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_object ) diff --git a/libraries/chain/include/graphene/chain/witness_object.hpp b/libraries/chain/include/graphene/chain/witness_object.hpp index 2d1b7666..7928b46e 100644 --- a/libraries/chain/include/graphene/chain/witness_object.hpp +++ b/libraries/chain/include/graphene/chain/witness_object.hpp @@ -29,8 +29,6 @@ namespace graphene { namespace chain { using namespace graphene::db; - class witness_object; - class witness_object : public abstract_object { public: @@ -85,3 +83,5 @@ FC_REFLECT_DERIVED( graphene::chain::witness_object, (graphene::db::object), (total_missed) (last_confirmed_block_num) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_object ) diff --git a/libraries/chain/include/graphene/chain/witness_schedule_object.hpp b/libraries/chain/include/graphene/chain/witness_schedule_object.hpp index e4c4bb51..1702212d 100644 --- a/libraries/chain/include/graphene/chain/witness_schedule_object.hpp +++ b/libraries/chain/include/graphene/chain/witness_schedule_object.hpp @@ -30,8 +30,6 @@ namespace graphene { namespace chain { -class witness_schedule_object; - typedef hash_ctr_rng< /* HashClass = */ fc::sha256, /* SeedLength = */ GRAPHENE_RNG_SEED_LENGTH @@ -96,3 +94,6 @@ FC_REFLECT_DERIVED( (recent_slots_filled) (current_shuffled_witnesses) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_scheduler ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_schedule_object ) diff --git a/libraries/chain/include/graphene/chain/worker_object.hpp b/libraries/chain/include/graphene/chain/worker_object.hpp index 1219fc1c..5e23f0b8 100644 --- a/libraries/chain/include/graphene/chain/worker_object.hpp +++ b/libraries/chain/include/graphene/chain/worker_object.hpp @@ -22,8 +22,9 @@ * THE SOFTWARE. */ #pragma once -#include +#include #include +#include namespace graphene { namespace chain { @@ -175,3 +176,5 @@ FC_REFLECT_DERIVED( graphene::chain::worker_object, (graphene::db::object), (name) (url) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::worker_object ) diff --git a/libraries/chain/proposal_object.cpp b/libraries/chain/proposal_object.cpp index 343edce2..1d5a8706 100644 --- a/libraries/chain/proposal_object.cpp +++ b/libraries/chain/proposal_object.cpp @@ -37,7 +37,7 @@ bool proposal_object::is_authorized_to_execute(database& db) const [&]( account_id_type id ){ return &id(db).active; }, [&]( account_id_type id ){ return &id(db).owner; }, db.get_global_properties().parameters.max_authority_depth, - true, /* allow committeee */ + true, /* allow committee */ available_active_approvals, available_owner_approvals ); } @@ -90,3 +90,5 @@ void required_approval_index::object_removed( const object& obj ) } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::proposal_object ) diff --git a/libraries/chain/protocol/memo.cpp b/libraries/chain/protocol/memo.cpp index e04b5e43..8ced0e1b 100644 --- a/libraries/chain/protocol/memo.cpp +++ b/libraries/chain/protocol/memo.cpp @@ -23,6 +23,7 @@ */ #include #include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/tournament.cpp b/libraries/chain/protocol/tournament.cpp index 57e80bf3..78ab4c01 100644 --- a/libraries/chain/protocol/tournament.cpp +++ b/libraries/chain/protocol/tournament.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/small_objects.cpp b/libraries/chain/small_objects.cpp new file mode 100644 index 00000000..6b8af3d9 --- /dev/null +++ b/libraries/chain/small_objects.cpp @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2019 BitShares Blockchain Foundation, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::block_summary_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::budget_record ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::budget_record_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::buyback_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::immutable_chain_parameters ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::limit_order_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::call_order_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::force_settlement_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::chain_property_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::blinded_balance_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::fba_accumulator_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::dynamic_global_property_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::global_property_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::operation_history_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transaction_history_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::special_authority_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transaction_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_scheduler ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_schedule_object ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::worker_object ) diff --git a/libraries/chain/vesting_balance_object.cpp b/libraries/chain/vesting_balance_object.cpp index afba2557..4674c974 100644 --- a/libraries/chain/vesting_balance_object.cpp +++ b/libraries/chain/vesting_balance_object.cpp @@ -24,6 +24,8 @@ #include +#include + namespace graphene { namespace chain { inline bool sum_below_max_shares(const asset& a, const asset& b) @@ -248,3 +250,7 @@ asset vesting_balance_object::get_allowed_withdraw(const time_point_sec& now)con } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::linear_vesting_policy ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::cdd_vesting_policy ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vesting_balance_object ) diff --git a/libraries/net/include/graphene/net/message.hpp b/libraries/net/include/graphene/net/message.hpp index 5557383b..686fea24 100644 --- a/libraries/net/include/graphene/net/message.hpp +++ b/libraries/net/include/graphene/net/message.hpp @@ -114,8 +114,8 @@ namespace graphene { namespace net { } } // graphene::net -FC_REFLECT_TYPENAME( graphene::net::message_header ) -FC_REFLECT_TYPENAME( graphene::net::message ) +FC_REFLECT( graphene::net::message_header, (size)(msg_type) ) +FC_REFLECT_DERIVED( graphene::net::message, (graphene::net::message_header), (data) ) GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::net::message_header) GRAPHENE_EXTERNAL_SERIALIZATION(extern, graphene::net::message) diff --git a/libraries/net/message.cpp b/libraries/net/message.cpp index 74c04eba..6d35bfe5 100644 --- a/libraries/net/message.cpp +++ b/libraries/net/message.cpp @@ -25,8 +25,5 @@ #include -FC_REFLECT_DERIVED_NO_TYPENAME( graphene::net::message_header, BOOST_PP_SEQ_NIL, (size)(msg_type) ) -FC_REFLECT_DERIVED_NO_TYPENAME( graphene::net::message, (graphene::net::message_header), (data) ) - GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::net::message_header) GRAPHENE_EXTERNAL_SERIALIZATION(/*not extern*/, graphene::net::message) diff --git a/libraries/net/node.cpp b/libraries/net/node.cpp index d5ffa0ad..0fc61dde 100644 --- a/libraries/net/node.cpp +++ b/libraries/net/node.cpp @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libraries/net/peer_connection.cpp b/libraries/net/peer_connection.cpp index b77b34f9..9b753e6c 100644 --- a/libraries/net/peer_connection.cpp +++ b/libraries/net/peer_connection.cpp @@ -25,8 +25,9 @@ #include #include #include +#include -#include +#include #include #include From 2358149e469733dea4f2801da7fc87e0860bf9a4 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Tue, 14 May 2019 11:10:21 +0200 Subject: [PATCH 04/44] Externalized genesis serialization --- libraries/chain/genesis_state.cpp | 69 ++++++++++++++++ .../include/graphene/chain/genesis_state.hpp | 80 +++++++------------ 2 files changed, 97 insertions(+), 52 deletions(-) diff --git a/libraries/chain/genesis_state.cpp b/libraries/chain/genesis_state.cpp index a278b680..53311012 100644 --- a/libraries/chain/genesis_state.cpp +++ b/libraries/chain/genesis_state.cpp @@ -36,3 +36,72 @@ chain_id_type genesis_state_type::compute_chain_id() const } } } // graphene::chain + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_account_type, BOOST_PP_SEQ_NIL, (name)(owner_key)(active_key)(is_lifetime_member)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_asset_type, BOOST_PP_SEQ_NIL, + (symbol)(issuer_name)(description)(precision)(max_supply)(accumulated_fees)(is_bitasset)(collateral_records)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position, BOOST_PP_SEQ_NIL, + (owner)(collateral)(debt)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_balance_type, BOOST_PP_SEQ_NIL, + (owner)(asset_symbol)(amount)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_vesting_balance_type, BOOST_PP_SEQ_NIL, + (owner)(asset_symbol)(amount)(begin_timestamp)(vesting_cliff_seconds)(vesting_duration_seconds)(begin_balance)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_witness_type, BOOST_PP_SEQ_NIL, (owner_name)(block_signing_key)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_committee_member_type, BOOST_PP_SEQ_NIL, (owner_name)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_worker_type, BOOST_PP_SEQ_NIL, (owner_name)(daily_pay)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority, BOOST_PP_SEQ_NIL, + (weight_threshold) + (account_auths) + (key_auths) + (address_auths)) +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy, BOOST_PP_SEQ_NIL, + (vesting_seconds) + (coin_seconds_earned) + (start_claim) + (coin_seconds_earned_last_update)) +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy, BOOST_PP_SEQ_NIL, + (begin_timestamp) + (vesting_cliff_seconds) + (vesting_duration_seconds) + (begin_balance)) +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance, BOOST_PP_SEQ_NIL, + (asset_symbol) + (amount) + (policy_type) + (policy)) +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type, BOOST_PP_SEQ_NIL, + (name) + (owner_authority) + (active_authority) + (core_balance) + (vesting_balances)) + +FC_REFLECT_DERIVED_NO_TYPENAME(graphene::chain::genesis_state_type, BOOST_PP_SEQ_NIL, + (initial_timestamp)(max_core_supply)(initial_parameters)(initial_bts_accounts)(initial_accounts)(initial_assets)(initial_balances) + (initial_vesting_balances)(initial_active_witnesses)(initial_witness_candidates) + (initial_committee_candidates)(initial_worker_candidates) + (initial_chain_id) + (immutable_parameters)) + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_account_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_asset_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_balance_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_vesting_balance_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_witness_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_committee_member_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_worker_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type::initial_bts_account_type) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::genesis_state_type) diff --git a/libraries/chain/include/graphene/chain/genesis_state.hpp b/libraries/chain/include/graphene/chain/genesis_state.hpp index ebd153b6..2d859842 100644 --- a/libraries/chain/include/graphene/chain/genesis_state.hpp +++ b/libraries/chain/include/graphene/chain/genesis_state.hpp @@ -169,56 +169,32 @@ struct genesis_state_type { } } // namespace graphene::chain -FC_REFLECT(graphene::chain::genesis_state_type::initial_account_type, (name)(owner_key)(active_key)(is_lifetime_member)) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_account_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_asset_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_balance_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_vesting_balance_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_witness_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_committee_member_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_worker_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type::initial_bts_account_type) +FC_REFLECT_TYPENAME(graphene::chain::genesis_state_type) -FC_REFLECT(graphene::chain::genesis_state_type::initial_asset_type, - (symbol)(issuer_name)(description)(precision)(max_supply)(accumulated_fees)(is_bitasset)(collateral_records)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position, - (owner)(collateral)(debt)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_balance_type, - (owner)(asset_symbol)(amount)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_vesting_balance_type, - (owner)(asset_symbol)(amount)(begin_timestamp)(vesting_cliff_seconds)(vesting_duration_seconds)(begin_balance)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_witness_type, (owner_name)(block_signing_key)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_committee_member_type, (owner_name)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_worker_type, (owner_name)(daily_pay)) - -FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority, - (weight_threshold) - (account_auths) - (key_auths) - (address_auths)) -FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy, - (vesting_seconds) - (coin_seconds_earned) - (start_claim) - (coin_seconds_earned_last_update)) -FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy, - (begin_timestamp) - (vesting_cliff_seconds) - (vesting_duration_seconds) - (begin_balance)) -FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance, - (asset_symbol) - (amount) - (policy_type) - (policy)) -FC_REFLECT(graphene::chain::genesis_state_type::initial_bts_account_type, - (name) - (owner_authority) - (active_authority) - (core_balance) - (vesting_balances)) - -FC_REFLECT(graphene::chain::genesis_state_type, - (initial_timestamp)(max_core_supply)(initial_parameters)(initial_bts_accounts)(initial_accounts)(initial_assets)(initial_balances) - (initial_vesting_balances)(initial_active_witnesses)(initial_witness_candidates) - (initial_committee_candidates)(initial_worker_candidates) - (initial_chain_id) - (immutable_parameters)) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_account_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_asset_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_asset_type::initial_collateral_position) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_balance_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_vesting_balance_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_witness_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_committee_member_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_worker_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_bts_account_type::initial_authority) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_bts_account_type::initial_cdd_vesting_policy) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_bts_account_type::initial_linear_vesting_policy) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_bts_account_type::initial_vesting_balance) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type::initial_bts_account_type) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::genesis_state_type) From 854119233ae1b89705db7a4115de37bfd476550b Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Sun, 19 May 2019 11:38:40 +0200 Subject: [PATCH 05/44] Externalized serialization in protocol library --- libraries/app/database_api.cpp | 2 + libraries/chain/CMakeLists.txt | 1 + libraries/chain/balance_evaluator.cpp | 1 + .../include/graphene/chain/genesis_state.hpp | 1 + .../graphene/chain/protocol/account.hpp | 13 +++++- .../graphene/chain/protocol/address.hpp | 12 +++--- .../graphene/chain/protocol/assert.hpp | 3 ++ .../include/graphene/chain/protocol/asset.hpp | 4 ++ .../graphene/chain/protocol/asset_ops.hpp | 27 ++++++++++++ .../graphene/chain/protocol/authority.hpp | 3 ++ .../graphene/chain/protocol/balance.hpp | 4 ++ .../include/graphene/chain/protocol/base.hpp | 5 +++ .../graphene/chain/protocol/buyback.hpp | 2 + .../chain/protocol/chain_parameters.hpp | 4 +- .../chain/protocol/committee_member.hpp | 7 +++ .../graphene/chain/protocol/confidential.hpp | 7 +++ .../graphene/chain/protocol/custom.hpp | 3 ++ .../include/graphene/chain/protocol/ext.hpp | 1 + .../include/graphene/chain/protocol/fba.hpp | 3 ++ .../graphene/chain/protocol/fee_schedule.hpp | 2 + .../graphene/chain/protocol/market.hpp | 11 ++++- .../include/graphene/chain/protocol/memo.hpp | 3 ++ .../graphene/chain/protocol/operations.hpp | 2 + .../graphene/chain/protocol/proposal.hpp | 8 ++++ .../chain/protocol/special_authority.hpp | 2 + .../graphene/chain/protocol/transfer.hpp | 6 +++ .../include/graphene/chain/protocol/types.hpp | 2 +- .../graphene/chain/protocol/vesting.hpp | 6 +++ .../include/graphene/chain/protocol/vote.hpp | 9 ++-- .../chain/protocol/withdraw_permission.hpp | 10 +++++ .../graphene/chain/protocol/witness.hpp | 6 +++ .../graphene/chain/protocol/worker.hpp | 3 ++ .../include/graphene/chain/pts_address.hpp | 11 ++++- libraries/chain/protocol/account.cpp | 12 ++++++ libraries/chain/protocol/address.cpp | 5 ++- libraries/chain/protocol/assert.cpp | 10 ++++- libraries/chain/protocol/asset.cpp | 5 +++ libraries/chain/protocol/asset_ops.cpp | 27 ++++++++++++ libraries/chain/protocol/authority.cpp | 3 ++ libraries/chain/protocol/committee_member.cpp | 10 +++++ libraries/chain/protocol/confidential.cpp | 13 +++--- libraries/chain/protocol/custom.cpp | 3 ++ libraries/chain/protocol/fee_schedule.cpp | 4 ++ libraries/chain/protocol/market.cpp | 9 ++++ libraries/chain/protocol/memo.cpp | 3 ++ libraries/chain/protocol/operations.cpp | 3 ++ libraries/chain/protocol/proposal.cpp | 7 +++ libraries/chain/protocol/small_ops.cpp | 43 +++++++++++++++++++ libraries/chain/protocol/transaction.cpp | 1 + libraries/chain/protocol/transfer.cpp | 5 +++ libraries/chain/protocol/vote.cpp | 2 + .../chain/protocol/withdraw_permission.cpp | 9 +++- libraries/chain/protocol/witness.cpp | 6 +++ libraries/chain/protocol/worker.cpp | 4 ++ libraries/chain/pts_address.cpp | 11 ++++- libraries/chain/special_authority.cpp | 5 +++ 56 files changed, 354 insertions(+), 30 deletions(-) create mode 100644 libraries/chain/protocol/small_ops.cpp diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index b49e1b35..3987f192 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include diff --git a/libraries/chain/CMakeLists.txt b/libraries/chain/CMakeLists.txt index 649f641a..07f1ea0a 100644 --- a/libraries/chain/CMakeLists.txt +++ b/libraries/chain/CMakeLists.txt @@ -60,6 +60,7 @@ add_library( graphene_chain protocol/confidential.cpp protocol/vote.cpp protocol/tournament.cpp + protocol/small_ops.cpp genesis_state.cpp get_config.cpp diff --git a/libraries/chain/balance_evaluator.cpp b/libraries/chain/balance_evaluator.cpp index 8d29c01d..817d736f 100644 --- a/libraries/chain/balance_evaluator.cpp +++ b/libraries/chain/balance_evaluator.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/include/graphene/chain/genesis_state.hpp b/libraries/chain/include/graphene/chain/genesis_state.hpp index 2d859842..b2f76118 100644 --- a/libraries/chain/include/graphene/chain/genesis_state.hpp +++ b/libraries/chain/include/graphene/chain/genesis_state.hpp @@ -23,6 +23,7 @@ */ #pragma once +#include #include #include #include diff --git a/libraries/chain/include/graphene/chain/protocol/account.hpp b/libraries/chain/include/graphene/chain/protocol/account.hpp index 5f4c730a..76f7df7c 100644 --- a/libraries/chain/include/graphene/chain/protocol/account.hpp +++ b/libraries/chain/include/graphene/chain/protocol/account.hpp @@ -317,5 +317,16 @@ FC_REFLECT( graphene::chain::account_whitelist_operation::fee_parameters_type, ( FC_REFLECT( graphene::chain::account_update_operation::fee_parameters_type, (fee)(price_per_kbyte) ) FC_REFLECT( graphene::chain::account_upgrade_operation::fee_parameters_type, (membership_annual_fee)(membership_lifetime_fee) ) FC_REFLECT( graphene::chain::account_transfer_operation::fee_parameters_type, (fee) ) - FC_REFLECT( graphene::chain::account_transfer_operation, (fee)(account_id)(new_owner)(extensions) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_whitelist_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_upgrade_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_whitelist_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_upgrade_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::account_transfer_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/address.hpp b/libraries/chain/include/graphene/chain/protocol/address.hpp index b225b42c..8bf0fab6 100644 --- a/libraries/chain/include/graphene/chain/protocol/address.hpp +++ b/libraries/chain/include/graphene/chain/protocol/address.hpp @@ -25,14 +25,10 @@ #include #include +#include -#include #include - -namespace fc { namespace ecc { - class public_key; - typedef fc::array public_key_data; -} } // fc::ecc +#include namespace graphene { namespace chain { @@ -51,7 +47,7 @@ namespace graphene { namespace chain { class address { public: - address(); ///< constructs empty / null address + address(){} ///< constructs empty / null address explicit address( const std::string& base58str ); ///< converts to binary, validates checksum address( const fc::ecc::public_key& pub ); ///< converts to binary explicit address( const fc::ecc::public_key_data& pub ); ///< converts to binary @@ -97,3 +93,5 @@ namespace std #include FC_REFLECT( graphene::chain::address, (addr) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::address ) diff --git a/libraries/chain/include/graphene/chain/protocol/assert.hpp b/libraries/chain/include/graphene/chain/protocol/assert.hpp index c9f3b277..ce758862 100644 --- a/libraries/chain/include/graphene/chain/protocol/assert.hpp +++ b/libraries/chain/include/graphene/chain/protocol/assert.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -112,3 +113,5 @@ FC_REFLECT( graphene::chain::block_id_predicate, (id) ) FC_REFLECT_TYPENAME( graphene::chain::predicate ) FC_REFLECT( graphene::chain::assert_operation, (fee)(fee_paying_account)(predicates)(required_auths)(extensions) ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::assert_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::assert_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/asset.hpp b/libraries/chain/include/graphene/chain/protocol/asset.hpp index a938129a..60bd3cd0 100644 --- a/libraries/chain/include/graphene/chain/protocol/asset.hpp +++ b/libraries/chain/include/graphene/chain/protocol/asset.hpp @@ -218,3 +218,7 @@ FC_REFLECT( graphene::chain::price, (base)(quote) ) (core_exchange_rate) FC_REFLECT( graphene::chain::price_feed, GRAPHENE_PRICE_FEED_FIELDS ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::price ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::price_feed ) diff --git a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp index a567c5a1..ae5dc211 100644 --- a/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp +++ b/libraries/chain/include/graphene/chain/protocol/asset_ops.hpp @@ -764,3 +764,30 @@ FC_REFLECT( graphene::chain::asset_reserve_operation, FC_REFLECT( graphene::chain::asset_fund_fee_pool_operation, (fee)(from_account)(asset_id)(amount)(extensions) ); FC_REFLECT( graphene::chain::asset_dividend_distribution_operation, (fee)(dividend_asset_id)(account_id)(amounts)(extensions) ); + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::bitasset_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_global_settle_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_settle_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_fund_fee_pool_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_dividend_distribution_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_claim_fees_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_bitasset_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_feed_producers_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_publish_feed_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_issue_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_reserve_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_global_settle_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_settle_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_settle_cancel_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_fund_fee_pool_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_claim_fees_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_bitasset_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_update_feed_producers_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_publish_feed_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_issue_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::asset_reserve_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/authority.hpp b/libraries/chain/include/graphene/chain/protocol/authority.hpp index 70b674b3..d279402d 100644 --- a/libraries/chain/include/graphene/chain/protocol/authority.hpp +++ b/libraries/chain/include/graphene/chain/protocol/authority.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -134,3 +135,5 @@ void add_authority_accounts( FC_REFLECT( graphene::chain::authority, (weight_threshold)(account_auths)(key_auths)(address_auths) ) // FC_REFLECT_TYPENAME( graphene::chain::authority::classification ) FC_REFLECT_ENUM( graphene::chain::authority::classification, (owner)(active)(key) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::authority ) diff --git a/libraries/chain/include/graphene/chain/protocol/balance.hpp b/libraries/chain/include/graphene/chain/protocol/balance.hpp index f60087a7..9d0b252f 100644 --- a/libraries/chain/include/graphene/chain/protocol/balance.hpp +++ b/libraries/chain/include/graphene/chain/protocol/balance.hpp @@ -23,6 +23,8 @@ */ #pragma once #include +#include +#include namespace graphene { namespace chain { @@ -57,3 +59,5 @@ namespace graphene { namespace chain { FC_REFLECT( graphene::chain::balance_claim_operation::fee_parameters_type, ) FC_REFLECT( graphene::chain::balance_claim_operation, (fee)(deposit_to_account)(balance_to_claim)(balance_owner_key)(total_claimed) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::balance_claim_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/base.hpp b/libraries/chain/include/graphene/chain/protocol/base.hpp index 52240b93..23c285d3 100644 --- a/libraries/chain/include/graphene/chain/protocol/base.hpp +++ b/libraries/chain/include/graphene/chain/protocol/base.hpp @@ -27,8 +27,13 @@ #include #include +#include + namespace graphene { namespace chain { + struct asset; + struct authority; + /** * @defgroup operations Operations * @ingroup transactions Transactions diff --git a/libraries/chain/include/graphene/chain/protocol/buyback.hpp b/libraries/chain/include/graphene/chain/protocol/buyback.hpp index 6adad52d..4a51e8c7 100644 --- a/libraries/chain/include/graphene/chain/protocol/buyback.hpp +++ b/libraries/chain/include/graphene/chain/protocol/buyback.hpp @@ -50,3 +50,5 @@ struct buyback_account_options } } FC_REFLECT( graphene::chain::buyback_account_options, (asset_to_buy)(asset_to_buy_issuer)(markets) ); + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::buyback_account_options ) diff --git a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp index 93098c21..091da0c9 100644 --- a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp +++ b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp @@ -28,6 +28,7 @@ #include #include <../hardfork.d/GPOS.hf> +#include namespace graphene { namespace chain { struct fee_schedule; } } @@ -147,7 +148,6 @@ FC_REFLECT( graphene::chain::parameter_extension, (min_bet_multiplier) (max_bet_multiplier) (betting_rake_fee_percentage) - (permitted_betting_odds_increments) (live_betting_delay_time) (sweeps_distribution_percentage) (sweeps_distribution_asset) @@ -203,3 +203,5 @@ FC_REFLECT( graphene::chain::chain_parameters, (maximum_tournament_number_of_wins) (extensions) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::chain_parameters ) diff --git a/libraries/chain/include/graphene/chain/protocol/committee_member.hpp b/libraries/chain/include/graphene/chain/protocol/committee_member.hpp index 77188367..8aaed748 100644 --- a/libraries/chain/include/graphene/chain/protocol/committee_member.hpp +++ b/libraries/chain/include/graphene/chain/protocol/committee_member.hpp @@ -104,3 +104,10 @@ FC_REFLECT( graphene::chain::committee_member_create_operation, FC_REFLECT( graphene::chain::committee_member_update_operation, (fee)(committee_member)(committee_member_account)(new_url) ) FC_REFLECT( graphene::chain::committee_member_update_global_parameters_operation, (fee)(new_parameters) ); + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_update_global_parameters_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::committee_member_update_global_parameters_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/confidential.hpp b/libraries/chain/include/graphene/chain/protocol/confidential.hpp index 763006ae..697ef35b 100644 --- a/libraries/chain/include/graphene/chain/protocol/confidential.hpp +++ b/libraries/chain/include/graphene/chain/protocol/confidential.hpp @@ -281,3 +281,10 @@ FC_REFLECT( graphene::chain::blind_transfer_operation, FC_REFLECT( graphene::chain::transfer_to_blind_operation::fee_parameters_type, (fee)(price_per_output) ) FC_REFLECT( graphene::chain::transfer_from_blind_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::blind_transfer_operation::fee_parameters_type, (fee)(price_per_output) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_to_blind_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_from_blind_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::blind_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_to_blind_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_from_blind_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::blind_transfer_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/custom.hpp b/libraries/chain/include/graphene/chain/protocol/custom.hpp index e5701a4b..5596aaad 100644 --- a/libraries/chain/include/graphene/chain/protocol/custom.hpp +++ b/libraries/chain/include/graphene/chain/protocol/custom.hpp @@ -56,3 +56,6 @@ namespace graphene { namespace chain { FC_REFLECT( graphene::chain::custom_operation::fee_parameters_type, (fee)(price_per_kbyte) ) FC_REFLECT( graphene::chain::custom_operation, (fee)(payer)(required_auths)(id)(data) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::custom_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::custom_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/ext.hpp b/libraries/chain/include/graphene/chain/protocol/ext.hpp index 31f66506..6c974630 100644 --- a/libraries/chain/include/graphene/chain/protocol/ext.hpp +++ b/libraries/chain/include/graphene/chain/protocol/ext.hpp @@ -24,6 +24,7 @@ #pragma once #include +#include #include namespace graphene { namespace chain { diff --git a/libraries/chain/include/graphene/chain/protocol/fba.hpp b/libraries/chain/include/graphene/chain/protocol/fba.hpp index 7460ca8d..dc672436 100644 --- a/libraries/chain/include/graphene/chain/protocol/fba.hpp +++ b/libraries/chain/include/graphene/chain/protocol/fba.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -45,3 +46,5 @@ struct fba_distribute_operation : public base_operation FC_REFLECT( graphene::chain::fba_distribute_operation::fee_parameters_type, ) FC_REFLECT( graphene::chain::fba_distribute_operation, (fee)(account_id)(fba_id)(amount) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::fba_distribute_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp index e250ab17..5afa1b21 100644 --- a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp +++ b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp @@ -85,3 +85,5 @@ namespace graphene { namespace chain { FC_REFLECT_TYPENAME( graphene::chain::fee_parameters ) FC_REFLECT( graphene::chain::fee_schedule, (parameters)(scale) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::fee_schedule ) diff --git a/libraries/chain/include/graphene/chain/protocol/market.hpp b/libraries/chain/include/graphene/chain/protocol/market.hpp index 56352c60..2bff8c56 100644 --- a/libraries/chain/include/graphene/chain/protocol/market.hpp +++ b/libraries/chain/include/graphene/chain/protocol/market.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -165,9 +166,15 @@ FC_REFLECT( graphene::chain::limit_order_cancel_operation::fee_parameters_type, FC_REFLECT( graphene::chain::call_order_update_operation::fee_parameters_type, (fee) ) /// THIS IS THE ONLY VIRTUAL OPERATION THUS FAR... FC_REFLECT( graphene::chain::fill_order_operation::fee_parameters_type, ) - - FC_REFLECT( graphene::chain::limit_order_create_operation,(fee)(seller)(amount_to_sell)(min_to_receive)(expiration)(fill_or_kill)(extensions)) FC_REFLECT( graphene::chain::limit_order_cancel_operation,(fee)(fee_paying_account)(order)(extensions) ) FC_REFLECT( graphene::chain::call_order_update_operation, (fee)(funding_account)(delta_collateral)(delta_debt)(extensions) ) FC_REFLECT( graphene::chain::fill_order_operation, (fee)(order_id)(account_id)(pays)(receives) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::limit_order_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::limit_order_cancel_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::call_order_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::limit_order_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::limit_order_cancel_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::call_order_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::fill_order_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/memo.hpp b/libraries/chain/include/graphene/chain/protocol/memo.hpp index b126d3a7..6c5b69fb 100644 --- a/libraries/chain/include/graphene/chain/protocol/memo.hpp +++ b/libraries/chain/include/graphene/chain/protocol/memo.hpp @@ -89,3 +89,6 @@ namespace graphene { namespace chain { FC_REFLECT( graphene::chain::memo_message, (checksum)(text) ) FC_REFLECT( graphene::chain::memo_data, (from)(to)(nonce)(message) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::memo_message ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::memo_data ) diff --git a/libraries/chain/include/graphene/chain/protocol/operations.hpp b/libraries/chain/include/graphene/chain/protocol/operations.hpp index bce0e201..cb9a83a1 100644 --- a/libraries/chain/include/graphene/chain/protocol/operations.hpp +++ b/libraries/chain/include/graphene/chain/protocol/operations.hpp @@ -167,3 +167,5 @@ namespace graphene { namespace chain { FC_REFLECT_TYPENAME( graphene::chain::operation ) FC_REFLECT( graphene::chain::op_wrapper, (op) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::op_wrapper ) diff --git a/libraries/chain/include/graphene/chain/protocol/proposal.hpp b/libraries/chain/include/graphene/chain/protocol/proposal.hpp index 3383b6cf..141ec35f 100644 --- a/libraries/chain/include/graphene/chain/protocol/proposal.hpp +++ b/libraries/chain/include/graphene/chain/protocol/proposal.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { /** @@ -179,3 +180,10 @@ FC_REFLECT( graphene::chain::proposal_update_operation, (fee)(fee_paying_account (active_approvals_to_add)(active_approvals_to_remove)(owner_approvals_to_add)(owner_approvals_to_remove) (key_approvals_to_add)(key_approvals_to_remove)(extensions) ) FC_REFLECT( graphene::chain::proposal_delete_operation, (fee)(fee_paying_account)(using_owner_authority)(proposal)(extensions) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_delete_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::proposal_delete_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/special_authority.hpp b/libraries/chain/include/graphene/chain/protocol/special_authority.hpp index 3ee6f15f..05a80719 100644 --- a/libraries/chain/include/graphene/chain/protocol/special_authority.hpp +++ b/libraries/chain/include/graphene/chain/protocol/special_authority.hpp @@ -48,3 +48,5 @@ void validate_special_authority( const special_authority& auth ); FC_REFLECT( graphene::chain::no_special_authority, ) FC_REFLECT( graphene::chain::top_holders_special_authority, (asset)(num_top_holders) ) FC_REFLECT_TYPENAME( graphene::chain::special_authority ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::top_holders_special_authority ) diff --git a/libraries/chain/include/graphene/chain/protocol/transfer.hpp b/libraries/chain/include/graphene/chain/protocol/transfer.hpp index f4417bb7..5366a7ab 100644 --- a/libraries/chain/include/graphene/chain/protocol/transfer.hpp +++ b/libraries/chain/include/graphene/chain/protocol/transfer.hpp @@ -24,6 +24,7 @@ #pragma once #include #include +#include namespace graphene { namespace chain { @@ -105,3 +106,8 @@ FC_REFLECT( graphene::chain::override_transfer_operation::fee_parameters_type, ( FC_REFLECT( graphene::chain::override_transfer_operation, (fee)(issuer)(from)(to)(amount)(memo)(extensions) ) FC_REFLECT( graphene::chain::transfer_operation, (fee)(from)(to)(amount)(memo)(extensions) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::override_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::transfer_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::override_transfer_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/types.hpp b/libraries/chain/include/graphene/chain/protocol/types.hpp index 8cd38ea5..8ea3a8af 100644 --- a/libraries/chain/include/graphene/chain/protocol/types.hpp +++ b/libraries/chain/include/graphene/chain/protocol/types.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +44,6 @@ #include #include #include -#include #include #include diff --git a/libraries/chain/include/graphene/chain/protocol/vesting.hpp b/libraries/chain/include/graphene/chain/protocol/vesting.hpp index 2a861b2a..1d83b90f 100644 --- a/libraries/chain/include/graphene/chain/protocol/vesting.hpp +++ b/libraries/chain/include/graphene/chain/protocol/vesting.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -133,3 +134,8 @@ FC_REFLECT(graphene::chain::cdd_vesting_policy_initializer, (start_claim)(vestin FC_REFLECT_TYPENAME( graphene::chain::vesting_policy_initializer ) FC_REFLECT_ENUM( graphene::chain::vesting_balance_type, (normal)(gpos) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vesting_balance_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vesting_balance_withdraw_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vesting_balance_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vesting_balance_withdraw_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/vote.hpp b/libraries/chain/include/graphene/chain/protocol/vote.hpp index 67536f7a..7d733e45 100644 --- a/libraries/chain/include/graphene/chain/protocol/vote.hpp +++ b/libraries/chain/include/graphene/chain/protocol/vote.hpp @@ -24,12 +24,7 @@ #pragma once -#include -#include -#include - -#include -#include +#include namespace graphene { namespace chain { @@ -150,3 +145,5 @@ FC_REFLECT_TYPENAME( fc::flat_set ) FC_REFLECT_ENUM( graphene::chain::vote_id_type::vote_type, (witness)(committee)(worker)(VOTE_TYPE_COUNT) ) FC_REFLECT( graphene::chain::vote_id_type, (content) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::vote_id_type ) diff --git a/libraries/chain/include/graphene/chain/protocol/withdraw_permission.hpp b/libraries/chain/include/graphene/chain/protocol/withdraw_permission.hpp index 7bc905ac..7963e99f 100644 --- a/libraries/chain/include/graphene/chain/protocol/withdraw_permission.hpp +++ b/libraries/chain/include/graphene/chain/protocol/withdraw_permission.hpp @@ -24,6 +24,7 @@ #pragma once #include #include +#include namespace graphene { namespace chain { @@ -179,3 +180,12 @@ FC_REFLECT( graphene::chain::withdraw_permission_update_operation, (fee)(withdra FC_REFLECT( graphene::chain::withdraw_permission_claim_operation, (fee)(withdraw_permission)(withdraw_from_account)(withdraw_to_account)(amount_to_withdraw)(memo) ); FC_REFLECT( graphene::chain::withdraw_permission_delete_operation, (fee)(withdraw_from_account)(authorized_account) (withdrawal_permission) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_claim_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_delete_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_claim_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::withdraw_permission_delete_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/witness.hpp b/libraries/chain/include/graphene/chain/protocol/witness.hpp index b096e826..2b5e88b0 100644 --- a/libraries/chain/include/graphene/chain/protocol/witness.hpp +++ b/libraries/chain/include/graphene/chain/protocol/witness.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -84,3 +85,8 @@ FC_REFLECT( graphene::chain::witness_create_operation, (fee)(witness_account)(ur FC_REFLECT( graphene::chain::witness_update_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::witness_update_operation, (fee)(witness)(witness_account)(new_url)(new_signing_key)(new_initial_secret) ) + +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::witness_update_operation ) diff --git a/libraries/chain/include/graphene/chain/protocol/worker.hpp b/libraries/chain/include/graphene/chain/protocol/worker.hpp index 9e6eef35..11e0aa05 100644 --- a/libraries/chain/include/graphene/chain/protocol/worker.hpp +++ b/libraries/chain/include/graphene/chain/protocol/worker.hpp @@ -23,6 +23,7 @@ */ #pragma once #include +#include namespace graphene { namespace chain { @@ -104,3 +105,5 @@ FC_REFLECT( graphene::chain::worker_create_operation::fee_parameters_type, (fee) FC_REFLECT( graphene::chain::worker_create_operation, (fee)(owner)(work_begin_date)(work_end_date)(daily_pay)(name)(url)(initializer) ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::worker_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( extern, graphene::chain::worker_create_operation ) diff --git a/libraries/chain/include/graphene/chain/pts_address.hpp b/libraries/chain/include/graphene/chain/pts_address.hpp index 636e2f11..c0bc80ff 100644 --- a/libraries/chain/include/graphene/chain/pts_address.hpp +++ b/libraries/chain/include/graphene/chain/pts_address.hpp @@ -24,6 +24,8 @@ #pragma once #include +#include +#include #include namespace fc { namespace ecc { class public_key; } } @@ -75,4 +77,11 @@ namespace fc { void to_variant( const graphene::chain::pts_address& var, fc::variant& vo, uint32_t max_depth = 1 ); void from_variant( const fc::variant& var, graphene::chain::pts_address& vo, uint32_t max_depth = 1 ); -} +namespace raw { + extern template void pack( datastream& s, const graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + extern template void pack( datastream& s, const graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + extern template void unpack( datastream& s, graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); +} } // fc::raw diff --git a/libraries/chain/protocol/account.cpp b/libraries/chain/protocol/account.cpp index 66dcdb90..e77552a4 100644 --- a/libraries/chain/protocol/account.cpp +++ b/libraries/chain/protocol/account.cpp @@ -322,3 +322,15 @@ void account_transfer_operation::validate()const } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_whitelist_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_upgrade_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_whitelist_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_upgrade_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::account_transfer_operation ) diff --git a/libraries/chain/protocol/address.cpp b/libraries/chain/protocol/address.cpp index 19bb4df5..f0edbd49 100644 --- a/libraries/chain/protocol/address.cpp +++ b/libraries/chain/protocol/address.cpp @@ -27,9 +27,10 @@ #include #include +#include + namespace graphene { namespace chain { - address::address(){} address::address( const std::string& base58str ) { @@ -110,3 +111,5 @@ namespace fc vo = graphene::chain::address( var.as_string() ); } } + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::address ) diff --git a/libraries/chain/protocol/assert.cpp b/libraries/chain/protocol/assert.cpp index 60f26e3f..5ce61e45 100644 --- a/libraries/chain/protocol/assert.cpp +++ b/libraries/chain/protocol/assert.cpp @@ -21,7 +21,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include +#include +#include +#include + +#include namespace graphene { namespace chain { @@ -62,5 +66,7 @@ share_type assert_operation::calculate_fee(const fee_parameters_type& k)const return k.fee * predicates.size(); } - } } // namespace graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::assert_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::assert_operation ) diff --git a/libraries/chain/protocol/asset.cpp b/libraries/chain/protocol/asset.cpp index c47d88e3..525e193b 100644 --- a/libraries/chain/protocol/asset.cpp +++ b/libraries/chain/protocol/asset.cpp @@ -24,6 +24,7 @@ #include #include #include +#include namespace graphene { namespace chain { typedef boost::multiprecision::uint128_t uint128_t; @@ -206,3 +207,7 @@ const int64_t scaled_precision_lut[19] = }; } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::price ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::price_feed ) diff --git a/libraries/chain/protocol/asset_ops.cpp b/libraries/chain/protocol/asset_ops.cpp index 9c551882..5dfd09ee 100644 --- a/libraries/chain/protocol/asset_ops.cpp +++ b/libraries/chain/protocol/asset_ops.cpp @@ -290,3 +290,30 @@ void lottery_asset_options::validate() const } } } // namespace graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::bitasset_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_global_settle_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_fund_fee_pool_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_claim_fees_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_bitasset_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_feed_producers_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_publish_feed_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_issue_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_reserve_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_global_settle_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_settle_cancel_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_fund_fee_pool_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_claim_fees_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_dividend_distribution_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_bitasset_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_update_feed_producers_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_publish_feed_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_issue_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::asset_reserve_operation ) diff --git a/libraries/chain/protocol/authority.cpp b/libraries/chain/protocol/authority.cpp index 97470d33..6cfed2ec 100644 --- a/libraries/chain/protocol/authority.cpp +++ b/libraries/chain/protocol/authority.cpp @@ -23,6 +23,7 @@ */ #include +#include namespace graphene { namespace chain { @@ -36,3 +37,5 @@ void add_authority_accounts( } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::authority ) diff --git a/libraries/chain/protocol/committee_member.cpp b/libraries/chain/protocol/committee_member.cpp index 4c8c5d25..e468936c 100644 --- a/libraries/chain/protocol/committee_member.cpp +++ b/libraries/chain/protocol/committee_member.cpp @@ -22,6 +22,9 @@ * THE SOFTWARE. */ #include +#include + +#include namespace graphene { namespace chain { @@ -45,3 +48,10 @@ void committee_member_update_global_parameters_operation::validate() const } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_update_global_parameters_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::committee_member_update_global_parameters_operation ) diff --git a/libraries/chain/protocol/confidential.cpp b/libraries/chain/protocol/confidential.cpp index 603befa1..2e8fbc68 100644 --- a/libraries/chain/protocol/confidential.cpp +++ b/libraries/chain/protocol/confidential.cpp @@ -27,7 +27,6 @@ #include #include -#include namespace graphene { namespace chain { @@ -141,9 +140,6 @@ share_type blind_transfer_operation::calculate_fee( const fee_parameters_type& k return k.fee + outputs.size() * k.price_per_output; } - - - /** * Packs *this then encodes as base58 encoded string. */ @@ -159,6 +155,11 @@ stealth_confirmation::stealth_confirmation( const std::string& base58 ) *this = fc::raw::unpack( fc::from_base58( base58 ) ); } - - } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_to_blind_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_from_blind_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::blind_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_to_blind_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_from_blind_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::blind_transfer_operation ) diff --git a/libraries/chain/protocol/custom.cpp b/libraries/chain/protocol/custom.cpp index be03419f..72f8dd44 100644 --- a/libraries/chain/protocol/custom.cpp +++ b/libraries/chain/protocol/custom.cpp @@ -37,3 +37,6 @@ share_type custom_operation::calculate_fee(const fee_parameters_type& k)const } } } + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::custom_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::custom_operation ) diff --git a/libraries/chain/protocol/fee_schedule.cpp b/libraries/chain/protocol/fee_schedule.cpp index 138d801e..6d494e37 100644 --- a/libraries/chain/protocol/fee_schedule.cpp +++ b/libraries/chain/protocol/fee_schedule.cpp @@ -35,6 +35,8 @@ namespace fc //template const graphene::chain::fee_schedule& smart_ref::operator*() const; } +#include + #define MAX_FEE_STABILIZATION_ITERATION 4 namespace graphene { namespace chain { @@ -208,3 +210,5 @@ namespace graphene { namespace chain { } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::fee_schedule ) diff --git a/libraries/chain/protocol/market.cpp b/libraries/chain/protocol/market.cpp index 923f4763..ae0a3a68 100644 --- a/libraries/chain/protocol/market.cpp +++ b/libraries/chain/protocol/market.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { @@ -46,3 +47,11 @@ void call_order_update_operation::validate()const } FC_CAPTURE_AND_RETHROW((*this)) } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::limit_order_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::limit_order_cancel_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::call_order_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::limit_order_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::limit_order_cancel_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::call_order_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::fill_order_operation ) diff --git a/libraries/chain/protocol/memo.cpp b/libraries/chain/protocol/memo.cpp index 8ced0e1b..afa0b486 100644 --- a/libraries/chain/protocol/memo.cpp +++ b/libraries/chain/protocol/memo.cpp @@ -89,3 +89,6 @@ memo_message memo_message::deserialize(const string& serial) } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::memo_message ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::memo_data ) diff --git a/libraries/chain/protocol/operations.cpp b/libraries/chain/protocol/operations.cpp index 57831b8f..fb766b3d 100644 --- a/libraries/chain/protocol/operations.cpp +++ b/libraries/chain/protocol/operations.cpp @@ -23,6 +23,7 @@ */ #include #include +#include namespace graphene { namespace chain { @@ -86,3 +87,5 @@ void operation_get_required_authorities( const operation& op, } } } // namespace graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::op_wrapper ) diff --git a/libraries/chain/protocol/proposal.cpp b/libraries/chain/protocol/proposal.cpp index bca0c416..c77e71e4 100644 --- a/libraries/chain/protocol/proposal.cpp +++ b/libraries/chain/protocol/proposal.cpp @@ -107,3 +107,10 @@ void proposal_update_operation::get_required_owner_authorities( flat_set +#include +#include +#include +#include +#include + +#include + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_claim_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::buyback_account_options ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::fba_distribute_operation ) + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vesting_balance_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vesting_balance_withdraw_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vesting_balance_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vesting_balance_withdraw_operation ) + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::chain_parameters ) diff --git a/libraries/chain/protocol/transaction.cpp b/libraries/chain/protocol/transaction.cpp index e9e60d50..093e7833 100644 --- a/libraries/chain/protocol/transaction.cpp +++ b/libraries/chain/protocol/transaction.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/transfer.cpp b/libraries/chain/protocol/transfer.cpp index 3ec78237..0fb0aefa 100644 --- a/libraries/chain/protocol/transfer.cpp +++ b/libraries/chain/protocol/transfer.cpp @@ -63,3 +63,8 @@ void override_transfer_operation::validate()const } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::override_transfer_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::transfer_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::override_transfer_operation ) diff --git a/libraries/chain/protocol/vote.cpp b/libraries/chain/protocol/vote.cpp index f78f2b4f..68f476f5 100644 --- a/libraries/chain/protocol/vote.cpp +++ b/libraries/chain/protocol/vote.cpp @@ -49,3 +49,5 @@ void from_variant( const variant& var, graphene::chain::vote_id_type& vo, uint32 } } // fc + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::vote_id_type ) diff --git a/libraries/chain/protocol/withdraw_permission.cpp b/libraries/chain/protocol/withdraw_permission.cpp index ec7b36f8..b36c378d 100644 --- a/libraries/chain/protocol/withdraw_permission.cpp +++ b/libraries/chain/protocol/withdraw_permission.cpp @@ -67,6 +67,13 @@ void withdraw_permission_delete_operation::validate() const FC_ASSERT( withdraw_from_account != authorized_account ); } - } } // graphene::chain +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_claim_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_delete_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_update_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_claim_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::withdraw_permission_delete_operation ) diff --git a/libraries/chain/protocol/witness.cpp b/libraries/chain/protocol/witness.cpp index 82fa462a..90583cd8 100644 --- a/libraries/chain/protocol/witness.cpp +++ b/libraries/chain/protocol/witness.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { @@ -39,3 +40,8 @@ void witness_update_operation::validate() const } } } // graphene::chain + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_update_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_create_operation ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::witness_update_operation ) diff --git a/libraries/chain/protocol/worker.cpp b/libraries/chain/protocol/worker.cpp index eb133da0..932148ec 100644 --- a/libraries/chain/protocol/worker.cpp +++ b/libraries/chain/protocol/worker.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include +#include namespace graphene { namespace chain { @@ -36,3 +37,6 @@ void worker_create_operation::validate() const } } } + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::worker_create_operation::fee_parameters_type ) +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::worker_create_operation ) diff --git a/libraries/chain/pts_address.cpp b/libraries/chain/pts_address.cpp index 27f3d256..c6d74f58 100644 --- a/libraries/chain/pts_address.cpp +++ b/libraries/chain/pts_address.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace graphene { namespace chain { @@ -97,4 +98,12 @@ namespace fc { vo = graphene::chain::pts_address( var.as_string() ); } -} + +namespace raw { + template void pack( datastream& s, const graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + template void pack( datastream& s, const graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); + template void unpack( datastream& s, graphene::chain::pts_address& tx, + uint32_t _max_depth=FC_PACK_MAX_DEPTH ); +} } // fc::raw diff --git a/libraries/chain/special_authority.cpp b/libraries/chain/special_authority.cpp index ca974f30..74889f80 100644 --- a/libraries/chain/special_authority.cpp +++ b/libraries/chain/special_authority.cpp @@ -25,6 +25,8 @@ #include #include +#include + namespace graphene { namespace chain { struct special_authority_validate_visitor @@ -68,3 +70,6 @@ void evaluate_special_authority( const database& db, const special_authority& a } } } // graphene::chain + + +GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::top_holders_special_authority ) From 25458c294da1650cea979cc9b5cd3174b061f81d Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Tue, 4 Jun 2019 13:36:21 +0200 Subject: [PATCH 06/44] Undo superfluous change --- libraries/wallet/include/graphene/wallet/wallet.hpp | 6 +++--- libraries/wallet/wallet.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index c456f7e1..7c1960ee 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -229,13 +229,12 @@ struct worker_vote_delta flat_set vote_abstain; }; -struct signed_block_with_info +struct signed_block_with_info : public signed_block { signed_block_with_info(); signed_block_with_info( const signed_block& block ); signed_block_with_info( const signed_block_with_info& block ) = default; - signed_block block; block_id_type block_id; public_key_type signing_key; vector< transaction_id_type > transaction_ids; @@ -1979,7 +1978,8 @@ FC_REFLECT( graphene::wallet::worker_vote_delta, (vote_abstain) ) -FC_REFLECT( graphene::wallet::signed_block_with_info, (block_id)(signing_key)(transaction_ids) ) +FC_REFLECT_DERIVED( graphene::wallet::signed_block_with_info, (graphene::chain::signed_block), + (block_id)(signing_key)(transaction_ids) ) FC_REFLECT_DERIVED( graphene::wallet::vesting_balance_object_with_info, (graphene::chain::vesting_balance_object), (allowed_withdraw)(allowed_withdraw_time) ) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 2bbb9d9b..bdb756c2 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -6191,13 +6191,13 @@ std::vector wallet_api::get_all_matched_bets_for_bettor(acco } // default ctor necessary for FC_REFLECT -signed_block_with_info::signed_block_with_info( const signed_block& _block ) - : block( _block ) +signed_block_with_info::signed_block_with_info( const signed_block& block ) + : signed_block( block ) { - block_id = _block.id(); - signing_key = _block.signee(); - transaction_ids.reserve( _block.transactions.size() ); - for( const processed_transaction& tx : _block.transactions ) + block_id = id(); + signing_key = signee(); + transaction_ids.reserve( transactions.size() ); + for( const processed_transaction& tx : transactions ) transaction_ids.push_back( tx.id() ); } From 40c2fd8783e4d6bb02da8636111f89151e420ebb Mon Sep 17 00:00:00 2001 From: gladcow Date: Mon, 2 Dec 2019 17:41:13 +0300 Subject: [PATCH 07/44] fix compilation issues --- .../graphene/chain/protocol/fee_schedule.hpp | 1 + libraries/chain/protocol/committee_member.cpp | 3 ++- libraries/chain/protocol/operations.cpp | 1 + libraries/chain/protocol/small_ops.cpp | 1 + libraries/chain/small_objects.cpp | 1 + programs/build_helpers/cat-parts | Bin 474216 -> 0 bytes 6 files changed, 6 insertions(+), 1 deletion(-) delete mode 100755 programs/build_helpers/cat-parts diff --git a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp index 5afa1b21..9baaffc7 100644 --- a/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp +++ b/libraries/chain/include/graphene/chain/protocol/fee_schedule.hpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #pragma once +#include #include namespace graphene { namespace chain { diff --git a/libraries/chain/protocol/committee_member.cpp b/libraries/chain/protocol/committee_member.cpp index e468936c..1824870a 100644 --- a/libraries/chain/protocol/committee_member.cpp +++ b/libraries/chain/protocol/committee_member.cpp @@ -21,8 +21,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include +#include #include +#include #include diff --git a/libraries/chain/protocol/operations.cpp b/libraries/chain/protocol/operations.cpp index fb766b3d..7db51078 100644 --- a/libraries/chain/protocol/operations.cpp +++ b/libraries/chain/protocol/operations.cpp @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#include #include #include #include diff --git a/libraries/chain/protocol/small_ops.cpp b/libraries/chain/protocol/small_ops.cpp index cba4b1b7..8ab7cf43 100644 --- a/libraries/chain/protocol/small_ops.cpp +++ b/libraries/chain/protocol/small_ops.cpp @@ -22,6 +22,7 @@ * THE SOFTWARE. */ +#include #include #include #include diff --git a/libraries/chain/small_objects.cpp b/libraries/chain/small_objects.cpp index 6b8af3d9..a74fa116 100644 --- a/libraries/chain/small_objects.cpp +++ b/libraries/chain/small_objects.cpp @@ -44,6 +44,7 @@ #include #include +#include GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::balance_object ) GRAPHENE_EXTERNAL_SERIALIZATION( /*not extern*/, graphene::chain::block_summary_object ) diff --git a/programs/build_helpers/cat-parts b/programs/build_helpers/cat-parts deleted file mode 100755 index 2bcd1c8ae6bb1d90d70ed00c6a53e973d2ae70c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 474216 zcmeFad0-Sp`aj$W2?Rul2#RnX45Im%7X8E?qvj5p+S>K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Jw!9RH?G%pHuoq4gbkzc%HPUrqQ;Sr9EK3 zaXF@?Wb-2Gdu&D-(I>-YLa+8Ou5O-QZO+d=xjCC`rmF)}D+iLzi0a08(zci7FKdlu zD#@C=sN-+sGetM(Z%gy-WHXzVH{;jM`&+m~l0y8;vf}3D7MG{r+&EC5TSori`hi&t zVpkY_W=6A9*YO@ua`9kPaA|5o#<1UM9C|v2@W0)E!^5S6wO<^P>l4t>yW9Qe3OLz^_Bi}+_YdxnKUjO_ZE|h@`s??6 z{NZQL{I`EpdRn_jU)bhv&$0F(y8qO<|ISay{nj3q%Y^1nL)rWloZO;t8}HC3=IEfNS^ud;d;4SZnWTL)iSSeT#SheR{vO$FAqUxINd# z`)%+3e|x@s32RTbj@tU~|1Q1XzF$(;-?Y75_rDD@V83Yl`)Fx~cK;m*i4tT z{O5nzyZ`X2+;8on5xY}bTQ`G#%DexD_sIR$zUDORDXstfzXF)L&>5tk!H-?2t&G#@ z`_bp3BX9R#tM^~~F}dHLuU%XFueg`i&+ebl`zQ4NyY1kh5B>PxpKhkTZ}%skmiZ^2 zmgf&hlb#QIu8ngi?scC(@L9Qk;Ine$;dEendUpP7oRe|0dw+7T+@IVl_ivKh(tqtf z13Vlz6U-j7P4C~N_uplI&>IHqMr|Ld&mZ*QcK>b|AfEGKhdtNeV*Q*e@c@4-af&|cPTxzzuSH8wXBpuq@9?P`)|5jt{;!)x%l7q okDW`xZ{8N+8}5Fa+<(e%@MZds|NJu|_kXY=i2tB>gLj$yf9*|<8UO$Q From 9a9c35649be6e16fd7db5fba01a371d42dbac661 Mon Sep 17 00:00:00 2001 From: satyakoneru Date: Wed, 28 Aug 2019 14:25:39 +0000 Subject: [PATCH 08/44] GRPH-46-Quit_command_cliwallet --- libraries/wallet/include/graphene/wallet/wallet.hpp | 1 + libraries/wallet/wallet.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index d6082564..d34b50b3 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -2154,4 +2154,5 @@ FC_API( graphene::wallet::wallet_api, (get_matched_bets_for_bettor) (get_all_matched_bets_for_bettor) (buy_ticket) + (quit) ) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 27eac237..50af7798 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -1082,6 +1082,14 @@ public: return true; } + + void quit() + { + ilog( "Quitting Cli Wallet ..." ); + + throw fc::canceled_exception(); + } + void save_wallet_file(string wallet_filename = "") { // From e98927541414d63ca6a94539985370a8ed1ec895 Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Tue, 3 Dec 2019 19:44:16 +0530 Subject: [PATCH 09/44] removed multiple function definition --- libraries/wallet/wallet.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 50af7798..f64e5beb 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -1083,13 +1083,6 @@ public: return true; } - void quit() - { - ilog( "Quitting Cli Wallet ..." ); - - throw fc::canceled_exception(); - } - void save_wallet_file(string wallet_filename = "") { // From 2dfaa866ca2436ecf42ea772a01015b9aa25647d Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Thu, 5 Dec 2019 18:53:38 +0530 Subject: [PATCH 10/44] Fixed chainparameter update proposal issue --- libraries/chain/db_block.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/db_block.cpp b/libraries/chain/db_block.cpp index 5174e018..dcedcd70 100644 --- a/libraries/chain/db_block.cpp +++ b/libraries/chain/db_block.cpp @@ -336,8 +336,6 @@ processed_transaction database::validate_transaction( const signed_transaction& processed_transaction database::push_proposal(const proposal_object& proposal) { try { - FC_ASSERT( _undo_db.size() < _undo_db.max_size(), "Undo database is full!" ); - transaction_evaluation_state eval_state(this); eval_state._is_proposed_trx = true; @@ -347,6 +345,8 @@ processed_transaction database::push_proposal(const proposal_object& proposal) size_t old_applied_ops_size = _applied_ops.size(); try { + if( _undo_db.size() >= _undo_db.max_size() ) + _undo_db.set_max_size( _undo_db.size() + 1 ); auto session = _undo_db.start_undo_session(true); for( auto& op : proposal.proposed_transaction.operations ) eval_state.operation_results.emplace_back(apply_operation(eval_state, op)); From 38bb9226ec1fabc4939108f76809c84de999c3e2 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Thu, 5 Dec 2019 13:46:13 -0400 Subject: [PATCH 11/44] Move GPOS withdraw logic to have single transaction(also single fee) and update API --- libraries/app/database_api.cpp | 21 +++++ .../app/include/graphene/app/database_api.hpp | 6 +- .../chain/protocol/chain_parameters.hpp | 2 +- .../graphene/chain/protocol/vesting.hpp | 3 +- libraries/chain/vesting_balance_evaluator.cpp | 89 +++++++++++++++---- libraries/wallet/wallet.cpp | 51 +++-------- tests/tests/gpos_tests.cpp | 65 ++++++++++++++ 7 files changed, 176 insertions(+), 61 deletions(-) diff --git a/libraries/app/database_api.cpp b/libraries/app/database_api.cpp index 3987f192..df6458f3 100644 --- a/libraries/app/database_api.cpp +++ b/libraries/app/database_api.cpp @@ -2278,7 +2278,28 @@ graphene::app::gpos_info database_api_impl::get_gpos_info(const account_id_type } #endif + vector account_vbos; + const time_point_sec now = _db.head_block_time(); + auto vesting_range = _db.get_index_type().indices().get().equal_range(account); + std::for_each(vesting_range.first, vesting_range.second, + [&account_vbos, now](const vesting_balance_object& balance) { + if(balance.balance.amount > 0 && balance.balance_type == vesting_balance_type::gpos + && balance.balance.asset_id == asset_id_type()) + account_vbos.emplace_back(balance); + }); + + share_type allowed_withdraw_amount = 0, account_vested_balance = 0; + + for (const vesting_balance_object& vesting_balance_obj : account_vbos) + { + account_vested_balance += vesting_balance_obj.balance.amount; + if(vesting_balance_obj.is_withdraw_allowed(_db.head_block_time(), vesting_balance_obj.balance.amount)) + allowed_withdraw_amount += vesting_balance_obj.balance.amount; + } + result.total_amount = total_amount; + result.allowed_withdraw_amount = allowed_withdraw_amount; + result.account_vested_balance = account_vested_balance; return result; } diff --git a/libraries/app/include/graphene/app/database_api.hpp b/libraries/app/include/graphene/app/database_api.hpp index 378a4aea..dc8aba52 100644 --- a/libraries/app/include/graphene/app/database_api.hpp +++ b/libraries/app/include/graphene/app/database_api.hpp @@ -119,7 +119,9 @@ struct gpos_info { asset award; share_type total_amount; uint32_t current_subperiod; - fc::time_point_sec last_voted_time; + fc::time_point_sec last_voted_time; + share_type allowed_withdraw_amount; + share_type account_vested_balance; }; /** @@ -722,7 +724,7 @@ FC_REFLECT( graphene::app::order_book, (base)(quote)(bids)(asks) ); FC_REFLECT( graphene::app::market_ticker, (base)(quote)(latest)(lowest_ask)(highest_bid)(percent_change)(base_volume)(quote_volume) ); FC_REFLECT( graphene::app::market_volume, (base)(quote)(base_volume)(quote_volume) ); FC_REFLECT( graphene::app::market_trade, (date)(price)(amount)(value) ); -FC_REFLECT( graphene::app::gpos_info, (vesting_factor)(award)(total_amount)(current_subperiod)(last_voted_time) ); +FC_REFLECT( graphene::app::gpos_info, (vesting_factor)(award)(total_amount)(current_subperiod)(last_voted_time)(allowed_withdraw_amount)(account_vested_balance) ); FC_API(graphene::app::database_api, diff --git a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp index 091da0c9..3f2c5a22 100644 --- a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp +++ b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp @@ -47,7 +47,7 @@ namespace graphene { namespace chain { /* gpos parameters */ optional < uint32_t > gpos_period = GPOS_PERIOD; optional < uint32_t > gpos_subperiod = GPOS_SUBPERIOD; - optional < uint32_t > gpos_period_start; + optional < uint32_t > gpos_period_start = HARDFORK_GPOS_TIME.sec_since_epoch(); optional < uint32_t > gpos_vesting_lockin_period = GPOS_VESTING_LOCKIN_PERIOD; }; diff --git a/libraries/chain/include/graphene/chain/protocol/vesting.hpp b/libraries/chain/include/graphene/chain/protocol/vesting.hpp index 1d83b90f..7c53b378 100644 --- a/libraries/chain/include/graphene/chain/protocol/vesting.hpp +++ b/libraries/chain/include/graphene/chain/protocol/vesting.hpp @@ -112,6 +112,7 @@ namespace graphene { namespace chain { vesting_balance_id_type vesting_balance; account_id_type owner; ///< Must be vesting_balance.owner asset amount; + vesting_balance_type balance_type; account_id_type fee_payer()const { return owner; } void validate()const @@ -127,7 +128,7 @@ FC_REFLECT( graphene::chain::vesting_balance_create_operation::fee_parameters_ty FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::vesting_balance_create_operation, (fee)(creator)(owner)(amount)(policy)(balance_type) ) -FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation, (fee)(vesting_balance)(owner)(amount) ) +FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation, (fee)(vesting_balance)(owner)(amount)(balance_type) ) FC_REFLECT(graphene::chain::linear_vesting_policy_initializer, (begin_timestamp)(vesting_cliff_seconds)(vesting_duration_seconds) ) FC_REFLECT(graphene::chain::cdd_vesting_policy_initializer, (start_claim)(vesting_seconds) ) diff --git a/libraries/chain/vesting_balance_evaluator.cpp b/libraries/chain/vesting_balance_evaluator.cpp index ec974600..7d78b54d 100644 --- a/libraries/chain/vesting_balance_evaluator.cpp +++ b/libraries/chain/vesting_balance_evaluator.cpp @@ -143,11 +143,33 @@ void_result vesting_balance_withdraw_evaluator::do_evaluate( const vesting_balan const database& d = db(); const time_point_sec now = d.head_block_time(); - const vesting_balance_object& vbo = op.vesting_balance( d ); - FC_ASSERT( op.owner == vbo.owner, "", ("op.owner", op.owner)("vbo.owner", vbo.owner) ); - FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "Account has either insufficient ${balance_type} Vested Balance or lock-in period is not matured", - ("balance_type", get_vesting_balance_type(vbo.balance_type))("now", now)("op", op)("vbo", vbo) ); - assert( op.amount <= vbo.balance ); // is_withdraw_allowed should fail before this check is reached + if(op.balance_type == vesting_balance_type::gpos) + { + const account_id_type account_id = op.owner; + vector vbos; + auto vesting_range = d.get_index_type().indices().get().equal_range(account_id); + std::for_each(vesting_range.first, vesting_range.second, + [&vbos, now](const vesting_balance_object& balance) { + if(balance.balance.amount > 0 && balance.balance_type == vesting_balance_type::gpos + && balance.is_withdraw_allowed(now, balance.balance.amount) && balance.balance.asset_id == asset_id_type()) + vbos.emplace_back(balance); + }); + + asset total_amount; + for (const vesting_balance_object& vesting_balance_obj : vbos) + { + total_amount += vesting_balance_obj.balance.amount; + } + FC_ASSERT( op.amount <= total_amount, "Account has either insufficient GPOS Vested Balance or lock-in period is not matured"); + } + else + { + const vesting_balance_object& vbo = op.vesting_balance( d ); + FC_ASSERT( op.owner == vbo.owner, "", ("op.owner", op.owner)("vbo.owner", vbo.owner) ); + FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "Account has either insufficient ${balance_type} Vested Balance to withdraw", + ("balance_type", get_vesting_balance_type(vbo.balance_type))("now", now)("op", op)("vbo", vbo) ); + assert( op.amount <= vbo.balance ); // is_withdraw_allowed should fail before this check is reached + } /* const account_object& owner_account = op.owner( d ); */ // TODO: Check asset authorizations and withdrawals @@ -159,21 +181,54 @@ void_result vesting_balance_withdraw_evaluator::do_apply( const vesting_balance_ database& d = db(); const time_point_sec now = d.head_block_time(); - - const vesting_balance_object& vbo = op.vesting_balance( d ); - - // Allow zero balance objects to stick around, (1) to comply - // with the chain's "objects live forever" design principle, (2) - // if it's cashback or worker, it'll be filled up again. - - d.modify( vbo, [&]( vesting_balance_object& vbo ) + //Handling all GPOS withdrawls separately from normal and SONs(future extension). + // One request/transaction would be sufficient to withdraw from multiple vesting balance ids + if(op.balance_type == vesting_balance_type::gpos) { - vbo.withdraw( now, op.amount ); - } ); + const account_id_type account_id = op.owner; + vector ids; + auto vesting_range = d.get_index_type().indices().get().equal_range(account_id); + std::for_each(vesting_range.first, vesting_range.second, + [&ids, now](const vesting_balance_object& balance) { + if(balance.balance.amount > 0 && balance.balance_type == vesting_balance_type::gpos + && balance.balance.asset_id == asset_id_type()) + ids.emplace_back(balance.id); + }); - d.adjust_balance( op.owner, op.amount ); + asset total_withdraw_amount = op.amount; + for (const vesting_balance_id_type& id : ids) + { + const vesting_balance_object& vbo = id( d ); + if(total_withdraw_amount.amount > vbo.balance.amount) + { + total_withdraw_amount.amount -= vbo.balance.amount; + d.modify( vbo, [&]( vesting_balance_object& vbo ) {vbo.withdraw( now, vbo.balance );} ); + d.adjust_balance( op.owner, vbo.balance ); + } + else + { + d.modify( vbo, [&]( vesting_balance_object& vbo ) {vbo.withdraw( now, total_withdraw_amount );} ); + d.adjust_balance( op.owner, total_withdraw_amount); + break; + } + } + } + else + { + const vesting_balance_object& vbo = op.vesting_balance( d ); + + // Allow zero balance objects to stick around, (1) to comply + // with the chain's "objects live forever" design principle, (2) + // if it's cashback or worker, it'll be filled up again. + + d.modify( vbo, [&]( vesting_balance_object& vbo ) + { + vbo.withdraw( now, op.amount ); + } ); + + d.adjust_balance( op.owner, op.amount ); + } - // TODO: Check asset authorizations and withdrawals return void_result(); } FC_CAPTURE_AND_RETHROW( (op) ) } diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index bdb756c2..ae64ff04 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2133,47 +2133,18 @@ public: if(!vbos.size()) vbos.emplace_back( get_object(*vbid) ); + const vesting_balance_object& vbo = vbos.front(); + + vesting_balance_withdraw_operation vesting_balance_withdraw_op; + + vesting_balance_withdraw_op.vesting_balance = vbo.id; + vesting_balance_withdraw_op.owner = vbo.owner; + vesting_balance_withdraw_op.amount = asset_obj.amount_from_string(amount); + vesting_balance_withdraw_op.balance_type = vesting_balance_type::gpos; + signed_transaction tx; - asset withdraw_amount = asset_obj.amount_from_string(amount); - bool onetime_fee_paid = false; - - for(const vesting_balance_object& vbo: vbos ) - { - if((vbo.balance_type == vesting_balance_type::gpos) && vbo.balance.amount > 0) - { - fc::optional vest_id = vbo.id; - vesting_balance_withdraw_operation vesting_balance_withdraw_op; - - // Since there are multiple vesting objects, below logic with vesting_balance_evaluator.cpp changes will - // deduct fee from single object and set withdrawl fee to 0 for rest of objects based on requested amount. - if(onetime_fee_paid) - vesting_balance_withdraw_op.fee = asset( 0, asset_id_type() ); - else - vesting_balance_withdraw_op.fee = _remote_db->get_global_properties().parameters.current_fees->calculate_fee(vesting_balance_withdraw_op); - - vesting_balance_withdraw_op.vesting_balance = *vest_id; - vesting_balance_withdraw_op.owner = vbo.owner; - if(withdraw_amount.amount > vbo.balance.amount) - { - vesting_balance_withdraw_op.amount = vbo.balance.amount; - withdraw_amount.amount -= vbo.balance.amount; - } - else - { - vesting_balance_withdraw_op.amount = withdraw_amount.amount; - tx.operations.push_back( vesting_balance_withdraw_op ); - withdraw_amount.amount -= vbo.balance.amount; - break; - } - - tx.operations.push_back( vesting_balance_withdraw_op ); - onetime_fee_paid = true; - } - } - - if( withdraw_amount.amount > 0) - FC_THROW("Account has NO or Insufficient balance to withdraw"); - + tx.operations.push_back( vesting_balance_withdraw_op ); + set_operation_fees( tx, _remote_db->get_global_properties().parameters.current_fees ); tx.validate(); return sign_transaction( tx, broadcast ); diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 196fe7ee..5deaddd4 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -70,6 +71,23 @@ struct gpos_fixture: database_fixture return db.get(ptx.operation_results[0].get()); } + void withdraw_gpos_vesting(const vesting_balance_id_type v_bid, const account_id_type owner, const asset amount, + const vesting_balance_type type, const fc::ecc::private_key& key) + { + vesting_balance_withdraw_operation op; + op.vesting_balance = v_bid; + op.owner = owner; + op.amount = amount; + op.balance_type = type; + + trx.operations.push_back(op); + set_expiration(db, trx); + trx.validate(); + sign(trx, key); + PUSH_TX(db, trx); + trx.clear(); + } + void update_payout_interval(std::string asset_name, fc::time_point start, uint32_t interval) { auto dividend_holder_asset_object = get_asset(asset_name); @@ -90,10 +108,12 @@ struct gpos_fixture: database_fixture p.parameters.extensions.value.gpos_period = vesting_period; p.parameters.extensions.value.gpos_subperiod = vesting_subperiod; p.parameters.extensions.value.gpos_period_start = period_start.sec_since_epoch(); + p.parameters.extensions.value.gpos_vesting_lockin_period = vesting_subperiod; }); BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period(), vesting_period); BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_subperiod(), vesting_subperiod); BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period_start(), period_start.sec_since_epoch()); + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_vesting_lockin_period(), vesting_subperiod); } void update_maintenance_interval(uint32_t new_interval) @@ -919,6 +939,51 @@ BOOST_AUTO_TEST_CASE( account_multiple_vesting ) throw; } } + +BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) +{ + try { + // advance to HF + generate_blocks(HARDFORK_GPOS_TIME); + generate_block(); + set_expiration(db, trx); + + // update default gpos global parameters to 4 days + auto now = db.head_block_time(); + update_gpos_global(345600, 86400, now); + + ACTORS((alice)(bob)); + + const auto& core = asset_id_type()(db); + + + transfer( committee_account, alice_id, core.amount( 500 ) ); + transfer( committee_account, bob_id, core.amount( 99 ) ); + + // add some vesting to Alice, Bob + vesting_balance_object vbo; + create_vesting(alice_id, core.amount(150), vesting_balance_type::gpos); + create_vesting(bob_id, core.amount(99), vesting_balance_type::gpos); + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + + generate_block(); + + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); + BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 350); + withdraw_gpos_vesting(vbo.id, alice_id, core.amount(50), vesting_balance_type::gpos, alice_private_key); + withdraw_gpos_vesting(vbo.id, bob_id, core.amount(99), vesting_balance_type::gpos, bob_private_key); + generate_block(); + // verify charles balance + BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 400); + BOOST_CHECK_EQUAL(get_balance(bob_id(db), core), 99); + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} + /* BOOST_AUTO_TEST_CASE( competing_proposals ) { From d5662ada04ff09e67f53e30b3fff3177a09f0d34 Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Fri, 6 Dec 2019 11:07:38 +0530 Subject: [PATCH 12/44] Added log for authorization failure of proposal operations --- libraries/chain/proposal_object.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/chain/proposal_object.cpp b/libraries/chain/proposal_object.cpp index 1d5a8706..2186b0b6 100644 --- a/libraries/chain/proposal_object.cpp +++ b/libraries/chain/proposal_object.cpp @@ -43,6 +43,7 @@ bool proposal_object::is_authorized_to_execute(database& db) const } catch ( const fc::exception& e ) { + elog( "caught exception ${e} while checking authorization of proposal operations",("e", e.to_detail_string()) ); return false; } return true; From 067fcd13f78d86979050038a144c55e187f61ed9 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Fri, 6 Dec 2019 11:26:49 -0400 Subject: [PATCH 13/44] Votes consideration on GPOS activation --- libraries/chain/account_evaluator.cpp | 2 - libraries/chain/db_maint.cpp | 12 +++- tests/tests/gpos_tests.cpp | 87 +++++++++++++++++++++++++++ 3 files changed, 98 insertions(+), 3 deletions(-) diff --git a/libraries/chain/account_evaluator.cpp b/libraries/chain/account_evaluator.cpp index 0d389d7c..ad6ac5dc 100644 --- a/libraries/chain/account_evaluator.cpp +++ b/libraries/chain/account_evaluator.cpp @@ -261,8 +261,6 @@ void_result account_update_evaluator::do_evaluate( const account_update_operatio FC_ASSERT( !o.extensions.value.owner_special_authority.valid() ); FC_ASSERT( !o.extensions.value.active_special_authority.valid() ); } - if( d.head_block_time() < HARDFORK_GPOS_TIME ) - FC_ASSERT( !o.extensions.value.update_last_voting_time.valid() ); try { diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index af609833..11a2b426 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -1560,11 +1560,19 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g if(d.head_block_time() >= HARDFORK_GPOS_TIME) { - if (itr == vesting_amounts.end()) + if (itr == vesting_amounts.end() && d.head_block_time() >= (HARDFORK_GPOS_TIME + props.parameters.gpos_subperiod()/2)) return; auto vesting_factor = d.calculate_vesting_factor(stake_account); voting_stake = (uint64_t)floor(voting_stake * vesting_factor); + + //Include votes(based on stake) for the period of gpos_subperiod()/2 as system has zero votes on GPOS activation + if(d.head_block_time() < (HARDFORK_GPOS_TIME + props.parameters.gpos_subperiod()/2)) + { + voting_stake += stats.total_core_in_orders.value + + (stake_account.cashback_vb.valid() ? (*stake_account.cashback_vb)(d).balance.amount.value : 0) + + d.get_balance(stake_account.get_id(), asset_id_type()).amount.value; + } } else { @@ -1644,6 +1652,8 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g p.pending_parameters->extensions.value.permitted_betting_odds_increments = p.parameters.extensions.value.permitted_betting_odds_increments; if( !p.pending_parameters->extensions.value.live_betting_delay_time.valid() ) p.pending_parameters->extensions.value.live_betting_delay_time = p.parameters.extensions.value.live_betting_delay_time; + if( !p.pending_parameters->extensions.value.gpos_period_start.valid() ) + p.pending_parameters->extensions.value.gpos_period_start = p.parameters.extensions.value.gpos_period_start; if( !p.pending_parameters->extensions.value.gpos_period.valid() ) p.pending_parameters->extensions.value.gpos_period = p.parameters.extensions.value.gpos_period; if( !p.pending_parameters->extensions.value.gpos_subperiod.valid() ) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 196fe7ee..1e6415e0 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -514,6 +514,93 @@ BOOST_AUTO_TEST_CASE( gpos_basic_dividend_distribution_to_core_asset ) } } +BOOST_AUTO_TEST_CASE( votes_on_gpos_activation ) +{ + ACTORS((alice)(bob)); + try { + const auto& core = asset_id_type()(db); + + // send some asset to alice and bob + transfer( committee_account, alice_id, core.amount( 1000 ) ); + transfer( committee_account, bob_id, core.amount( 1000 ) ); + generate_block(); + + // update default gpos + auto now = db.head_block_time(); + // 5184000 = 60x60x24x6 = 6 days + // 864000 = 60x60x24x1 = 1 days + update_gpos_global(518400, 86400, now); + + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period(), 518400); + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_subperiod(), 86400); + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period_start(), now.sec_since_epoch()); + // no votes for witness 1 + auto witness1 = witness_id_type(1)(db); + BOOST_CHECK_EQUAL(witness1.total_votes, 0); + + // no votes for witness 2 + auto witness2 = witness_id_type(2)(db); + BOOST_CHECK_EQUAL(witness2.total_votes, 0); + + // vote for witness1 and witness2 - this before GPOS period starts + vote_for(alice_id, witness1.vote_id, alice_private_key); + vote_for(bob_id, witness2.vote_id, bob_private_key); + + // go to maint + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + + // vote is the same as amount in the first subperiod since voting + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + BOOST_CHECK_EQUAL(witness1.total_votes, 1000); + BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + + // move to hardfork + generate_blocks( HARDFORK_GPOS_TIME ); + generate_block(); + + update_maintenance_interval(3600); //update maintenance interval to 1hr to evaluate sub-periods + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.maintenance_interval, 3600); + + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + BOOST_CHECK_EQUAL(witness1.total_votes, 1000); + BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + + // add some vesting to alice and don't add anything for Bob + create_vesting(alice_id, core.amount(99), vesting_balance_type::gpos); + generate_block(); + vote_for(alice_id, witness1.vote_id, alice_private_key); + generate_block(); + + advance_x_maint(1); + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + //System needs to consider votes based on both regular balance + GPOS balance for 1/2 sub-period on GPOS activation + BOOST_CHECK_EQUAL(witness1.total_votes, 1000); + BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + + advance_x_maint(2); + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + BOOST_CHECK_EQUAL(witness1.total_votes, 1000); + BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + + advance_x_maint(3); + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + //Since Alice has votes, votes should be based on GPOS balance i.e 99 + //Since Bob not voted after GPOS activation, witness2 votes should be 0 after crossing 1/2 sub-period(6 maintanence intervals in this case) + BOOST_CHECK_EQUAL(witness1.total_votes, 99); + BOOST_CHECK_EQUAL(witness2.total_votes, 0); + + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} + BOOST_AUTO_TEST_CASE( voting ) { ACTORS((alice)(bob)); From e0db30291c2d7099fa0fc951d8e32163fe2915a6 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Fri, 6 Dec 2019 16:35:59 -0400 Subject: [PATCH 14/44] bump fc version --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index bca39221..31e289c5 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit bca392213c5104773be9ffa0fbde8958835a5da2 +Subproject commit 31e289c53d3625afea87c54edb6d97c3bca4c626 From 383b8d0b02ec28d2f15d9efaadc3cbed2f2f1d66 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Sat, 7 Dec 2019 17:06:48 -0400 Subject: [PATCH 15/44] fix gpos tests --- tests/tests/gpos_tests.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 1e6415e0..390ac8f4 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -529,11 +529,11 @@ BOOST_AUTO_TEST_CASE( votes_on_gpos_activation ) auto now = db.head_block_time(); // 5184000 = 60x60x24x6 = 6 days // 864000 = 60x60x24x1 = 1 days - update_gpos_global(518400, 86400, now); + update_gpos_global(518400, 86400, HARDFORK_GPOS_TIME); BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period(), 518400); BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_subperiod(), 86400); - BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period_start(), now.sec_since_epoch()); + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.gpos_period_start(), HARDFORK_GPOS_TIME.sec_since_epoch()); // no votes for witness 1 auto witness1 = witness_id_type(1)(db); BOOST_CHECK_EQUAL(witness1.total_votes, 0); @@ -555,13 +555,13 @@ BOOST_AUTO_TEST_CASE( votes_on_gpos_activation ) BOOST_CHECK_EQUAL(witness1.total_votes, 1000); BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + update_maintenance_interval(3600); //update maintenance interval to 1hr to evaluate sub-periods + BOOST_CHECK_EQUAL(db.get_global_properties().parameters.maintenance_interval, 3600); + // move to hardfork generate_blocks( HARDFORK_GPOS_TIME ); generate_block(); - update_maintenance_interval(3600); //update maintenance interval to 1hr to evaluate sub-periods - BOOST_CHECK_EQUAL(db.get_global_properties().parameters.maintenance_interval, 3600); - witness1 = witness_id_type(1)(db); witness2 = witness_id_type(2)(db); BOOST_CHECK_EQUAL(witness1.total_votes, 1000); @@ -580,17 +580,18 @@ BOOST_AUTO_TEST_CASE( votes_on_gpos_activation ) BOOST_CHECK_EQUAL(witness1.total_votes, 1000); BOOST_CHECK_EQUAL(witness2.total_votes, 1000); - advance_x_maint(2); + advance_x_maint(6); witness1 = witness_id_type(1)(db); witness2 = witness_id_type(2)(db); BOOST_CHECK_EQUAL(witness1.total_votes, 1000); BOOST_CHECK_EQUAL(witness2.total_votes, 1000); - advance_x_maint(3); + advance_x_maint(5); + generate_block(); witness1 = witness_id_type(1)(db); witness2 = witness_id_type(2)(db); //Since Alice has votes, votes should be based on GPOS balance i.e 99 - //Since Bob not voted after GPOS activation, witness2 votes should be 0 after crossing 1/2 sub-period(6 maintanence intervals in this case) + //Since Bob not voted after GPOS activation, witness2 votes should be 0 after crossing 1/2 sub-period(12 maintanence intervals in this case) BOOST_CHECK_EQUAL(witness1.total_votes, 99); BOOST_CHECK_EQUAL(witness2.total_votes, 0); From b5249ac2b153977006e9c477347e88f8f017006b Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Sat, 7 Dec 2019 22:15:53 -0400 Subject: [PATCH 16/44] Bump fc version --- libraries/fc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/fc b/libraries/fc index bca39221..31e289c5 160000 --- a/libraries/fc +++ b/libraries/fc @@ -1 +1 @@ -Subproject commit bca392213c5104773be9ffa0fbde8958835a5da2 +Subproject commit 31e289c53d3625afea87c54edb6d97c3bca4c626 From c98c7bcb94f980a37e7c685675b7d9eeb894bde5 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Sat, 7 Dec 2019 23:41:22 -0400 Subject: [PATCH 17/44] Updated gpos/voting_tests --- tests/tests/gpos_tests.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 390ac8f4..d8c87a89 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -658,13 +658,20 @@ BOOST_AUTO_TEST_CASE( voting ) // go to maint generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); - // vote is the same as amount in the first subperiod since voting + // need to consider both gpos and regular balance for first 1/2 sub period + witness1 = witness_id_type(1)(db); + witness2 = witness_id_type(2)(db); + BOOST_CHECK_EQUAL(witness1.total_votes, 1000); + BOOST_CHECK_EQUAL(witness2.total_votes, 1000); + + advance_x_maint(6); + witness1 = witness_id_type(1)(db); witness2 = witness_id_type(2)(db); BOOST_CHECK_EQUAL(witness1.total_votes, 100); BOOST_CHECK_EQUAL(witness2.total_votes, 100); - advance_x_maint(10); + advance_x_maint(4); //Bob votes for witness2 - sub-period 2 vote_for(bob_id, witness2.vote_id, bob_private_key); From d3ecbba3d753271b41a841ea76f340d4f8d63dfb Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Wed, 11 Dec 2019 17:02:26 +0530 Subject: [PATCH 18/44] avoid directly overwriting wallet file --- libraries/wallet/wallet.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index d4d72771..88924cb8 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -1100,8 +1100,6 @@ public: if( wallet_filename == "" ) wallet_filename = _wallet_filename; - wlog( "saving wallet to file ${fn}", ("fn", wallet_filename) ); - string data = fc::json::to_pretty_string( _wallet ); try { @@ -1112,14 +1110,38 @@ public: // // http://en.wikipedia.org/wiki/Most_vexing_parse // - fc::ofstream outfile{ fc::path( wallet_filename ) }; + std::string tmp_wallet_filename = wallet_filename + ".tmp"; + fc::ofstream outfile{ fc::path( tmp_wallet_filename ) }; outfile.write( data.c_str(), data.length() ); outfile.flush(); outfile.close(); + + ilog( "saved successfully wallet to tmp file ${fn}", ("fn", tmp_wallet_filename) ); + + std::string wallet_file_content; + fc::read_file_contents(tmp_wallet_filename, wallet_file_content); + + if (wallet_file_content == data) { + dlog( "validated successfully tmp wallet file ${fn}", ("fn", tmp_wallet_filename) ); + fc::rename( tmp_wallet_filename, wallet_filename ); + dlog( "renamed successfully tmp wallet file ${fn}", ("fn", tmp_wallet_filename) ); + } + else + { + FC_THROW("tmp wallet file cannot be validated ${fn}", ("fn", tmp_wallet_filename) ); + } + + ilog( "successfully saved wallet to file ${fn}", ("fn", wallet_filename) ); + disable_umask_protection(); } catch(...) { + string ws_password = _wallet.ws_password; + _wallet.ws_password = ""; + elog("wallet file content is: ${data}", ("data", fc::json::to_pretty_string( _wallet ) ) ); + _wallet.ws_password = ws_password; + disable_umask_protection(); throw; } From b57220a180ae74853bb2d2a60b5a77cf7c942f43 Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Thu, 12 Dec 2019 14:14:31 +0530 Subject: [PATCH 19/44] Fixed withdraw vesting bug --- libraries/chain/vesting_balance_evaluator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/vesting_balance_evaluator.cpp b/libraries/chain/vesting_balance_evaluator.cpp index 7d78b54d..94e22dca 100644 --- a/libraries/chain/vesting_balance_evaluator.cpp +++ b/libraries/chain/vesting_balance_evaluator.cpp @@ -191,7 +191,7 @@ void_result vesting_balance_withdraw_evaluator::do_apply( const vesting_balance_ std::for_each(vesting_range.first, vesting_range.second, [&ids, now](const vesting_balance_object& balance) { if(balance.balance.amount > 0 && balance.balance_type == vesting_balance_type::gpos - && balance.balance.asset_id == asset_id_type()) + && balance.is_withdraw_allowed(now, balance.balance.amount) && balance.balance.asset_id == asset_id_type()) ids.emplace_back(balance.id); }); @@ -202,8 +202,8 @@ void_result vesting_balance_withdraw_evaluator::do_apply( const vesting_balance_ if(total_withdraw_amount.amount > vbo.balance.amount) { total_withdraw_amount.amount -= vbo.balance.amount; - d.modify( vbo, [&]( vesting_balance_object& vbo ) {vbo.withdraw( now, vbo.balance );} ); d.adjust_balance( op.owner, vbo.balance ); + d.modify( vbo, [&]( vesting_balance_object& vbo ) {vbo.withdraw( now, vbo.balance );} ); } else { From e7af03a987e221e87f5726d62e21dd6bd29defdf Mon Sep 17 00:00:00 2001 From: Sandip Patel Date: Fri, 13 Dec 2019 13:11:03 +0530 Subject: [PATCH 20/44] Added unit test --- tests/tests/gpos_tests.cpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 07ded744..436052e7 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -1049,6 +1049,7 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) ACTORS((alice)(bob)); + graphene::app::database_api db_api1(db); const auto& core = asset_id_type()(db); @@ -1072,6 +1073,43 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) // verify charles balance BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 400); BOOST_CHECK_EQUAL(get_balance(bob_id(db), core), 99); + + // Add more 50 and 73 vesting objects and withdraw 90 from + // total vesting balance of user + create_vesting(alice_id, core.amount(50), vesting_balance_type::gpos); + create_vesting(alice_id, core.amount(73), vesting_balance_type::gpos); + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + + generate_block(); + + vector vbos = db_api1.get_vesting_balances("alice"); + asset total_vesting; + for (const vesting_balance_object& vbo : vbos) + { + if (vbo.balance_type == vesting_balance_type::gpos && vbo.balance.asset_id == asset_id_type()) + total_vesting += vbo.balance; + } + // total vesting balance of alice + BOOST_CHECK_EQUAL(total_vesting.amount.value, core.amount(223).amount.value); + + generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); + generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); + BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 277); + withdraw_gpos_vesting(vbo.id, alice_id, core.amount(90), vesting_balance_type::gpos, alice_private_key); + generate_block(); + // verify alice balance + BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 367); + + // verify remaining vesting balance + vbos = db_api1.get_vesting_balances("alice"); + asset remaining_vesting; + for (const vesting_balance_object& vbo : vbos) + { + if (vbo.balance_type == vesting_balance_type::gpos && vbo.balance.asset_id == asset_id_type()) + remaining_vesting += vbo.balance; + } + // remaining vesting balance of alice + BOOST_CHECK_EQUAL(remaining_vesting.amount.value, core.amount(133).amount.value); } catch (fc::exception &e) { edump((e.to_detail_string())); From a4d399d6ccff4e2d3953e4069c44476a172e4dd1 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Tue, 17 Dec 2019 09:18:34 -0400 Subject: [PATCH 21/44] Update hardfork date for TESTNET, sync fc module and update logs --- .gitmodules | 2 +- libraries/chain/hardfork.d/GPOS.hf | 4 ++-- libraries/chain/proposal_object.cpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4d3518d1..0cf82577 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,5 +5,5 @@ [submodule "libraries/fc"] path = libraries/fc url = https://github.com/peerplays-network/peerplays-fc.git - branch = latest-fc + branch = beatrice ignore = dirty diff --git a/libraries/chain/hardfork.d/GPOS.hf b/libraries/chain/hardfork.d/GPOS.hf index 626cf003..5d40decd 100644 --- a/libraries/chain/hardfork.d/GPOS.hf +++ b/libraries/chain/hardfork.d/GPOS.hf @@ -1,4 +1,4 @@ -// GPOS HARDFORK Thursday, October 1, 2020 05:00:00 AM GMT +// GPOS HARDFORK Monday, Dec 23, 2019 04:00:00 AM GMT #ifndef HARDFORK_GPOS_TIME -#define HARDFORK_GPOS_TIME (fc::time_point_sec( 1601528400 )) +#define HARDFORK_GPOS_TIME (fc::time_point_sec( 1577073600 )) #endif diff --git a/libraries/chain/proposal_object.cpp b/libraries/chain/proposal_object.cpp index 2186b0b6..04c6168d 100644 --- a/libraries/chain/proposal_object.cpp +++ b/libraries/chain/proposal_object.cpp @@ -43,7 +43,9 @@ bool proposal_object::is_authorized_to_execute(database& db) const } catch ( const fc::exception& e ) { - elog( "caught exception ${e} while checking authorization of proposal operations",("e", e.to_detail_string()) ); + #ifndef NDEBUG + wlog( "caught exception ${e} while checking authorization of proposal operations",("e", e.to_detail_string()) ); + #endif return false; } return true; From 26886cc7d5511822e12b49fd4633bda3ff59208c Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Tue, 17 Dec 2019 12:13:46 -0400 Subject: [PATCH 22/44] avoid wlog as it filling up space --- libraries/chain/proposal_object.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libraries/chain/proposal_object.cpp b/libraries/chain/proposal_object.cpp index 04c6168d..1d5a8706 100644 --- a/libraries/chain/proposal_object.cpp +++ b/libraries/chain/proposal_object.cpp @@ -43,9 +43,6 @@ bool proposal_object::is_authorized_to_execute(database& db) const } catch ( const fc::exception& e ) { - #ifndef NDEBUG - wlog( "caught exception ${e} while checking authorization of proposal operations",("e", e.to_detail_string()) ); - #endif return false; } return true; From 054f06adc77489ed680c48893838d6a20a72c6cb Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Fri, 20 Dec 2019 21:55:45 -0400 Subject: [PATCH 23/44] Beatrice hot fix(sync issue fix) --- .../graphene/chain/protocol/vesting.hpp | 3 +- libraries/chain/vesting_balance_evaluator.cpp | 60 ++++++++----------- libraries/wallet/wallet.cpp | 1 - tests/tests/gpos_tests.cpp | 10 ++-- 4 files changed, 30 insertions(+), 44 deletions(-) diff --git a/libraries/chain/include/graphene/chain/protocol/vesting.hpp b/libraries/chain/include/graphene/chain/protocol/vesting.hpp index 7c53b378..4dffb253 100644 --- a/libraries/chain/include/graphene/chain/protocol/vesting.hpp +++ b/libraries/chain/include/graphene/chain/protocol/vesting.hpp @@ -112,7 +112,6 @@ namespace graphene { namespace chain { vesting_balance_id_type vesting_balance; account_id_type owner; ///< Must be vesting_balance.owner asset amount; - vesting_balance_type balance_type; account_id_type fee_payer()const { return owner; } void validate()const @@ -128,7 +127,7 @@ FC_REFLECT( graphene::chain::vesting_balance_create_operation::fee_parameters_ty FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation::fee_parameters_type, (fee) ) FC_REFLECT( graphene::chain::vesting_balance_create_operation, (fee)(creator)(owner)(amount)(policy)(balance_type) ) -FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation, (fee)(vesting_balance)(owner)(amount)(balance_type) ) +FC_REFLECT( graphene::chain::vesting_balance_withdraw_operation, (fee)(vesting_balance)(owner)(amount)) FC_REFLECT(graphene::chain::linear_vesting_policy_initializer, (begin_timestamp)(vesting_cliff_seconds)(vesting_duration_seconds) ) FC_REFLECT(graphene::chain::cdd_vesting_policy_initializer, (start_claim)(vesting_seconds) ) diff --git a/libraries/chain/vesting_balance_evaluator.cpp b/libraries/chain/vesting_balance_evaluator.cpp index 94e22dca..e81383b6 100644 --- a/libraries/chain/vesting_balance_evaluator.cpp +++ b/libraries/chain/vesting_balance_evaluator.cpp @@ -118,19 +118,8 @@ object_id_type vesting_balance_create_evaluator::do_apply( const vesting_balance operation_result vesting_balance_withdraw_evaluator::start_evaluate( transaction_evaluation_state& eval_state, const operation& op, bool apply ) { try { trx_state = &eval_state; - database& d = db(); const auto& oper = op.get(); - const time_point_sec now = d.head_block_time(); - - if(now >= HARDFORK_GPOS_TIME ) - { - if(oper.fee.amount == 0) - { - trx_state->skip_fee_schedule_check = true; - trx_state->skip_fee = true; - } - } //check_required_authorities(op); auto result = evaluate( oper ); @@ -143,7 +132,15 @@ void_result vesting_balance_withdraw_evaluator::do_evaluate( const vesting_balan const database& d = db(); const time_point_sec now = d.head_block_time(); - if(op.balance_type == vesting_balance_type::gpos) + const vesting_balance_object& vbo = op.vesting_balance( d ); + if(vbo.balance_type == vesting_balance_type::normal) + { + FC_ASSERT( op.owner == vbo.owner, "", ("op.owner", op.owner)("vbo.owner", vbo.owner) ); + FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "Account has insufficient ${balance_type} Vested Balance to withdraw", + ("balance_type", get_vesting_balance_type(vbo.balance_type))("now", now)("op", op)("vbo", vbo) ); + assert( op.amount <= vbo.balance ); // is_withdraw_allowed should fail before this check is reached + } + else if(now > HARDFORK_GPOS_TIME && vbo.balance_type == vesting_balance_type::gpos) { const account_id_type account_id = op.owner; vector vbos; @@ -162,14 +159,6 @@ void_result vesting_balance_withdraw_evaluator::do_evaluate( const vesting_balan } FC_ASSERT( op.amount <= total_amount, "Account has either insufficient GPOS Vested Balance or lock-in period is not matured"); } - else - { - const vesting_balance_object& vbo = op.vesting_balance( d ); - FC_ASSERT( op.owner == vbo.owner, "", ("op.owner", op.owner)("vbo.owner", vbo.owner) ); - FC_ASSERT( vbo.is_withdraw_allowed( now, op.amount ), "Account has either insufficient ${balance_type} Vested Balance to withdraw", - ("balance_type", get_vesting_balance_type(vbo.balance_type))("now", now)("op", op)("vbo", vbo) ); - assert( op.amount <= vbo.balance ); // is_withdraw_allowed should fail before this check is reached - } /* const account_object& owner_account = op.owner( d ); */ // TODO: Check asset authorizations and withdrawals @@ -183,7 +172,21 @@ void_result vesting_balance_withdraw_evaluator::do_apply( const vesting_balance_ const time_point_sec now = d.head_block_time(); //Handling all GPOS withdrawls separately from normal and SONs(future extension). // One request/transaction would be sufficient to withdraw from multiple vesting balance ids - if(op.balance_type == vesting_balance_type::gpos) + const vesting_balance_object& vbo = op.vesting_balance( d ); + if(vbo.balance_type == vesting_balance_type::normal) + { + // Allow zero balance objects to stick around, (1) to comply + // with the chain's "objects live forever" design principle, (2) + // if it's cashback or worker, it'll be filled up again. + + d.modify( vbo, [&]( vesting_balance_object& vbo ) + { + vbo.withdraw( now, op.amount ); + } ); + + d.adjust_balance( op.owner, op.amount ); + } + else if(now > HARDFORK_GPOS_TIME && vbo.balance_type == vesting_balance_type::gpos) { const account_id_type account_id = op.owner; vector ids; @@ -213,21 +216,6 @@ void_result vesting_balance_withdraw_evaluator::do_apply( const vesting_balance_ } } } - else - { - const vesting_balance_object& vbo = op.vesting_balance( d ); - - // Allow zero balance objects to stick around, (1) to comply - // with the chain's "objects live forever" design principle, (2) - // if it's cashback or worker, it'll be filled up again. - - d.modify( vbo, [&]( vesting_balance_object& vbo ) - { - vbo.withdraw( now, op.amount ); - } ); - - d.adjust_balance( op.owner, op.amount ); - } return void_result(); } FC_CAPTURE_AND_RETHROW( (op) ) } diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index d4d72771..ab6f5bb7 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2141,7 +2141,6 @@ public: vesting_balance_withdraw_op.vesting_balance = vbo.id; vesting_balance_withdraw_op.owner = vbo.owner; vesting_balance_withdraw_op.amount = asset_obj.amount_from_string(amount); - vesting_balance_withdraw_op.balance_type = vesting_balance_type::gpos; signed_transaction tx; tx.operations.push_back( vesting_balance_withdraw_op ); diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index 436052e7..e9543d60 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -72,13 +72,13 @@ struct gpos_fixture: database_fixture } void withdraw_gpos_vesting(const vesting_balance_id_type v_bid, const account_id_type owner, const asset amount, - const vesting_balance_type type, const fc::ecc::private_key& key) + /*const vesting_balance_type type, */const fc::ecc::private_key& key) { vesting_balance_withdraw_operation op; op.vesting_balance = v_bid; op.owner = owner; op.amount = amount; - op.balance_type = type; + //op.balance_type = type; trx.operations.push_back(op); set_expiration(db, trx); @@ -1067,8 +1067,8 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 350); - withdraw_gpos_vesting(vbo.id, alice_id, core.amount(50), vesting_balance_type::gpos, alice_private_key); - withdraw_gpos_vesting(vbo.id, bob_id, core.amount(99), vesting_balance_type::gpos, bob_private_key); + withdraw_gpos_vesting(vbo.id, alice_id, core.amount(50), /*vesting_balance_type::gpos, */alice_private_key); + withdraw_gpos_vesting(vbo.id, bob_id, core.amount(99), /*vesting_balance_type::gpos, */bob_private_key); generate_block(); // verify charles balance BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 400); @@ -1095,7 +1095,7 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 277); - withdraw_gpos_vesting(vbo.id, alice_id, core.amount(90), vesting_balance_type::gpos, alice_private_key); + withdraw_gpos_vesting(vbo.id, alice_id, core.amount(90), /*vesting_balance_type::gpos,*/ alice_private_key); generate_block(); // verify alice balance BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 367); From b6fc20716092cf26cf474132b0bd499d2bb117d8 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Fri, 20 Dec 2019 22:16:09 -0400 Subject: [PATCH 24/44] gpos tests fix --- tests/tests/gpos_tests.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/tests/gpos_tests.cpp b/tests/tests/gpos_tests.cpp index e9543d60..aa9969ee 100644 --- a/tests/tests/gpos_tests.cpp +++ b/tests/tests/gpos_tests.cpp @@ -1057,9 +1057,9 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) transfer( committee_account, bob_id, core.amount( 99 ) ); // add some vesting to Alice, Bob - vesting_balance_object vbo; - create_vesting(alice_id, core.amount(150), vesting_balance_type::gpos); - create_vesting(bob_id, core.amount(99), vesting_balance_type::gpos); + vesting_balance_object vbo1, vbo2; + vbo1 = create_vesting(alice_id, core.amount(150), vesting_balance_type::gpos); + vbo2 = create_vesting(bob_id, core.amount(99), vesting_balance_type::gpos); generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_block(); @@ -1067,8 +1067,8 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 350); - withdraw_gpos_vesting(vbo.id, alice_id, core.amount(50), /*vesting_balance_type::gpos, */alice_private_key); - withdraw_gpos_vesting(vbo.id, bob_id, core.amount(99), /*vesting_balance_type::gpos, */bob_private_key); + withdraw_gpos_vesting(vbo1.id, alice_id, core.amount(50), /*vesting_balance_type::gpos, */alice_private_key); + withdraw_gpos_vesting(vbo2.id, bob_id, core.amount(99), /*vesting_balance_type::gpos, */bob_private_key); generate_block(); // verify charles balance BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 400); @@ -1076,8 +1076,8 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) // Add more 50 and 73 vesting objects and withdraw 90 from // total vesting balance of user - create_vesting(alice_id, core.amount(50), vesting_balance_type::gpos); - create_vesting(alice_id, core.amount(73), vesting_balance_type::gpos); + vbo1 = create_vesting(alice_id, core.amount(50), vesting_balance_type::gpos); + vbo2 = create_vesting(alice_id, core.amount(73), vesting_balance_type::gpos); generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_block(); @@ -1095,7 +1095,7 @@ BOOST_AUTO_TEST_CASE( Withdraw_gpos_vesting_balance ) generate_blocks(db.get_dynamic_global_properties().next_maintenance_time); generate_blocks(db.get_global_properties().parameters.gpos_vesting_lockin_period()); BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 277); - withdraw_gpos_vesting(vbo.id, alice_id, core.amount(90), /*vesting_balance_type::gpos,*/ alice_private_key); + withdraw_gpos_vesting(vbo1.id, alice_id, core.amount(90), /*vesting_balance_type::gpos,*/ alice_private_key); generate_block(); // verify alice balance BOOST_CHECK_EQUAL(get_balance(alice_id(db), core), 367); From d52f9fbb59206cbf3c42301c401958972783e706 Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Tue, 24 Dec 2019 10:46:27 -0400 Subject: [PATCH 25/44] Set hardfork date to Jan5th on TESTNET --- libraries/chain/hardfork.d/GPOS.hf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/chain/hardfork.d/GPOS.hf b/libraries/chain/hardfork.d/GPOS.hf index 5d40decd..52e95a72 100644 --- a/libraries/chain/hardfork.d/GPOS.hf +++ b/libraries/chain/hardfork.d/GPOS.hf @@ -1,4 +1,4 @@ -// GPOS HARDFORK Monday, Dec 23, 2019 04:00:00 AM GMT +// GPOS HARDFORK Monday, 6 January 2020 01:00:00 GMT #ifndef HARDFORK_GPOS_TIME -#define HARDFORK_GPOS_TIME (fc::time_point_sec( 1577073600 )) +#define HARDFORK_GPOS_TIME (fc::time_point_sec( 1578272400 )) #endif From e1244eb7ab23f648b08a6034136e6ea27731efcb Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Wed, 24 May 2017 19:16:09 +0200 Subject: [PATCH 26/44] Implemented "plugins" config variable --- libraries/app/application.cpp | 39 +++++++++++++++---- .../app/include/graphene/app/application.hpp | 5 ++- .../delayed_node/delayed_node_plugin.cpp | 3 +- programs/witness_node/main.cpp | 6 ++- 4 files changed, 41 insertions(+), 12 deletions(-) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index bcbe6659..5e5c7b8c 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -891,7 +891,8 @@ namespace detail { std::shared_ptr _websocket_server; std::shared_ptr _websocket_tls_server; - std::map> _plugins; + std::map> _active_plugins; + std::map> _available_plugins; bool _is_finished_syncing = false; }; @@ -933,6 +934,7 @@ void application::set_program_options(boost::program_options::options_descriptio ("enable-standby-votes-tracking", bpo::value()->implicit_value(true), "Whether to enable tracking of votes of standby witnesses and committee members. " "Set it to true to provide accurate data to API clients, set to false for slightly better performance.") + ("plugins", bpo::value(), "Space-separated list of plugins to activate") ; command_line_options.add(configuration_file_options); command_line_options.add_options() @@ -978,6 +980,22 @@ void application::initialize(const fc::path& data_dir, const boost::program_opti std::exit(EXIT_SUCCESS); } + + std::vector wanted; + if( options.count("plugins") ) + { + boost::split(wanted, options.at("plugins").as(), [](char c){return c == ' ';}); + } + else + { + wanted.push_back("witness"); + wanted.push_back("account_history"); + wanted.push_back("market_history"); + } + for (auto it = wanted.cbegin(); it != wanted.cend(); it++) + { + if (!it->empty()) enable_plugin(*it); + } } void application::startup() @@ -995,7 +1013,7 @@ void application::startup() std::shared_ptr application::get_plugin(const string& name) const { - return my->_plugins[name]; + return my->_active_plugins[name]; } net::node_ptr application::p2p_node() @@ -1028,14 +1046,21 @@ bool application::is_finished_syncing() const return my->_is_finished_syncing; } -void graphene::app::application::add_plugin(const string& name, std::shared_ptr p) +void graphene::app::application::enable_plugin(const string& name) { - my->_plugins[name] = p; + FC_ASSERT(my->_available_plugins[name], "Unknown plugin '" + name + "'"); + my->_active_plugins[name] = my->_available_plugins[name]; + my->_active_plugins[name]->plugin_set_app(this); +} + +void graphene::app::application::add_available_plugin(std::shared_ptr p) +{ + my->_available_plugins[p->plugin_name()] = p; } void application::shutdown_plugins() { - for( auto& entry : my->_plugins ) + for( auto& entry : my->_active_plugins ) entry.second->plugin_shutdown(); return; } @@ -1049,14 +1074,14 @@ void application::shutdown() void application::initialize_plugins( const boost::program_options::variables_map& options ) { - for( auto& entry : my->_plugins ) + for( auto& entry : my->_active_plugins ) entry.second->plugin_initialize( options ); return; } void application::startup_plugins() { - for( auto& entry : my->_plugins ) + for( auto& entry : my->_active_plugins ) entry.second->plugin_startup(); return; } diff --git a/libraries/app/include/graphene/app/application.hpp b/libraries/app/include/graphene/app/application.hpp index 26ae78ef..758069a0 100644 --- a/libraries/app/include/graphene/app/application.hpp +++ b/libraries/app/include/graphene/app/application.hpp @@ -63,7 +63,7 @@ namespace graphene { namespace app { if( !plugin_cfg_options.options().empty() ) _cfg_options.add(plugin_cfg_options); - add_plugin( plug->plugin_name(), plug ); + add_available_plugin( plug ); return plug; } std::shared_ptr get_plugin( const string& name )const; @@ -89,7 +89,8 @@ namespace graphene { namespace app { boost::signals2::signal syncing_finished; private: - void add_plugin( const string& name, std::shared_ptr p ); + void enable_plugin( const string& name ); + void add_available_plugin( std::shared_ptr p ); std::shared_ptr my; boost::program_options::options_description _cli_options; diff --git a/libraries/plugins/delayed_node/delayed_node_plugin.cpp b/libraries/plugins/delayed_node/delayed_node_plugin.cpp index f9db2ccd..d49129b0 100644 --- a/libraries/plugins/delayed_node/delayed_node_plugin.cpp +++ b/libraries/plugins/delayed_node/delayed_node_plugin.cpp @@ -58,7 +58,7 @@ delayed_node_plugin::~delayed_node_plugin() void delayed_node_plugin::plugin_set_program_options(bpo::options_description& cli, bpo::options_description& cfg) { cli.add_options() - ("trusted-node", boost::program_options::value()->required(), "RPC endpoint of a trusted validating node (required)") + ("trusted-node", boost::program_options::value(), "RPC endpoint of a trusted validating node (required)") ; cfg.add(cli); } @@ -74,6 +74,7 @@ void delayed_node_plugin::connect() void delayed_node_plugin::plugin_initialize(const boost::program_options::variables_map& options) { + FC_ASSERT(options.count("trusted-node") > 0); my->remote_endpoint = "ws://" + options.at("trusted-node").as(); } diff --git a/programs/witness_node/main.cpp b/programs/witness_node/main.cpp index 8c613067..ec08feb6 100644 --- a/programs/witness_node/main.cpp +++ b/programs/witness_node/main.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -71,6 +72,7 @@ int main(int argc, char** argv) { bpo::variables_map options; auto witness_plug = node->register_plugin(); + auto debug_witness_plug = node->register_plugin(); auto history_plug = node->register_plugin(); auto market_history_plug = node->register_plugin(); //auto generate_genesis_plug = node->register_plugin(); @@ -142,7 +144,7 @@ int main(int argc, char** argv) { exit_promise->set_value(signal); }, SIGTERM); - ilog("Started witness node on a chain with ${h} blocks.", ("h", node->chain_database()->head_block_num())); + ilog("Started BitShares node on a chain with ${h} blocks.", ("h", node->chain_database()->head_block_num())); ilog("Chain ID is ${id}", ("id", node->chain_database()->get_chain_id()) ); int signal = exit_promise->wait(); @@ -163,4 +165,4 @@ int main(int argc, char** argv) { delete node; return 1; } -} \ No newline at end of file +} From f3d961bb700391ea8b8cfe3ca43255da3f0c819f Mon Sep 17 00:00:00 2001 From: Alfredo Date: Fri, 10 Nov 2017 16:18:31 -0300 Subject: [PATCH 27/44] allow plugin to have descriptions --- libraries/app/include/graphene/app/application.hpp | 3 ++- libraries/app/include/graphene/app/plugin.hpp | 2 ++ libraries/app/plugin.cpp | 5 +++++ .../plugins/snapshot/include/graphene/snapshot/snapshot.hpp | 1 + libraries/plugins/snapshot/snapshot.cpp | 5 +++++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/libraries/app/include/graphene/app/application.hpp b/libraries/app/include/graphene/app/application.hpp index 758069a0..6f55c390 100644 --- a/libraries/app/include/graphene/app/application.hpp +++ b/libraries/app/include/graphene/app/application.hpp @@ -56,7 +56,8 @@ namespace graphene { namespace app { auto plug = std::make_shared(); plug->plugin_set_app(this); - boost::program_options::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options; + boost::program_options::options_description plugin_cli_options(plug->plugin_name() + " plugin. " + plug->plugin_description() + "\nOptions"), plugin_cfg_options; + //boost::program_options::options_description plugin_cli_options("Options for plugin " + plug->plugin_name()), plugin_cfg_options; plug->plugin_set_program_options(plugin_cli_options, plugin_cfg_options); if( !plugin_cli_options.options().empty() ) _cli_options.add(plugin_cli_options); diff --git a/libraries/app/include/graphene/app/plugin.hpp b/libraries/app/include/graphene/app/plugin.hpp index c242130b..45336f67 100644 --- a/libraries/app/include/graphene/app/plugin.hpp +++ b/libraries/app/include/graphene/app/plugin.hpp @@ -35,6 +35,7 @@ class abstract_plugin public: virtual ~abstract_plugin(){} virtual std::string plugin_name()const = 0; + virtual std::string plugin_description()const = 0; /** * @brief Perform early startup routines and register plugin indexes, callbacks, etc. @@ -100,6 +101,7 @@ class plugin : public abstract_plugin virtual ~plugin() override; virtual std::string plugin_name()const override; + virtual std::string plugin_description()const override; virtual void plugin_initialize( const boost::program_options::variables_map& options ) override; virtual void plugin_startup() override; virtual void plugin_shutdown() override; diff --git a/libraries/app/plugin.cpp b/libraries/app/plugin.cpp index 8568d371..cae488a6 100644 --- a/libraries/app/plugin.cpp +++ b/libraries/app/plugin.cpp @@ -43,6 +43,11 @@ std::string plugin::plugin_name()const return ""; } +std::string plugin::plugin_description()const +{ + return ""; +} + void plugin::plugin_initialize( const boost::program_options::variables_map& options ) { return; diff --git a/libraries/plugins/snapshot/include/graphene/snapshot/snapshot.hpp b/libraries/plugins/snapshot/include/graphene/snapshot/snapshot.hpp index b3ee30c6..eb8d3a16 100644 --- a/libraries/plugins/snapshot/include/graphene/snapshot/snapshot.hpp +++ b/libraries/plugins/snapshot/include/graphene/snapshot/snapshot.hpp @@ -35,6 +35,7 @@ class snapshot_plugin : public graphene::app::plugin { ~snapshot_plugin() {} std::string plugin_name()const override; + std::string plugin_description()const override; virtual void plugin_set_program_options( boost::program_options::options_description &command_line_options, diff --git a/libraries/plugins/snapshot/snapshot.cpp b/libraries/plugins/snapshot/snapshot.cpp index fe856ecb..f74ad589 100644 --- a/libraries/plugins/snapshot/snapshot.cpp +++ b/libraries/plugins/snapshot/snapshot.cpp @@ -54,6 +54,11 @@ std::string snapshot_plugin::plugin_name()const return "snapshot"; } +std::string snapshot_plugin::plugin_description()const +{ + return "Create snapshots at a specified time or block number."; +} + void snapshot_plugin::plugin_initialize(const boost::program_options::variables_map& options) { try { ilog("snapshot plugin: plugin_initialize() begin"); From 00f14c472934e752ca920fff91226acd9c6f5b2a Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Sat, 11 Nov 2017 10:32:53 -0300 Subject: [PATCH 28/44] Merge pull request #444 from oxarbitrage/elasticsearch Elasticsearch plugin --- libraries/app/application.cpp | 14 +- .../chain/operation_history_object.hpp | 10 + libraries/plugins/CMakeLists.txt | 1 + .../plugins/elasticsearch/CMakeLists.txt | 23 ++ .../elasticsearch/elasticsearch_plugin.cpp | 388 ++++++++++++++++++ .../elasticsearch/elasticsearch_plugin.hpp | 159 +++++++ programs/witness_node/CMakeLists.txt | 2 +- programs/witness_node/main.cpp | 2 + 8 files changed, 596 insertions(+), 3 deletions(-) create mode 100644 libraries/plugins/elasticsearch/CMakeLists.txt create mode 100644 libraries/plugins/elasticsearch/elasticsearch_plugin.cpp create mode 100644 libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index 5e5c7b8c..b366be49 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -992,9 +992,19 @@ void application::initialize(const fc::path& data_dir, const boost::program_opti wanted.push_back("account_history"); wanted.push_back("market_history"); } - for (auto it = wanted.cbegin(); it != wanted.cend(); it++) + int es_ah_conflict_counter = 0; + for (auto& it : wanted) { - if (!it->empty()) enable_plugin(*it); + if(it == "account_history") + ++es_ah_conflict_counter; + if(it == "elasticsearch") + ++es_ah_conflict_counter; + + if(es_ah_conflict_counter > 1) { + elog("Can't start program with elasticsearch and account_history plugin at the same time"); + std::exit(EXIT_FAILURE); + } + if (!it.empty()) enable_plugin(it); } } diff --git a/libraries/chain/include/graphene/chain/operation_history_object.hpp b/libraries/chain/include/graphene/chain/operation_history_object.hpp index b35b171f..89199472 100644 --- a/libraries/chain/include/graphene/chain/operation_history_object.hpp +++ b/libraries/chain/include/graphene/chain/operation_history_object.hpp @@ -102,6 +102,16 @@ namespace graphene { namespace chain { struct by_seq; struct by_op; struct by_opid; + +typedef multi_index_container< + operation_history_object, + indexed_by< + ordered_unique< tag, member< object, object_id_type, &object::id > > + > +> operation_history_multi_index_type; + +typedef generic_index operation_history_index; + typedef multi_index_container< account_transaction_history_object, indexed_by< diff --git a/libraries/plugins/CMakeLists.txt b/libraries/plugins/CMakeLists.txt index 01079fe2..b3fe52d2 100644 --- a/libraries/plugins/CMakeLists.txt +++ b/libraries/plugins/CMakeLists.txt @@ -2,6 +2,7 @@ add_subdirectory( witness ) add_subdirectory( account_history ) add_subdirectory( accounts_list ) add_subdirectory( affiliate_stats ) +add_subdirectory( elasticsearch ) add_subdirectory( market_history ) add_subdirectory( delayed_node ) add_subdirectory( bookie ) diff --git a/libraries/plugins/elasticsearch/CMakeLists.txt b/libraries/plugins/elasticsearch/CMakeLists.txt new file mode 100644 index 00000000..f4815576 --- /dev/null +++ b/libraries/plugins/elasticsearch/CMakeLists.txt @@ -0,0 +1,23 @@ +file(GLOB HEADERS "include/graphene/elasticsearch/*.hpp") + +add_library( graphene_elasticsearch + elasticsearch_plugin.cpp + ) + +target_link_libraries( graphene_elasticsearch graphene_chain graphene_app curl ) +target_include_directories( graphene_elasticsearch + PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) + +if(MSVC) + set_source_files_properties(elasticsearch_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) +endif(MSVC) + +install( TARGETS + graphene_elasticsearch + + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/elasticsearch" ) + diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp new file mode 100644 index 00000000..b63802db --- /dev/null +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -0,0 +1,388 @@ +/* + * Copyright (c) 2017 Cryptonomex, Inc., and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace graphene { namespace elasticsearch { + +namespace detail +{ + +class elasticsearch_plugin_impl +{ + public: + elasticsearch_plugin_impl(elasticsearch_plugin& _plugin) + : _self( _plugin ) + { curl = curl_easy_init(); } + virtual ~elasticsearch_plugin_impl(); + + void update_account_histories( const signed_block& b ); + + graphene::chain::database& database() + { + return _self.database(); + } + + elasticsearch_plugin& _self; + primary_index< operation_history_index >* _oho_index; + + std::string _elasticsearch_node_url = "http://localhost:9200/"; + uint32_t _elasticsearch_bulk_replay = 10000; + uint32_t _elasticsearch_bulk_sync = 100; + bool _elasticsearch_logs = true; + bool _elasticsearch_visitor = false; + CURL *curl; // curl handler + vector bulk; // vector of op lines + private: + void add_elasticsearch( const account_id_type account_id, const optional& oho, const signed_block& b ); + void createBulkLine(account_transaction_history_object ath, operation_history_struct os, int op_type, block_struct bs, visitor_struct vs); + void sendBulk(std::string _elasticsearch_node_url, bool _elasticsearch_logs); + +}; + +elasticsearch_plugin_impl::~elasticsearch_plugin_impl() +{ + return; +} + +void elasticsearch_plugin_impl::update_account_histories( const signed_block& b ) +{ + graphene::chain::database& db = database(); + const vector >& hist = db.get_applied_operations(); + for( const optional< operation_history_object >& o_op : hist ) { + optional oho; + + auto create_oho = [&]() { + return optional( + db.create([&](operation_history_object &h) { + if (o_op.valid()) + { + h.op = o_op->op; + h.result = o_op->result; + h.block_num = o_op->block_num; + h.trx_in_block = o_op->trx_in_block; + h.op_in_trx = o_op->op_in_trx; + h.virtual_op = o_op->virtual_op; + } + })); + }; + + if( !o_op.valid() ) { + _oho_index->use_next_id(); + continue; + } + oho = create_oho(); + + const operation_history_object& op = *o_op; + + // get the set of accounts this operation applies to + flat_set impacted; + vector other; + operation_get_required_authorities( op.op, impacted, impacted, other ); // fee_payer is added here + + if( op.op.which() == operation::tag< account_create_operation >::value ) + impacted.insert( op.result.get() ); + else + graphene::app::operation_get_impacted_accounts( op.op, impacted ); + + for( auto& a : other ) + for( auto& item : a.account_auths ) + impacted.insert( item.first ); + + for( auto& account_id : impacted ) + { + add_elasticsearch( account_id, oho, b ); + } + } +} + +void elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account_id, const optional & oho, const signed_block& b) +{ + graphene::chain::database& db = database(); + const auto &stats_obj = account_id(db).statistics(db); + + // add new entry + const auto &ath = db.create([&](account_transaction_history_object &obj) { + obj.operation_id = oho->id; + obj.account = account_id; + obj.sequence = stats_obj.total_ops + 1; + obj.next = stats_obj.most_recent_op; + }); + + // keep stats growing as no op will be removed + db.modify(stats_obj, [&](account_statistics_object &obj) { + obj.most_recent_op = ath.id; + obj.total_ops = ath.sequence; + }); + + // operation_type + int op_type = -1; + if (!oho->id.is_null()) + op_type = oho->op.which(); + + // operation history data + operation_history_struct os; + os.trx_in_block = oho->trx_in_block; + os.op_in_trx = oho->op_in_trx; + os.operation_result = fc::json::to_string(oho->result); + os.virtual_op = oho->virtual_op; + os.op = fc::json::to_string(oho->op); + + // visitor data + visitor_struct vs; + if(_elasticsearch_visitor) { + operation_visitor o_v; + oho->op.visit(o_v); + + vs.fee_data.asset = o_v.fee_asset; + vs.fee_data.amount = o_v.fee_amount; + vs.transfer_data.asset = o_v.transfer_asset_id; + vs.transfer_data.amount = o_v.transfer_amount; + vs.transfer_data.from = o_v.transfer_from; + vs.transfer_data.to = o_v.transfer_to; + } + + // block data + std::string trx_id = ""; + if(!b.transactions.empty() && oho->trx_in_block < b.transactions.size()) { + trx_id = b.transactions[oho->trx_in_block].id().str(); + } + block_struct bs; + bs.block_num = b.block_num(); + bs.block_time = b.timestamp; + bs.trx_id = trx_id; + + // check if we are in replay or in sync and change number of bulk documents accordingly + uint32_t limit_documents = 0; + if((fc::time_point::now() - b.timestamp) < fc::seconds(30)) + limit_documents = _elasticsearch_bulk_sync; + else + limit_documents = _elasticsearch_bulk_replay; + + createBulkLine(ath, os, op_type, bs, vs); // we have everything, creating bulk line + + if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech + sendBulk(_elasticsearch_node_url, _elasticsearch_logs); + } + + // remove everything except current object from ath + const auto &his_idx = db.get_index_type(); + const auto &by_seq_idx = his_idx.indices().get(); + auto itr = by_seq_idx.lower_bound(boost::make_tuple(account_id, 0)); + if (itr != by_seq_idx.end() && itr->account == account_id && itr->id != ath.id) { + // if found, remove the entry + const auto remove_op_id = itr->operation_id; + const auto itr_remove = itr; + ++itr; + db.remove( *itr_remove ); + // modify previous node's next pointer + // this should be always true, but just have a check here + if( itr != by_seq_idx.end() && itr->account == account_id ) + { + db.modify( *itr, [&]( account_transaction_history_object& obj ){ + obj.next = account_transaction_history_id_type(); + }); + } + // do the same on oho + const auto &by_opid_idx = his_idx.indices().get(); + if (by_opid_idx.find(remove_op_id) == by_opid_idx.end()) { + db.remove(remove_op_id(db)); + } + } +} + +void elasticsearch_plugin_impl::createBulkLine(account_transaction_history_object ath, operation_history_struct os, int op_type, block_struct bs, visitor_struct vs) +{ + bulk_struct bulks; + bulks.account_history = ath; + bulks.operation_history = os; + bulks.operation_type = op_type; + bulks.block_data = bs; + bulks.additional_data = vs; + + std::string alltogether = fc::json::to_string(bulks); + + auto block_date = bulks.block_data.block_time.to_iso_string(); + std::vector parts; + boost::split(parts, block_date, boost::is_any_of("-")); + std::string index_name = "graphene-" + parts[0] + "-" + parts[1]; + + // bulk header before each line, op_type = create to avoid dups, index id will be ath id(2.9.X). + std::string _id = fc::json::to_string(ath.id); + bulk.push_back("{ \"index\" : { \"_index\" : \""+index_name+"\", \"_type\" : \"data\", \"op_type\" : \"create\", \"_id\" : "+_id+" } }"); // header + bulk.push_back(alltogether); +} + +void elasticsearch_plugin_impl::sendBulk(std::string _elasticsearch_node_url, bool _elasticsearch_logs) +{ + + // curl buffers to read + std::string readBuffer; + std::string readBuffer_logs; + + std::string bulking = ""; + + bulking = boost::algorithm::join(bulk, "\n"); + bulking = bulking + "\n"; + bulk.clear(); + + //wlog((bulking)); + + struct curl_slist *headers = NULL; + curl_slist_append(headers, "Content-Type: application/json"); + std::string url = _elasticsearch_node_url + "_bulk"; + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_POST, true); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, bulking.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&readBuffer); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); + //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); + curl_easy_perform(curl); + + long http_code = 0; + curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); + if(http_code == 200) { + // all good, do nothing + } + else if(http_code == 429) { + // repeat request? + } + else { + // exit everything ? + } + + if(_elasticsearch_logs) { + auto logs = readBuffer; + // do logs + std::string url_logs = _elasticsearch_node_url + "logs/data/"; + curl_easy_setopt(curl, CURLOPT_URL, url_logs.c_str()); + curl_easy_setopt(curl, CURLOPT_POST, true); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, logs.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &readBuffer_logs); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); + //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); + //ilog("log here curl: ${output}", ("output", readBuffer_logs)); + curl_easy_perform(curl); + + http_code = 0; + curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); + if(http_code == 200) { + // all good, do nothing + } + else if(http_code == 429) { + // repeat request? + } + else { + // exit everything ? + } + } +} + +} // end namespace detail + +elasticsearch_plugin::elasticsearch_plugin() : + my( new detail::elasticsearch_plugin_impl(*this) ) +{ +} + +elasticsearch_plugin::~elasticsearch_plugin() +{ +} + +std::string elasticsearch_plugin::plugin_name()const +{ + return "elasticsearch"; +} +std::string elasticsearch_plugin::plugin_description()const +{ + return "Stores account history data in elasticsearch database(EXPERIMENTAL)."; +} + +void elasticsearch_plugin::plugin_set_program_options( + boost::program_options::options_description& cli, + boost::program_options::options_description& cfg + ) +{ + cli.add_options() + ("elasticsearch-node-url", boost::program_options::value(), "Elastic Search database node url") + ("elasticsearch-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") + ("elasticsearch-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") + ("elasticsearch-logs", boost::program_options::value(), "Log bulk events to database") + ("elasticsearch-visitor", boost::program_options::value(), "Use visitor to index additional data(slows down the replay)") + ; + cfg.add(cli); +} + +void elasticsearch_plugin::plugin_initialize(const boost::program_options::variables_map& options) +{ + database().applied_block.connect( [&]( const signed_block& b){ my->update_account_histories(b); } ); + my->_oho_index = database().add_index< primary_index< operation_history_index > >(); + database().add_index< primary_index< account_transaction_history_index > >(); + + if (options.count("elasticsearch-node-url")) { + my->_elasticsearch_node_url = options["elasticsearch-node-url"].as(); + } + if (options.count("elasticsearch-bulk-replay")) { + my->_elasticsearch_bulk_replay = options["elasticsearch-bulk-replay"].as(); + } + if (options.count("elasticsearch-bulk-sync")) { + my->_elasticsearch_bulk_sync = options["elasticsearch-bulk-sync"].as(); + } + if (options.count("elasticsearch-logs")) { + my->_elasticsearch_logs = options["elasticsearch-logs"].as(); + } + if (options.count("elasticsearch-visitor")) { + my->_elasticsearch_visitor = options["elasticsearch-visitor"].as(); + } +} + +void elasticsearch_plugin::plugin_startup() +{ +} + +} } diff --git a/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp new file mode 100644 index 00000000..cc51c247 --- /dev/null +++ b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2017 Cryptonomex, Inc., and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#pragma once + +#include +#include +#include + +namespace graphene { namespace elasticsearch { + using namespace chain; + //using namespace graphene::db; + //using boost::multi_index_container; + //using namespace boost::multi_index; + +// +// Plugins should #define their SPACE_ID's so plugins with +// conflicting SPACE_ID assignments can be compiled into the +// same binary (by simply re-assigning some of the conflicting #defined +// SPACE_ID's in a build script). +// +// Assignment of SPACE_ID's cannot be done at run-time because +// various template automagic depends on them being known at compile +// time. +// +#ifndef ELASTICSEARCH_SPACE_ID +#define ELASTICSEARCH_SPACE_ID 6 +#endif + +static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) +{ + ((std::string*)userp)->append((char*)contents, size * nmemb); + return size * nmemb; +} + +namespace detail +{ + class elasticsearch_plugin_impl; +} + +class elasticsearch_plugin : public graphene::app::plugin +{ + public: + elasticsearch_plugin(); + virtual ~elasticsearch_plugin(); + + std::string plugin_name()const override; + std::string plugin_description()const override; + virtual void plugin_set_program_options( + boost::program_options::options_description& cli, + boost::program_options::options_description& cfg) override; + virtual void plugin_initialize(const boost::program_options::variables_map& options) override; + virtual void plugin_startup() override; + + friend class detail::elasticsearch_plugin_impl; + std::unique_ptr my; +}; + + +struct operation_visitor +{ + typedef void result_type; + + share_type fee_amount; + asset_id_type fee_asset; + + asset_id_type transfer_asset_id; + share_type transfer_amount; + account_id_type transfer_from; + account_id_type transfer_to; + + void operator()( const graphene::chain::transfer_operation& o ) + { + fee_asset = o.fee.asset_id; + fee_amount = o.fee.amount; + + transfer_asset_id = o.amount.asset_id; + transfer_amount = o.amount.amount; + transfer_from = o.from; + transfer_to = o.to; + } + template + void operator()( const T& o ) + { + fee_asset = o.fee.asset_id; + fee_amount = o.fee.amount; + } +}; + +struct operation_history_struct { + int trx_in_block; + int op_in_trx; + std::string operation_result; + int virtual_op; + std::string op; +}; + +struct block_struct { + int block_num; + fc::time_point_sec block_time; + std::string trx_id; +}; + +struct fee_struct { + asset_id_type asset; + share_type amount; +}; + +struct transfer_struct { + asset_id_type asset; + share_type amount; + account_id_type from; + account_id_type to; +}; + +struct visitor_struct { + fee_struct fee_data; + transfer_struct transfer_data; +}; + +struct bulk_struct { + account_transaction_history_object account_history; + operation_history_struct operation_history; + int operation_type; + block_struct block_data; + visitor_struct additional_data; +}; + + +} } //graphene::elasticsearch + +FC_REFLECT( graphene::elasticsearch::operation_history_struct, (trx_in_block)(op_in_trx)(operation_result)(virtual_op)(op) ) +FC_REFLECT( graphene::elasticsearch::block_struct, (block_num)(block_time)(trx_id) ) +FC_REFLECT( graphene::elasticsearch::fee_struct, (asset)(amount) ) +FC_REFLECT( graphene::elasticsearch::transfer_struct, (asset)(amount)(from)(to) ) +FC_REFLECT( graphene::elasticsearch::visitor_struct, (fee_data)(transfer_data) ) +FC_REFLECT( graphene::elasticsearch::bulk_struct, (account_history)(operation_history)(operation_type)(block_data)(additional_data) ) + + diff --git a/programs/witness_node/CMakeLists.txt b/programs/witness_node/CMakeLists.txt index 3d03253b..0aa73cf1 100644 --- a/programs/witness_node/CMakeLists.txt +++ b/programs/witness_node/CMakeLists.txt @@ -11,7 +11,7 @@ endif() # We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246 target_link_libraries( witness_node - PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) + PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_elasticsearch graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) # also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins install( TARGETS diff --git a/programs/witness_node/main.cpp b/programs/witness_node/main.cpp index ec08feb6..65b36c04 100644 --- a/programs/witness_node/main.cpp +++ b/programs/witness_node/main.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include //#include //#include @@ -74,6 +75,7 @@ int main(int argc, char** argv) { auto witness_plug = node->register_plugin(); auto debug_witness_plug = node->register_plugin(); auto history_plug = node->register_plugin(); + auto elasticsearch_plug = node->register_plugin(); auto market_history_plug = node->register_plugin(); //auto generate_genesis_plug = node->register_plugin(); //auto generate_uia_sharedrop_genesis_plug = node->register_plugin(); From 8d900a5276af9ad4724818b89d9bda02fe37c975 Mon Sep 17 00:00:00 2001 From: oxarbitrage Date: Tue, 20 Mar 2018 17:06:05 -0300 Subject: [PATCH 29/44] Merge pull request #500 from oxarbitrage/elasticsearch-extras es_objects plugin --- libraries/plugins/CMakeLists.txt | 1 + libraries/plugins/es_objects/CMakeLists.txt | 23 ++ libraries/plugins/es_objects/es_objects.cpp | 355 ++++++++++++++++++ .../graphene/es_objects/es_objects.hpp | 137 +++++++ libraries/utilities/CMakeLists.txt | 1 + libraries/utilities/elasticsearch.cpp | 123 ++++++ .../graphene/utilities/elasticsearch.hpp | 42 +++ programs/witness_node/CMakeLists.txt | 2 +- programs/witness_node/main.cpp | 2 + 9 files changed, 685 insertions(+), 1 deletion(-) create mode 100644 libraries/plugins/es_objects/CMakeLists.txt create mode 100644 libraries/plugins/es_objects/es_objects.cpp create mode 100644 libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp create mode 100644 libraries/utilities/elasticsearch.cpp create mode 100644 libraries/utilities/include/graphene/utilities/elasticsearch.hpp diff --git a/libraries/plugins/CMakeLists.txt b/libraries/plugins/CMakeLists.txt index b3fe52d2..58728a9e 100644 --- a/libraries/plugins/CMakeLists.txt +++ b/libraries/plugins/CMakeLists.txt @@ -10,3 +10,4 @@ add_subdirectory( generate_genesis ) add_subdirectory( generate_uia_sharedrop_genesis ) add_subdirectory( debug_witness ) add_subdirectory( snapshot ) +add_subdirectory( es_objects ) diff --git a/libraries/plugins/es_objects/CMakeLists.txt b/libraries/plugins/es_objects/CMakeLists.txt new file mode 100644 index 00000000..92e3d150 --- /dev/null +++ b/libraries/plugins/es_objects/CMakeLists.txt @@ -0,0 +1,23 @@ +file(GLOB HEADERS "include/graphene/es_objects/*.hpp") + +add_library( graphene_es_objects + es_objects.cpp + ) + +target_link_libraries( graphene_es_objects graphene_chain graphene_app curl ) +target_include_directories( graphene_es_objects + PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" ) + +if(MSVC) + set_source_files_properties(es_objects.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) +endif(MSVC) + +install( TARGETS + graphene_es_objects + + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib +) +INSTALL( FILES ${HEADERS} DESTINATION "include/graphene/es_objects" ) + diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp new file mode 100644 index 00000000..7c9c2b61 --- /dev/null +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2018 oxarbitrage, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include + +#include +#include +#include +#include + +#include + + +namespace graphene { namespace es_objects { + +namespace detail +{ + +class es_objects_plugin_impl +{ + public: + es_objects_plugin_impl(es_objects_plugin& _plugin) + : _self( _plugin ) + { curl = curl_easy_init(); } + virtual ~es_objects_plugin_impl(); + + void updateDatabase( const vector& ids , bool isNew); + + es_objects_plugin& _self; + std::string _es_objects_elasticsearch_url = "http://localhost:9200/"; + uint32_t _es_objects_bulk_replay = 5000; + uint32_t _es_objects_bulk_sync = 10; + bool _es_objects_proposals = true; + bool _es_objects_accounts = true; + bool _es_objects_assets = true; + bool _es_objects_balances = true; + bool _es_objects_limit_orders = true; + bool _es_objects_asset_bitasset = true; + bool _es_objects_logs = true; + CURL *curl; // curl handler + vector bulk; + vector prepare; + map bitassets; + //uint32_t bitasset_seq; + private: + void PrepareProposal(const proposal_object* proposal_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareAccount(const account_object* account_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareAsset(const asset_object* asset_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareBalance(const balance_object* balance_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareLimit(const limit_order_object* limit_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareBitAsset(const asset_bitasset_data_object* bitasset_object, const fc::time_point_sec block_time, uint32_t block_number); +}; + +void es_objects_plugin_impl::updateDatabase( const vector& ids , bool isNew) +{ + + graphene::chain::database &db = _self.database(); + + const fc::time_point_sec block_time = db.head_block_time(); + const uint32_t block_number = db.head_block_num(); + + // check if we are in replay or in sync and change number of bulk documents accordingly + uint32_t limit_documents = 0; + if((fc::time_point::now() - block_time) < fc::seconds(30)) + limit_documents = _es_objects_bulk_sync; + else + limit_documents = _es_objects_bulk_replay; + + if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech + if(!graphene::utilities::SendBulk(curl, bulk, _es_objects_elasticsearch_url, _es_objects_logs, "objects_logs")) + elog("Error sending data to database"); + bulk.clear(); + } + + for(auto const& value: ids) { + if(value.is() && _es_objects_proposals) { + auto obj = db.find_object(value); + auto p = static_cast(obj); + if(p != nullptr) + PrepareProposal(p, block_time, block_number); + } + else if(value.is() && _es_objects_accounts) { + auto obj = db.find_object(value); + auto a = static_cast(obj); + if(a != nullptr) + PrepareAccount(a, block_time, block_number); + } + else if(value.is() && _es_objects_assets) { + auto obj = db.find_object(value); + auto a = static_cast(obj); + if(a != nullptr) + PrepareAsset(a, block_time, block_number); + } + else if(value.is() && _es_objects_balances) { + auto obj = db.find_object(value); + auto b = static_cast(obj); + if(b != nullptr) + PrepareBalance(b, block_time, block_number); + } + else if(value.is() && _es_objects_limit_orders) { + auto obj = db.find_object(value); + auto l = static_cast(obj); + if(l != nullptr) + PrepareLimit(l, block_time, block_number); + } + else if(value.is() && _es_objects_asset_bitasset) { + auto obj = db.find_object(value); + auto ba = static_cast(obj); + if(ba != nullptr) + PrepareBitAsset(ba, block_time, block_number); + } + } +} + +void es_objects_plugin_impl::PrepareProposal(const proposal_object* proposal_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + proposal_struct prop; + prop.object_id = proposal_object->id; + prop.block_time = block_time; + prop.block_number = block_number; + prop.expiration_time = proposal_object->expiration_time; + prop.review_period_time = proposal_object->review_period_time; + prop.proposed_transaction = fc::json::to_string(proposal_object->proposed_transaction); + prop.required_owner_approvals = fc::json::to_string(proposal_object->required_owner_approvals); + prop.available_owner_approvals = fc::json::to_string(proposal_object->available_owner_approvals); + prop.required_active_approvals = fc::json::to_string(proposal_object->required_active_approvals); + prop.available_key_approvals = fc::json::to_string(proposal_object->available_key_approvals); + prop.proposer = proposal_object->proposer; + + std::string data = fc::json::to_string(prop); + prepare = graphene::utilities::createBulk("bitshares-proposal", data, "", 1); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); +} + +void es_objects_plugin_impl::PrepareAccount(const account_object* account_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + account_struct acct; + acct.object_id = account_object->id; + acct.block_time = block_time; + acct.block_number = block_number; + acct.membership_expiration_date = account_object->membership_expiration_date; + acct.registrar = account_object->registrar; + acct.referrer = account_object->referrer; + acct.lifetime_referrer = account_object->lifetime_referrer; + acct.network_fee_percentage = account_object->network_fee_percentage; + acct.lifetime_referrer_fee_percentage = account_object->lifetime_referrer_fee_percentage; + acct.referrer_rewards_percentage = account_object->referrer_rewards_percentage; + acct.name = account_object->name; + acct.owner_account_auths = fc::json::to_string(account_object->owner.account_auths); + acct.owner_key_auths = fc::json::to_string(account_object->owner.key_auths); + acct.owner_address_auths = fc::json::to_string(account_object->owner.address_auths); + acct.active_account_auths = fc::json::to_string(account_object->active.account_auths); + acct.active_key_auths = fc::json::to_string(account_object->active.key_auths); + acct.active_address_auths = fc::json::to_string(account_object->active.address_auths); + acct.voting_account = account_object->options.voting_account; + + std::string data = fc::json::to_string(acct); + prepare = graphene::utilities::createBulk("bitshares-account", data, "", 1); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); +} + +void es_objects_plugin_impl::PrepareAsset(const asset_object* asset_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + asset_struct _asset; + _asset.object_id = asset_object->id; + _asset.block_time = block_time; + _asset.block_number = block_number; + _asset.symbol = asset_object->symbol; + _asset.issuer = asset_object->issuer; + _asset.is_market_issued = asset_object->is_market_issued(); + _asset.dynamic_asset_data_id = asset_object->dynamic_asset_data_id; + _asset.bitasset_data_id = asset_object->bitasset_data_id; + + std::string data = fc::json::to_string(_asset); + prepare = graphene::utilities::createBulk("bitshares-asset", data, fc::json::to_string(asset_object->id), 0); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); +} + +void es_objects_plugin_impl::PrepareBalance(const balance_object* balance_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + balance_struct balance; + balance.object_id = balance_object->id; + balance.block_time = block_time; + balance.block_number = block_number;balance.owner = balance_object->owner; + balance.asset_id = balance_object->balance.asset_id; + balance.amount = balance_object->balance.amount; + + std::string data = fc::json::to_string(balance); + prepare = graphene::utilities::createBulk("bitshares-balance", data, "", 1); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); +} + +void es_objects_plugin_impl::PrepareLimit(const limit_order_object* limit_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + limit_order_struct limit; + limit.object_id = limit_object->id; + limit.block_time = block_time; + limit.block_number = block_number; + limit.expiration = limit_object->expiration; + limit.seller = limit_object->seller; + limit.for_sale = limit_object->for_sale; + limit.sell_price = limit_object->sell_price; + limit.deferred_fee = limit_object->deferred_fee; + + std::string data = fc::json::to_string(limit); + prepare = graphene::utilities::createBulk("bitshares-limitorder", data, "", 1); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); +} + +void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object* bitasset_object, const fc::time_point_sec block_time, uint32_t block_number) +{ + if(!bitasset_object->is_prediction_market) { + + auto object_id = bitasset_object->id; + auto it = bitassets.find(object_id); + if(it == bitassets.end()) + bitassets[object_id] = fc::json::to_string(bitasset_object->current_feed); + else { + if(it->second == fc::json::to_string(bitasset_object->current_feed)) return; + else bitassets[object_id] = fc::json::to_string(bitasset_object->current_feed); + } + + bitasset_struct bitasset; + + bitasset.object_id = bitasset_object->id; + bitasset.block_time = block_time; + bitasset.block_number = block_number; + bitasset.current_feed = fc::json::to_string(bitasset_object->current_feed); + bitasset.current_feed_publication_time = bitasset_object->current_feed_publication_time; + + std::string data = fc::json::to_string(bitasset); + prepare = graphene::utilities::createBulk("bitshares-bitasset", data, "", 1); + bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare.clear(); + } +} + +es_objects_plugin_impl::~es_objects_plugin_impl() +{ + return; +} + + +} // end namespace detail + +es_objects_plugin::es_objects_plugin() : + my( new detail::es_objects_plugin_impl(*this) ) +{ +} + +es_objects_plugin::~es_objects_plugin() +{ +} + +std::string es_objects_plugin::plugin_name()const +{ + return "es_objects"; +} +std::string es_objects_plugin::plugin_description()const +{ + return "Stores blockchain objects in ES database. Experimental."; +} + +void es_objects_plugin::plugin_set_program_options( + boost::program_options::options_description& cli, + boost::program_options::options_description& cfg + ) +{ + cli.add_options() + ("es-objects-elasticsearch-url", boost::program_options::value(), "Elasticsearch node url") + ("es-objects-logs", boost::program_options::value(), "Log bulk events to database") + ("es-objects-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") + ("es-objects-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") + ("es-objects-proposals", boost::program_options::value(), "Store proposal objects") + ("es-objects-accounts", boost::program_options::value(), "Store account objects") + ("es-objects-assets", boost::program_options::value(), "Store asset objects") + ("es-objects-balances", boost::program_options::value(), "Store balances objects") + ("es-objects-limit-orders", boost::program_options::value(), "Store limit order objects") + ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data") + + ; + cfg.add(cli); +} + +void es_objects_plugin::plugin_initialize(const boost::program_options::variables_map& options) +{ + database().new_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ){ my->updateDatabase(ids, 1); }); + database().changed_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ){ my->updateDatabase(ids, 0); }); + + if (options.count("es-objects-elasticsearch-url")) { + my->_es_objects_elasticsearch_url = options["es-objects-elasticsearch-url"].as(); + } + if (options.count("es-objects-logs")) { + my->_es_objects_logs = options["es-objects-logs"].as(); + } + if (options.count("es-objects-bulk-replay")) { + my->_es_objects_bulk_replay = options["es-objects-bulk-replay"].as(); + } + if (options.count("es-objects-bulk-sync")) { + my->_es_objects_bulk_sync = options["es-objects-bulk-sync"].as(); + } + if (options.count("es-objects-proposals")) { + my->_es_objects_proposals = options["es-objects-proposals"].as(); + } + if (options.count("es-objects-accounts")) { + my->_es_objects_accounts = options["es-objects-accounts"].as(); + } + if (options.count("es-objects-assets")) { + my->_es_objects_assets = options["es-objects-assets"].as(); + } + if (options.count("es-objects-balances")) { + my->_es_objects_balances = options["es-objects-balances"].as(); + } + if (options.count("es-objects-limit-orders")) { + my->_es_objects_limit_orders = options["es-objects-limit-orders"].as(); + } + if (options.count("es-objects-asset-bitasset")) { + my->_es_objects_asset_bitasset = options["es-objects-asset-bitasset"].as(); + } +} + +void es_objects_plugin::plugin_startup() +{ + ilog("elasticsearch objects: plugin_startup() begin"); +} + +} } \ No newline at end of file diff --git a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp new file mode 100644 index 00000000..31809e04 --- /dev/null +++ b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2018 oxarbitrage, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#pragma once + +#include +#include + +namespace graphene { namespace es_objects { + +using namespace chain; + + +namespace detail +{ + class es_objects_plugin_impl; +} + +class es_objects_plugin : public graphene::app::plugin +{ + public: + es_objects_plugin(); + virtual ~es_objects_plugin(); + + std::string plugin_name()const override; + std::string plugin_description()const override; + virtual void plugin_set_program_options( + boost::program_options::options_description& cli, + boost::program_options::options_description& cfg) override; + virtual void plugin_initialize(const boost::program_options::variables_map& options) override; + virtual void plugin_startup() override; + + friend class detail::es_objects_plugin_impl; + std::unique_ptr my; +}; + +struct proposal_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + time_point_sec expiration_time; + optional review_period_time; + string proposed_transaction; + string required_active_approvals; + string available_active_approvals; + string required_owner_approvals; + string available_owner_approvals; + string available_key_approvals; + account_id_type proposer; + +}; +struct account_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + time_point_sec membership_expiration_date; + account_id_type registrar; + account_id_type referrer; + account_id_type lifetime_referrer; + uint16_t network_fee_percentage; + uint16_t lifetime_referrer_fee_percentage; + uint16_t referrer_rewards_percentage; + string name; + string owner_account_auths; + string owner_key_auths; + string owner_address_auths; + string active_account_auths; + string active_key_auths; + string active_address_auths; + account_id_type voting_account; +}; +struct asset_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + string symbol; + account_id_type issuer; + bool is_market_issued; + asset_dynamic_data_id_type dynamic_asset_data_id; + optional bitasset_data_id; + +}; +struct balance_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + address owner; + asset_id_type asset_id; + share_type amount; +}; +struct limit_order_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + time_point_sec expiration; + account_id_type seller; + share_type for_sale; + price sell_price; + share_type deferred_fee; +}; +struct bitasset_struct { + object_id_type object_id; + fc::time_point_sec block_time; + uint32_t block_number; + string current_feed; + time_point_sec current_feed_publication_time; + time_point_sec feed_expiration_time; +}; + +} } //graphene::es_objects + +FC_REFLECT( graphene::es_objects::proposal_struct, (object_id)(block_time)(block_number)(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals)(available_active_approvals)(required_owner_approvals)(available_owner_approvals)(available_key_approvals)(proposer) ) +FC_REFLECT( graphene::es_objects::account_struct, (object_id)(block_time)(block_number)(membership_expiration_date)(registrar)(referrer)(lifetime_referrer)(network_fee_percentage)(lifetime_referrer_fee_percentage)(referrer_rewards_percentage)(name)(owner_account_auths)(owner_key_auths)(owner_address_auths)(active_account_auths)(active_key_auths)(active_address_auths)(voting_account) ) +FC_REFLECT( graphene::es_objects::asset_struct, (object_id)(block_time)(block_number)(symbol)(issuer)(is_market_issued)(dynamic_asset_data_id)(bitasset_data_id) ) +FC_REFLECT( graphene::es_objects::balance_struct, (object_id)(block_time)(block_number)(block_time)(owner)(asset_id)(amount) ) +FC_REFLECT( graphene::es_objects::limit_order_struct, (object_id)(block_time)(block_number)(expiration)(seller)(for_sale)(sell_price)(deferred_fee) ) +FC_REFLECT( graphene::es_objects::bitasset_struct, (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) ) \ No newline at end of file diff --git a/libraries/utilities/CMakeLists.txt b/libraries/utilities/CMakeLists.txt index f2d646d5..98086b10 100644 --- a/libraries/utilities/CMakeLists.txt +++ b/libraries/utilities/CMakeLists.txt @@ -14,6 +14,7 @@ set(sources string_escape.cpp tempdir.cpp words.cpp + elasticsearch.cpp ${HEADERS}) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/git_revision.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp" @ONLY) diff --git a/libraries/utilities/elasticsearch.cpp b/libraries/utilities/elasticsearch.cpp new file mode 100644 index 00000000..1674a12a --- /dev/null +++ b/libraries/utilities/elasticsearch.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2018 oxarbitrage, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#include + +#include +#include + +namespace graphene { namespace utilities { + +bool SendBulk(CURL *curl, std::vector& bulk, std::string elasticsearch_url, bool do_logs, std::string logs_index) +{ + // curl buffers to read + std::string readBuffer; + std::string readBuffer_logs; + + std::string bulking = ""; + + bulking = boost::algorithm::join(bulk, "\n"); + bulking = bulking + "\n"; + bulk.clear(); + + struct curl_slist *headers = NULL; + headers = curl_slist_append(headers, "Content-Type: application/json"); + std::string url = elasticsearch_url + "_bulk"; + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + curl_easy_setopt(curl, CURLOPT_POST, true); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, bulking.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&readBuffer); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); + //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); + curl_easy_perform(curl); + + long http_code = 0; + curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); + if(http_code == 200) { + // all good, do nothing + } + else if(http_code == 413) { + elog("413 error: Can be low space disk"); + return 0; + } + else { + elog(http_code + "error: Unknown error"); + return 0; + } + + if(do_logs) { + auto logs = readBuffer; + // do logs + std::string url_logs = elasticsearch_url + logs_index + "/data/"; + curl_easy_setopt(curl, CURLOPT_URL, url_logs.c_str()); + curl_easy_setopt(curl, CURLOPT_POST, true); + curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(curl, CURLOPT_POSTFIELDS, logs.c_str()); + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &readBuffer_logs); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); + curl_easy_perform(curl); + + http_code = 0; + curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); + if(http_code == 200) { + // all good, do nothing + return 1; + } + else if(http_code == 201) { + // 201 is ok + return 1; + } + else if(http_code == 409) { + // 409 for record already exist is ok + return 1; + } + else if(http_code == 413) { + elog("413 error: Can be low space disk"); + return 0; + } + else { + elog(http_code + "error: Unknown error"); + return 0; + } + } + return 0; +} + +std::vector createBulk(std::string index_name, std::string data, std::string id, bool onlycreate) +{ + std::vector bulk; + std::string create_string = ""; + if(!onlycreate) + create_string = ",\"_id\" : "+id; + + bulk.push_back("{ \"index\" : { \"_index\" : \""+index_name+"\", \"_type\" : \"data\" "+create_string+" } }"); + bulk.push_back(data); + + return bulk; +} + + +} } // end namespace graphene::utilities diff --git a/libraries/utilities/include/graphene/utilities/elasticsearch.hpp b/libraries/utilities/include/graphene/utilities/elasticsearch.hpp new file mode 100644 index 00000000..517f2345 --- /dev/null +++ b/libraries/utilities/include/graphene/utilities/elasticsearch.hpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018 oxarbitrage, and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +#pragma once +#include +#include +#include + +#include + +static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) +{ + ((std::string*)userp)->append((char*)contents, size * nmemb); + return size * nmemb; +} + +namespace graphene { namespace utilities { + + bool SendBulk(CURL *curl, std::vector & bulk, std::string elasticsearch_url, bool do_logs, std::string logs_index); + std::vector createBulk(std::string type, std::string data, std::string id, bool onlycreate); + +} } // end namespace graphene::utilities diff --git a/programs/witness_node/CMakeLists.txt b/programs/witness_node/CMakeLists.txt index 0aa73cf1..0c4c1db4 100644 --- a/programs/witness_node/CMakeLists.txt +++ b/programs/witness_node/CMakeLists.txt @@ -11,7 +11,7 @@ endif() # We have to link against graphene_debug_witness because deficiency in our API infrastructure doesn't allow plugins to be fully abstracted #246 target_link_libraries( witness_node - PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_elasticsearch graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) + PRIVATE graphene_app graphene_account_history graphene_affiliate_stats graphene_elasticsearch graphene_market_history graphene_witness graphene_chain graphene_debug_witness graphene_bookie graphene_egenesis_full graphene_es_objects fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} ) # also add dependencies to graphene_generate_genesis graphene_generate_uia_sharedrop_genesis if you want those plugins install( TARGETS diff --git a/programs/witness_node/main.cpp b/programs/witness_node/main.cpp index 65b36c04..0d6e65c6 100644 --- a/programs/witness_node/main.cpp +++ b/programs/witness_node/main.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include //#include //#include @@ -76,6 +77,7 @@ int main(int argc, char** argv) { auto debug_witness_plug = node->register_plugin(); auto history_plug = node->register_plugin(); auto elasticsearch_plug = node->register_plugin(); + auto es_objects_plug = node->register_plugin(); auto market_history_plug = node->register_plugin(); //auto generate_genesis_plug = node->register_plugin(); //auto generate_uia_sharedrop_genesis_plug = node->register_plugin(); From e91e61e6cba0dc75d6a8c69eef93faacc1d10d10 Mon Sep 17 00:00:00 2001 From: Abit Date: Wed, 25 Apr 2018 16:34:37 +0200 Subject: [PATCH 30/44] Merge pull request #873 from pmconrad/585_fix_history_ids Fix history ids --- .../plugins/elasticsearch/elasticsearch_plugin.cpp | 13 ++++++++++++- tests/tests/history_api_tests.cpp | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index b63802db..a7d3fefa 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -90,10 +90,21 @@ void elasticsearch_plugin_impl::update_account_histories( const signed_block& b { graphene::chain::database& db = database(); const vector >& hist = db.get_applied_operations(); + bool is_first = true; + auto skip_oho_id = [&is_first,&db,this]() { + if( is_first && db._undo_db.enabled() ) // this ensures that the current id is rolled back on undo + { + db.remove( db.create( []( operation_history_object& obj) {} ) ); + is_first = false; + } + else + _oho_index->use_next_id(); + }; for( const optional< operation_history_object >& o_op : hist ) { optional oho; auto create_oho = [&]() { + is_first = false; return optional( db.create([&](operation_history_object &h) { if (o_op.valid()) @@ -109,7 +120,7 @@ void elasticsearch_plugin_impl::update_account_histories( const signed_block& b }; if( !o_op.valid() ) { - _oho_index->use_next_id(); + skip_oho_id(); continue; } oho = create_oho(); diff --git a/tests/tests/history_api_tests.cpp b/tests/tests/history_api_tests.cpp index 4edccce5..943b8265 100644 --- a/tests/tests/history_api_tests.cpp +++ b/tests/tests/history_api_tests.cpp @@ -595,4 +595,4 @@ BOOST_AUTO_TEST_CASE(get_account_history_operations) { } } -BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file +BOOST_AUTO_TEST_SUITE_END() From c9583f4486605ecb5152881d69ec6de1c833f834 Mon Sep 17 00:00:00 2001 From: Abit Date: Thu, 2 Aug 2018 15:31:54 +0000 Subject: [PATCH 31/44] Merge pull request #1201 from oxarbitrage/elasticsearch_tests2 Elasticsearch refactor --- .../elasticsearch/elasticsearch_plugin.cpp | 383 ++++++++++-------- .../elasticsearch/elasticsearch_plugin.hpp | 58 ++- libraries/plugins/es_objects/es_objects.cpp | 317 ++++++++++----- .../graphene/es_objects/es_objects.hpp | 74 +++- libraries/utilities/elasticsearch.cpp | 223 ++++++---- .../graphene/utilities/elasticsearch.hpp | 40 +- tests/CMakeLists.txt | 20 +- tests/common/database_fixture.cpp | 51 ++- tests/elasticsearch/main.cpp | 213 ++++++++++ 9 files changed, 985 insertions(+), 394 deletions(-) create mode 100644 tests/elasticsearch/main.cpp diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index a7d3fefa..b69ff64a 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -23,26 +23,11 @@ */ #include - #include - #include -#include -#include -#include -#include -#include -#include - #include -#include - #include -#include -#include -#include -#include -#include +#include namespace graphene { namespace elasticsearch { @@ -57,7 +42,7 @@ class elasticsearch_plugin_impl { curl = curl_easy_init(); } virtual ~elasticsearch_plugin_impl(); - void update_account_histories( const signed_block& b ); + bool update_account_histories( const signed_block& b ); graphene::chain::database& database() { @@ -70,15 +55,39 @@ class elasticsearch_plugin_impl std::string _elasticsearch_node_url = "http://localhost:9200/"; uint32_t _elasticsearch_bulk_replay = 10000; uint32_t _elasticsearch_bulk_sync = 100; - bool _elasticsearch_logs = true; bool _elasticsearch_visitor = false; + std::string _elasticsearch_basic_auth = ""; + std::string _elasticsearch_index_prefix = "bitshares-"; CURL *curl; // curl handler - vector bulk; // vector of op lines - private: - void add_elasticsearch( const account_id_type account_id, const optional& oho, const signed_block& b ); - void createBulkLine(account_transaction_history_object ath, operation_history_struct os, int op_type, block_struct bs, visitor_struct vs); - void sendBulk(std::string _elasticsearch_node_url, bool _elasticsearch_logs); + vector bulk_lines; // vector of op lines + vector prepare; + graphene::utilities::ES es; + uint32_t limit_documents; + int16_t op_type; + operation_history_struct os; + block_struct bs; + visitor_struct vs; + bulk_struct bulk_line_struct; + std::string bulk_line; + std::string index_name; + bool is_sync = false; + private: + bool add_elasticsearch( const account_id_type account_id, const optional& oho, const signed_block& b ); + const account_transaction_history_object& addNewEntry(const account_statistics_object& stats_obj, + const account_id_type account_id, + const optional & oho); + const account_statistics_object& getStatsObject(const account_id_type account_id); + void growStats(const account_statistics_object& stats_obj, const account_transaction_history_object& ath); + void getOperationType(const optional & oho); + void doOperationHistory(const optional & oho); + void doBlock(const optional & oho, const signed_block& b); + void doVisitor(const optional & oho); + void checkState(const fc::time_point_sec& block_time); + void cleanObjects(const account_transaction_history_object& ath, account_id_type account_id); + void createBulkLine(const account_transaction_history_object& ath); + void prepareBulk(const account_transaction_history_id_type& ath_id); + void populateESstruct(); }; elasticsearch_plugin_impl::~elasticsearch_plugin_impl() @@ -86,8 +95,11 @@ elasticsearch_plugin_impl::~elasticsearch_plugin_impl() return; } -void elasticsearch_plugin_impl::update_account_histories( const signed_block& b ) +bool elasticsearch_plugin_impl::update_account_histories( const signed_block& b ) { + checkState(b.timestamp); + index_name = graphene::utilities::generateIndexName(b.timestamp, _elasticsearch_index_prefix); + graphene::chain::database& db = database(); const vector >& hist = db.get_applied_operations(); bool is_first = true; @@ -125,6 +137,13 @@ void elasticsearch_plugin_impl::update_account_histories( const signed_block& b } oho = create_oho(); + // populate what we can before impacted loop + getOperationType(oho); + doOperationHistory(oho); + doBlock(oho, b); + if(_elasticsearch_visitor) + doVisitor(oho); + const operation_history_object& op = *o_op; // get the set of accounts this operation applies to @@ -143,17 +162,124 @@ void elasticsearch_plugin_impl::update_account_histories( const signed_block& b for( auto& account_id : impacted ) { - add_elasticsearch( account_id, oho, b ); + if(!add_elasticsearch( account_id, oho, b )) + return false; } } + // we send bulk at end of block when we are in sync for better real time client experience + if(is_sync) + { + populateESstruct(); + if(es.bulk_lines.size() > 0) + { + prepare.clear(); + if(!graphene::utilities::SendBulk(es)) + return false; + else + bulk_lines.clear(); + } + } + + return true; +} + +void elasticsearch_plugin_impl::checkState(const fc::time_point_sec& block_time) +{ + if((fc::time_point::now() - block_time) < fc::seconds(30)) + { + limit_documents = _elasticsearch_bulk_sync; + is_sync = true; + } + else + { + limit_documents = _elasticsearch_bulk_replay; + is_sync = false; + } } -void elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account_id, const optional & oho, const signed_block& b) +void elasticsearch_plugin_impl::getOperationType(const optional & oho) +{ + if (!oho->id.is_null()) + op_type = oho->op.which(); +} + +void elasticsearch_plugin_impl::doOperationHistory(const optional & oho) +{ + os.trx_in_block = oho->trx_in_block; + os.op_in_trx = oho->op_in_trx; + os.operation_result = fc::json::to_string(oho->result); + os.virtual_op = oho->virtual_op; + os.op = fc::json::to_string(oho->op); +} + +void elasticsearch_plugin_impl::doBlock(const optional & oho, const signed_block& b) +{ + std::string trx_id = ""; + if(oho->trx_in_block < b.transactions.size()) + trx_id = b.transactions[oho->trx_in_block].id().str(); + bs.block_num = b.block_num(); + bs.block_time = b.timestamp; + bs.trx_id = trx_id; +} + +void elasticsearch_plugin_impl::doVisitor(const optional & oho) +{ + operation_visitor o_v; + oho->op.visit(o_v); + + vs.fee_data.asset = o_v.fee_asset; + vs.fee_data.amount = o_v.fee_amount; + + vs.transfer_data.asset = o_v.transfer_asset_id; + vs.transfer_data.amount = o_v.transfer_amount; + vs.transfer_data.from = o_v.transfer_from; + vs.transfer_data.to = o_v.transfer_to; + + vs.fill_data.order_id = o_v.fill_order_id; + vs.fill_data.account_id = o_v.fill_account_id; + vs.fill_data.pays_asset_id = o_v.fill_pays_asset_id; + vs.fill_data.pays_amount = o_v.fill_pays_amount; + vs.fill_data.receives_asset_id = o_v.fill_receives_asset_id; + vs.fill_data.receives_amount = o_v.fill_receives_amount; + //vs.fill_data.fill_price = o_v.fill_fill_price; + //vs.fill_data.is_maker = o_v.fill_is_maker; +} + +bool elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account_id, + const optional & oho, + const signed_block& b) +{ + const auto &stats_obj = getStatsObject(account_id); + const auto &ath = addNewEntry(stats_obj, account_id, oho); + growStats(stats_obj, ath); + createBulkLine(ath); + prepareBulk(ath.id); + cleanObjects(ath, account_id); + + if (curl && bulk_lines.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech + prepare.clear(); + populateESstruct(); + if(!graphene::utilities::SendBulk(es)) + return false; + else + bulk_lines.clear(); + } + + return true; +} + +const account_statistics_object& elasticsearch_plugin_impl::getStatsObject(const account_id_type account_id) { graphene::chain::database& db = database(); - const auto &stats_obj = account_id(db).statistics(db); + const auto &acct = db.get(account_id); + return acct.statistics(db); +} - // add new entry +const account_transaction_history_object& elasticsearch_plugin_impl::addNewEntry(const account_statistics_object& stats_obj, + const account_id_type account_id, + const optional & oho) +{ + graphene::chain::database& db = database(); const auto &ath = db.create([&](account_transaction_history_object &obj) { obj.operation_id = oho->id; obj.account = account_id; @@ -161,62 +287,45 @@ void elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account obj.next = stats_obj.most_recent_op; }); - // keep stats growing as no op will be removed + return ath; +} + +void elasticsearch_plugin_impl::growStats(const account_statistics_object& stats_obj, + const account_transaction_history_object& ath) +{ + graphene::chain::database& db = database(); db.modify(stats_obj, [&](account_statistics_object &obj) { obj.most_recent_op = ath.id; obj.total_ops = ath.sequence; }); +} - // operation_type - int op_type = -1; - if (!oho->id.is_null()) - op_type = oho->op.which(); +void elasticsearch_plugin_impl::createBulkLine(const account_transaction_history_object& ath) +{ + bulk_line_struct.account_history = ath; + bulk_line_struct.operation_history = os; + bulk_line_struct.operation_type = op_type; + bulk_line_struct.operation_id_num = ath.operation_id.instance.value; + bulk_line_struct.block_data = bs; + if(_elasticsearch_visitor) + bulk_line_struct.additional_data = vs; + bulk_line = fc::json::to_string(bulk_line_struct); +} - // operation history data - operation_history_struct os; - os.trx_in_block = oho->trx_in_block; - os.op_in_trx = oho->op_in_trx; - os.operation_result = fc::json::to_string(oho->result); - os.virtual_op = oho->virtual_op; - os.op = fc::json::to_string(oho->op); - - // visitor data - visitor_struct vs; - if(_elasticsearch_visitor) { - operation_visitor o_v; - oho->op.visit(o_v); - - vs.fee_data.asset = o_v.fee_asset; - vs.fee_data.amount = o_v.fee_amount; - vs.transfer_data.asset = o_v.transfer_asset_id; - vs.transfer_data.amount = o_v.transfer_amount; - vs.transfer_data.from = o_v.transfer_from; - vs.transfer_data.to = o_v.transfer_to; - } - - // block data - std::string trx_id = ""; - if(!b.transactions.empty() && oho->trx_in_block < b.transactions.size()) { - trx_id = b.transactions[oho->trx_in_block].id().str(); - } - block_struct bs; - bs.block_num = b.block_num(); - bs.block_time = b.timestamp; - bs.trx_id = trx_id; - - // check if we are in replay or in sync and change number of bulk documents accordingly - uint32_t limit_documents = 0; - if((fc::time_point::now() - b.timestamp) < fc::seconds(30)) - limit_documents = _elasticsearch_bulk_sync; - else - limit_documents = _elasticsearch_bulk_replay; - - createBulkLine(ath, os, op_type, bs, vs); // we have everything, creating bulk line - - if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech - sendBulk(_elasticsearch_node_url, _elasticsearch_logs); - } +void elasticsearch_plugin_impl::prepareBulk(const account_transaction_history_id_type& ath_id) +{ + const std::string _id = fc::json::to_string(ath_id); + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = index_name; + bulk_header["_type"] = "data"; + bulk_header["_id"] = fc::to_string(ath_id.space_id) + "." + fc::to_string(ath_id.type_id) + "." + ath_id.instance; + prepare = graphene::utilities::createBulk(bulk_header, bulk_line); + bulk_lines.insert(bulk_lines.end(), prepare.begin(), prepare.end()); +} +void elasticsearch_plugin_impl::cleanObjects(const account_transaction_history_object& ath, account_id_type account_id) +{ + graphene::chain::database& db = database(); // remove everything except current object from ath const auto &his_idx = db.get_index_type(); const auto &by_seq_idx = his_idx.indices().get(); @@ -243,95 +352,12 @@ void elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account } } -void elasticsearch_plugin_impl::createBulkLine(account_transaction_history_object ath, operation_history_struct os, int op_type, block_struct bs, visitor_struct vs) +void elasticsearch_plugin_impl::populateESstruct() { - bulk_struct bulks; - bulks.account_history = ath; - bulks.operation_history = os; - bulks.operation_type = op_type; - bulks.block_data = bs; - bulks.additional_data = vs; - - std::string alltogether = fc::json::to_string(bulks); - - auto block_date = bulks.block_data.block_time.to_iso_string(); - std::vector parts; - boost::split(parts, block_date, boost::is_any_of("-")); - std::string index_name = "graphene-" + parts[0] + "-" + parts[1]; - - // bulk header before each line, op_type = create to avoid dups, index id will be ath id(2.9.X). - std::string _id = fc::json::to_string(ath.id); - bulk.push_back("{ \"index\" : { \"_index\" : \""+index_name+"\", \"_type\" : \"data\", \"op_type\" : \"create\", \"_id\" : "+_id+" } }"); // header - bulk.push_back(alltogether); -} - -void elasticsearch_plugin_impl::sendBulk(std::string _elasticsearch_node_url, bool _elasticsearch_logs) -{ - - // curl buffers to read - std::string readBuffer; - std::string readBuffer_logs; - - std::string bulking = ""; - - bulking = boost::algorithm::join(bulk, "\n"); - bulking = bulking + "\n"; - bulk.clear(); - - //wlog((bulking)); - - struct curl_slist *headers = NULL; - curl_slist_append(headers, "Content-Type: application/json"); - std::string url = _elasticsearch_node_url + "_bulk"; - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl, CURLOPT_POST, true); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, bulking.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&readBuffer); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); - //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); - curl_easy_perform(curl); - - long http_code = 0; - curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); - if(http_code == 200) { - // all good, do nothing - } - else if(http_code == 429) { - // repeat request? - } - else { - // exit everything ? - } - - if(_elasticsearch_logs) { - auto logs = readBuffer; - // do logs - std::string url_logs = _elasticsearch_node_url + "logs/data/"; - curl_easy_setopt(curl, CURLOPT_URL, url_logs.c_str()); - curl_easy_setopt(curl, CURLOPT_POST, true); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, logs.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &readBuffer_logs); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); - //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); - //ilog("log here curl: ${output}", ("output", readBuffer_logs)); - curl_easy_perform(curl); - - http_code = 0; - curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); - if(http_code == 200) { - // all good, do nothing - } - else if(http_code == 429) { - // repeat request? - } - else { - // exit everything ? - } - } + es.curl = curl; + es.bulk_lines = bulk_lines; + es.elasticsearch_url = _elasticsearch_node_url; + es.auth = _elasticsearch_basic_auth; } } // end namespace detail @@ -363,15 +389,21 @@ void elasticsearch_plugin::plugin_set_program_options( ("elasticsearch-node-url", boost::program_options::value(), "Elastic Search database node url") ("elasticsearch-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") ("elasticsearch-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") - ("elasticsearch-logs", boost::program_options::value(), "Log bulk events to database") ("elasticsearch-visitor", boost::program_options::value(), "Use visitor to index additional data(slows down the replay)") + ("elasticsearch-basic-auth", boost::program_options::value(), "Pass basic auth to elasticsearch database ") + ("elasticsearch-index-prefix", boost::program_options::value(), "Add a prefix to the index(bitshares-)") ; cfg.add(cli); } void elasticsearch_plugin::plugin_initialize(const boost::program_options::variables_map& options) { - database().applied_block.connect( [&]( const signed_block& b){ my->update_account_histories(b); } ); + database().applied_block.connect( [&]( const signed_block& b) { + if(!my->update_account_histories(b)) + { + FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); + } + } ); my->_oho_index = database().add_index< primary_index< operation_history_index > >(); database().add_index< primary_index< account_transaction_history_index > >(); @@ -384,16 +416,27 @@ void elasticsearch_plugin::plugin_initialize(const boost::program_options::varia if (options.count("elasticsearch-bulk-sync")) { my->_elasticsearch_bulk_sync = options["elasticsearch-bulk-sync"].as(); } - if (options.count("elasticsearch-logs")) { - my->_elasticsearch_logs = options["elasticsearch-logs"].as(); - } if (options.count("elasticsearch-visitor")) { my->_elasticsearch_visitor = options["elasticsearch-visitor"].as(); } + if (options.count("elasticsearch-basic-auth")) { + my->_elasticsearch_basic_auth = options["elasticsearch-basic-auth"].as(); + } + if (options.count("elasticsearch-index-prefix")) { + my->_elasticsearch_index_prefix = options["elasticsearch-index-prefix"].as(); + } } void elasticsearch_plugin::plugin_startup() { + graphene::utilities::ES es; + es.curl = my->curl; + es.elasticsearch_url = my->_elasticsearch_node_url; + es.auth = my->_elasticsearch_basic_auth; + + if(!graphene::utilities::checkES(es)) + FC_THROW_EXCEPTION(fc::exception, "ES database is not up in url ${url}", ("url", my->_elasticsearch_node_url)); + ilog("elasticsearch ACCOUNT HISTORY: plugin_startup() begin"); } } } diff --git a/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp index cc51c247..19a48843 100644 --- a/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp +++ b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp @@ -29,9 +29,6 @@ namespace graphene { namespace elasticsearch { using namespace chain; - //using namespace graphene::db; - //using boost::multi_index_container; - //using namespace boost::multi_index; // // Plugins should #define their SPACE_ID's so plugins with @@ -47,12 +44,6 @@ namespace graphene { namespace elasticsearch { #define ELASTICSEARCH_SPACE_ID 6 #endif -static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ - ((std::string*)userp)->append((char*)contents, size * nmemb); - return size * nmemb; -} - namespace detail { class elasticsearch_plugin_impl; @@ -76,7 +67,6 @@ class elasticsearch_plugin : public graphene::app::plugin std::unique_ptr my; }; - struct operation_visitor { typedef void result_type; @@ -99,6 +89,31 @@ struct operation_visitor transfer_from = o.from; transfer_to = o.to; } + + object_id_type fill_order_id; + account_id_type fill_account_id; + asset_id_type fill_pays_asset_id; + share_type fill_pays_amount; + asset_id_type fill_receives_asset_id; + share_type fill_receives_amount; + //double fill_fill_price; + //bool fill_is_maker; + + void operator()( const graphene::chain::fill_order_operation& o ) + { + fee_asset = o.fee.asset_id; + fee_amount = o.fee.amount; + + fill_order_id = o.order_id; + fill_account_id = o.account_id; + fill_pays_asset_id = o.pays.asset_id; + fill_pays_amount = o.pays.amount; + fill_receives_asset_id = o.receives.asset_id; + fill_receives_amount = o.receives.amount; + //fill_fill_price = o.fill_price.to_real(); + //fill_is_maker = o.is_maker; + } + template void operator()( const T& o ) { @@ -133,27 +148,38 @@ struct transfer_struct { account_id_type to; }; +struct fill_struct { + object_id_type order_id; + account_id_type account_id; + asset_id_type pays_asset_id; + share_type pays_amount; + asset_id_type receives_asset_id; + share_type receives_amount; + double fill_price; + bool is_maker; +}; + struct visitor_struct { fee_struct fee_data; transfer_struct transfer_data; + fill_struct fill_data; }; struct bulk_struct { account_transaction_history_object account_history; operation_history_struct operation_history; int operation_type; + int operation_id_num; block_struct block_data; - visitor_struct additional_data; + optional additional_data; }; - } } //graphene::elasticsearch FC_REFLECT( graphene::elasticsearch::operation_history_struct, (trx_in_block)(op_in_trx)(operation_result)(virtual_op)(op) ) FC_REFLECT( graphene::elasticsearch::block_struct, (block_num)(block_time)(trx_id) ) FC_REFLECT( graphene::elasticsearch::fee_struct, (asset)(amount) ) FC_REFLECT( graphene::elasticsearch::transfer_struct, (asset)(amount)(from)(to) ) -FC_REFLECT( graphene::elasticsearch::visitor_struct, (fee_data)(transfer_data) ) -FC_REFLECT( graphene::elasticsearch::bulk_struct, (account_history)(operation_history)(operation_type)(block_data)(additional_data) ) - - +FC_REFLECT( graphene::elasticsearch::fill_struct, (order_id)(account_id)(pays_asset_id)(pays_amount)(receives_asset_id)(receives_amount)(fill_price)(is_maker)) +FC_REFLECT( graphene::elasticsearch::visitor_struct, (fee_data)(transfer_data)(fill_data) ) +FC_REFLECT( graphene::elasticsearch::bulk_struct, (account_history)(operation_history)(operation_type)(operation_id_num)(block_data)(additional_data) ) diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 7c9c2b61..5f04e40c 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -47,10 +47,11 @@ class es_objects_plugin_impl { curl = curl_easy_init(); } virtual ~es_objects_plugin_impl(); - void updateDatabase( const vector& ids , bool isNew); + bool updateDatabase( const vector& ids , bool isNew); es_objects_plugin& _self; std::string _es_objects_elasticsearch_url = "http://localhost:9200/"; + std::string _es_objects_auth = ""; uint32_t _es_objects_bulk_replay = 5000; uint32_t _es_objects_bulk_sync = 10; bool _es_objects_proposals = true; @@ -59,24 +60,27 @@ class es_objects_plugin_impl bool _es_objects_balances = true; bool _es_objects_limit_orders = true; bool _es_objects_asset_bitasset = true; - bool _es_objects_logs = true; + std::string _es_objects_index_prefix = "objects-"; CURL *curl; // curl handler vector bulk; vector prepare; - map bitassets; - //uint32_t bitasset_seq; + map bitassets; + map accounts; + map proposals; + map assets; + map balances; + map limit_orders; private: - void PrepareProposal(const proposal_object* proposal_object, const fc::time_point_sec block_time, uint32_t block_number); - void PrepareAccount(const account_object* account_object, const fc::time_point_sec block_time, uint32_t block_number); - void PrepareAsset(const asset_object* asset_object, const fc::time_point_sec block_time, uint32_t block_number); - void PrepareBalance(const balance_object* balance_object, const fc::time_point_sec block_time, uint32_t block_number); - void PrepareLimit(const limit_order_object* limit_object, const fc::time_point_sec block_time, uint32_t block_number); - void PrepareBitAsset(const asset_bitasset_data_object* bitasset_object, const fc::time_point_sec block_time, uint32_t block_number); + void PrepareProposal(const proposal_object& proposal_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void PrepareAccount(const account_object& account_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void PrepareAsset(const asset_object& asset_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void PrepareBalance(const balance_object& balance_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void PrepareLimit(const limit_order_object& limit_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void PrepareBitAsset(const asset_bitasset_data_object& bitasset_object, const fc::time_point_sec& block_time, const uint32_t& block_number); }; -void es_objects_plugin_impl::updateDatabase( const vector& ids , bool isNew) +bool es_objects_plugin_impl::updateDatabase( const vector& ids , bool isNew) { - graphene::chain::database &db = _self.database(); const fc::time_point_sec block_time = db.head_block_time(); @@ -89,175 +93,259 @@ void es_objects_plugin_impl::updateDatabase( const vector& ids , else limit_documents = _es_objects_bulk_replay; - if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech - if(!graphene::utilities::SendBulk(curl, bulk, _es_objects_elasticsearch_url, _es_objects_logs, "objects_logs")) - elog("Error sending data to database"); - bulk.clear(); - } - for(auto const& value: ids) { if(value.is() && _es_objects_proposals) { auto obj = db.find_object(value); auto p = static_cast(obj); if(p != nullptr) - PrepareProposal(p, block_time, block_number); + PrepareProposal(*p, block_time, block_number); } else if(value.is() && _es_objects_accounts) { auto obj = db.find_object(value); auto a = static_cast(obj); if(a != nullptr) - PrepareAccount(a, block_time, block_number); + PrepareAccount(*a, block_time, block_number); } else if(value.is() && _es_objects_assets) { auto obj = db.find_object(value); auto a = static_cast(obj); if(a != nullptr) - PrepareAsset(a, block_time, block_number); + PrepareAsset(*a, block_time, block_number); } else if(value.is() && _es_objects_balances) { auto obj = db.find_object(value); auto b = static_cast(obj); if(b != nullptr) - PrepareBalance(b, block_time, block_number); + PrepareBalance(*b, block_time, block_number); } else if(value.is() && _es_objects_limit_orders) { auto obj = db.find_object(value); auto l = static_cast(obj); if(l != nullptr) - PrepareLimit(l, block_time, block_number); + PrepareLimit(*l, block_time, block_number); } else if(value.is() && _es_objects_asset_bitasset) { auto obj = db.find_object(value); auto ba = static_cast(obj); if(ba != nullptr) - PrepareBitAsset(ba, block_time, block_number); + PrepareBitAsset(*ba, block_time, block_number); } } + + if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech + + graphene::utilities::ES es; + es.curl = curl; + es.bulk_lines = bulk; + es.elasticsearch_url = _es_objects_elasticsearch_url; + es.auth = _es_objects_auth; + + if(!graphene::utilities::SendBulk(es)) + return false; + else + bulk.clear(); + } + + return true; } -void es_objects_plugin_impl::PrepareProposal(const proposal_object* proposal_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareProposal(const proposal_object& proposal_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { proposal_struct prop; - prop.object_id = proposal_object->id; + prop.object_id = proposal_object.id; prop.block_time = block_time; prop.block_number = block_number; - prop.expiration_time = proposal_object->expiration_time; - prop.review_period_time = proposal_object->review_period_time; - prop.proposed_transaction = fc::json::to_string(proposal_object->proposed_transaction); - prop.required_owner_approvals = fc::json::to_string(proposal_object->required_owner_approvals); - prop.available_owner_approvals = fc::json::to_string(proposal_object->available_owner_approvals); - prop.required_active_approvals = fc::json::to_string(proposal_object->required_active_approvals); - prop.available_key_approvals = fc::json::to_string(proposal_object->available_key_approvals); - prop.proposer = proposal_object->proposer; + prop.expiration_time = proposal_object.expiration_time; + prop.review_period_time = proposal_object.review_period_time; + prop.proposed_transaction = fc::json::to_string(proposal_object.proposed_transaction); + prop.required_owner_approvals = fc::json::to_string(proposal_object.required_owner_approvals); + prop.available_owner_approvals = fc::json::to_string(proposal_object.available_owner_approvals); + prop.required_active_approvals = fc::json::to_string(proposal_object.required_active_approvals); + prop.available_key_approvals = fc::json::to_string(proposal_object.available_key_approvals); + prop.proposer = proposal_object.proposer; + + auto it = proposals.find(proposal_object.id); + if(it == proposals.end()) + proposals[proposal_object.id] = prop; + else { + if(it->second == prop) return; + else proposals[proposal_object.id] = prop; + } std::string data = fc::json::to_string(prop); - prepare = graphene::utilities::createBulk("bitshares-proposal", data, "", 1); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "proposal"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } -void es_objects_plugin_impl::PrepareAccount(const account_object* account_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareAccount(const account_object& account_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { account_struct acct; - acct.object_id = account_object->id; + acct.object_id = account_object.id; acct.block_time = block_time; acct.block_number = block_number; - acct.membership_expiration_date = account_object->membership_expiration_date; - acct.registrar = account_object->registrar; - acct.referrer = account_object->referrer; - acct.lifetime_referrer = account_object->lifetime_referrer; - acct.network_fee_percentage = account_object->network_fee_percentage; - acct.lifetime_referrer_fee_percentage = account_object->lifetime_referrer_fee_percentage; - acct.referrer_rewards_percentage = account_object->referrer_rewards_percentage; - acct.name = account_object->name; - acct.owner_account_auths = fc::json::to_string(account_object->owner.account_auths); - acct.owner_key_auths = fc::json::to_string(account_object->owner.key_auths); - acct.owner_address_auths = fc::json::to_string(account_object->owner.address_auths); - acct.active_account_auths = fc::json::to_string(account_object->active.account_auths); - acct.active_key_auths = fc::json::to_string(account_object->active.key_auths); - acct.active_address_auths = fc::json::to_string(account_object->active.address_auths); - acct.voting_account = account_object->options.voting_account; + acct.membership_expiration_date = account_object.membership_expiration_date; + acct.registrar = account_object.registrar; + acct.referrer = account_object.referrer; + acct.lifetime_referrer = account_object.lifetime_referrer; + acct.network_fee_percentage = account_object.network_fee_percentage; + acct.lifetime_referrer_fee_percentage = account_object.lifetime_referrer_fee_percentage; + acct.referrer_rewards_percentage = account_object.referrer_rewards_percentage; + acct.name = account_object.name; + acct.owner_account_auths = fc::json::to_string(account_object.owner.account_auths); + acct.owner_key_auths = fc::json::to_string(account_object.owner.key_auths); + acct.owner_address_auths = fc::json::to_string(account_object.owner.address_auths); + acct.active_account_auths = fc::json::to_string(account_object.active.account_auths); + acct.active_key_auths = fc::json::to_string(account_object.active.key_auths); + acct.active_address_auths = fc::json::to_string(account_object.active.address_auths); + acct.voting_account = account_object.options.voting_account; + + auto it = accounts.find(account_object.id); + if(it == accounts.end()) + accounts[account_object.id] = acct; + else { + if(it->second == acct) return; + else accounts[account_object.id] = acct; + } std::string data = fc::json::to_string(acct); - prepare = graphene::utilities::createBulk("bitshares-account", data, "", 1); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "acount"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } -void es_objects_plugin_impl::PrepareAsset(const asset_object* asset_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareAsset(const asset_object& asset_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { - asset_struct _asset; - _asset.object_id = asset_object->id; - _asset.block_time = block_time; - _asset.block_number = block_number; - _asset.symbol = asset_object->symbol; - _asset.issuer = asset_object->issuer; - _asset.is_market_issued = asset_object->is_market_issued(); - _asset.dynamic_asset_data_id = asset_object->dynamic_asset_data_id; - _asset.bitasset_data_id = asset_object->bitasset_data_id; + asset_struct asset; + asset.object_id = asset_object.id; + asset.block_time = block_time; + asset.block_number = block_number; + asset.symbol = asset_object.symbol; + asset.issuer = asset_object.issuer; + asset.is_market_issued = asset_object.is_market_issued(); + asset.dynamic_asset_data_id = asset_object.dynamic_asset_data_id; + asset.bitasset_data_id = asset_object.bitasset_data_id; - std::string data = fc::json::to_string(_asset); - prepare = graphene::utilities::createBulk("bitshares-asset", data, fc::json::to_string(asset_object->id), 0); + auto it = assets.find(asset_object.id); + if(it == assets.end()) + assets[asset_object.id] = asset; + else { + if(it->second == asset) return; + else assets[asset_object.id] = asset; + } + + std::string data = fc::json::to_string(asset); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "asset"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } -void es_objects_plugin_impl::PrepareBalance(const balance_object* balance_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareBalance(const balance_object& balance_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { balance_struct balance; - balance.object_id = balance_object->id; + balance.object_id = balance_object.id; balance.block_time = block_time; - balance.block_number = block_number;balance.owner = balance_object->owner; - balance.asset_id = balance_object->balance.asset_id; - balance.amount = balance_object->balance.amount; + balance.block_number = block_number;balance.owner = balance_object.owner; + balance.asset_id = balance_object.balance.asset_id; + balance.amount = balance_object.balance.amount; + + auto it = balances.find(balance_object.id); + if(it == balances.end()) + balances[balance_object.id] = balance; + else { + if(it->second == balance) return; + else balances[balance_object.id] = balance; + } std::string data = fc::json::to_string(balance); - prepare = graphene::utilities::createBulk("bitshares-balance", data, "", 1); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "balance"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } -void es_objects_plugin_impl::PrepareLimit(const limit_order_object* limit_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareLimit(const limit_order_object& limit_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { limit_order_struct limit; - limit.object_id = limit_object->id; + limit.object_id = limit_object.id; limit.block_time = block_time; limit.block_number = block_number; - limit.expiration = limit_object->expiration; - limit.seller = limit_object->seller; - limit.for_sale = limit_object->for_sale; - limit.sell_price = limit_object->sell_price; - limit.deferred_fee = limit_object->deferred_fee; + limit.expiration = limit_object.expiration; + limit.seller = limit_object.seller; + limit.for_sale = limit_object.for_sale; + limit.sell_price = limit_object.sell_price; + limit.deferred_fee = limit_object.deferred_fee; + + auto it = limit_orders.find(limit_object.id); + if(it == limit_orders.end()) + limit_orders[limit_object.id] = limit; + else { + if(it->second == limit) return; + else limit_orders[limit_object.id] = limit; + } std::string data = fc::json::to_string(limit); - prepare = graphene::utilities::createBulk("bitshares-limitorder", data, "", 1); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "limitorder"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } -void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object* bitasset_object, const fc::time_point_sec block_time, uint32_t block_number) +void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object& bitasset_object, + const fc::time_point_sec& block_time, const uint32_t& block_number) { - if(!bitasset_object->is_prediction_market) { - - auto object_id = bitasset_object->id; - auto it = bitassets.find(object_id); - if(it == bitassets.end()) - bitassets[object_id] = fc::json::to_string(bitasset_object->current_feed); - else { - if(it->second == fc::json::to_string(bitasset_object->current_feed)) return; - else bitassets[object_id] = fc::json::to_string(bitasset_object->current_feed); - } + if(!bitasset_object.is_prediction_market) { bitasset_struct bitasset; - - bitasset.object_id = bitasset_object->id; + bitasset.object_id = bitasset_object.id; bitasset.block_time = block_time; bitasset.block_number = block_number; - bitasset.current_feed = fc::json::to_string(bitasset_object->current_feed); - bitasset.current_feed_publication_time = bitasset_object->current_feed_publication_time; + bitasset.current_feed = fc::json::to_string(bitasset_object.current_feed); + bitasset.current_feed_publication_time = bitasset_object.current_feed_publication_time; + + auto it = bitassets.find(bitasset_object.id); + if(it == bitassets.end()) + bitassets[bitasset_object.id] = bitasset; + else { + if(it->second == bitasset) return; + else bitassets[bitasset_object.id] = bitasset; + } std::string data = fc::json::to_string(bitasset); - prepare = graphene::utilities::createBulk("bitshares-bitasset", data, "", 1); + + fc::mutable_variant_object bulk_header; + bulk_header["_index"] = _es_objects_index_prefix + "bitasset"; + bulk_header["_type"] = "data"; + + prepare = graphene::utilities::createBulk(bulk_header, data); bulk.insert(bulk.end(), prepare.begin(), prepare.end()); prepare.clear(); } @@ -268,7 +356,6 @@ es_objects_plugin_impl::~es_objects_plugin_impl() return; } - } // end namespace detail es_objects_plugin::es_objects_plugin() : @@ -296,7 +383,7 @@ void es_objects_plugin::plugin_set_program_options( { cli.add_options() ("es-objects-elasticsearch-url", boost::program_options::value(), "Elasticsearch node url") - ("es-objects-logs", boost::program_options::value(), "Log bulk events to database") + ("es-objects-auth", boost::program_options::value(), "Basic auth username:password") ("es-objects-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") ("es-objects-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") ("es-objects-proposals", boost::program_options::value(), "Store proposal objects") @@ -305,21 +392,30 @@ void es_objects_plugin::plugin_set_program_options( ("es-objects-balances", boost::program_options::value(), "Store balances objects") ("es-objects-limit-orders", boost::program_options::value(), "Store limit order objects") ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data") - + ("es-objects-index-prefix", boost::program_options::value(), "Add a prefix to the index(objects-)") ; cfg.add(cli); } void es_objects_plugin::plugin_initialize(const boost::program_options::variables_map& options) { - database().new_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ){ my->updateDatabase(ids, 1); }); - database().changed_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ){ my->updateDatabase(ids, 0); }); - + database().new_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { + if(!my->updateDatabase(ids, 1)) + { + FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); + } + }); + database().changed_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { + if(!my->updateDatabase(ids, 0)) + { + FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); + } + }); if (options.count("es-objects-elasticsearch-url")) { my->_es_objects_elasticsearch_url = options["es-objects-elasticsearch-url"].as(); } - if (options.count("es-objects-logs")) { - my->_es_objects_logs = options["es-objects-logs"].as(); + if (options.count("es-objects-auth")) { + my->_es_objects_auth = options["es-objects-auth"].as(); } if (options.count("es-objects-bulk-replay")) { my->_es_objects_bulk_replay = options["es-objects-bulk-replay"].as(); @@ -345,11 +441,22 @@ void es_objects_plugin::plugin_initialize(const boost::program_options::variable if (options.count("es-objects-asset-bitasset")) { my->_es_objects_asset_bitasset = options["es-objects-asset-bitasset"].as(); } + if (options.count("es-objects-index-prefix")) { + my->_es_objects_index_prefix = options["es-objects-index-prefix"].as(); + } } void es_objects_plugin::plugin_startup() { - ilog("elasticsearch objects: plugin_startup() begin"); + graphene::utilities::ES es; + es.curl = my->curl; + es.elasticsearch_url = my->_es_objects_elasticsearch_url; + es.auth = my->_es_objects_auth; + es.auth = my->_es_objects_index_prefix; + + if(!graphene::utilities::checkES(es)) + FC_THROW_EXCEPTION(fc::exception, "ES database is not up in url ${url}", ("url", my->_es_objects_elasticsearch_url)); + ilog("elasticsearch OBJECTS: plugin_startup() begin"); } -} } \ No newline at end of file +} } diff --git a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp index 31809e04..d9c38711 100644 --- a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp +++ b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp @@ -68,6 +68,20 @@ struct proposal_struct { string available_key_approvals; account_id_type proposer; + friend bool operator==(const proposal_struct& l, const proposal_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.expiration_time, l.review_period_time, + l.proposed_transaction, l.required_active_approvals, l.available_active_approvals, + l.required_owner_approvals, l.available_owner_approvals, l.available_key_approvals, + l.proposer) == std::tie(r.object_id, r.block_time, r.block_number, r.expiration_time, r.review_period_time, + r.proposed_transaction, r.required_active_approvals, r.available_active_approvals, + r.required_owner_approvals, r.available_owner_approvals, r.available_key_approvals, + r.proposer); + } + friend bool operator!=(const proposal_struct& l, const proposal_struct& r) + { + return !operator==(l, r); + } }; struct account_struct { object_id_type object_id; @@ -88,6 +102,23 @@ struct account_struct { string active_key_auths; string active_address_auths; account_id_type voting_account; + + friend bool operator==(const account_struct& l, const account_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.membership_expiration_date, l.registrar, l.referrer, + l.lifetime_referrer, l.network_fee_percentage, l.lifetime_referrer_fee_percentage, + l.referrer_rewards_percentage, l.name, l.owner_account_auths, l.owner_key_auths, + l.owner_address_auths, l.active_account_auths, l.active_key_auths, l.active_address_auths, + l.voting_account) == std::tie(r.object_id, r.block_time, r.block_number, r.membership_expiration_date, r.registrar, r.referrer, + r.lifetime_referrer, r.network_fee_percentage, r.lifetime_referrer_fee_percentage, + r.referrer_rewards_percentage, r.name, r.owner_account_auths, r.owner_key_auths, + r.owner_address_auths, r.active_account_auths, r.active_key_auths, r.active_address_auths, + r.voting_account); + } + friend bool operator!=(const account_struct& l, const account_struct& r) + { + return !operator==(l, r); + } }; struct asset_struct { object_id_type object_id; @@ -99,6 +130,17 @@ struct asset_struct { asset_dynamic_data_id_type dynamic_asset_data_id; optional bitasset_data_id; + friend bool operator==(const asset_struct& l, const asset_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.symbol, l.issuer, l.is_market_issued, + l.dynamic_asset_data_id, l.bitasset_data_id) == std::tie(r.object_id, r.block_time, + r.block_number, r.symbol, r.issuer, r.is_market_issued, r.dynamic_asset_data_id, + r.bitasset_data_id); + } + friend bool operator!=(const asset_struct& l, const asset_struct& r) + { + return !operator==(l, r); + } }; struct balance_struct { object_id_type object_id; @@ -107,6 +149,16 @@ struct balance_struct { address owner; asset_id_type asset_id; share_type amount; + + friend bool operator==(const balance_struct& l, const balance_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.block_time, l.owner, l.asset_id, l.amount) + == std::tie(r.object_id, r.block_time, r.block_number, r.block_time, r.owner, r.asset_id, r.amount); + } + friend bool operator!=(const balance_struct& l, const balance_struct& r) + { + return !operator==(l, r); + } }; struct limit_order_struct { object_id_type object_id; @@ -117,6 +169,16 @@ struct limit_order_struct { share_type for_sale; price sell_price; share_type deferred_fee; + + friend bool operator==(const limit_order_struct& l, const limit_order_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.expiration, l.seller, l.for_sale, l.sell_price, l.deferred_fee) + == std::tie(r.object_id, r.block_time, r.block_number, r.expiration, r.seller, r.for_sale, r.sell_price, r.deferred_fee); + } + friend bool operator!=(const limit_order_struct& l, const limit_order_struct& r) + { + return !operator==(l, r); + } }; struct bitasset_struct { object_id_type object_id; @@ -125,6 +187,16 @@ struct bitasset_struct { string current_feed; time_point_sec current_feed_publication_time; time_point_sec feed_expiration_time; + + friend bool operator==(const bitasset_struct& l, const bitasset_struct& r) + { + return std::tie(l.object_id, l.block_time, l.block_number, l.current_feed, l.current_feed_publication_time) + == std::tie(r.object_id, r.block_time, r.block_number, r.current_feed, r.current_feed_publication_time); + } + friend bool operator!=(const bitasset_struct& l, const bitasset_struct& r) + { + return !operator==(l, r); + } }; } } //graphene::es_objects @@ -134,4 +206,4 @@ FC_REFLECT( graphene::es_objects::account_struct, (object_id)(block_time)(block_ FC_REFLECT( graphene::es_objects::asset_struct, (object_id)(block_time)(block_number)(symbol)(issuer)(is_market_issued)(dynamic_asset_data_id)(bitasset_data_id) ) FC_REFLECT( graphene::es_objects::balance_struct, (object_id)(block_time)(block_number)(block_time)(owner)(asset_id)(amount) ) FC_REFLECT( graphene::es_objects::limit_order_struct, (object_id)(block_time)(block_number)(expiration)(seller)(for_sale)(sell_price)(deferred_fee) ) -FC_REFLECT( graphene::es_objects::bitasset_struct, (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) ) \ No newline at end of file +FC_REFLECT( graphene::es_objects::bitasset_struct, (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) ) diff --git a/libraries/utilities/elasticsearch.cpp b/libraries/utilities/elasticsearch.cpp index 1674a12a..11a9561b 100644 --- a/libraries/utilities/elasticsearch.cpp +++ b/libraries/utilities/elasticsearch.cpp @@ -24,100 +24,167 @@ #include #include +#include #include +#include + +size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) +{ + ((std::string*)userp)->append((char*)contents, size * nmemb); + return size * nmemb; +} namespace graphene { namespace utilities { -bool SendBulk(CURL *curl, std::vector& bulk, std::string elasticsearch_url, bool do_logs, std::string logs_index) +bool checkES(ES& es) { - // curl buffers to read - std::string readBuffer; - std::string readBuffer_logs; + graphene::utilities::CurlRequest curl_request; + curl_request.handler = es.curl; + curl_request.url = es.elasticsearch_url + "_nodes"; + curl_request.auth = es.auth; + curl_request.type = "GET"; - std::string bulking = ""; + if(doCurl(curl_request).empty()) + return false; + return true; - bulking = boost::algorithm::join(bulk, "\n"); - bulking = bulking + "\n"; - bulk.clear(); +} +const std::string simpleQuery(ES& es) +{ + graphene::utilities::CurlRequest curl_request; + curl_request.handler = es.curl; + curl_request.url = es.elasticsearch_url + es.endpoint; + curl_request.auth = es.auth; + curl_request.type = "POST"; + curl_request.query = es.query; - struct curl_slist *headers = NULL; - headers = curl_slist_append(headers, "Content-Type: application/json"); - std::string url = elasticsearch_url + "_bulk"; - curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); - curl_easy_setopt(curl, CURLOPT_POST, true); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, bulking.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&readBuffer); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); - //curl_easy_setopt(curl, CURLOPT_VERBOSE, true); - curl_easy_perform(curl); - - long http_code = 0; - curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); - if(http_code == 200) { - // all good, do nothing - } - else if(http_code == 413) { - elog("413 error: Can be low space disk"); - return 0; - } - else { - elog(http_code + "error: Unknown error"); - return 0; - } - - if(do_logs) { - auto logs = readBuffer; - // do logs - std::string url_logs = elasticsearch_url + logs_index + "/data/"; - curl_easy_setopt(curl, CURLOPT_URL, url_logs.c_str()); - curl_easy_setopt(curl, CURLOPT_POST, true); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, logs.c_str()); - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *) &readBuffer_logs); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "libcrp/0.1"); - curl_easy_perform(curl); - - http_code = 0; - curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &http_code); - if(http_code == 200) { - // all good, do nothing - return 1; - } - else if(http_code == 201) { - // 201 is ok - return 1; - } - else if(http_code == 409) { - // 409 for record already exist is ok - return 1; - } - else if(http_code == 413) { - elog("413 error: Can be low space disk"); - return 0; - } - else { - elog(http_code + "error: Unknown error"); - return 0; - } - } - return 0; + return doCurl(curl_request); } -std::vector createBulk(std::string index_name, std::string data, std::string id, bool onlycreate) +bool SendBulk(ES& es) +{ + std::string bulking = joinBulkLines(es.bulk_lines); + + graphene::utilities::CurlRequest curl_request; + curl_request.handler = es.curl; + curl_request.url = es.elasticsearch_url + "_bulk"; + curl_request.auth = es.auth; + curl_request.type = "POST"; + curl_request.query = bulking; + + auto curlResponse = doCurl(curl_request); + + if(handleBulkResponse(getResponseCode(curl_request.handler), curlResponse)) + return true; + return false; +} + +const std::string joinBulkLines(const std::vector& bulk) +{ + auto bulking = boost::algorithm::join(bulk, "\n"); + bulking = bulking + "\n"; + + return bulking; +} +long getResponseCode(CURL *handler) +{ + long http_code = 0; + curl_easy_getinfo (handler, CURLINFO_RESPONSE_CODE, &http_code); + return http_code; +} + +bool handleBulkResponse(long http_code, const std::string& CurlReadBuffer) +{ + if(http_code == 200) { + // all good, but check errors in response + fc::variant j = fc::json::from_string(CurlReadBuffer); + bool errors = j["errors"].as_bool(); + if(errors == true) { + return false; + } + } + else { + if(http_code == 413) { + elog( "413 error: Can be low disk space" ); + } + else if(http_code == 401) { + elog( "401 error: Unauthorized" ); + } + else { + elog( std::to_string(http_code) + " error: Unknown error" ); + } + return false; + } + return true; +} + +const std::vector createBulk(const fc::mutable_variant_object& bulk_header, const std::string& data) { std::vector bulk; - std::string create_string = ""; - if(!onlycreate) - create_string = ",\"_id\" : "+id; - - bulk.push_back("{ \"index\" : { \"_index\" : \""+index_name+"\", \"_type\" : \"data\" "+create_string+" } }"); + fc::mutable_variant_object final_bulk_header; + final_bulk_header["index"] = bulk_header; + bulk.push_back(fc::json::to_string(final_bulk_header)); bulk.push_back(data); return bulk; } +bool deleteAll(ES& es) +{ + graphene::utilities::CurlRequest curl_request; + curl_request.handler = es.curl; + curl_request.url = es.elasticsearch_url + es.index_prefix + "*"; + curl_request.auth = es.auth; + curl_request.type = "DELETE"; + + auto curl_response = doCurl(curl_request); + if(curl_response.empty()) + return false; + else + return true; +} +const std::string getEndPoint(ES& es) +{ + graphene::utilities::CurlRequest curl_request; + curl_request.handler = es.curl; + curl_request.url = es.elasticsearch_url + es.endpoint; + curl_request.auth = es.auth; + curl_request.type = "GET"; + + return doCurl(curl_request); +} + +const std::string generateIndexName(const fc::time_point_sec& block_date, const std::string& _elasticsearch_index_prefix) +{ + auto block_date_string = block_date.to_iso_string(); + std::vector parts; + boost::split(parts, block_date_string, boost::is_any_of("-")); + std::string index_name = _elasticsearch_index_prefix + parts[0] + "-" + parts[1]; + return index_name; +} + +const std::string doCurl(CurlRequest& curl) +{ + std::string CurlReadBuffer; + struct curl_slist *headers = NULL; + headers = curl_slist_append(headers, "Content-Type: application/json"); + + curl_easy_setopt(curl.handler, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(curl.handler, CURLOPT_URL, curl.url.c_str()); + curl_easy_setopt(curl.handler, CURLOPT_CUSTOMREQUEST, curl.type.c_str()); + if(curl.type == "POST") + { + curl_easy_setopt(curl.handler, CURLOPT_POST, true); + curl_easy_setopt(curl.handler, CURLOPT_POSTFIELDS, curl.query.c_str()); + } + curl_easy_setopt(curl.handler, CURLOPT_WRITEFUNCTION, WriteCallback); + curl_easy_setopt(curl.handler, CURLOPT_WRITEDATA, (void *)&CurlReadBuffer); + curl_easy_setopt(curl.handler, CURLOPT_USERAGENT, "libcrp/0.1"); + if(!curl.auth.empty()) + curl_easy_setopt(curl.handler, CURLOPT_USERPWD, curl.auth.c_str()); + curl_easy_perform(curl.handler); + + return CurlReadBuffer; +} } } // end namespace graphene::utilities diff --git a/libraries/utilities/include/graphene/utilities/elasticsearch.hpp b/libraries/utilities/include/graphene/utilities/elasticsearch.hpp index 517f2345..898464b1 100644 --- a/libraries/utilities/include/graphene/utilities/elasticsearch.hpp +++ b/libraries/utilities/include/graphene/utilities/elasticsearch.hpp @@ -27,16 +27,42 @@ #include #include +#include +#include -static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) -{ - ((std::string*)userp)->append((char*)contents, size * nmemb); - return size * nmemb; -} +size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp); namespace graphene { namespace utilities { - bool SendBulk(CURL *curl, std::vector & bulk, std::string elasticsearch_url, bool do_logs, std::string logs_index); - std::vector createBulk(std::string type, std::string data, std::string id, bool onlycreate); + class ES { + public: + CURL *curl; + std::vector bulk_lines; + std::string elasticsearch_url; + std::string index_prefix; + std::string auth; + std::string endpoint; + std::string query; + }; + class CurlRequest { + public: + CURL *handler; + std::string url; + std::string type; + std::string auth; + std::string query; + }; + + bool SendBulk(ES& es); + const std::vector createBulk(const fc::mutable_variant_object& bulk_header, const std::string& data); + bool checkES(ES& es); + const std::string simpleQuery(ES& es); + bool deleteAll(ES& es); + bool handleBulkResponse(long http_code, const std::string& CurlReadBuffer); + const std::string getEndPoint(ES& es); + const std::string generateIndexName(const fc::time_point_sec& block_date, const std::string& _elasticsearch_index_prefix); + const std::string doCurl(CurlRequest& curl); + const std::string joinBulkLines(const std::vector& bulk); + long getResponseCode(CURL *handler); } } // end namespace graphene::utilities diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 44af778b..e57e3374 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,38 +8,38 @@ endif() file(GLOB UNIT_TESTS "tests/*.cpp") add_executable( chain_test ${UNIT_TESTS} ${COMMON_SOURCES} ) -target_link_libraries( chain_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( chain_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} ) if(MSVC) set_source_files_properties( tests/serialization_tests.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) endif(MSVC) file(GLOB PERFORMANCE_TESTS "performance/*.cpp") add_executable( performance_test ${PERFORMANCE_TESTS} ${COMMON_SOURCES} ) -target_link_libraries( performance_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( performance_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB BENCH_MARKS "benchmarks/*.cpp") add_executable( chain_bench ${BENCH_MARKS} ${COMMON_SOURCES} ) -target_link_libraries( chain_bench graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( chain_bench graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB APP_SOURCES "app/*.cpp") add_executable( app_test ${APP_SOURCES} ) -target_link_libraries( app_test graphene_app graphene_account_history graphene_bookie graphene_net graphene_chain graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( app_test graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_witness graphene_bookie graphene_net graphene_chain graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB INTENSE_SOURCES "intense/*.cpp") add_executable( intense_test ${INTENSE_SOURCES} ${COMMON_SOURCES} ) -target_link_libraries( intense_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( intense_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_bookie graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB BETTING_TESTS "betting/*.cpp") add_executable( betting_test ${BETTING_TESTS} ${COMMON_SOURCES} ) -target_link_libraries( betting_test graphene_chain graphene_app graphene_account_history graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( betting_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_bookie graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB TOURNAMENT_TESTS "tournament/*.cpp") add_executable( tournament_test ${TOURNAMENT_TESTS} ${COMMON_SOURCES} ) -target_link_libraries( tournament_test graphene_chain graphene_app graphene_account_history graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( tournament_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB RANDOM_SOURCES "random/*.cpp") add_executable( random_test ${RANDOM_SOURCES} ${COMMON_SOURCES} ) -target_link_libraries( random_test graphene_chain graphene_app graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) +target_link_libraries( random_test graphene_chain graphene_app graphene_elasticsearch graphene_es_objects graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) file(GLOB CLI_SOURCES "cli/*.cpp") add_executable( cli_test ${CLI_SOURCES} ) @@ -51,4 +51,8 @@ if(MSVC) set_source_files_properties( cli/main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" ) endif(MSVC) +file(GLOB ES_SOURCES "elasticsearch/*.cpp") +add_executable( es_test ${ES_SOURCES} ${COMMON_SOURCES} ) +target_link_libraries( es_test graphene_chain graphene_app graphene_account_history graphene_elasticsearch graphene_es_objects graphene_egenesis_none fc ${PLATFORM_SPECIFIC_LIBS} ) + add_subdirectory( generate_empty_blocks ) diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index 0728ce2d..8cd3dc40 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -29,11 +29,9 @@ #include #include #include +#include +#include -#include - -#include -#include #include #include #include @@ -51,9 +49,7 @@ #include #include -#include #include -#include #include "database_fixture.hpp" @@ -134,8 +130,46 @@ database_fixture::database_fixture() } // app.initialize(); - ahplugin->plugin_set_app(&app); - ahplugin->plugin_initialize(options); + + auto test_name = boost::unit_test::framework::current_test_case().p_name.value; + if(test_name == "elasticsearch_account_history" || test_name == "elasticsearch_suite") { + auto esplugin = app.register_plugin(); + esplugin->plugin_set_app(&app); + + options.insert(std::make_pair("elasticsearch-node-url", boost::program_options::variable_value(string("http://localhost:9200/"), false))); + options.insert(std::make_pair("elasticsearch-bulk-replay", boost::program_options::variable_value(uint32_t(2), false))); + options.insert(std::make_pair("elasticsearch-bulk-sync", boost::program_options::variable_value(uint32_t(2), false))); + options.insert(std::make_pair("elasticsearch-visitor", boost::program_options::variable_value(true, false))); + //options.insert(std::make_pair("elasticsearch-basic-auth", boost::program_options::variable_value(string("elastic:changeme"), false))); + + esplugin->plugin_initialize(options); + esplugin->plugin_startup(); + } + else { + auto ahplugin = app.register_plugin(); + ahplugin->plugin_set_app(&app); + ahplugin->plugin_initialize(options); + ahplugin->plugin_startup(); + } + + if(test_name == "elasticsearch_objects" || test_name == "elasticsearch_suite") { + auto esobjects_plugin = app.register_plugin(); + esobjects_plugin->plugin_set_app(&app); + + options.insert(std::make_pair("es-objects-elasticsearch-url", boost::program_options::variable_value(string("http://localhost:9200/"), false))); + options.insert(std::make_pair("es-objects-bulk-replay", boost::program_options::variable_value(uint32_t(2), false))); + options.insert(std::make_pair("es-objects-bulk-sync", boost::program_options::variable_value(uint32_t(2), false))); + options.insert(std::make_pair("es-objects-proposals", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("es-objects-accounts", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("es-objects-assets", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("es-objects-balances", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("es-objects-limit-orders", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("es-objects-asset-bitasset", boost::program_options::variable_value(true, false))); + + esobjects_plugin->plugin_initialize(options); + esobjects_plugin->plugin_startup(); + } + mhplugin->plugin_set_app(&app); mhplugin->plugin_initialize(options); bookieplugin->plugin_set_app(&app); @@ -143,7 +177,6 @@ database_fixture::database_fixture() affiliateplugin->plugin_set_app(&app); affiliateplugin->plugin_initialize(options); - ahplugin->plugin_startup(); mhplugin->plugin_startup(); bookieplugin->plugin_startup(); affiliateplugin->plugin_startup(); diff --git a/tests/elasticsearch/main.cpp b/tests/elasticsearch/main.cpp new file mode 100644 index 00000000..18674a3b --- /dev/null +++ b/tests/elasticsearch/main.cpp @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2018 oxarbitrage and contributors. + * + * The MIT License + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include +#include + +#include + +#include "../common/database_fixture.hpp" + +#define BOOST_TEST_MODULE Elastic Search Database Tests +#include + +using namespace graphene::chain; +using namespace graphene::chain::test; +using namespace graphene::app; + +BOOST_FIXTURE_TEST_SUITE( elasticsearch_tests, database_fixture ) + +BOOST_AUTO_TEST_CASE(elasticsearch_account_history) { + try { + + CURL *curl; // curl handler + curl = curl_easy_init(); + + graphene::utilities::ES es; + es.curl = curl; + es.elasticsearch_url = "http://localhost:9200/"; + es.index_prefix = "bitshares-"; + //es.auth = "elastic:changeme"; + + // delete all first + auto delete_account_history = graphene::utilities::deleteAll(es); + fc::usleep(fc::milliseconds(1000)); // this is because index.refresh_interval, nothing to worry + + if(delete_account_history) { // all records deleted + + //account_id_type() do 3 ops + create_bitasset("USD", account_id_type()); + auto dan = create_account("dan"); + auto bob = create_account("bob"); + + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + // for later use + //int asset_create_op_id = operation::tag::value; + //int account_create_op_id = operation::tag::value; + + string query = "{ \"query\" : { \"bool\" : { \"must\" : [{\"match_all\": {}}] } } }"; + es.endpoint = es.index_prefix + "*/data/_count"; + es.query = query; + + auto res = graphene::utilities::simpleQuery(es); + variant j = fc::json::from_string(res); + auto total = j["count"].as_string(); + BOOST_CHECK_EQUAL(total, "5"); + + es.endpoint = es.index_prefix + "*/data/_search"; + res = graphene::utilities::simpleQuery(es); + j = fc::json::from_string(res); + auto first_id = j["hits"]["hits"][size_t(0)]["_id"].as_string(); + BOOST_CHECK_EQUAL(first_id, "2.9.0"); + + generate_block(); + auto willie = create_account("willie"); + generate_block(); + + fc::usleep(fc::milliseconds(1000)); // index.refresh_interval + + es.endpoint = es.index_prefix + "*/data/_count"; + res = graphene::utilities::simpleQuery(es); + j = fc::json::from_string(res); + + total = j["count"].as_string(); + BOOST_CHECK_EQUAL(total, "7"); + + // do some transfers in 1 block + transfer(account_id_type()(db), bob, asset(100)); + transfer(account_id_type()(db), bob, asset(200)); + transfer(account_id_type()(db), bob, asset(300)); + + generate_block(); + fc::usleep(fc::milliseconds(1000)); // index.refresh_interval + + res = graphene::utilities::simpleQuery(es); + j = fc::json::from_string(res); + + total = j["count"].as_string(); + BOOST_CHECK_EQUAL(total, "13"); + + // check the visitor data + auto block_date = db.head_block_time(); + std::string index_name = graphene::utilities::generateIndexName(block_date, "bitshares-"); + + es.endpoint = index_name + "/data/2.9.12"; // we know last op is a transfer of amount 300 + res = graphene::utilities::getEndPoint(es); + j = fc::json::from_string(res); + auto last_transfer_amount = j["_source"]["additional_data"]["transfer_data"]["amount"].as_string(); + BOOST_CHECK_EQUAL(last_transfer_amount, "300"); + } + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} + +BOOST_AUTO_TEST_CASE(elasticsearch_objects) { + try { + + CURL *curl; // curl handler + curl = curl_easy_init(); + + graphene::utilities::ES es; + es.curl = curl; + es.elasticsearch_url = "http://localhost:9200/"; + es.index_prefix = "objects-"; + //es.auth = "elastic:changeme"; + + // delete all first + auto delete_objects = graphene::utilities::deleteAll(es); + + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + if(delete_objects) { // all records deleted + + // asset and bitasset + create_bitasset("USD", account_id_type()); + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + string query = "{ \"query\" : { \"bool\" : { \"must\" : [{\"match_all\": {}}] } } }"; + es.endpoint = es.index_prefix + "*/data/_count"; + es.query = query; + + auto res = graphene::utilities::simpleQuery(es); + variant j = fc::json::from_string(res); + auto total = j["count"].as_string(); + BOOST_CHECK_EQUAL(total, "2"); + + es.endpoint = es.index_prefix + "asset/data/_search"; + res = graphene::utilities::simpleQuery(es); + j = fc::json::from_string(res); + auto first_id = j["hits"]["hits"][size_t(0)]["_source"]["symbol"].as_string(); + BOOST_CHECK_EQUAL(first_id, "USD"); + + auto bitasset_data_id = j["hits"]["hits"][size_t(0)]["_source"]["bitasset_data_id"].as_string(); + es.endpoint = es.index_prefix + "bitasset/data/_search"; + es.query = "{ \"query\" : { \"bool\": { \"must\" : [{ \"term\": { \"object_id\": \""+bitasset_data_id+"\"}}] } } }"; + res = graphene::utilities::simpleQuery(es); + j = fc::json::from_string(res); + auto bitasset_object_id = j["hits"]["hits"][size_t(0)]["_source"]["object_id"].as_string(); + BOOST_CHECK_EQUAL(bitasset_object_id, bitasset_data_id); + } + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} + +BOOST_AUTO_TEST_CASE(elasticsearch_suite) { + try { + + CURL *curl; // curl handler + curl = curl_easy_init(); + + graphene::utilities::ES es; + es.curl = curl; + es.elasticsearch_url = "http://localhost:9200/"; + es.index_prefix = "bitshares-"; + auto delete_account_history = graphene::utilities::deleteAll(es); + fc::usleep(fc::milliseconds(1000)); + es.index_prefix = "objects-"; + auto delete_objects = graphene::utilities::deleteAll(es); + fc::usleep(fc::milliseconds(1000)); + + if(delete_account_history && delete_objects) { // all records deleted + + + } + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} + +BOOST_AUTO_TEST_SUITE_END() From 2d19aa3de10ae145d9d4644379ff2502a91c6cc0 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Mon, 15 Oct 2018 14:42:45 -0300 Subject: [PATCH 32/44] Merge pull request #1271 from oxarbitrage/es_objects refine es_objects plugin --- libraries/plugins/es_objects/es_objects.cpp | 271 ++++++++++-------- .../graphene/es_objects/es_objects.hpp | 48 +++- 2 files changed, 183 insertions(+), 136 deletions(-) diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 5f04e40c..82e6ff23 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -47,13 +47,14 @@ class es_objects_plugin_impl { curl = curl_easy_init(); } virtual ~es_objects_plugin_impl(); - bool updateDatabase( const vector& ids , bool isNew); + bool index_database( const vector& ids, std::string action); + void remove_from_database( object_id_type id, std::string index); es_objects_plugin& _self; std::string _es_objects_elasticsearch_url = "http://localhost:9200/"; std::string _es_objects_auth = ""; - uint32_t _es_objects_bulk_replay = 5000; - uint32_t _es_objects_bulk_sync = 10; + uint32_t _es_objects_bulk_replay = 10000; + uint32_t _es_objects_bulk_sync = 100; bool _es_objects_proposals = true; bool _es_objects_accounts = true; bool _es_objects_assets = true; @@ -64,27 +65,27 @@ class es_objects_plugin_impl CURL *curl; // curl handler vector bulk; vector prepare; - map bitassets; - map accounts; - map proposals; - map assets; - map balances; - map limit_orders; + + bool _es_objects_keep_only_current = true; + + uint32_t block_number; + fc::time_point_sec block_time; + private: - void PrepareProposal(const proposal_object& proposal_object, const fc::time_point_sec& block_time, const uint32_t& block_number); - void PrepareAccount(const account_object& account_object, const fc::time_point_sec& block_time, const uint32_t& block_number); - void PrepareAsset(const asset_object& asset_object, const fc::time_point_sec& block_time, const uint32_t& block_number); - void PrepareBalance(const balance_object& balance_object, const fc::time_point_sec& block_time, const uint32_t& block_number); - void PrepareLimit(const limit_order_object& limit_object, const fc::time_point_sec& block_time, const uint32_t& block_number); - void PrepareBitAsset(const asset_bitasset_data_object& bitasset_object, const fc::time_point_sec& block_time, const uint32_t& block_number); + void prepare_proposal(const proposal_object& proposal_object); + void prepare_account(const account_object& account_object); + void prepare_asset(const asset_object& asset_object); + void prepare_balance(const account_balance_object& account_balance_object); + void prepare_limit(const limit_order_object& limit_object); + void prepare_bitasset(const asset_bitasset_data_object& bitasset_object); }; -bool es_objects_plugin_impl::updateDatabase( const vector& ids , bool isNew) +bool es_objects_plugin_impl::index_database( const vector& ids, std::string action) { graphene::chain::database &db = _self.database(); - const fc::time_point_sec block_time = db.head_block_time(); - const uint32_t block_number = db.head_block_num(); + block_time = db.head_block_time(); + block_number = db.head_block_num(); // check if we are in replay or in sync and change number of bulk documents accordingly uint32_t limit_documents = 0; @@ -97,38 +98,62 @@ bool es_objects_plugin_impl::updateDatabase( const vector& ids , if(value.is() && _es_objects_proposals) { auto obj = db.find_object(value); auto p = static_cast(obj); - if(p != nullptr) - PrepareProposal(*p, block_time, block_number); + if(p != nullptr) { + if(action == "delete") + remove_from_database(p->id, "proposal"); + else + prepare_proposal(*p); + } } else if(value.is() && _es_objects_accounts) { auto obj = db.find_object(value); auto a = static_cast(obj); - if(a != nullptr) - PrepareAccount(*a, block_time, block_number); + if(a != nullptr) { + if(action == "delete") + remove_from_database(a->id, "account"); + else + prepare_account(*a); + } } else if(value.is() && _es_objects_assets) { auto obj = db.find_object(value); auto a = static_cast(obj); - if(a != nullptr) - PrepareAsset(*a, block_time, block_number); + if(a != nullptr) { + if(action == "delete") + remove_from_database(a->id, "asset"); + else + prepare_asset(*a); + } } - else if(value.is() && _es_objects_balances) { + else if(value.is() && _es_objects_balances) { auto obj = db.find_object(value); - auto b = static_cast(obj); - if(b != nullptr) - PrepareBalance(*b, block_time, block_number); + auto b = static_cast(obj); + if(b != nullptr) { + if(action == "delete") + remove_from_database(b->id, "balance"); + else + prepare_balance(*b); + } } else if(value.is() && _es_objects_limit_orders) { auto obj = db.find_object(value); auto l = static_cast(obj); - if(l != nullptr) - PrepareLimit(*l, block_time, block_number); + if(l != nullptr) { + if(action == "delete") + remove_from_database(l->id, "limitorder"); + else + prepare_limit(*l); + } } else if(value.is() && _es_objects_asset_bitasset) { auto obj = db.find_object(value); auto ba = static_cast(obj); - if(ba != nullptr) - PrepareBitAsset(*ba, block_time, block_number); + if(ba != nullptr) { + if(action == "delete") + remove_from_database(ba->id, "bitasset"); + else + prepare_bitasset(*ba); + } } } @@ -149,8 +174,23 @@ bool es_objects_plugin_impl::updateDatabase( const vector& ids , return true; } -void es_objects_plugin_impl::PrepareProposal(const proposal_object& proposal_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::remove_from_database( object_id_type id, std::string index) +{ + if(_es_objects_keep_only_current) + { + fc::mutable_variant_object delete_line; + delete_line["_id"] = string(id); + delete_line["_index"] = _es_objects_index_prefix + index; + delete_line["_type"] = "data"; + fc::mutable_variant_object final_delete_line; + final_delete_line["delete"] = delete_line; + prepare.push_back(fc::json::to_string(final_delete_line)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); + prepare.clear(); + } +} + +void es_objects_plugin_impl::prepare_proposal(const proposal_object& proposal_object) { proposal_struct prop; prop.object_id = proposal_object.id; @@ -165,27 +205,22 @@ void es_objects_plugin_impl::PrepareProposal(const proposal_object& proposal_obj prop.available_key_approvals = fc::json::to_string(proposal_object.available_key_approvals); prop.proposer = proposal_object.proposer; - auto it = proposals.find(proposal_object.id); - if(it == proposals.end()) - proposals[proposal_object.id] = prop; - else { - if(it->second == prop) return; - else proposals[proposal_object.id] = prop; - } - std::string data = fc::json::to_string(prop); fc::mutable_variant_object bulk_header; bulk_header["_index"] = _es_objects_index_prefix + "proposal"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(prop.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::PrepareAccount(const account_object& account_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::prepare_account(const account_object& account_object) { account_struct acct; acct.object_id = account_object.id; @@ -206,28 +241,24 @@ void es_objects_plugin_impl::PrepareAccount(const account_object& account_object acct.active_key_auths = fc::json::to_string(account_object.active.key_auths); acct.active_address_auths = fc::json::to_string(account_object.active.address_auths); acct.voting_account = account_object.options.voting_account; - - auto it = accounts.find(account_object.id); - if(it == accounts.end()) - accounts[account_object.id] = acct; - else { - if(it->second == acct) return; - else accounts[account_object.id] = acct; - } + acct.votes = fc::json::to_string(account_object.options.votes); std::string data = fc::json::to_string(acct); fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "acount"; + bulk_header["_index"] = _es_objects_index_prefix + "account"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(acct.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::PrepareAsset(const asset_object& asset_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::prepare_asset(const asset_object& asset_object) { asset_struct asset; asset.object_id = asset_object.id; @@ -239,56 +270,47 @@ void es_objects_plugin_impl::PrepareAsset(const asset_object& asset_object, asset.dynamic_asset_data_id = asset_object.dynamic_asset_data_id; asset.bitasset_data_id = asset_object.bitasset_data_id; - auto it = assets.find(asset_object.id); - if(it == assets.end()) - assets[asset_object.id] = asset; - else { - if(it->second == asset) return; - else assets[asset_object.id] = asset; - } - std::string data = fc::json::to_string(asset); fc::mutable_variant_object bulk_header; bulk_header["_index"] = _es_objects_index_prefix + "asset"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(asset.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::PrepareBalance(const balance_object& balance_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::prepare_balance(const account_balance_object& account_balance_object) { balance_struct balance; - balance.object_id = balance_object.id; + balance.object_id = account_balance_object.id; balance.block_time = block_time; - balance.block_number = block_number;balance.owner = balance_object.owner; - balance.asset_id = balance_object.balance.asset_id; - balance.amount = balance_object.balance.amount; - - auto it = balances.find(balance_object.id); - if(it == balances.end()) - balances[balance_object.id] = balance; - else { - if(it->second == balance) return; - else balances[balance_object.id] = balance; - } + balance.block_number = block_number; + balance.owner = account_balance_object.owner; + balance.asset_type = account_balance_object.asset_type; + balance.balance = account_balance_object.balance; std::string data = fc::json::to_string(balance); fc::mutable_variant_object bulk_header; bulk_header["_index"] = _es_objects_index_prefix + "balance"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(balance.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::PrepareLimit(const limit_order_object& limit_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::prepare_limit(const limit_order_object& limit_object) { limit_order_struct limit; limit.object_id = limit_object.id; @@ -300,27 +322,22 @@ void es_objects_plugin_impl::PrepareLimit(const limit_order_object& limit_object limit.sell_price = limit_object.sell_price; limit.deferred_fee = limit_object.deferred_fee; - auto it = limit_orders.find(limit_object.id); - if(it == limit_orders.end()) - limit_orders[limit_object.id] = limit; - else { - if(it->second == limit) return; - else limit_orders[limit_object.id] = limit; - } - std::string data = fc::json::to_string(limit); fc::mutable_variant_object bulk_header; bulk_header["_index"] = _es_objects_index_prefix + "limitorder"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(limit.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object& bitasset_object, - const fc::time_point_sec& block_time, const uint32_t& block_number) +void es_objects_plugin_impl::prepare_bitasset(const asset_bitasset_data_object& bitasset_object) { if(!bitasset_object.is_prediction_market) { @@ -331,22 +348,18 @@ void es_objects_plugin_impl::PrepareBitAsset(const asset_bitasset_data_object& b bitasset.current_feed = fc::json::to_string(bitasset_object.current_feed); bitasset.current_feed_publication_time = bitasset_object.current_feed_publication_time; - auto it = bitassets.find(bitasset_object.id); - if(it == bitassets.end()) - bitassets[bitasset_object.id] = bitasset; - else { - if(it->second == bitasset) return; - else bitassets[bitasset_object.id] = bitasset; - } - std::string data = fc::json::to_string(bitasset); fc::mutable_variant_object bulk_header; bulk_header["_index"] = _es_objects_index_prefix + "bitasset"; bulk_header["_type"] = "data"; + if(_es_objects_keep_only_current) + { + bulk_header["_id"] = string(bitasset.object_id); + } - prepare = graphene::utilities::createBulk(bulk_header, data); - bulk.insert(bulk.end(), prepare.begin(), prepare.end()); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); + std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } } @@ -382,17 +395,18 @@ void es_objects_plugin::plugin_set_program_options( ) { cli.add_options() - ("es-objects-elasticsearch-url", boost::program_options::value(), "Elasticsearch node url") - ("es-objects-auth", boost::program_options::value(), "Basic auth username:password") - ("es-objects-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") - ("es-objects-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") - ("es-objects-proposals", boost::program_options::value(), "Store proposal objects") - ("es-objects-accounts", boost::program_options::value(), "Store account objects") - ("es-objects-assets", boost::program_options::value(), "Store asset objects") - ("es-objects-balances", boost::program_options::value(), "Store balances objects") - ("es-objects-limit-orders", boost::program_options::value(), "Store limit order objects") - ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data") + ("es-objects-elasticsearch-url", boost::program_options::value(), "Elasticsearch node url(http://localhost:9200/)") + ("es-objects-auth", boost::program_options::value(), "Basic auth username:password('')") + ("es-objects-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(10000)") + ("es-objects-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a synchronized chain(100)") + ("es-objects-proposals", boost::program_options::value(), "Store proposal objects(true)") + ("es-objects-accounts", boost::program_options::value(), "Store account objects(true)") + ("es-objects-assets", boost::program_options::value(), "Store asset objects(true)") + ("es-objects-balances", boost::program_options::value(), "Store balances objects(true)") + ("es-objects-limit-orders", boost::program_options::value(), "Store limit order objects(true)") + ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data(true)") ("es-objects-index-prefix", boost::program_options::value(), "Add a prefix to the index(objects-)") + ("es-objects-keep-only-current", boost::program_options::value(), "Keep only current state of the objects(true)") ; cfg.add(cli); } @@ -400,17 +414,25 @@ void es_objects_plugin::plugin_set_program_options( void es_objects_plugin::plugin_initialize(const boost::program_options::variables_map& options) { database().new_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { - if(!my->updateDatabase(ids, 1)) + if(!my->index_database(ids, "create")) { - FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); + FC_THROW_EXCEPTION(fc::exception, "Error creating object from ES database, we are going to keep trying."); } }); database().changed_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { - if(!my->updateDatabase(ids, 0)) + if(!my->index_database(ids, "update")) { - FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); + FC_THROW_EXCEPTION(fc::exception, "Error updating object from ES database, we are going to keep trying."); } }); + database().removed_objects.connect([this](const vector& ids, const vector& objs, const flat_set& impacted_accounts) { + if(!my->index_database(ids, "delete")) + { + FC_THROW_EXCEPTION(fc::exception, "Error deleting object from ES database, we are going to keep trying."); + } + }); + + if (options.count("es-objects-elasticsearch-url")) { my->_es_objects_elasticsearch_url = options["es-objects-elasticsearch-url"].as(); } @@ -444,6 +466,9 @@ void es_objects_plugin::plugin_initialize(const boost::program_options::variable if (options.count("es-objects-index-prefix")) { my->_es_objects_index_prefix = options["es-objects-index-prefix"].as(); } + if (options.count("es-objects-keep-only-current")) { + my->_es_objects_keep_only_current = options["es-objects-keep-only-current"].as(); + } } void es_objects_plugin::plugin_startup() diff --git a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp index d9c38711..886129c8 100644 --- a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp +++ b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp @@ -102,6 +102,7 @@ struct account_struct { string active_key_auths; string active_address_auths; account_id_type voting_account; + string votes; friend bool operator==(const account_struct& l, const account_struct& r) { @@ -109,11 +110,11 @@ struct account_struct { l.lifetime_referrer, l.network_fee_percentage, l.lifetime_referrer_fee_percentage, l.referrer_rewards_percentage, l.name, l.owner_account_auths, l.owner_key_auths, l.owner_address_auths, l.active_account_auths, l.active_key_auths, l.active_address_auths, - l.voting_account) == std::tie(r.object_id, r.block_time, r.block_number, r.membership_expiration_date, r.registrar, r.referrer, + l.voting_account, l.votes) == std::tie(r.object_id, r.block_time, r.block_number, r.membership_expiration_date, r.registrar, r.referrer, r.lifetime_referrer, r.network_fee_percentage, r.lifetime_referrer_fee_percentage, r.referrer_rewards_percentage, r.name, r.owner_account_auths, r.owner_key_auths, r.owner_address_auths, r.active_account_auths, r.active_key_auths, r.active_address_auths, - r.voting_account); + r.voting_account, r.votes); } friend bool operator!=(const account_struct& l, const account_struct& r) { @@ -146,14 +147,14 @@ struct balance_struct { object_id_type object_id; fc::time_point_sec block_time; uint32_t block_number; - address owner; - asset_id_type asset_id; - share_type amount; + account_id_type owner; + asset_id_type asset_type; + share_type balance; friend bool operator==(const balance_struct& l, const balance_struct& r) { - return std::tie(l.object_id, l.block_time, l.block_number, l.block_time, l.owner, l.asset_id, l.amount) - == std::tie(r.object_id, r.block_time, r.block_number, r.block_time, r.owner, r.asset_id, r.amount); + return std::tie(l.object_id, l.block_time, l.block_number, l.block_time, l.owner, l.asset_type, l.balance) + == std::tie(r.object_id, r.block_time, r.block_number, r.block_time, r.owner, r.asset_type, r.balance); } friend bool operator!=(const balance_struct& l, const balance_struct& r) { @@ -201,9 +202,30 @@ struct bitasset_struct { } } //graphene::es_objects -FC_REFLECT( graphene::es_objects::proposal_struct, (object_id)(block_time)(block_number)(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals)(available_active_approvals)(required_owner_approvals)(available_owner_approvals)(available_key_approvals)(proposer) ) -FC_REFLECT( graphene::es_objects::account_struct, (object_id)(block_time)(block_number)(membership_expiration_date)(registrar)(referrer)(lifetime_referrer)(network_fee_percentage)(lifetime_referrer_fee_percentage)(referrer_rewards_percentage)(name)(owner_account_auths)(owner_key_auths)(owner_address_auths)(active_account_auths)(active_key_auths)(active_address_auths)(voting_account) ) -FC_REFLECT( graphene::es_objects::asset_struct, (object_id)(block_time)(block_number)(symbol)(issuer)(is_market_issued)(dynamic_asset_data_id)(bitasset_data_id) ) -FC_REFLECT( graphene::es_objects::balance_struct, (object_id)(block_time)(block_number)(block_time)(owner)(asset_id)(amount) ) -FC_REFLECT( graphene::es_objects::limit_order_struct, (object_id)(block_time)(block_number)(expiration)(seller)(for_sale)(sell_price)(deferred_fee) ) -FC_REFLECT( graphene::es_objects::bitasset_struct, (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) ) +FC_REFLECT( + graphene::es_objects::proposal_struct, + (object_id)(block_time)(block_number)(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals) + (available_active_approvals)(required_owner_approvals)(available_owner_approvals)(available_key_approvals)(proposer) +) +FC_REFLECT( + graphene::es_objects::account_struct, + (object_id)(block_time)(block_number)(membership_expiration_date)(registrar)(referrer)(lifetime_referrer) + (network_fee_percentage)(lifetime_referrer_fee_percentage)(referrer_rewards_percentage)(name)(owner_account_auths) + (owner_key_auths)(owner_address_auths)(active_account_auths)(active_key_auths)(active_address_auths)(voting_account)(votes) +) +FC_REFLECT( + graphene::es_objects::asset_struct, + (object_id)(block_time)(block_number)(symbol)(issuer)(is_market_issued)(dynamic_asset_data_id)(bitasset_data_id) +) +FC_REFLECT( + graphene::es_objects::balance_struct, + (object_id)(block_time)(block_number)(owner)(asset_type)(balance) +) +FC_REFLECT( + graphene::es_objects::limit_order_struct, + (object_id)(block_time)(block_number)(expiration)(seller)(for_sale)(sell_price)(deferred_fee) +) +FC_REFLECT( + graphene::es_objects::bitasset_struct, + (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) +) From 4f5f8f44799c5279661158335334c3b7b52e36f1 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 19 Dec 2018 09:48:43 -0300 Subject: [PATCH 33/44] Merge pull request #1429 from oxarbitrage/es_objects_templates Add an adaptor to es_objects and template function to reduce code --- libraries/plugins/es_objects/es_objects.cpp | 200 ++-------------- .../graphene/es_objects/es_objects.hpp | 224 +++++------------- 2 files changed, 78 insertions(+), 346 deletions(-) diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 82e6ff23..9896772d 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -30,10 +30,11 @@ #include #include #include +#include +#include #include - namespace graphene { namespace es_objects { namespace detail @@ -72,12 +73,8 @@ class es_objects_plugin_impl fc::time_point_sec block_time; private: - void prepare_proposal(const proposal_object& proposal_object); - void prepare_account(const account_object& account_object); - void prepare_asset(const asset_object& asset_object); - void prepare_balance(const account_balance_object& account_balance_object); - void prepare_limit(const limit_order_object& limit_object); - void prepare_bitasset(const asset_bitasset_data_object& bitasset_object); + template + void prepareTemplate(T blockchain_object, string index_name); }; bool es_objects_plugin_impl::index_database( const vector& ids, std::string action) @@ -102,7 +99,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(p->id, "proposal"); else - prepare_proposal(*p); + prepareTemplate(*p, "proposal"); } } else if(value.is() && _es_objects_accounts) { @@ -112,7 +109,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(a->id, "account"); else - prepare_account(*a); + prepareTemplate(*a, "account"); } } else if(value.is() && _es_objects_assets) { @@ -122,7 +119,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(a->id, "asset"); else - prepare_asset(*a); + prepareTemplate(*a, "asset"); } } else if(value.is() && _es_objects_balances) { @@ -132,7 +129,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(b->id, "balance"); else - prepare_balance(*b); + prepareTemplate(*b, "balance"); } } else if(value.is() && _es_objects_limit_orders) { @@ -142,7 +139,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(l->id, "limitorder"); else - prepare_limit(*l); + prepareTemplate(*l, "limitorder"); } } else if(value.is() && _es_objects_asset_bitasset) { @@ -152,7 +149,7 @@ bool es_objects_plugin_impl::index_database( const vector& ids, if(action == "delete") remove_from_database(ba->id, "bitasset"); else - prepare_bitasset(*ba); + prepareTemplate(*ba, "bitasset"); } } } @@ -190,180 +187,33 @@ void es_objects_plugin_impl::remove_from_database( object_id_type id, std::strin } } -void es_objects_plugin_impl::prepare_proposal(const proposal_object& proposal_object) +template +void es_objects_plugin_impl::prepareTemplate(T blockchain_object, string index_name) { - proposal_struct prop; - prop.object_id = proposal_object.id; - prop.block_time = block_time; - prop.block_number = block_number; - prop.expiration_time = proposal_object.expiration_time; - prop.review_period_time = proposal_object.review_period_time; - prop.proposed_transaction = fc::json::to_string(proposal_object.proposed_transaction); - prop.required_owner_approvals = fc::json::to_string(proposal_object.required_owner_approvals); - prop.available_owner_approvals = fc::json::to_string(proposal_object.available_owner_approvals); - prop.required_active_approvals = fc::json::to_string(proposal_object.required_active_approvals); - prop.available_key_approvals = fc::json::to_string(proposal_object.available_key_approvals); - prop.proposer = proposal_object.proposer; - - std::string data = fc::json::to_string(prop); - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "proposal"; + bulk_header["_index"] = _es_objects_index_prefix + index_name; bulk_header["_type"] = "data"; if(_es_objects_keep_only_current) { - bulk_header["_id"] = string(prop.object_id); + bulk_header["_id"] = string(blockchain_object.id); } + adaptor_struct adaptor; + fc::variant blockchain_object_variant; + fc::to_variant( blockchain_object, blockchain_object_variant, GRAPHENE_NET_MAX_NESTED_OBJECTS ); + fc::mutable_variant_object o = adaptor.adapt(blockchain_object_variant.get_object()); + + o["object_id"] = string(blockchain_object.id); + o["block_time"] = block_time; + o["block_number"] = block_number; + + string data = fc::json::to_string(o); + prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); prepare.clear(); } -void es_objects_plugin_impl::prepare_account(const account_object& account_object) -{ - account_struct acct; - acct.object_id = account_object.id; - acct.block_time = block_time; - acct.block_number = block_number; - acct.membership_expiration_date = account_object.membership_expiration_date; - acct.registrar = account_object.registrar; - acct.referrer = account_object.referrer; - acct.lifetime_referrer = account_object.lifetime_referrer; - acct.network_fee_percentage = account_object.network_fee_percentage; - acct.lifetime_referrer_fee_percentage = account_object.lifetime_referrer_fee_percentage; - acct.referrer_rewards_percentage = account_object.referrer_rewards_percentage; - acct.name = account_object.name; - acct.owner_account_auths = fc::json::to_string(account_object.owner.account_auths); - acct.owner_key_auths = fc::json::to_string(account_object.owner.key_auths); - acct.owner_address_auths = fc::json::to_string(account_object.owner.address_auths); - acct.active_account_auths = fc::json::to_string(account_object.active.account_auths); - acct.active_key_auths = fc::json::to_string(account_object.active.key_auths); - acct.active_address_auths = fc::json::to_string(account_object.active.address_auths); - acct.voting_account = account_object.options.voting_account; - acct.votes = fc::json::to_string(account_object.options.votes); - - std::string data = fc::json::to_string(acct); - - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "account"; - bulk_header["_type"] = "data"; - if(_es_objects_keep_only_current) - { - bulk_header["_id"] = string(acct.object_id); - } - - prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); - std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); - prepare.clear(); -} - -void es_objects_plugin_impl::prepare_asset(const asset_object& asset_object) -{ - asset_struct asset; - asset.object_id = asset_object.id; - asset.block_time = block_time; - asset.block_number = block_number; - asset.symbol = asset_object.symbol; - asset.issuer = asset_object.issuer; - asset.is_market_issued = asset_object.is_market_issued(); - asset.dynamic_asset_data_id = asset_object.dynamic_asset_data_id; - asset.bitasset_data_id = asset_object.bitasset_data_id; - - std::string data = fc::json::to_string(asset); - - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "asset"; - bulk_header["_type"] = "data"; - if(_es_objects_keep_only_current) - { - bulk_header["_id"] = string(asset.object_id); - } - - prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); - std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); - prepare.clear(); -} - -void es_objects_plugin_impl::prepare_balance(const account_balance_object& account_balance_object) -{ - balance_struct balance; - balance.object_id = account_balance_object.id; - balance.block_time = block_time; - balance.block_number = block_number; - balance.owner = account_balance_object.owner; - balance.asset_type = account_balance_object.asset_type; - balance.balance = account_balance_object.balance; - - std::string data = fc::json::to_string(balance); - - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "balance"; - bulk_header["_type"] = "data"; - if(_es_objects_keep_only_current) - { - bulk_header["_id"] = string(balance.object_id); - } - - prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); - std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); - prepare.clear(); -} - -void es_objects_plugin_impl::prepare_limit(const limit_order_object& limit_object) -{ - limit_order_struct limit; - limit.object_id = limit_object.id; - limit.block_time = block_time; - limit.block_number = block_number; - limit.expiration = limit_object.expiration; - limit.seller = limit_object.seller; - limit.for_sale = limit_object.for_sale; - limit.sell_price = limit_object.sell_price; - limit.deferred_fee = limit_object.deferred_fee; - - std::string data = fc::json::to_string(limit); - - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "limitorder"; - bulk_header["_type"] = "data"; - if(_es_objects_keep_only_current) - { - bulk_header["_id"] = string(limit.object_id); - } - - prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); - std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); - prepare.clear(); -} - -void es_objects_plugin_impl::prepare_bitasset(const asset_bitasset_data_object& bitasset_object) -{ - if(!bitasset_object.is_prediction_market) { - - bitasset_struct bitasset; - bitasset.object_id = bitasset_object.id; - bitasset.block_time = block_time; - bitasset.block_number = block_number; - bitasset.current_feed = fc::json::to_string(bitasset_object.current_feed); - bitasset.current_feed_publication_time = bitasset_object.current_feed_publication_time; - - std::string data = fc::json::to_string(bitasset); - - fc::mutable_variant_object bulk_header; - bulk_header["_index"] = _es_objects_index_prefix + "bitasset"; - bulk_header["_type"] = "data"; - if(_es_objects_keep_only_current) - { - bulk_header["_id"] = string(bitasset.object_id); - } - - prepare = graphene::utilities::createBulk(bulk_header, std::move(data)); - std::move(prepare.begin(), prepare.end(), std::back_inserter(bulk)); - prepare.clear(); - } -} - es_objects_plugin_impl::~es_objects_plugin_impl() { return; diff --git a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp index 886129c8..fa91e3bd 100644 --- a/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp +++ b/libraries/plugins/es_objects/include/graphene/es_objects/es_objects.hpp @@ -30,7 +30,6 @@ namespace graphene { namespace es_objects { using namespace chain; - namespace detail { class es_objects_plugin_impl; @@ -54,178 +53,61 @@ class es_objects_plugin : public graphene::app::plugin std::unique_ptr my; }; -struct proposal_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - time_point_sec expiration_time; - optional review_period_time; - string proposed_transaction; - string required_active_approvals; - string available_active_approvals; - string required_owner_approvals; - string available_owner_approvals; - string available_key_approvals; - account_id_type proposer; +struct adaptor_struct { + fc::mutable_variant_object adapt(const variant_object &obj) { + fc::mutable_variant_object o(obj); + vector keys_to_rename; + for (auto i = o.begin(); i != o.end(); ++i) { + auto &element = (*i).value(); + if (element.is_object()) { + const string &name = (*i).key(); + auto &vo = element.get_object(); + if (vo.contains(name.c_str())) + keys_to_rename.emplace_back(name); + element = adapt(vo); + } else if (element.is_array()) + adapt(element.get_array()); + } + for (const auto &i : keys_to_rename) { + string new_name = i + "_"; + o[new_name] = variant(o[i]); + o.erase(i); + } + if (o.find("owner") != o.end() && o["owner"].is_string()) + { + o["owner_"] = o["owner"].as_string(); + o.erase("owner"); + } + if (o.find("active_special_authority") != o.end()) + { + o["active_special_authority"] = fc::json::to_string(o["active_special_authority"]); + } + if (o.find("owner_special_authority") != o.end()) + { + o["owner_special_authority"] = fc::json::to_string(o["owner_special_authority"]); + } + if (o.find("feeds") != o.end()) + { + o["feeds"] = fc::json::to_string(o["feeds"]); + } + if (o.find("operations") != o.end()) + { + o["operations"] = fc::json::to_string(o["operations"]); + } + + return o; + } - friend bool operator==(const proposal_struct& l, const proposal_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.expiration_time, l.review_period_time, - l.proposed_transaction, l.required_active_approvals, l.available_active_approvals, - l.required_owner_approvals, l.available_owner_approvals, l.available_key_approvals, - l.proposer) == std::tie(r.object_id, r.block_time, r.block_number, r.expiration_time, r.review_period_time, - r.proposed_transaction, r.required_active_approvals, r.available_active_approvals, - r.required_owner_approvals, r.available_owner_approvals, r.available_key_approvals, - r.proposer); - } - friend bool operator!=(const proposal_struct& l, const proposal_struct& r) - { - return !operator==(l, r); - } -}; -struct account_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - time_point_sec membership_expiration_date; - account_id_type registrar; - account_id_type referrer; - account_id_type lifetime_referrer; - uint16_t network_fee_percentage; - uint16_t lifetime_referrer_fee_percentage; - uint16_t referrer_rewards_percentage; - string name; - string owner_account_auths; - string owner_key_auths; - string owner_address_auths; - string active_account_auths; - string active_key_auths; - string active_address_auths; - account_id_type voting_account; - string votes; - - friend bool operator==(const account_struct& l, const account_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.membership_expiration_date, l.registrar, l.referrer, - l.lifetime_referrer, l.network_fee_percentage, l.lifetime_referrer_fee_percentage, - l.referrer_rewards_percentage, l.name, l.owner_account_auths, l.owner_key_auths, - l.owner_address_auths, l.active_account_auths, l.active_key_auths, l.active_address_auths, - l.voting_account, l.votes) == std::tie(r.object_id, r.block_time, r.block_number, r.membership_expiration_date, r.registrar, r.referrer, - r.lifetime_referrer, r.network_fee_percentage, r.lifetime_referrer_fee_percentage, - r.referrer_rewards_percentage, r.name, r.owner_account_auths, r.owner_key_auths, - r.owner_address_auths, r.active_account_auths, r.active_key_auths, r.active_address_auths, - r.voting_account, r.votes); - } - friend bool operator!=(const account_struct& l, const account_struct& r) - { - return !operator==(l, r); - } -}; -struct asset_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - string symbol; - account_id_type issuer; - bool is_market_issued; - asset_dynamic_data_id_type dynamic_asset_data_id; - optional bitasset_data_id; - - friend bool operator==(const asset_struct& l, const asset_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.symbol, l.issuer, l.is_market_issued, - l.dynamic_asset_data_id, l.bitasset_data_id) == std::tie(r.object_id, r.block_time, - r.block_number, r.symbol, r.issuer, r.is_market_issued, r.dynamic_asset_data_id, - r.bitasset_data_id); - } - friend bool operator!=(const asset_struct& l, const asset_struct& r) - { - return !operator==(l, r); - } -}; -struct balance_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - account_id_type owner; - asset_id_type asset_type; - share_type balance; - - friend bool operator==(const balance_struct& l, const balance_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.block_time, l.owner, l.asset_type, l.balance) - == std::tie(r.object_id, r.block_time, r.block_number, r.block_time, r.owner, r.asset_type, r.balance); - } - friend bool operator!=(const balance_struct& l, const balance_struct& r) - { - return !operator==(l, r); - } -}; -struct limit_order_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - time_point_sec expiration; - account_id_type seller; - share_type for_sale; - price sell_price; - share_type deferred_fee; - - friend bool operator==(const limit_order_struct& l, const limit_order_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.expiration, l.seller, l.for_sale, l.sell_price, l.deferred_fee) - == std::tie(r.object_id, r.block_time, r.block_number, r.expiration, r.seller, r.for_sale, r.sell_price, r.deferred_fee); - } - friend bool operator!=(const limit_order_struct& l, const limit_order_struct& r) - { - return !operator==(l, r); - } -}; -struct bitasset_struct { - object_id_type object_id; - fc::time_point_sec block_time; - uint32_t block_number; - string current_feed; - time_point_sec current_feed_publication_time; - time_point_sec feed_expiration_time; - - friend bool operator==(const bitasset_struct& l, const bitasset_struct& r) - { - return std::tie(l.object_id, l.block_time, l.block_number, l.current_feed, l.current_feed_publication_time) - == std::tie(r.object_id, r.block_time, r.block_number, r.current_feed, r.current_feed_publication_time); - } - friend bool operator!=(const bitasset_struct& l, const bitasset_struct& r) - { - return !operator==(l, r); + void adapt(fc::variants &v) { + for (auto &array_element : v) { + if (array_element.is_object()) + array_element = adapt(array_element.get_object()); + else if (array_element.is_array()) + adapt(array_element.get_array()); + else + array_element = array_element.as_string(); + } } }; } } //graphene::es_objects - -FC_REFLECT( - graphene::es_objects::proposal_struct, - (object_id)(block_time)(block_number)(expiration_time)(review_period_time)(proposed_transaction)(required_active_approvals) - (available_active_approvals)(required_owner_approvals)(available_owner_approvals)(available_key_approvals)(proposer) -) -FC_REFLECT( - graphene::es_objects::account_struct, - (object_id)(block_time)(block_number)(membership_expiration_date)(registrar)(referrer)(lifetime_referrer) - (network_fee_percentage)(lifetime_referrer_fee_percentage)(referrer_rewards_percentage)(name)(owner_account_auths) - (owner_key_auths)(owner_address_auths)(active_account_auths)(active_key_auths)(active_address_auths)(voting_account)(votes) -) -FC_REFLECT( - graphene::es_objects::asset_struct, - (object_id)(block_time)(block_number)(symbol)(issuer)(is_market_issued)(dynamic_asset_data_id)(bitasset_data_id) -) -FC_REFLECT( - graphene::es_objects::balance_struct, - (object_id)(block_time)(block_number)(owner)(asset_type)(balance) -) -FC_REFLECT( - graphene::es_objects::limit_order_struct, - (object_id)(block_time)(block_number)(expiration)(seller)(for_sale)(sell_price)(deferred_fee) -) -FC_REFLECT( - graphene::es_objects::bitasset_struct, - (object_id)(block_time)(block_number)(current_feed)(current_feed_publication_time) -) From c4612a522b9c1819a1d0712a0e9bab4f6ec40a2f Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Fri, 21 Dec 2018 08:24:45 -0300 Subject: [PATCH 34/44] Merge pull request #1458 from oxarbitrage/issue1455 add option elasticsearch-start-es-after-block to es plugin --- .../elasticsearch/elasticsearch_plugin.cpp | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index b69ff64a..23cb31aa 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -58,6 +58,8 @@ class elasticsearch_plugin_impl bool _elasticsearch_visitor = false; std::string _elasticsearch_basic_auth = ""; std::string _elasticsearch_index_prefix = "bitshares-"; + bool _elasticsearch_operation_object = false; + uint32_t _elasticsearch_start_es_after_block = 0; // disabled CURL *curl; // curl handler vector bulk_lines; // vector of op lines vector prepare; @@ -73,7 +75,7 @@ class elasticsearch_plugin_impl std::string index_name; bool is_sync = false; private: - bool add_elasticsearch( const account_id_type account_id, const optional& oho, const signed_block& b ); + bool add_elasticsearch( const account_id_type account_id, const optional& oho, const uint32_t block_number ); const account_transaction_history_object& addNewEntry(const account_statistics_object& stats_obj, const account_id_type account_id, const optional & oho); @@ -162,7 +164,7 @@ bool elasticsearch_plugin_impl::update_account_histories( const signed_block& b for( auto& account_id : impacted ) { - if(!add_elasticsearch( account_id, oho, b )) + if(!add_elasticsearch( account_id, oho, b.block_num() )) return false; } } @@ -247,13 +249,15 @@ void elasticsearch_plugin_impl::doVisitor(const optional & oho, - const signed_block& b) + const uint32_t block_number) { const auto &stats_obj = getStatsObject(account_id); const auto &ath = addNewEntry(stats_obj, account_id, oho); growStats(stats_obj, ath); - createBulkLine(ath); - prepareBulk(ath.id); + if(_elasticsearch_start_es_after_block == 0 || block_number > _elasticsearch_start_es_after_block) { + createBulkLine(ath); + prepareBulk(ath.id); + } cleanObjects(ath, account_id); if (curl && bulk_lines.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech @@ -392,6 +396,8 @@ void elasticsearch_plugin::plugin_set_program_options( ("elasticsearch-visitor", boost::program_options::value(), "Use visitor to index additional data(slows down the replay)") ("elasticsearch-basic-auth", boost::program_options::value(), "Pass basic auth to elasticsearch database ") ("elasticsearch-index-prefix", boost::program_options::value(), "Add a prefix to the index(bitshares-)") + ("elasticsearch-operation-object", boost::program_options::value(), "Save operation as object(false)") + ("elasticsearch-start-es-after-block", boost::program_options::value(), "Start doing ES job after block(0)") ; cfg.add(cli); } @@ -399,11 +405,10 @@ void elasticsearch_plugin::plugin_set_program_options( void elasticsearch_plugin::plugin_initialize(const boost::program_options::variables_map& options) { database().applied_block.connect( [&]( const signed_block& b) { - if(!my->update_account_histories(b)) - { + if (!my->update_account_histories(b)) FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); - } } ); + my->_oho_index = database().add_index< primary_index< operation_history_index > >(); database().add_index< primary_index< account_transaction_history_index > >(); @@ -425,6 +430,12 @@ void elasticsearch_plugin::plugin_initialize(const boost::program_options::varia if (options.count("elasticsearch-index-prefix")) { my->_elasticsearch_index_prefix = options["elasticsearch-index-prefix"].as(); } + if (options.count("elasticsearch-operation-object")) { + my->_elasticsearch_operation_object = options["elasticsearch-operation-object"].as(); + } + if (options.count("elasticsearch-start-es-after-block")) { + my->_elasticsearch_start_es_after_block = options["elasticsearch-start-es-after-block"].as(); + } } void elasticsearch_plugin::plugin_startup() From 6d9ad94e20a07903f5dd6e95b66bda80aac58844 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 30 Jan 2019 11:46:17 -0300 Subject: [PATCH 35/44] Merge pull request #1541 from oxarbitrage/es_objects_start_after_block add es-objects-start-es-after-block option --- .../elasticsearch/elasticsearch_plugin.cpp | 4 +- libraries/plugins/es_objects/es_objects.cpp | 164 +++++++++--------- 2 files changed, 86 insertions(+), 82 deletions(-) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index 23cb31aa..1ca911f9 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -59,7 +59,7 @@ class elasticsearch_plugin_impl std::string _elasticsearch_basic_auth = ""; std::string _elasticsearch_index_prefix = "bitshares-"; bool _elasticsearch_operation_object = false; - uint32_t _elasticsearch_start_es_after_block = 0; // disabled + uint32_t _elasticsearch_start_es_after_block = 0; CURL *curl; // curl handler vector bulk_lines; // vector of op lines vector prepare; @@ -254,7 +254,7 @@ bool elasticsearch_plugin_impl::add_elasticsearch( const account_id_type account const auto &stats_obj = getStatsObject(account_id); const auto &ath = addNewEntry(stats_obj, account_id, oho); growStats(stats_obj, ath); - if(_elasticsearch_start_es_after_block == 0 || block_number > _elasticsearch_start_es_after_block) { + if(block_number > _elasticsearch_start_es_after_block) { createBulkLine(ath); prepareBulk(ath.id); } diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 9896772d..58517349 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -63,6 +63,7 @@ class es_objects_plugin_impl bool _es_objects_limit_orders = true; bool _es_objects_asset_bitasset = true; std::string _es_objects_index_prefix = "objects-"; + uint32_t _es_objects_start_es_after_block = 0; CURL *curl; // curl handler vector bulk; vector prepare; @@ -84,88 +85,87 @@ bool es_objects_plugin_impl::index_database( const vector& ids, block_time = db.head_block_time(); block_number = db.head_block_num(); - // check if we are in replay or in sync and change number of bulk documents accordingly - uint32_t limit_documents = 0; - if((fc::time_point::now() - block_time) < fc::seconds(30)) - limit_documents = _es_objects_bulk_sync; - else - limit_documents = _es_objects_bulk_replay; + if(block_number > _es_objects_start_es_after_block) { - for(auto const& value: ids) { - if(value.is() && _es_objects_proposals) { - auto obj = db.find_object(value); - auto p = static_cast(obj); - if(p != nullptr) { - if(action == "delete") - remove_from_database(p->id, "proposal"); - else - prepareTemplate(*p, "proposal"); - } - } - else if(value.is() && _es_objects_accounts) { - auto obj = db.find_object(value); - auto a = static_cast(obj); - if(a != nullptr) { - if(action == "delete") - remove_from_database(a->id, "account"); - else - prepareTemplate(*a, "account"); - } - } - else if(value.is() && _es_objects_assets) { - auto obj = db.find_object(value); - auto a = static_cast(obj); - if(a != nullptr) { - if(action == "delete") - remove_from_database(a->id, "asset"); - else - prepareTemplate(*a, "asset"); - } - } - else if(value.is() && _es_objects_balances) { - auto obj = db.find_object(value); - auto b = static_cast(obj); - if(b != nullptr) { - if(action == "delete") - remove_from_database(b->id, "balance"); - else - prepareTemplate(*b, "balance"); - } - } - else if(value.is() && _es_objects_limit_orders) { - auto obj = db.find_object(value); - auto l = static_cast(obj); - if(l != nullptr) { - if(action == "delete") - remove_from_database(l->id, "limitorder"); - else - prepareTemplate(*l, "limitorder"); - } - } - else if(value.is() && _es_objects_asset_bitasset) { - auto obj = db.find_object(value); - auto ba = static_cast(obj); - if(ba != nullptr) { - if(action == "delete") - remove_from_database(ba->id, "bitasset"); - else - prepareTemplate(*ba, "bitasset"); - } - } - } - - if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech - - graphene::utilities::ES es; - es.curl = curl; - es.bulk_lines = bulk; - es.elasticsearch_url = _es_objects_elasticsearch_url; - es.auth = _es_objects_auth; - - if(!graphene::utilities::SendBulk(es)) - return false; + // check if we are in replay or in sync and change number of bulk documents accordingly + uint32_t limit_documents = 0; + if ((fc::time_point::now() - block_time) < fc::seconds(30)) + limit_documents = _es_objects_bulk_sync; else - bulk.clear(); + limit_documents = _es_objects_bulk_replay; + + + for (auto const &value: ids) { + if (value.is() && _es_objects_proposals) { + auto obj = db.find_object(value); + auto p = static_cast(obj); + if (p != nullptr) { + if (action == "delete") + remove_from_database(p->id, "proposal"); + else + prepareTemplate(*p, "proposal"); + } + } else if (value.is() && _es_objects_accounts) { + auto obj = db.find_object(value); + auto a = static_cast(obj); + if (a != nullptr) { + if (action == "delete") + remove_from_database(a->id, "account"); + else + prepareTemplate(*a, "account"); + } + } else if (value.is() && _es_objects_assets) { + auto obj = db.find_object(value); + auto a = static_cast(obj); + if (a != nullptr) { + if (action == "delete") + remove_from_database(a->id, "asset"); + else + prepareTemplate(*a, "asset"); + } + } else if (value.is() && _es_objects_balances) { + auto obj = db.find_object(value); + auto b = static_cast(obj); + if (b != nullptr) { + if (action == "delete") + remove_from_database(b->id, "balance"); + else + prepareTemplate(*b, "balance"); + } + } else if (value.is() && _es_objects_limit_orders) { + auto obj = db.find_object(value); + auto l = static_cast(obj); + if (l != nullptr) { + if (action == "delete") + remove_from_database(l->id, "limitorder"); + else + prepareTemplate(*l, "limitorder"); + } + } else if (value.is() && _es_objects_asset_bitasset) { + auto obj = db.find_object(value); + auto ba = static_cast(obj); + if (ba != nullptr) { + if (action == "delete") + remove_from_database(ba->id, "bitasset"); + else + prepareTemplate(*ba, "bitasset"); + } + } + } + + if (curl && bulk.size() >= limit_documents) { // we are in bulk time, ready to add data to elasticsearech + + graphene::utilities::ES es; + es.curl = curl; + es.bulk_lines = bulk; + es.elasticsearch_url = _es_objects_elasticsearch_url; + es.auth = _es_objects_auth; + + if (!graphene::utilities::SendBulk(es)) + return false; + else + bulk.clear(); + } } return true; @@ -257,6 +257,7 @@ void es_objects_plugin::plugin_set_program_options( ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data(true)") ("es-objects-index-prefix", boost::program_options::value(), "Add a prefix to the index(objects-)") ("es-objects-keep-only-current", boost::program_options::value(), "Keep only current state of the objects(true)") + ("es-objects-start-es-after-block", boost::program_options::value(), "Start doing ES job after block(0)") ; cfg.add(cli); } @@ -319,6 +320,9 @@ void es_objects_plugin::plugin_initialize(const boost::program_options::variable if (options.count("es-objects-keep-only-current")) { my->_es_objects_keep_only_current = options["es-objects-keep-only-current"].as(); } + if (options.count("es-objects-start-es-after-block")) { + my->_es_objects_start_es_after_block = options["es-objects-start-es-after-block"].as(); + } } void es_objects_plugin::plugin_startup() From 82ef3a51d1037295d8de3c06339d809e04a4c960 Mon Sep 17 00:00:00 2001 From: crypto-ape <43807588+crypto-ape@users.noreply.github.com> Date: Tue, 2 Apr 2019 12:55:25 +0200 Subject: [PATCH 36/44] explicitly cleanup external library facilities --- libraries/plugins/elasticsearch/elasticsearch_plugin.cpp | 4 ++++ libraries/plugins/es_objects/es_objects.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index 1ca911f9..d67539c4 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -94,6 +94,10 @@ class elasticsearch_plugin_impl elasticsearch_plugin_impl::~elasticsearch_plugin_impl() { + if (curl) { + curl_easy_cleanup(curl); + curl = nullptr; + } return; } diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 58517349..4b95343b 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -216,6 +216,10 @@ void es_objects_plugin_impl::prepareTemplate(T blockchain_object, string index_n es_objects_plugin_impl::~es_objects_plugin_impl() { + if (curl) { + curl_easy_cleanup(curl); + curl = nullptr; + } return; } From 2f054ac619c7ac3a5f886053933442a504a8a8a8 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Tue, 23 Apr 2019 07:56:14 -0300 Subject: [PATCH 37/44] Merge pull request #1717 from oxarbitrage/issue1652 add genesis data to es_objects --- libraries/plugins/es_objects/es_objects.cpp | 66 +++++++++++++++++++-- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 4b95343b..5b3f29e7 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -48,8 +48,9 @@ class es_objects_plugin_impl { curl = curl_easy_init(); } virtual ~es_objects_plugin_impl(); - bool index_database( const vector& ids, std::string action); - void remove_from_database( object_id_type id, std::string index); + bool index_database(const vector& ids, std::string action); + bool genesis(); + void remove_from_database(object_id_type id, std::string index); es_objects_plugin& _self; std::string _es_objects_elasticsearch_url = "http://localhost:9200/"; @@ -78,7 +79,55 @@ class es_objects_plugin_impl void prepareTemplate(T blockchain_object, string index_name); }; -bool es_objects_plugin_impl::index_database( const vector& ids, std::string action) +bool es_objects_plugin_impl::genesis() +{ + + ilog("elasticsearch OBJECTS: inserting data from genesis"); + + graphene::chain::database &db = _self.database(); + + block_number = db.head_block_num(); + block_time = db.head_block_time(); + + if (_es_objects_accounts) { + auto &index_accounts = db.get_index(1, 2); + index_accounts.inspect_all_objects([this, &db](const graphene::db::object &o) { + auto obj = db.find_object(o.id); + auto a = static_cast(obj); + prepareTemplate(*a, "account"); + }); + } + if (_es_objects_assets) { + auto &index_assets = db.get_index(1, 3); + index_assets.inspect_all_objects([this, &db](const graphene::db::object &o) { + auto obj = db.find_object(o.id); + auto a = static_cast(obj); + prepareTemplate(*a, "asset"); + }); + } + if (_es_objects_balances) { + auto &index_balances = db.get_index(2, 5); + index_balances.inspect_all_objects([this, &db](const graphene::db::object &o) { + auto obj = db.find_object(o.id); + auto b = static_cast(obj); + prepareTemplate(*b, "balance"); + }); + } + + graphene::utilities::ES es; + es.curl = curl; + es.bulk_lines = bulk; + es.elasticsearch_url = _es_objects_elasticsearch_url; + es.auth = _es_objects_auth; + if (!graphene::utilities::SendBulk(es)) + FC_THROW_EXCEPTION(fc::exception, "Error inserting genesis data."); + else + bulk.clear(); + + return true; +} + +bool es_objects_plugin_impl::index_database(const vector& ids, std::string action) { graphene::chain::database &db = _self.database(); @@ -268,13 +317,20 @@ void es_objects_plugin::plugin_set_program_options( void es_objects_plugin::plugin_initialize(const boost::program_options::variables_map& options) { - database().new_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { + database().applied_block.connect([this](const signed_block &b) { + if(b.block_num() == 1) { + if (!my->genesis()) + FC_THROW_EXCEPTION(fc::exception, "Error populating genesis data."); + } + }); + + database().new_objects.connect([this]( const vector& ids, const flat_set& impacted_accounts ) { if(!my->index_database(ids, "create")) { FC_THROW_EXCEPTION(fc::exception, "Error creating object from ES database, we are going to keep trying."); } }); - database().changed_objects.connect([&]( const vector& ids, const flat_set& impacted_accounts ) { + database().changed_objects.connect([this]( const vector& ids, const flat_set& impacted_accounts ) { if(!my->index_database(ids, "update")) { FC_THROW_EXCEPTION(fc::exception, "Error updating object from ES database, we are going to keep trying."); From de4faee7f0a6aa12874303ab444df5ccd77bedee Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Thu, 21 Jun 2018 09:01:51 -0300 Subject: [PATCH 38/44] Merge pull request #1073 from xiangxn/merge-impacted merge impacted into db_notify --- libraries/app/CMakeLists.txt | 1 - libraries/app/api.cpp | 1 - libraries/app/impacted.cpp | 315 ------------------ libraries/chain/db_notify.cpp | 10 +- .../include/graphene/chain}/impacted.hpp | 4 +- .../account_history_plugin.cpp | 7 +- .../accounts_list/accounts_list_plugin.cpp | 2 +- .../affiliate_stats_plugin.cpp | 2 +- libraries/plugins/bookie/bookie_plugin.cpp | 2 +- .../elasticsearch/elasticsearch_plugin.cpp | 4 +- 10 files changed, 19 insertions(+), 329 deletions(-) delete mode 100644 libraries/app/impacted.cpp rename libraries/{app/include/graphene/app => chain/include/graphene/chain}/impacted.hpp (96%) diff --git a/libraries/app/CMakeLists.txt b/libraries/app/CMakeLists.txt index 93e540f9..ac69dfe5 100644 --- a/libraries/app/CMakeLists.txt +++ b/libraries/app/CMakeLists.txt @@ -5,7 +5,6 @@ add_library( graphene_app api.cpp application.cpp database_api.cpp - impacted.cpp plugin.cpp config_util.cpp ${HEADERS} diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 138e0560..94f01330 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/libraries/app/impacted.cpp b/libraries/app/impacted.cpp deleted file mode 100644 index 08253417..00000000 --- a/libraries/app/impacted.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2015 Cryptonomex, Inc., and contributors. - * - * The MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include - -namespace graphene { namespace app { - -using namespace fc; -using namespace graphene::chain; - -// TODO: Review all of these, especially no-ops -struct get_impacted_account_visitor -{ - flat_set& _impacted; - get_impacted_account_visitor( flat_set& impact ):_impacted(impact) {} - typedef void result_type; - - void operator()( const transfer_operation& op ) - { - _impacted.insert( op.to ); - } - - void operator()( const asset_claim_fees_operation& op ){} - void operator()( const limit_order_create_operation& op ) {} - void operator()( const limit_order_cancel_operation& op ) - { - _impacted.insert( op.fee_paying_account ); - } - void operator()( const call_order_update_operation& op ) {} - void operator()( const fill_order_operation& op ) - { - _impacted.insert( op.account_id ); - } - - void operator()( const account_create_operation& op ) - { - _impacted.insert( op.registrar ); - _impacted.insert( op.referrer ); - add_authority_accounts( _impacted, op.owner ); - add_authority_accounts( _impacted, op.active ); - } - - void operator()( const account_update_operation& op ) - { - _impacted.insert( op.account ); - if( op.owner ) - add_authority_accounts( _impacted, *(op.owner) ); - if( op.active ) - add_authority_accounts( _impacted, *(op.active) ); - } - - void operator()( const account_whitelist_operation& op ) - { - _impacted.insert( op.account_to_list ); - } - - void operator()( const account_upgrade_operation& op ) {} - void operator()( const account_transfer_operation& op ) - { - _impacted.insert( op.new_owner ); - } - - void operator()( const asset_create_operation& op ) {} - void operator()( const asset_update_operation& op ) - { - if( op.new_issuer ) - _impacted.insert( *(op.new_issuer) ); - } - - void operator()( const asset_update_bitasset_operation& op ) {} - void operator()( const asset_update_dividend_operation& op ) {} - void operator()( const asset_dividend_distribution_operation& op ) - { - _impacted.insert( op.account_id ); - } - - void operator()( const asset_update_feed_producers_operation& op ) {} - - void operator()( const asset_issue_operation& op ) - { - _impacted.insert( op.issue_to_account ); - } - - void operator()( const asset_reserve_operation& op ) {} - void operator()( const asset_fund_fee_pool_operation& op ) {} - void operator()( const asset_settle_operation& op ) {} - void operator()( const asset_global_settle_operation& op ) {} - void operator()( const asset_publish_feed_operation& op ) {} - void operator()( const witness_create_operation& op ) - { - _impacted.insert( op.witness_account ); - } - void operator()( const witness_update_operation& op ) - { - _impacted.insert( op.witness_account ); - } - - void operator()( const proposal_create_operation& op ) - { - vector other; - for( const auto& proposed_op : op.proposed_ops ) - operation_get_required_authorities( proposed_op.op, _impacted, _impacted, other ); - for( auto& o : other ) - add_authority_accounts( _impacted, o ); - } - - void operator()( const proposal_update_operation& op ) {} - void operator()( const proposal_delete_operation& op ) {} - - void operator()( const withdraw_permission_create_operation& op ) - { - _impacted.insert( op.authorized_account ); - } - - void operator()( const withdraw_permission_update_operation& op ) - { - _impacted.insert( op.authorized_account ); - } - - void operator()( const withdraw_permission_claim_operation& op ) - { - _impacted.insert( op.withdraw_from_account ); - } - - void operator()( const withdraw_permission_delete_operation& op ) - { - _impacted.insert( op.authorized_account ); - } - - void operator()( const committee_member_create_operation& op ) - { - _impacted.insert( op.committee_member_account ); - } - void operator()( const committee_member_update_operation& op ) - { - _impacted.insert( op.committee_member_account ); - } - void operator()( const committee_member_update_global_parameters_operation& op ) {} - - void operator()( const vesting_balance_create_operation& op ) - { - _impacted.insert( op.owner ); - } - - void operator()( const vesting_balance_withdraw_operation& op ) {} - void operator()( const worker_create_operation& op ) {} - void operator()( const custom_operation& op ) {} - void operator()( const assert_operation& op ) {} - void operator()( const balance_claim_operation& op ) {} - - void operator()( const override_transfer_operation& op ) - { - _impacted.insert( op.to ); - _impacted.insert( op.from ); - _impacted.insert( op.issuer ); - } - - void operator()( const transfer_to_blind_operation& op ) - { - _impacted.insert( op.from ); - for( const auto& out : op.outputs ) - add_authority_accounts( _impacted, out.owner ); - } - - void operator()( const blind_transfer_operation& op ) - { - for( const auto& in : op.inputs ) - add_authority_accounts( _impacted, in.owner ); - for( const auto& out : op.outputs ) - add_authority_accounts( _impacted, out.owner ); - } - - void operator()( const transfer_from_blind_operation& op ) - { - _impacted.insert( op.to ); - for( const auto& in : op.inputs ) - add_authority_accounts( _impacted, in.owner ); - } - - void operator()( const asset_settle_cancel_operation& op ) - { - _impacted.insert( op.account ); - } - - void operator()( const fba_distribute_operation& op ) - { - _impacted.insert( op.account_id ); - } - - void operator()( const sport_create_operation& op ) {} - void operator()( const sport_update_operation& op ) {} - void operator()( const sport_delete_operation& op ) {} - void operator()( const event_group_create_operation& op ) {} - void operator()( const event_group_update_operation& op ) {} - void operator()( const event_group_delete_operation& op ) {} - void operator()( const event_create_operation& op ) {} - void operator()( const event_update_operation& op ) {} - void operator()( const event_update_status_operation& op ) {} - void operator()( const betting_market_rules_create_operation& op ) {} - void operator()( const betting_market_rules_update_operation& op ) {} - void operator()( const betting_market_group_create_operation& op ) {} - void operator()( const betting_market_group_update_operation& op ) {} - void operator()( const betting_market_create_operation& op ) {} - void operator()( const betting_market_update_operation& op ) {} - void operator()( const betting_market_group_resolve_operation& op ) {} - void operator()( const betting_market_group_cancel_unmatched_bets_operation& op ) {} - - void operator()( const bet_place_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - void operator()( const bet_cancel_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - void operator()( const bet_canceled_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - void operator()( const bet_adjusted_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - void operator()( const bet_matched_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - void operator()( const betting_market_group_resolved_operation& op ) - { - _impacted.insert( op.bettor_id ); - } - - void operator()( const tournament_create_operation& op ) - { - _impacted.insert( op.creator ); - _impacted.insert( op.options.whitelist.begin(), op.options.whitelist.end() ); - } - void operator()( const tournament_join_operation& op ) - { - _impacted.insert( op.payer_account_id ); - _impacted.insert( op.player_account_id ); - } - void operator()( const tournament_leave_operation& op ) - { - //if account canceling registration is not the player, it must be the payer - if (op.canceling_account_id != op.player_account_id) - _impacted.erase( op.canceling_account_id ); - _impacted.erase( op.player_account_id ); - } - void operator()( const game_move_operation& op ) - { - _impacted.insert( op.player_account_id ); - } - void operator()( const tournament_payout_operation& op ) - { - _impacted.insert( op.payout_account_id ); - } - void operator()( const affiliate_payout_operation& op ) - { - _impacted.insert( op.affiliate ); - } - void operator()( const affiliate_referral_payout_operation& op ) { } - void operator()( const lottery_asset_create_operation& op) { } - void operator()( const ticket_purchase_operation& op ) - { - _impacted.insert( op.buyer ); - } - void operator()( const lottery_reward_operation& op ) { - _impacted.insert( op.winner ); - } - void operator()( const lottery_end_operation& op ) { - for( auto participant : op.participants ) { - _impacted.insert(participant.first); - } - } - void operator()( const sweeps_vesting_claim_operation& op ) { - _impacted.insert( op.account ); - } -}; - -void operation_get_impacted_accounts( const operation& op, flat_set& result ) -{ - get_impacted_account_visitor vtor = get_impacted_account_visitor( result ); - op.visit( vtor ); -} - -void transaction_get_impacted_accounts( const transaction& tx, flat_set& result ) -{ - for( const auto& op : tx.operations ) - operation_get_impacted_accounts( op, result ); -} - -} } diff --git a/libraries/chain/db_notify.cpp b/libraries/chain/db_notify.cpp index 3404989a..d41c2a26 100644 --- a/libraries/chain/db_notify.cpp +++ b/libraries/chain/db_notify.cpp @@ -33,6 +33,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include using namespace fc; using namespace graphene::chain; @@ -287,13 +293,13 @@ struct get_impacted_account_visitor } }; -void operation_get_impacted_accounts( const operation& op, flat_set& result ) +void graphene::chain::operation_get_impacted_accounts( const operation& op, flat_set& result ) { get_impacted_account_visitor vtor = get_impacted_account_visitor( result ); op.visit( vtor ); } -void transaction_get_impacted_accounts( const transaction& tx, flat_set& result ) +void graphene::chain::transaction_get_impacted_accounts( const transaction& tx, flat_set& result ) { for( const auto& op : tx.operations ) operation_get_impacted_accounts( op, result ); diff --git a/libraries/app/include/graphene/app/impacted.hpp b/libraries/chain/include/graphene/chain/impacted.hpp similarity index 96% rename from libraries/app/include/graphene/app/impacted.hpp rename to libraries/chain/include/graphene/chain/impacted.hpp index 2e59b910..2a22cbd1 100644 --- a/libraries/app/include/graphene/app/impacted.hpp +++ b/libraries/chain/include/graphene/chain/impacted.hpp @@ -28,7 +28,7 @@ #include #include -namespace graphene { namespace app { +namespace graphene { namespace chain { void operation_get_impacted_accounts( const graphene::chain::operation& op, @@ -39,4 +39,4 @@ void transaction_get_impacted_accounts( fc::flat_set& result ); -} } // graphene::app +} } // graphene::app \ No newline at end of file diff --git a/libraries/plugins/account_history/account_history_plugin.cpp b/libraries/plugins/account_history/account_history_plugin.cpp index 81acb01e..67322f80 100644 --- a/libraries/plugins/account_history/account_history_plugin.cpp +++ b/libraries/plugins/account_history/account_history_plugin.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include @@ -128,8 +128,8 @@ void account_history_plugin_impl::update_account_histories( const signed_block& if( op.op.which() == operation::tag< account_create_operation >::value ) impacted.insert( op.result.get() ); else - graphene::app::operation_get_impacted_accounts( op.op, impacted ); - if( op.op.which() == operation::tag< lottery_end_operation >::value ) + graphene::chain::operation_get_impacted_accounts( op.op, impacted ); + if( op.op.which() == operation::tag< lottery_end_operation >::value ) { auto lop = op.op.get< lottery_end_operation >(); auto asset_object = lop.lottery( db ); @@ -137,6 +137,7 @@ void account_history_plugin_impl::update_account_histories( const signed_block& for( auto benefactor : asset_object.lottery_options->benefactors ) impacted.insert( benefactor.id ); } + for( auto& a : other ) for( auto& item : a.account_auths ) impacted.insert( item.first ); diff --git a/libraries/plugins/accounts_list/accounts_list_plugin.cpp b/libraries/plugins/accounts_list/accounts_list_plugin.cpp index aabf711d..757891ea 100644 --- a/libraries/plugins/accounts_list/accounts_list_plugin.cpp +++ b/libraries/plugins/accounts_list/accounts_list_plugin.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include diff --git a/libraries/plugins/affiliate_stats/affiliate_stats_plugin.cpp b/libraries/plugins/affiliate_stats/affiliate_stats_plugin.cpp index 438b1aca..da9c8a04 100644 --- a/libraries/plugins/affiliate_stats/affiliate_stats_plugin.cpp +++ b/libraries/plugins/affiliate_stats/affiliate_stats_plugin.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/libraries/plugins/bookie/bookie_plugin.cpp b/libraries/plugins/bookie/bookie_plugin.cpp index f15ac2f7..5b59d14a 100644 --- a/libraries/plugins/bookie/bookie_plugin.cpp +++ b/libraries/plugins/bookie/bookie_plugin.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index d67539c4..98f91c59 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -23,7 +23,7 @@ */ #include -#include +#include #include #include #include @@ -160,7 +160,7 @@ bool elasticsearch_plugin_impl::update_account_histories( const signed_block& b if( op.op.which() == operation::tag< account_create_operation >::value ) impacted.insert( op.result.get() ); else - graphene::app::operation_get_impacted_accounts( op.op, impacted ); + graphene::chain::operation_get_impacted_accounts( op.op, impacted ); for( auto& a : other ) for( auto& item : a.account_auths ) From 62247c543d2422345334a239179463dc431d7e95 Mon Sep 17 00:00:00 2001 From: Alfredo Garcia Date: Wed, 14 Aug 2019 07:57:10 -0300 Subject: [PATCH 39/44] Merge pull request #1725 from oxarbitrage/issue1682 elasticsearch history api #1682 --- libraries/app/CMakeLists.txt | 2 +- libraries/app/api.cpp | 12 + libraries/app/application.cpp | 5 + libraries/app/include/graphene/app/api.hpp | 2 + .../app/include/graphene/app/application.hpp | 7 +- .../elasticsearch/elasticsearch_plugin.cpp | 188 +++++++++- .../elasticsearch/elasticsearch_plugin.hpp | 106 +++++- tests/common/database_fixture.cpp | 11 +- tests/elasticsearch/main.cpp | 324 +++++++++++++++++- 9 files changed, 634 insertions(+), 23 deletions(-) diff --git a/libraries/app/CMakeLists.txt b/libraries/app/CMakeLists.txt index ac69dfe5..d66b4052 100644 --- a/libraries/app/CMakeLists.txt +++ b/libraries/app/CMakeLists.txt @@ -13,7 +13,7 @@ add_library( graphene_app # need to link graphene_debug_witness because plugins aren't sufficiently isolated #246 #target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_chain fc graphene_db graphene_net graphene_utilities graphene_debug_witness ) -target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_accounts_list graphene_affiliate_stats graphene_chain fc graphene_db graphene_net graphene_time graphene_utilities graphene_debug_witness graphene_bookie ) +target_link_libraries( graphene_app graphene_market_history graphene_account_history graphene_accounts_list graphene_affiliate_stats graphene_chain fc graphene_db graphene_net graphene_time graphene_utilities graphene_debug_witness graphene_bookie graphene_elasticsearch ) target_include_directories( graphene_app PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../egenesis/include" ) diff --git a/libraries/app/api.cpp b/libraries/app/api.cpp index 94f01330..c808a27c 100644 --- a/libraries/app/api.cpp +++ b/libraries/app/api.cpp @@ -580,6 +580,18 @@ namespace graphene { namespace app { start = node.operation_id; } catch(...) { return result; } + if(_app.is_plugin_enabled("elasticsearch")) { + auto es = _app.get_plugin("elasticsearch"); + if(es.get()->get_running_mode() != elasticsearch::mode::only_save) { + if(!_app.elasticsearch_thread) + _app.elasticsearch_thread= std::make_shared("elasticsearch"); + + return _app.elasticsearch_thread->async([&es, &account, &stop, &limit, &start]() { + return es->get_account_history(account, stop, limit, start); + }, "thread invoke for method " BOOST_PP_STRINGIZE(method_name)).wait(); + } + } + const auto& hist_idx = db.get_index_type(); const auto& by_op_idx = hist_idx.indices().get(); auto index_start = by_op_idx.begin(); diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index b366be49..b20ffc4c 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -1026,6 +1026,11 @@ std::shared_ptr application::get_plugin(const string& name) con return my->_active_plugins[name]; } +bool application::is_plugin_enabled(const string& name) const +{ + return !(my->_active_plugins.find(name) == my->_active_plugins.end()); +} + net::node_ptr application::p2p_node() { return my->_p2p_network; diff --git a/libraries/app/include/graphene/app/api.hpp b/libraries/app/include/graphene/app/api.hpp index 9e468dca..4adf73a3 100644 --- a/libraries/app/include/graphene/app/api.hpp +++ b/libraries/app/include/graphene/app/api.hpp @@ -31,6 +31,8 @@ #include #include +#include + #include #include #include diff --git a/libraries/app/include/graphene/app/application.hpp b/libraries/app/include/graphene/app/application.hpp index 6f55c390..a313e2f8 100644 --- a/libraries/app/include/graphene/app/application.hpp +++ b/libraries/app/include/graphene/app/application.hpp @@ -89,8 +89,13 @@ namespace graphene { namespace app { /// Emitted when syncing finishes (is_finished_syncing will return true) boost::signals2::signal syncing_finished; - private: void enable_plugin( const string& name ); + + bool is_plugin_enabled(const string& name) const; + + std::shared_ptr elasticsearch_thread; + + private: void add_available_plugin( std::shared_ptr p ); std::shared_ptr my; diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index 98f91c59..7db8ccee 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -27,7 +27,6 @@ #include #include #include -#include namespace graphene { namespace elasticsearch { @@ -60,6 +59,8 @@ class elasticsearch_plugin_impl std::string _elasticsearch_index_prefix = "bitshares-"; bool _elasticsearch_operation_object = false; uint32_t _elasticsearch_start_es_after_block = 0; + bool _elasticsearch_operation_string = true; + mode _elasticsearch_mode = mode::only_save; CURL *curl; // curl handler vector bulk_lines; // vector of op lines vector prepare; @@ -215,7 +216,14 @@ void elasticsearch_plugin_impl::doOperationHistory(const optional op_in_trx; os.operation_result = fc::json::to_string(oho->result); os.virtual_op = oho->virtual_op; - os.op = fc::json::to_string(oho->op); + + if(_elasticsearch_operation_object) { + oho->op.visit(fc::from_static_variant(os.op_object, FC_PACK_MAX_DEPTH)); + adaptor_struct adaptor; + os.op_object = adaptor.adapt(os.op_object.get_object()); + } + if(_elasticsearch_operation_string) + os.op = fc::json::to_string(oho->op); } void elasticsearch_plugin_impl::doBlock(const optional & oho, const signed_block& b) @@ -394,25 +402,32 @@ void elasticsearch_plugin::plugin_set_program_options( ) { cli.add_options() - ("elasticsearch-node-url", boost::program_options::value(), "Elastic Search database node url") - ("elasticsearch-bulk-replay", boost::program_options::value(), "Number of bulk documents to index on replay(5000)") - ("elasticsearch-bulk-sync", boost::program_options::value(), "Number of bulk documents to index on a syncronied chain(10)") - ("elasticsearch-visitor", boost::program_options::value(), "Use visitor to index additional data(slows down the replay)") - ("elasticsearch-basic-auth", boost::program_options::value(), "Pass basic auth to elasticsearch database ") - ("elasticsearch-index-prefix", boost::program_options::value(), "Add a prefix to the index(bitshares-)") - ("elasticsearch-operation-object", boost::program_options::value(), "Save operation as object(false)") - ("elasticsearch-start-es-after-block", boost::program_options::value(), "Start doing ES job after block(0)") + ("elasticsearch-node-url", boost::program_options::value(), + "Elastic Search database node url(http://localhost:9200/)") + ("elasticsearch-bulk-replay", boost::program_options::value(), + "Number of bulk documents to index on replay(10000)") + ("elasticsearch-bulk-sync", boost::program_options::value(), + "Number of bulk documents to index on a syncronied chain(100)") + ("elasticsearch-visitor", boost::program_options::value(), + "Use visitor to index additional data(slows down the replay(false))") + ("elasticsearch-basic-auth", boost::program_options::value(), + "Pass basic auth to elasticsearch database('')") + ("elasticsearch-index-prefix", boost::program_options::value(), + "Add a prefix to the index(bitshares-)") + ("elasticsearch-operation-object", boost::program_options::value(), + "Save operation as object(false)") + ("elasticsearch-start-es-after-block", boost::program_options::value(), + "Start doing ES job after block(0)") + ("elasticsearch-operation-string", boost::program_options::value(), + "Save operation as string. Needed to serve history api calls(true)") + ("elasticsearch-mode", boost::program_options::value(), + "Mode of operation: only_save(0), only_query(1), all(2) - Default: 0") ; cfg.add(cli); } void elasticsearch_plugin::plugin_initialize(const boost::program_options::variables_map& options) { - database().applied_block.connect( [&]( const signed_block& b) { - if (!my->update_account_histories(b)) - FC_THROW_EXCEPTION(fc::exception, "Error populating ES database, we are going to keep trying."); - } ); - my->_oho_index = database().add_index< primary_index< operation_history_index > >(); database().add_index< primary_index< account_transaction_history_index > >(); @@ -439,7 +454,28 @@ void elasticsearch_plugin::plugin_initialize(const boost::program_options::varia } if (options.count("elasticsearch-start-es-after-block")) { my->_elasticsearch_start_es_after_block = options["elasticsearch-start-es-after-block"].as(); - } + } + if (options.count("elasticsearch-operation-string")) { + my->_elasticsearch_operation_string = options["elasticsearch-operation-string"].as(); + } + if (options.count("elasticsearch-mode")) { + const auto option_number = options["elasticsearch-mode"].as(); + if(option_number > mode::all) + FC_THROW_EXCEPTION(fc::exception, "Elasticsearch mode not valid"); + my->_elasticsearch_mode = static_cast(options["elasticsearch-mode"].as()); + } + + if(my->_elasticsearch_mode != mode::only_query) { + if (my->_elasticsearch_mode == mode::all && !my->_elasticsearch_operation_string) + FC_THROW_EXCEPTION(fc::exception, + "If elasticsearch-mode is set to all then elasticsearch-operation-string need to be true"); + + database().applied_block.connect([this](const signed_block &b) { + if (!my->update_account_histories(b)) + FC_THROW_EXCEPTION(fc::exception, + "Error populating ES database, we are going to keep trying."); + }); + } } void elasticsearch_plugin::plugin_startup() @@ -454,4 +490,124 @@ void elasticsearch_plugin::plugin_startup() ilog("elasticsearch ACCOUNT HISTORY: plugin_startup() begin"); } +operation_history_object elasticsearch_plugin::get_operation_by_id(operation_history_id_type id) +{ + const string operation_id_string = std::string(object_id_type(id)); + + const string query = R"( + { + "query": { + "match": + { + "account_history.operation_id": )" + operation_id_string + R"(" + } + } + } + )"; + + auto es = prepareHistoryQuery(query); + const auto response = graphene::utilities::simpleQuery(es); + variant variant_response = fc::json::from_string(response); + const auto source = variant_response["hits"]["hits"][size_t(0)]["_source"]; + return fromEStoOperation(source); +} + +vector elasticsearch_plugin::get_account_history( + const account_id_type account_id, + operation_history_id_type stop = operation_history_id_type(), + unsigned limit = 100, + operation_history_id_type start = operation_history_id_type()) +{ + const string account_id_string = std::string(object_id_type(account_id)); + + const auto stop_number = stop.instance.value; + const auto start_number = start.instance.value; + + string range = ""; + if(stop_number == 0) + range = " AND operation_id_num: ["+fc::to_string(stop_number)+" TO "+fc::to_string(start_number)+"]"; + else if(stop_number > 0) + range = " AND operation_id_num: {"+fc::to_string(stop_number)+" TO "+fc::to_string(start_number)+"]"; + + const string query = R"( + { + "size": )" + fc::to_string(limit) + R"(, + "sort" : [{ "operation_id_num" : {"order" : "desc"}}], + "query": { + "bool": { + "must": [ + { + "query_string": { + "query": "account_history.account: )" + account_id_string + range + R"(" + } + } + ] + } + } + } + )"; + + auto es = prepareHistoryQuery(query); + + vector result; + + if(!graphene::utilities::checkES(es)) + return result; + + const auto response = graphene::utilities::simpleQuery(es); + variant variant_response = fc::json::from_string(response); + + const auto hits = variant_response["hits"]["total"]["value"]; + const auto size = std::min(static_cast(hits.as_uint64()), limit); + + for(unsigned i=0; i_elasticsearch_node_url; + es.index_prefix = my->_elasticsearch_index_prefix; + es.endpoint = es.index_prefix + "*/data/_search"; + es.query = query; + + return es; +} + +mode elasticsearch_plugin::get_running_mode() +{ + return my->_elasticsearch_mode; +} + + } } diff --git a/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp index 19a48843..01a83244 100644 --- a/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp +++ b/libraries/plugins/elasticsearch/include/graphene/elasticsearch/elasticsearch_plugin.hpp @@ -26,6 +26,7 @@ #include #include #include +#include namespace graphene { namespace elasticsearch { using namespace chain; @@ -49,6 +50,8 @@ namespace detail class elasticsearch_plugin_impl; } +enum mode { only_save = 0 , only_query = 1, all = 2 }; + class elasticsearch_plugin : public graphene::app::plugin { public: @@ -63,10 +66,20 @@ class elasticsearch_plugin : public graphene::app::plugin virtual void plugin_initialize(const boost::program_options::variables_map& options) override; virtual void plugin_startup() override; + operation_history_object get_operation_by_id(operation_history_id_type id); + vector get_account_history(const account_id_type account_id, + operation_history_id_type stop, unsigned limit, operation_history_id_type start); + mode get_running_mode(); + friend class detail::elasticsearch_plugin_impl; std::unique_ptr my; + + private: + operation_history_object fromEStoOperation(variant source); + graphene::utilities::ES prepareHistoryQuery(string query); }; + struct operation_visitor { typedef void result_type; @@ -128,6 +141,7 @@ struct operation_history_struct { std::string operation_result; int virtual_op; std::string op; + variant op_object; }; struct block_struct { @@ -174,9 +188,99 @@ struct bulk_struct { optional additional_data; }; +struct adaptor_struct { + variant adapt(const variant_object& op) + { + fc::mutable_variant_object o(op); + vector keys_to_rename; + for (auto i = o.begin(); i != o.end(); ++i) + { + auto& element = (*i).value(); + if (element.is_object()) + { + const string& name = (*i).key(); + auto& vo = element.get_object(); + if (vo.contains(name.c_str())) + keys_to_rename.emplace_back(name); + element = adapt(vo); + } + else if (element.is_array()) + adapt(element.get_array()); + } + for (const auto& i : keys_to_rename) + { + string new_name = i + "_"; + o[new_name] = variant(o[i]); + o.erase(i); + } + + if (o.find("memo") != o.end()) + { + auto& memo = o["memo"]; + if (memo.is_string()) + { + o["memo_"] = o["memo"]; + o.erase("memo"); + } + else if (memo.is_object()) + { + fc::mutable_variant_object tmp(memo.get_object()); + if (tmp.find("nonce") != tmp.end()) + { + tmp["nonce"] = tmp["nonce"].as_string(); + o["memo"] = tmp; + } + } + } + if (o.find("new_parameters") != o.end()) + { + auto& tmp = o["new_parameters"]; + if (tmp.is_object()) + { + fc::mutable_variant_object tmp2(tmp.get_object()); + if (tmp2.find("current_fees") != tmp2.end()) + { + tmp2.erase("current_fees"); + o["new_parameters"] = tmp2; + } + } + } + if (o.find("owner") != o.end() && o["owner"].is_string()) + { + o["owner_"] = o["owner"].as_string(); + o.erase("owner"); + } + if (o.find("proposed_ops") != o.end()) + { + o["proposed_ops"] = fc::json::to_string(o["proposed_ops"]); + } + if (o.find("initializer") != o.end()) + { + o["initializer"] = fc::json::to_string(o["initializer"]); + } + + variant v; + fc::to_variant(o, v, FC_PACK_MAX_DEPTH); + return v; + } + + void adapt(fc::variants& v) + { + for (auto& array_element : v) + { + if (array_element.is_object()) + array_element = adapt(array_element.get_object()); + else if (array_element.is_array()) + adapt(array_element.get_array()); + else + array_element = array_element.as_string(); + } + } +}; } } //graphene::elasticsearch -FC_REFLECT( graphene::elasticsearch::operation_history_struct, (trx_in_block)(op_in_trx)(operation_result)(virtual_op)(op) ) +FC_REFLECT_ENUM( graphene::elasticsearch::mode, (only_save)(only_query)(all) ) +FC_REFLECT( graphene::elasticsearch::operation_history_struct, (trx_in_block)(op_in_trx)(operation_result)(virtual_op)(op)(op_object) ) FC_REFLECT( graphene::elasticsearch::block_struct, (block_num)(block_time)(trx_id) ) FC_REFLECT( graphene::elasticsearch::fee_struct, (asset)(amount) ) FC_REFLECT( graphene::elasticsearch::transfer_struct, (asset)(amount)(from)(to) ) diff --git a/tests/common/database_fixture.cpp b/tests/common/database_fixture.cpp index 8cd3dc40..14b10fa3 100644 --- a/tests/common/database_fixture.cpp +++ b/tests/common/database_fixture.cpp @@ -132,21 +132,26 @@ database_fixture::database_fixture() // app.initialize(); auto test_name = boost::unit_test::framework::current_test_case().p_name.value; - if(test_name == "elasticsearch_account_history" || test_name == "elasticsearch_suite") { + if(test_name == "elasticsearch_account_history" || test_name == "elasticsearch_suite" || + test_name == "elasticsearch_history_api") { auto esplugin = app.register_plugin(); esplugin->plugin_set_app(&app); options.insert(std::make_pair("elasticsearch-node-url", boost::program_options::variable_value(string("http://localhost:9200/"), false))); options.insert(std::make_pair("elasticsearch-bulk-replay", boost::program_options::variable_value(uint32_t(2), false))); options.insert(std::make_pair("elasticsearch-bulk-sync", boost::program_options::variable_value(uint32_t(2), false))); - options.insert(std::make_pair("elasticsearch-visitor", boost::program_options::variable_value(true, false))); - //options.insert(std::make_pair("elasticsearch-basic-auth", boost::program_options::variable_value(string("elastic:changeme"), false))); + options.insert(std::make_pair("elasticsearch-start-es-after-block", boost::program_options::variable_value(uint32_t(0), false))); + options.insert(std::make_pair("elasticsearch-visitor", boost::program_options::variable_value(false, false))); + options.insert(std::make_pair("elasticsearch-operation-object", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("elasticsearch-operation-string", boost::program_options::variable_value(true, false))); + options.insert(std::make_pair("elasticsearch-mode", boost::program_options::variable_value(uint16_t(2), false))); esplugin->plugin_initialize(options); esplugin->plugin_startup(); } else { auto ahplugin = app.register_plugin(); + app.enable_plugin("affiliate_stats"); ahplugin->plugin_set_app(&app); ahplugin->plugin_initialize(options); ahplugin->plugin_startup(); diff --git a/tests/elasticsearch/main.cpp b/tests/elasticsearch/main.cpp index 18674a3b..fc459935 100644 --- a/tests/elasticsearch/main.cpp +++ b/tests/elasticsearch/main.cpp @@ -27,6 +27,7 @@ #include #include +#include #include "../common/database_fixture.hpp" @@ -118,7 +119,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_account_history) { es.endpoint = index_name + "/data/2.9.12"; // we know last op is a transfer of amount 300 res = graphene::utilities::getEndPoint(es); j = fc::json::from_string(res); - auto last_transfer_amount = j["_source"]["additional_data"]["transfer_data"]["amount"].as_string(); + auto last_transfer_amount = j["_source"]["operation_history"]["op_object"]["amount_"]["amount"].as_string(); BOOST_CHECK_EQUAL(last_transfer_amount, "300"); } } @@ -210,4 +211,325 @@ BOOST_AUTO_TEST_CASE(elasticsearch_suite) { } } +BOOST_AUTO_TEST_CASE(elasticsearch_history_api) { + try { + CURL *curl; // curl handler + curl = curl_easy_init(); + + graphene::utilities::ES es; + es.curl = curl; + es.elasticsearch_url = "http://localhost:9200/"; + es.index_prefix = "bitshares-"; + + auto delete_account_history = graphene::utilities::deleteAll(es); + + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + if(delete_account_history) { + + create_bitasset("USD", account_id_type()); // create op 0 + const account_object& dan = create_account("dan"); // create op 1 + create_bitasset("CNY", dan.id); // create op 2 + create_bitasset("BTC", account_id_type()); // create op 3 + create_bitasset("XMR", dan.id); // create op 4 + create_bitasset("EUR", account_id_type()); // create op 5 + create_bitasset("OIL", dan.id); // create op 6 + + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + graphene::app::history_api hist_api(app); + app.enable_plugin("elasticsearch"); + + // f(A, 0, 4, 9) = { 5, 3, 1, 0 } + auto histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(9)); + + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u); + + // f(A, 0, 4, 6) = { 5, 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(6)); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u); + + // f(A, 0, 4, 5) = { 5, 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(5)); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u); + + // f(A, 0, 4, 4) = { 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(4)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 0u); + + // f(A, 0, 4, 3) = { 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(3)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 0u); + + // f(A, 0, 4, 2) = { 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(2)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u); + + // f(A, 0, 4, 1) = { 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type(1)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u); + + // f(A, 0, 4, 0) = { 5, 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 4, operation_history_id_type()); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 0u); + + // f(A, 1, 5, 9) = { 5, 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(9)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + + // f(A, 1, 5, 6) = { 5, 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(6)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + + // f(A, 1, 5, 5) = { 5, 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(5)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + + // f(A, 1, 5, 4) = { 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(4)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + + // f(A, 1, 5, 3) = { 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(3)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + + // f(A, 1, 5, 2) = { } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(2)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(A, 1, 5, 1) = { } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(1)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(A, 1, 5, 0) = { 5, 3 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(1), 5, operation_history_id_type(0)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + + // f(A, 0, 3, 9) = { 5, 3, 1 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(9)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(A, 0, 3, 6) = { 5, 3, 1 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(6)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(A, 0, 3, 5) = { 5, 3, 1 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(5)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(A, 0, 3, 4) = { 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(4)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 0u); + + // f(A, 0, 3, 3) = { 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(3)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 0u); + + // f(A, 0, 3, 2) = { 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(2)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u); + + // f(A, 0, 3, 1) = { 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type(1)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 0u); + + // f(A, 0, 3, 0) = { 5, 3, 1 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(), 3, operation_history_id_type()); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(B, 0, 4, 9) = { 6, 4, 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(9)); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 1u); + + // f(B, 0, 4, 6) = { 6, 4, 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(6)); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 1u); + + // f(B, 0, 4, 5) = { 4, 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(5)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(B, 0, 4, 4) = { 4, 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(4)); + BOOST_CHECK_EQUAL(histories.size(), 3u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 1u); + + // f(B, 0, 4, 3) = { 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(3)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + + // f(B, 0, 4, 2) = { 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(2)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 1u); + + // f(B, 0, 4, 1) = { 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type(1)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 1u); + + // f(B, 0, 4, 0) = { 6, 4, 2, 1 } + histories = hist_api.get_account_history("dan", operation_history_id_type(), 4, operation_history_id_type()); + BOOST_CHECK_EQUAL(histories.size(), 4u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 2u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 1u); + + // f(B, 2, 4, 9) = { 6, 4 } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(9)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + + // f(B, 2, 4, 6) = { 6, 4 } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(6)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + + // f(B, 2, 4, 5) = { 4 } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(5)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u); + + // f(B, 2, 4, 4) = { 4 } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(4)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 4u); + + // f(B, 2, 4, 3) = { } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(3)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(B, 2, 4, 2) = { } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(2)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(B, 2, 4, 1) = { } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(1)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(B, 2, 4, 0) = { 6, 4 } + histories = hist_api.get_account_history("dan", operation_history_id_type(2), 4, operation_history_id_type(0)); + BOOST_CHECK_EQUAL(histories.size(), 2u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 6u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 4u); + + // 0 limits + histories = hist_api.get_account_history("dan", operation_history_id_type(0), 0, operation_history_id_type(0)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(3), 0, operation_history_id_type(9)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // non existent account + histories = hist_api.get_account_history("1.2.18", operation_history_id_type(0), 4, operation_history_id_type(0)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // create a new account C = alice { 7 } + auto alice = create_account("alice"); + + generate_block(); + fc::usleep(fc::milliseconds(1000)); + + // f(C, 0, 4, 10) = { 7 } + histories = hist_api.get_account_history("alice", operation_history_id_type(0), 4, operation_history_id_type(10)); + BOOST_CHECK_EQUAL(histories.size(), 1u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 7u); + + // f(C, 8, 4, 10) = { } + histories = hist_api.get_account_history("alice", operation_history_id_type(8), 4, operation_history_id_type(10)); + BOOST_CHECK_EQUAL(histories.size(), 0u); + + // f(A, 0, 10, 0) = { 7, 5, 3, 1, 0 } + histories = hist_api.get_account_history("1.2.0", operation_history_id_type(0), 10, operation_history_id_type(0)); + BOOST_CHECK_EQUAL(histories.size(), 5u); + BOOST_CHECK_EQUAL(histories[0].id.instance(), 7u); + BOOST_CHECK_EQUAL(histories[1].id.instance(), 5u); + BOOST_CHECK_EQUAL(histories[2].id.instance(), 3u); + BOOST_CHECK_EQUAL(histories[3].id.instance(), 1u); + BOOST_CHECK_EQUAL(histories[4].id.instance(), 0u); + } + } + catch (fc::exception &e) { + edump((e.to_detail_string())); + throw; + } +} BOOST_AUTO_TEST_SUITE_END() From bfa878f9b285571419cdfdb477d4ddea3b0867b2 Mon Sep 17 00:00:00 2001 From: gladcow Date: Fri, 13 Dec 2019 18:55:49 +0300 Subject: [PATCH 40/44] change ES index prefixes to Peerplays-specific --- .../plugins/elasticsearch/elasticsearch_plugin.cpp | 4 ++-- libraries/plugins/es_objects/es_objects.cpp | 4 ++-- tests/elasticsearch/main.cpp | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index 7db8ccee..11eee3e1 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -56,7 +56,7 @@ class elasticsearch_plugin_impl uint32_t _elasticsearch_bulk_sync = 100; bool _elasticsearch_visitor = false; std::string _elasticsearch_basic_auth = ""; - std::string _elasticsearch_index_prefix = "bitshares-"; + std::string _elasticsearch_index_prefix = "peerplays-"; bool _elasticsearch_operation_object = false; uint32_t _elasticsearch_start_es_after_block = 0; bool _elasticsearch_operation_string = true; @@ -413,7 +413,7 @@ void elasticsearch_plugin::plugin_set_program_options( ("elasticsearch-basic-auth", boost::program_options::value(), "Pass basic auth to elasticsearch database('')") ("elasticsearch-index-prefix", boost::program_options::value(), - "Add a prefix to the index(bitshares-)") + "Add a prefix to the index(peerplays-)") ("elasticsearch-operation-object", boost::program_options::value(), "Save operation as object(false)") ("elasticsearch-start-es-after-block", boost::program_options::value(), diff --git a/libraries/plugins/es_objects/es_objects.cpp b/libraries/plugins/es_objects/es_objects.cpp index 5b3f29e7..b9083cbc 100644 --- a/libraries/plugins/es_objects/es_objects.cpp +++ b/libraries/plugins/es_objects/es_objects.cpp @@ -63,7 +63,7 @@ class es_objects_plugin_impl bool _es_objects_balances = true; bool _es_objects_limit_orders = true; bool _es_objects_asset_bitasset = true; - std::string _es_objects_index_prefix = "objects-"; + std::string _es_objects_index_prefix = "ppobjects-"; uint32_t _es_objects_start_es_after_block = 0; CURL *curl; // curl handler vector bulk; @@ -308,7 +308,7 @@ void es_objects_plugin::plugin_set_program_options( ("es-objects-balances", boost::program_options::value(), "Store balances objects(true)") ("es-objects-limit-orders", boost::program_options::value(), "Store limit order objects(true)") ("es-objects-asset-bitasset", boost::program_options::value(), "Store feed data(true)") - ("es-objects-index-prefix", boost::program_options::value(), "Add a prefix to the index(objects-)") + ("es-objects-index-prefix", boost::program_options::value(), "Add a prefix to the index(ppobjects-)") ("es-objects-keep-only-current", boost::program_options::value(), "Keep only current state of the objects(true)") ("es-objects-start-es-after-block", boost::program_options::value(), "Start doing ES job after block(0)") ; diff --git a/tests/elasticsearch/main.cpp b/tests/elasticsearch/main.cpp index fc459935..28d3522c 100644 --- a/tests/elasticsearch/main.cpp +++ b/tests/elasticsearch/main.cpp @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_account_history) { graphene::utilities::ES es; es.curl = curl; es.elasticsearch_url = "http://localhost:9200/"; - es.index_prefix = "bitshares-"; + es.index_prefix = "peerplays-"; //es.auth = "elastic:changeme"; // delete all first @@ -67,7 +67,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_account_history) { fc::usleep(fc::milliseconds(1000)); // for later use - //int asset_create_op_id = operation::tag::value; + //int asset_crobjeate_op_id = operation::tag::value; //int account_create_op_id = operation::tag::value; string query = "{ \"query\" : { \"bool\" : { \"must\" : [{\"match_all\": {}}] } } }"; @@ -114,7 +114,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_account_history) { // check the visitor data auto block_date = db.head_block_time(); - std::string index_name = graphene::utilities::generateIndexName(block_date, "bitshares-"); + std::string index_name = graphene::utilities::generateIndexName(block_date, "peerplays-"); es.endpoint = index_name + "/data/2.9.12"; // we know last op is a transfer of amount 300 res = graphene::utilities::getEndPoint(es); @@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_objects) { graphene::utilities::ES es; es.curl = curl; es.elasticsearch_url = "http://localhost:9200/"; - es.index_prefix = "objects-"; + es.index_prefix = "ppobjects-"; //es.auth = "elastic:changeme"; // delete all first @@ -193,10 +193,10 @@ BOOST_AUTO_TEST_CASE(elasticsearch_suite) { graphene::utilities::ES es; es.curl = curl; es.elasticsearch_url = "http://localhost:9200/"; - es.index_prefix = "bitshares-"; + es.index_prefix = "peerplays-"; auto delete_account_history = graphene::utilities::deleteAll(es); fc::usleep(fc::milliseconds(1000)); - es.index_prefix = "objects-"; + es.index_prefix = "ppobjects-"; auto delete_objects = graphene::utilities::deleteAll(es); fc::usleep(fc::milliseconds(1000)); @@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE(elasticsearch_history_api) { graphene::utilities::ES es; es.curl = curl; es.elasticsearch_url = "http://localhost:9200/"; - es.index_prefix = "bitshares-"; + es.index_prefix = "peerplays-"; auto delete_account_history = graphene::utilities::deleteAll(es); From 63750ecf57fbf445649b74fb54e8856d18e26f1e Mon Sep 17 00:00:00 2001 From: pbattu123 Date: Thu, 2 Jan 2020 11:33:05 -0400 Subject: [PATCH 41/44] sync develop with beatrice --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 0cf82577..4d3518d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,5 +5,5 @@ [submodule "libraries/fc"] path = libraries/fc url = https://github.com/peerplays-network/peerplays-fc.git - branch = beatrice + branch = latest-fc ignore = dirty From 0a904429660461ac07aa2a38a0e731a31728210f Mon Sep 17 00:00:00 2001 From: gladcow Date: Mon, 13 Jan 2020 15:35:18 +0300 Subject: [PATCH 42/44] fix the data writing to ES during sync issues --- .../elasticsearch/elasticsearch_plugin.cpp | 5 ++- programs/witness_node/genesis.json | 37 ++++++++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp index 11eee3e1..96dbab7c 100644 --- a/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp +++ b/libraries/plugins/elasticsearch/elasticsearch_plugin.cpp @@ -75,6 +75,7 @@ class elasticsearch_plugin_impl std::string bulk_line; std::string index_name; bool is_sync = false; + fc::time_point last_sync; private: bool add_elasticsearch( const account_id_type account_id, const optional& oho, const uint32_t block_number ); const account_transaction_history_object& addNewEntry(const account_statistics_object& stats_obj, @@ -192,10 +193,12 @@ bool elasticsearch_plugin_impl::update_account_histories( const signed_block& b void elasticsearch_plugin_impl::checkState(const fc::time_point_sec& block_time) { - if((fc::time_point::now() - block_time) < fc::seconds(30)) + fc::time_point current_time(fc::time_point::now()); + if(((current_time - block_time) < fc::seconds(30)) || (current_time - last_sync > fc::seconds(60))) { limit_documents = _elasticsearch_bulk_sync; is_sync = true; + last_sync = current_time; } else { diff --git a/programs/witness_node/genesis.json b/programs/witness_node/genesis.json index ab153e7b..e07cec92 100644 --- a/programs/witness_node/genesis.json +++ b/programs/witness_node/genesis.json @@ -1,5 +1,5 @@ { - "initial_timestamp": "2019-05-14T18:47:51", + "initial_timestamp": "2020-01-13T06:03:15", "max_core_supply": "1000000000000000", "initial_parameters": { "current_fees": { @@ -307,6 +307,27 @@ 75,{} ],[ 76,{} + ],[ + 77,{ + "lottery_asset": 2000000, + "price_per_kbyte": 10 + } + ],[ + 78,{ + "fee": 0 + } + ],[ + 79,{ + "fee": 0 + } + ],[ + 80,{ + "fee": 0 + } + ],[ + 81,{ + "fee": 2000000 + } ] ], "scale": 10000 @@ -352,7 +373,19 @@ "maximum_tournament_start_time_in_future": 2419200, "maximum_tournament_start_delay": 604800, "maximum_tournament_number_of_wins": 100, - "extensions": {} + "extensions": { + "min_bet_multiplier": 10100, + "max_bet_multiplier": 10000000, + "betting_rake_fee_percentage": 300, + "live_betting_delay_time": 5, + "sweeps_distribution_percentage": 200, + "sweeps_distribution_asset": "1.3.0", + "sweeps_vesting_accumulator_account": "1.2.0", + "gpos_period": 15552000, + "gpos_subperiod": 2592000, + "gpos_period_start": 1601528400, + "gpos_vesting_lockin_period": 2592000 + } }, "initial_bts_accounts": [], "initial_accounts": [{ From e55075ec6d5aeacfb9e69a43bead9d7d75dc159b Mon Sep 17 00:00:00 2001 From: gladcow Date: Fri, 17 Jan 2020 18:51:44 +0300 Subject: [PATCH 43/44] fix CLI tests --- libraries/app/application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/app/application.cpp b/libraries/app/application.cpp index b20ffc4c..adfd8402 100644 --- a/libraries/app/application.cpp +++ b/libraries/app/application.cpp @@ -991,6 +991,7 @@ void application::initialize(const fc::path& data_dir, const boost::program_opti wanted.push_back("witness"); wanted.push_back("account_history"); wanted.push_back("market_history"); + wanted.push_back("bookie"); } int es_ah_conflict_counter = 0; for (auto& it : wanted) From 11919cdbd923a4715dc9930fee56653eba08613c Mon Sep 17 00:00:00 2001 From: pbattu123 <43043205+pbattu123@users.noreply.github.com> Date: Wed, 12 Feb 2020 14:08:23 -0400 Subject: [PATCH 44/44] brought updates from mainnet branch (#285) --- .../graphene/chain/protocol/chain_parameters.hpp | 12 ++++++------ libraries/plugins/bookie/bookie_plugin.cpp | 8 ++++---- libraries/wallet/wallet.cpp | 9 ++++++++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp index 3f2c5a22..5ab8ae7c 100644 --- a/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp +++ b/libraries/chain/include/graphene/chain/protocol/chain_parameters.hpp @@ -35,12 +35,11 @@ namespace graphene { namespace chain { struct fee_schedule; } } namespace graphene { namespace chain { struct parameter_extension { - optional< bet_multiplier_type > min_bet_multiplier = GRAPHENE_DEFAULT_MIN_BET_MULTIPLIER; - optional< bet_multiplier_type > max_bet_multiplier = GRAPHENE_DEFAULT_MAX_BET_MULTIPLIER; - optional< uint16_t > betting_rake_fee_percentage = GRAPHENE_DEFAULT_RAKE_FEE_PERCENTAGE; - optional< flat_map > - permitted_betting_odds_increments = flat_map(GRAPHENE_DEFAULT_PERMITTED_BETTING_ODDS_INCREMENTS); - optional< uint16_t > live_betting_delay_time = GRAPHENE_DEFAULT_LIVE_BETTING_DELAY_TIME; + optional< bet_multiplier_type > min_bet_multiplier; + optional< bet_multiplier_type > max_bet_multiplier; + optional< uint16_t > betting_rake_fee_percentage; + optional< flat_map > permitted_betting_odds_increments; + optional< uint16_t > live_betting_delay_time; optional< uint16_t > sweeps_distribution_percentage = SWEEPS_DEFAULT_DISTRIBUTION_PERCENTAGE; optional< asset_id_type > sweeps_distribution_asset = SWEEPS_DEFAULT_DISTRIBUTION_ASSET; optional< account_id_type > sweeps_vesting_accumulator_account= SWEEPS_ACCUMULATOR_ACCOUNT; @@ -148,6 +147,7 @@ FC_REFLECT( graphene::chain::parameter_extension, (min_bet_multiplier) (max_bet_multiplier) (betting_rake_fee_percentage) + (permitted_betting_odds_increments) (live_betting_delay_time) (sweeps_distribution_percentage) (sweeps_distribution_asset) diff --git a/libraries/plugins/bookie/bookie_plugin.cpp b/libraries/plugins/bookie/bookie_plugin.cpp index f15ac2f7..0d06f5ad 100644 --- a/libraries/plugins/bookie/bookie_plugin.cpp +++ b/libraries/plugins/bookie/bookie_plugin.cpp @@ -370,8 +370,8 @@ void bookie_plugin_impl::on_block_applied( const signed_block& ) assert(bet_iter != persistent_bets_by_bet_id.end()); if (bet_iter != persistent_bets_by_bet_id.end()) { - ilog("Adding bet_canceled_operation ${canceled_id} to bet ${bet_id}'s associated operations", - ("canceled_id", op.id)("bet_id", bet_canceled_op.bet_id)); + // ilog("Adding bet_canceled_operation ${canceled_id} to bet ${bet_id}'s associated operations", + // ("canceled_id", op.id)("bet_id", bet_canceled_op.bet_id)); if (is_operation_history_object_stored(op.id)) db.modify(*bet_iter, [&]( persistent_bet_object& obj ) { obj.associated_operations.emplace_back(op.id); @@ -386,8 +386,8 @@ void bookie_plugin_impl::on_block_applied( const signed_block& ) assert(bet_iter != persistent_bets_by_bet_id.end()); if (bet_iter != persistent_bets_by_bet_id.end()) { - ilog("Adding bet_adjusted_operation ${adjusted_id} to bet ${bet_id}'s associated operations", - ("adjusted_id", op.id)("bet_id", bet_adjusted_op.bet_id)); + // ilog("Adding bet_adjusted_operation ${adjusted_id} to bet ${bet_id}'s associated operations", + // ("adjusted_id", op.id)("bet_id", bet_adjusted_op.bet_id)); if (is_operation_history_object_stored(op.id)) db.modify(*bet_iter, [&]( persistent_bet_object& obj ) { obj.associated_operations.emplace_back(op.id); diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index ab6f5bb7..32034a79 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -2122,6 +2122,7 @@ public: asset_object asset_obj = get_asset( asset_symbol ); vector< vesting_balance_object > vbos; + vesting_balance_object vbo; fc::optional vbid = maybe_id(account_name); if( !vbid ) { @@ -2134,7 +2135,13 @@ public: if(!vbos.size()) vbos.emplace_back( get_object(*vbid) ); - const vesting_balance_object& vbo = vbos.front(); + for (const vesting_balance_object& vesting_balance_obj: vbos) { + if(vesting_balance_obj.balance_type == vesting_balance_type::gpos) + { + vbo = vesting_balance_obj; + break; + } + } vesting_balance_withdraw_operation vesting_balance_withdraw_op;