From 6bf503d23ac2539ac634eac9393844db08b8fa23 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Fri, 23 Aug 2019 12:50:38 -0700 Subject: [PATCH 1/9] Fix account_update2 test when building with low mem --- tests/tests/operation_tests.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/tests/operation_tests.cpp b/tests/tests/operation_tests.cpp index 017f6b7058..0633c45007 100644 --- a/tests/tests/operation_tests.cpp +++ b/tests/tests/operation_tests.cpp @@ -8187,14 +8187,17 @@ BOOST_AUTO_TEST_CASE( account_update2_apply ) const account_object& acct = db->get_account( "alice" ); const account_authority_object& acct_auth = db->get< account_authority_object, by_account >( "alice" ); - const account_metadata_object& acct_metadata = db->get< account_metadata_object, by_account >( acct.id ); BOOST_REQUIRE( acct.name == "alice" ); BOOST_REQUIRE( acct_auth.owner == authority( 1, new_private_key.get_public_key(), 1 ) ); BOOST_REQUIRE( acct_auth.active == authority( 2, new_private_key.get_public_key(), 2 ) ); BOOST_REQUIRE( acct.memo_key == new_private_key.get_public_key() ); + +#ifdef IS_LOW_MEM + const account_metadata_object& acct_metadata = db->get< account_metadata_object, by_account >( acct.id ); BOOST_REQUIRE( acct_metadata.json_metadata == "{\"bar\":\"foo\"}" ); BOOST_REQUIRE( acct_metadata.posting_json_metadata == "{\"success\":true}" ); +#endif validate_database(); From 47dc797f59be23a9db8493958748956b8b73750a Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Mon, 26 Aug 2019 08:53:54 -0700 Subject: [PATCH 2/9] Add missing fields to extended_dynamic_global_properties in condenser api --- .../plugins/condenser_api/condenser_api.hpp | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp index 401ba2ac2d..e721b42047 100644 --- a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp +++ b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp @@ -371,6 +371,7 @@ struct extended_dynamic_global_properties sbd_interest_rate( o.sbd_interest_rate ), sbd_print_rate( o.sbd_print_rate ), maximum_block_size( o.maximum_block_size ), + required_actions_partition_percent( o.required_actions_partition_percent ), current_aslot( o.current_aslot ), recent_slots_filled( o.recent_slots_filled ), participation_count( o.participation_count ), @@ -378,8 +379,20 @@ struct extended_dynamic_global_properties vote_power_reserve_rate( o.vote_power_reserve_rate ), delegation_return_period( o.delegation_return_period ), reverse_auction_seconds( o.reverse_auction_seconds ), + available_account_subsidies( o.available_account_subsidies ), sbd_stop_percent( o.sbd_stop_percent ), - sbd_start_percent( o.sbd_start_percent ) + sbd_start_percent( o.sbd_start_percent ), + next_maintenance_time( o.next_maintenance_time ), + last_budget_time( o.last_budget_time ), + content_reward_percent( o.content_reward_percent ), + vesting_reward_percent( o.vesting_reward_percent ), + sps_fund_percent( o.sps_fund_percent ), + sps_interval_ledger( legacy_asset::from_asset( o.sps_interval_ledger ) ), + downvote_pool_percent( o.downvote_pool_percent ) +#ifdef STEEM_ENABLE_SMT + , + smt_creation_fee( legacy_asset::from_asset( o.smt_creation_fee ) ) +#endif {} uint32_t head_block_number = 0; @@ -408,6 +421,7 @@ struct extended_dynamic_global_properties uint16_t sbd_print_rate = STEEM_100_PERCENT; uint32_t maximum_block_size = 0; + uint16_t required_actions_partition_percent = 0; uint64_t current_aslot = 0; fc::uint128_t recent_slots_filled; uint8_t participation_count = 0; @@ -419,8 +433,24 @@ struct extended_dynamic_global_properties uint64_t reverse_auction_seconds = 0; + int64_t available_account_subsidies = 0; + uint16_t sbd_stop_percent = 0; uint16_t sbd_start_percent = 0; + + time_point_sec next_maintenance_time; + time_point_sec last_budget_time; + + uint16_t content_reward_percent = STEEM_CONTENT_REWARD_PERCENT_HF16; + uint16_t vesting_reward_percent = STEEM_VESTING_FUND_PERCENT_HF16; + uint16_t sps_fund_percent = STEEM_PROPOSAL_FUND_PERCENT_HF0; + + legacy_asset sps_interval_ledger; + + uint16_t downvote_pool_percent = 0; +#ifdef STEEM_ENABLE_SMT + legacy_asset smt_creation_fee; +#endif }; struct api_witness_object @@ -1213,8 +1243,13 @@ FC_REFLECT( steem::plugins::condenser_api::extended_dynamic_global_properties, (total_vesting_fund_steem)(total_vesting_shares) (total_reward_fund_steem)(total_reward_shares2)(pending_rewarded_vesting_shares)(pending_rewarded_vesting_steem) (sbd_interest_rate)(sbd_print_rate) - (maximum_block_size)(current_aslot)(recent_slots_filled)(participation_count)(last_irreversible_block_num)(vote_power_reserve_rate) - (delegation_return_period)(reverse_auction_seconds)(sbd_stop_percent)(sbd_start_percent) ) + (maximum_block_size)(required_actions_partition_percent)(current_aslot)(recent_slots_filled)(participation_count)(last_irreversible_block_num) + (vote_power_reserve_rate)(delegation_return_period)(reverse_auction_seconds)(available_account_subsidies)(sbd_stop_percent)(sbd_start_percent) + (next_maintenance_time)(last_budget_time)(content_reward_percent)(vesting_reward_percent)(sps_fund_percent)(sps_interval_ledger) +#ifdef STEEM_ENABLE_SMT + (smt_creation_fee) +#endif + ) FC_REFLECT( steem::plugins::condenser_api::api_witness_object, (id) From b80bb9a42ee0b8664b9ae2f3a741e9849605b30d Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Mon, 26 Aug 2019 09:55:09 -0700 Subject: [PATCH 3/9] Add missing reflection field --- .../include/steem/plugins/condenser_api/condenser_api.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp index e721b42047..380798abd9 100644 --- a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp +++ b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp @@ -448,6 +448,7 @@ struct extended_dynamic_global_properties legacy_asset sps_interval_ledger; uint16_t downvote_pool_percent = 0; +FC_TODO( "Remove STEEM_ENABLE_SMT when merging to master" ) #ifdef STEEM_ENABLE_SMT legacy_asset smt_creation_fee; #endif @@ -1245,7 +1246,8 @@ FC_REFLECT( steem::plugins::condenser_api::extended_dynamic_global_properties, (sbd_interest_rate)(sbd_print_rate) (maximum_block_size)(required_actions_partition_percent)(current_aslot)(recent_slots_filled)(participation_count)(last_irreversible_block_num) (vote_power_reserve_rate)(delegation_return_period)(reverse_auction_seconds)(available_account_subsidies)(sbd_stop_percent)(sbd_start_percent) - (next_maintenance_time)(last_budget_time)(content_reward_percent)(vesting_reward_percent)(sps_fund_percent)(sps_interval_ledger) + (next_maintenance_time)(last_budget_time)(content_reward_percent)(vesting_reward_percent)(sps_fund_percent)(sps_interval_ledger)(downvote_pool_percent) +FC_TODO( "Remove STEEM_ENABLE_SMT when merging to master" ) #ifdef STEEM_ENABLE_SMT (smt_creation_fee) #endif From 14ca14cff35594850ed138135ff86c2048a0b8b5 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Mon, 26 Aug 2019 10:25:54 -0700 Subject: [PATCH 4/9] Remove smt_creation_fee. CI was not happy with reflection. --- .../include/steem/plugins/condenser_api/condenser_api.hpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp index 380798abd9..e66f88d032 100644 --- a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp +++ b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp @@ -448,10 +448,6 @@ struct extended_dynamic_global_properties legacy_asset sps_interval_ledger; uint16_t downvote_pool_percent = 0; -FC_TODO( "Remove STEEM_ENABLE_SMT when merging to master" ) -#ifdef STEEM_ENABLE_SMT - legacy_asset smt_creation_fee; -#endif }; struct api_witness_object @@ -1247,10 +1243,6 @@ FC_REFLECT( steem::plugins::condenser_api::extended_dynamic_global_properties, (maximum_block_size)(required_actions_partition_percent)(current_aslot)(recent_slots_filled)(participation_count)(last_irreversible_block_num) (vote_power_reserve_rate)(delegation_return_period)(reverse_auction_seconds)(available_account_subsidies)(sbd_stop_percent)(sbd_start_percent) (next_maintenance_time)(last_budget_time)(content_reward_percent)(vesting_reward_percent)(sps_fund_percent)(sps_interval_ledger)(downvote_pool_percent) -FC_TODO( "Remove STEEM_ENABLE_SMT when merging to master" ) -#ifdef STEEM_ENABLE_SMT - (smt_creation_fee) -#endif ) FC_REFLECT( steem::plugins::condenser_api::api_witness_object, From 3970f50167ae143f8f5944c70396dac785fb0a28 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Mon, 26 Aug 2019 10:58:58 -0700 Subject: [PATCH 5/9] Complete removal of smt_creation_fee --- .../include/steem/plugins/condenser_api/condenser_api.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp index e66f88d032..8e1ce630c3 100644 --- a/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp +++ b/libraries/plugins/apis/condenser_api/include/steem/plugins/condenser_api/condenser_api.hpp @@ -389,10 +389,6 @@ struct extended_dynamic_global_properties sps_fund_percent( o.sps_fund_percent ), sps_interval_ledger( legacy_asset::from_asset( o.sps_interval_ledger ) ), downvote_pool_percent( o.downvote_pool_percent ) -#ifdef STEEM_ENABLE_SMT - , - smt_creation_fee( legacy_asset::from_asset( o.smt_creation_fee ) ) -#endif {} uint32_t head_block_number = 0; From 5faab3a0d8fc2f83f20c8b89238cf69d1e8a5d70 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Tue, 27 Aug 2019 10:08:27 -0700 Subject: [PATCH 6/9] Add extra logging to the rc plugin --- libraries/plugins/rc/rc_plugin.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/libraries/plugins/rc/rc_plugin.cpp b/libraries/plugins/rc/rc_plugin.cpp index d336c43cf9..2ab1c565a8 100644 --- a/libraries/plugins/rc/rc_plugin.cpp +++ b/libraries/plugins/rc/rc_plugin.cpp @@ -239,6 +239,7 @@ void use_account_rcs( #endif ) { + if( account_name == account_name_type() ) { if( db.is_producing() ) @@ -262,6 +263,8 @@ void use_account_rcs( mbparams.max_mana = get_maximum_rc( account, rc_account ); mbparams.regen_time = STEEM_RC_REGEN_TIME; + try{ + db.modify( rc_account, [&]( rc_account_object& rca ) { rca.rc_manabar.regenerate_mana< true >( mbparams, gpo.time.sec_since_epoch() ); @@ -305,10 +308,11 @@ void use_account_rcs( rca.rc_manabar.use_mana( rc, min_mana ); } ); + }FC_CAPTURE_AND_RETHROW( (account)(rc_account)(mbparams.max_mana) ) } void rc_plugin_impl::on_post_apply_transaction( const transaction_notification& note ) -{ +{ try { const dynamic_global_property_object& gpo = _db.get_dynamic_global_properties(); if( before_first_block() ) return; @@ -357,7 +361,7 @@ void rc_plugin_impl::on_post_apply_transaction( const transaction_notification& } if( export_data ) export_data->tx_info.push_back( tx_info ); -} +} FC_CAPTURE_AND_RETHROW( (note.transaction) ) } struct block_extensions_count_resources_visitor { @@ -383,7 +387,7 @@ struct block_extensions_count_resources_visitor }; void rc_plugin_impl::on_post_apply_block( const block_notification& note ) -{ +{ try{ const dynamic_global_property_object& gpo = _db.get_dynamic_global_properties(); if( before_first_block() ) { @@ -512,7 +516,7 @@ void rc_plugin_impl::on_post_apply_block( const block_notification& note ) steem::plugins::block_data_export::find_export_data< exp_rc_data >( STEEM_RC_PLUGIN_NAME ); if( export_data ) export_data->block_info = block_info; -} +} FC_CAPTURE_AND_RETHROW( (note.block) ) } void rc_plugin_impl::on_first_block() { @@ -617,6 +621,8 @@ struct pre_apply_operation_visitor mbparams.max_mana = get_maximum_rc( account, rc_account ); mbparams.regen_time = STEEM_RC_REGEN_TIME; + try { + if( mbparams.max_mana != rc_account.last_max_rc ) { if( !_skip.skip_reject_unknown_delta_vests ) @@ -636,6 +642,7 @@ struct pre_apply_operation_visitor { rca.rc_manabar.regenerate_mana< true >( mbparams, _current_time ); } ); + } FC_CAPTURE_AND_RETHROW( (account)(rc_account)(mbparams.max_mana) ) } template< bool account_may_not_exist = false > @@ -654,8 +661,9 @@ struct pre_apply_operation_visitor const rc_account_object* rc_account = _db.find< rc_account_object, by_name >( name ); FC_ASSERT( rc_account != nullptr, "Unexpectedly, rc_account ${a} does not exist", ("a", name) ); - + try{ regenerate( *account, *rc_account ); + } FC_CAPTURE_AND_RETHROW( (*account)(*rc_account) ) } void operator()( const account_create_with_delegation_operation& op )const @@ -971,7 +979,7 @@ typedef post_apply_operation_visitor post_apply_optional_action_visitor; void rc_plugin_impl::on_pre_apply_operation( const operation_notification& note ) -{ +{ try { if( before_first_block() ) return; @@ -987,6 +995,7 @@ void rc_plugin_impl::on_pre_apply_operation( const operation_notification& note // ilog( "Calling pre-vtor on ${op}", ("op", note.op) ); note.op.visit( vtor ); + } FC_CAPTURE_AND_RETHROW( (note.op) ) } void update_modified_accounts( database& db, const std::vector< account_regen_info >& modified_accounts ) @@ -1009,7 +1018,7 @@ void update_modified_accounts( database& db, const std::vector< account_regen_in } void rc_plugin_impl::on_post_apply_operation( const operation_notification& note ) -{ +{ try { if( before_first_block() ) return; @@ -1023,7 +1032,7 @@ void rc_plugin_impl::on_post_apply_operation( const operation_notification& note note.op.visit( vtor ); update_modified_accounts( _db, modified_accounts ); -} +} FC_CAPTURE_AND_RETHROW( (note.op) ) } void rc_plugin_impl::on_pre_apply_optional_action( const optional_action_notification& note ) { From 215d74301c9945a0cee1b3febb0e1161ac6a534f Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Tue, 27 Aug 2019 10:48:31 -0700 Subject: [PATCH 7/9] More logging --- libraries/chain/database.cpp | 3 ++- libraries/chain/include/steem/chain/util/manabar.hpp | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/chain/database.cpp b/libraries/chain/database.cpp index a942bfe545..83eeee8592 100644 --- a/libraries/chain/database.cpp +++ b/libraries/chain/database.cpp @@ -4294,6 +4294,7 @@ void database::clear_expired_delegations() while( itr != delegations_by_exp.end() && itr->expiration < now ) { operation vop = return_vesting_delegation_operation( itr->delegator, itr->vesting_shares ); + try{ pre_push_virtual_operation( vop ); modify( get_account( itr->delegator ), [&]( account_object& a ) @@ -4314,7 +4315,7 @@ void database::clear_expired_delegations() remove( *itr ); itr = delegations_by_exp.begin(); - } + } FC_CAPTURE_AND_RETHROW( (vop) ) } } #ifdef STEEM_ENABLE_SMT template< typename smt_balance_object_type, class balance_operator_type > diff --git a/libraries/chain/include/steem/chain/util/manabar.hpp b/libraries/chain/include/steem/chain/util/manabar.hpp index 4e94ca6ae3..a1b9c27265 100644 --- a/libraries/chain/include/steem/chain/util/manabar.hpp +++ b/libraries/chain/include/steem/chain/util/manabar.hpp @@ -20,9 +20,9 @@ struct manabar_params : max_mana(mm), regen_time(rt) {} void validate()const - { + { try{ FC_ASSERT( max_mana >= 0 ); - } + } FC_CAPTURE_AND_RETHROW( (max_mana) ) } }; struct manabar @@ -120,18 +120,22 @@ template< typename PropType, typename AccountType > void update_manabar( const PropType& gpo, AccountType& account, bool downvote_mana = false, int64_t new_mana = 0 ) { auto effective_vests = util::get_effective_vesting_shares( account ); + try { manabar_params params( effective_vests, STEEM_VOTING_MANA_REGENERATION_SECONDS ); account.voting_manabar.regenerate_mana( params, gpo.time ); account.voting_manabar.use_mana( -new_mana ); + } FC_CAPTURE_LOG_AND_RETHROW( (account)(effective_vests) ) FC_TODO( "This hardfork check should not be needed. Remove after HF21 if that is the case." ); // This is used as a hardfork check. Can be replaced with if( gpo.downvote_pool_percent ). Leaving as a hard check to be safe until after HF 21 + try{ if( downvote_mana ) { util::manabar_params params( ( effective_vests * gpo.downvote_pool_percent ) / STEEM_100_PERCENT, STEEM_VOTING_MANA_REGENERATION_SECONDS ); account.downvote_manabar.regenerate_mana( params, gpo.time ); account.downvote_manabar.use_mana( ( -new_mana * gpo.downvote_pool_percent ) / STEEM_100_PERCENT ); } + } FC_CAPTURE_LOG_AND_RETHROW( (account)(effective_vests) ) } } } } // steem::chain::util From ec6eda5a58ef6c9e0f8e30c2a8a3f8d93592cd6a Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Tue, 27 Aug 2019 11:33:42 -0700 Subject: [PATCH 8/9] Fix overflow in downvote calcs for large stakeholders --- libraries/chain/database.cpp | 2 ++ .../include/steem/chain/util/manabar.hpp | 20 +++++++++++++++++-- libraries/chain/steem_evaluator.cpp | 10 +++++----- libraries/protocol/hardfork.d/0_21.hf | 2 ++ 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/libraries/chain/database.cpp b/libraries/chain/database.cpp index 83eeee8592..8c7eac849d 100644 --- a/libraries/chain/database.cpp +++ b/libraries/chain/database.cpp @@ -1283,6 +1283,7 @@ asset create_vesting2( database& db, const account_object& to_account, asset liq cprops, a, db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), + db.head_block_num() > STEEM_HF_21_STALL_BLOCK, new_vesting.amount.value ); }); } @@ -4305,6 +4306,7 @@ void database::clear_expired_delegations() gpo, a, has_hardfork( STEEM_HARDFORK_0_21__3336 ), + head_block_num() > STEEM_HF_21_STALL_BLOCK, itr->vesting_shares.amount.value ); } diff --git a/libraries/chain/include/steem/chain/util/manabar.hpp b/libraries/chain/include/steem/chain/util/manabar.hpp index a1b9c27265..93d244a180 100644 --- a/libraries/chain/include/steem/chain/util/manabar.hpp +++ b/libraries/chain/include/steem/chain/util/manabar.hpp @@ -117,7 +117,7 @@ int64_t get_effective_vesting_shares( const T& account ) } template< typename PropType, typename AccountType > -void update_manabar( const PropType& gpo, AccountType& account, bool downvote_mana = false, int64_t new_mana = 0 ) +void update_manabar( const PropType& gpo, AccountType& account, bool downvote_mana = false, bool check_overflow = true, int64_t new_mana = 0 ) { auto effective_vests = util::get_effective_vesting_shares( account ); try { @@ -131,7 +131,23 @@ void update_manabar( const PropType& gpo, AccountType& account, bool downvote_ma try{ if( downvote_mana ) { - util::manabar_params params( ( effective_vests * gpo.downvote_pool_percent ) / STEEM_100_PERCENT, STEEM_VOTING_MANA_REGENERATION_SECONDS ); + manabar_params params; + params.regen_time = STEEM_VOTING_MANA_REGENERATION_SECONDS; + + if( check_overflow ) + { + params.max_mana = ( ( uint128_t( effective_vests ) * gpo.downvote_pool_percent ) / STEEM_100_PERCENT ).to_int64(); + } + else + { + FC_TODO( "Cleanup once we have verified the overflow has not permanently made it in to the chain" ); + uint128_t numerator = effective_vests * gpo.downvote_pool_percent; + if( numerator.hi != 0 ) + elog( "NOTIFYALERT! max mana overflow made it in to the chain" ); + + params.max_mana = ( effective_vests * gpo.downvote_pool_percent ) / STEEM_100_PERCENT; + } + account.downvote_manabar.regenerate_mana( params, gpo.time ); account.downvote_manabar.use_mana( ( -new_mana * gpo.downvote_pool_percent ) / STEEM_100_PERCENT ); } diff --git a/libraries/chain/steem_evaluator.cpp b/libraries/chain/steem_evaluator.cpp index c9ba116a93..6d493c3d43 100644 --- a/libraries/chain/steem_evaluator.cpp +++ b/libraries/chain/steem_evaluator.cpp @@ -1906,7 +1906,7 @@ void hf20_vote_evaluator( const vote_operation& o, database& _db ) _db.modify( voter, [&]( account_object& a ) { - util::update_manabar( _db.get_dynamic_global_properties(), a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ) ); + util::update_manabar( _db.get_dynamic_global_properties(), a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), _db.head_block_num() > STEEM_HF_21_STALL_BLOCK ); }); if ( _db.has_hardfork( STEEM_HARDFORK_0_21__3004 ) ) @@ -2975,7 +2975,7 @@ void claim_reward_balance_evaluator::do_apply( const claim_reward_balance_operat { if( _db.has_hardfork( STEEM_HARDFORK_0_20__2539 ) ) { - util::update_manabar( _db.get_dynamic_global_properties(), a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), op.reward_vests.amount.value ); + util::update_manabar( _db.get_dynamic_global_properties(), a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), _db.head_block_num() > STEEM_HF_21_STALL_BLOCK, op.reward_vests.amount.value ); } a.vesting_shares += op.reward_vests; @@ -3084,7 +3084,7 @@ void delegate_vesting_shares_evaluator::do_apply( const delegate_vesting_shares_ _db.modify( delegator, [&]( account_object& a ) { - util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ) ); + util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), _db.head_block_num() > STEEM_HF_21_STALL_BLOCK ); }); available_shares = asset( delegator.voting_manabar.current_mana, VESTS_SYMBOL ); @@ -3180,7 +3180,7 @@ void delegate_vesting_shares_evaluator::do_apply( const delegate_vesting_shares_ { if( _db.has_hardfork( STEEM_HARDFORK_0_20__2539 ) ) { - util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), op.vesting_shares.amount.value ); + util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), _db.head_block_num() > STEEM_HF_21_STALL_BLOCK, op.vesting_shares.amount.value ); } a.received_vesting_shares += op.vesting_shares; @@ -3218,7 +3218,7 @@ void delegate_vesting_shares_evaluator::do_apply( const delegate_vesting_shares_ { if( _db.has_hardfork( STEEM_HARDFORK_0_20__2539 ) ) { - util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), delta.amount.value ); + util::update_manabar( gpo, a, _db.has_hardfork( STEEM_HARDFORK_0_21__3336 ), _db.head_block_num() > STEEM_HF_21_STALL_BLOCK, delta.amount.value ); } a.received_vesting_shares += delta; diff --git a/libraries/protocol/hardfork.d/0_21.hf b/libraries/protocol/hardfork.d/0_21.hf index 5b65b94d81..331599fbc1 100644 --- a/libraries/protocol/hardfork.d/0_21.hf +++ b/libraries/protocol/hardfork.d/0_21.hf @@ -11,6 +11,8 @@ #define STEEM_HARDFORK_0_21__3336 (STEEM_HARDFORK_0_21) #define STEEM_HARDFORK_0_21__3343 (STEEM_HARDFORK_0_21) +#define STEEM_HF_21_STALL_BLOCK 35922615 + #define STEEM_HARDFORK_0_21_VERSION hardfork_version( 0, 21 ) #endif From 28e745d7ac19788d9f8ce52dc276a47f404121b6 Mon Sep 17 00:00:00 2001 From: Michael Vandeberg Date: Tue, 27 Aug 2019 11:48:56 -0700 Subject: [PATCH 9/9] Bump version to 0.21.1 --- libraries/protocol/include/steem/protocol/config.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/protocol/include/steem/protocol/config.hpp b/libraries/protocol/include/steem/protocol/config.hpp index 6157a6f12b..c77067c123 100644 --- a/libraries/protocol/include/steem/protocol/config.hpp +++ b/libraries/protocol/include/steem/protocol/config.hpp @@ -44,7 +44,7 @@ #else // IS LIVE STEEM NETWORK -#define STEEM_BLOCKCHAIN_VERSION ( version(0, 21, 0) ) +#define STEEM_BLOCKCHAIN_VERSION ( version(0, 21, 1) ) #define STEEM_INIT_PUBLIC_KEY_STR "STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX" #define STEEM_CHAIN_ID fc::sha256()