Skip to content

Commit

Permalink
Merge pull request #3649 from steemhardfork/HF0.23
Browse files Browse the repository at this point in the history
Hardfork 0.23
  • Loading branch information
Yrp committed Jun 9, 2020
2 parents ca3c534 + a101bd8 commit a58daad
Show file tree
Hide file tree
Showing 19 changed files with 544 additions and 53 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ tests/performance_test
build/
build.*/
build-*/

# clion
.idea
cmake-build-debug
38 changes: 19 additions & 19 deletions doc/seednodes.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
seed-east.steemit.com:2001 # steemit
seed-central.steemit.com:2001 # steemit
seed-west.steemit.com:2001 # steemit
52.74.152.79:2001 # smooth.witness
anyx.io:2001 # anyx
seed.liondani.com:2016 # liondani
gtg.steem.house:2001 # gtg
seed.jesta.us:2001 # jesta
lafonasteem.com:2001 # lafona
steem-seed.altcap.io:40696 # ihashfury
seed.roelandp.nl:2001 # roelandp
seed.timcliff.com:2001 # timcliff
steemseed.clayop.com:2001 # clayop
seed.steemviz.com:2001 # ausbitbank
steem-seed.lukestokes.info:2001 # lukestokes
seed.steemian.info:2001 # drakos
seed.followbtcnews.com:2001 # followbtcnews
node.mahdiyari.info:2001 # mahdi.yari
seed.riversteem.com:2001 # riverhead
seed1.blockbrothers.io:2001 # blockbrothers
steemseed-fin.privex.io:2001 # privex
seed.yabapmatt.com:2001 # yabapmatt
sn1.steemit.com:2001 # Steemit, Inc.
sn2.steemit.com:2001 # Steemit, Inc.
sn3.steemit.com:2001 # Steemit, Inc.
sn4.steemit.com:2001 # Steemit, Inc.
sn5.steemit.com:2001 # Steemit, Inc.
sn6.steemit.com:2001 # Steemit, Inc.
seed.justyy.com:2001 # @justyy
steem-seed.urbanpedia.com:2001 # @fuli
steem-seed.61bts.com:2001 # @ety001
seed-1.blockbrothers.io:2001 # @blockbrothers
5.189.136.20:2001 # @maiyude
steemseed-fin.privex.io:2001 # privex (FI)
steemseed-se.privex.io:2001 # privex (SE)
seed.steemhunt.com:2001 # @steemhunt Location: South Korea
seed.steemzzang.com:2001 # @zzan.witnesses in Philland
seednode.dlike.io:2001 # @Dlike Location Germany
seed.steemer.app:2001 # @Bukio
seed.supporter.dev:2001 # @dev.supporters
seed.goodhello.net:2001" # @helloworld.wit
305 changes: 302 additions & 3 deletions libraries/chain/database.cpp

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions libraries/chain/include/steem/chain/database.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@ namespace steem { namespace chain {
///@}
#endif

//Clears all pending operations on account that involve balance, moves tokens to HIVE_TREASURY_ACCOUNT
void clear_account( const account_object& account,
asset* transferred_sbd_ptr = nullptr, asset* transferred_steem_ptr = nullptr,
asset* converted_vests_ptr = nullptr, asset* steem_from_vests_ptr = nullptr );

protected:
//Mark pop_undo() as protected -- we do not want outside calling pop_undo(); it should call pop_block() instead
//void pop_undo() { object_database::pop_undo(); }
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1256,6 +1256,8 @@ void withdraw_vesting_evaluator::do_apply( const withdraw_vesting_operation& o )
int vesting_withdraw_intervals = STEEM_VESTING_WITHDRAW_INTERVALS_PRE_HF_16;
if( _db.has_hardfork( STEEM_HARDFORK_0_16__551 ) )
vesting_withdraw_intervals = STEEM_VESTING_WITHDRAW_INTERVALS; /// 13 weeks = 1 quarter of a year
if( _db.has_hardfork( STEEM_HARDFORK_0_23 ) )
vesting_withdraw_intervals = STEEM_VESTING_WITHDRAW_INTERVALS_HF_23; /// 4 weeks

_db.modify( account, [&]( account_object& a )
{
Expand Down
6 changes: 6 additions & 0 deletions libraries/chain/util/impacted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ struct get_impacted_account_visitor
_impacted.insert( STEEM_INIT_MINER_NAME );
}

void operator()( const hardfork23_operation& op )
{
_impacted.insert( HIVE_TREASURY_ACCOUNT );
_impacted.insert( op.account );
}

//void operator()( const operation& op ){}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ void blockchain_statistics_plugin_impl::pre_operation( const operation_notificat
auto& account = db.get_account( op.account );
const auto& bucket = db.get(bucket_id);

auto new_vesting_withdrawal_rate = op.vesting_shares.amount / STEEM_VESTING_WITHDRAW_INTERVALS;
int vesting_withdraw_intervals = STEEM_VESTING_WITHDRAW_INTERVALS;
if( _db.has_hardfork( STEEM_HARDFORK_0_23 ) )
vesting_withdraw_intervals = STEEM_VESTING_WITHDRAW_INTERVALS_HF_23; /// 4 weeks

auto new_vesting_withdrawal_rate = op.vesting_shares.amount / vesting_withdraw_intervals;
if( op.vesting_shares.amount > 0 && new_vesting_withdrawal_rate == 0 )
new_vesting_withdrawal_rate = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,35 @@ namespace steem { namespace plugins { namespace condenser_api {
legacy_asset additional_funds;
};

struct legacy_hardfork23_operation
{
legacy_hardfork23_operation() {}
legacy_hardfork23_operation( const hardfork23_operation& op ) :
account( op.account ),
sbd_transferred( legacy_asset::from_asset( op.sbd_transferred ) ),
steem_transferred( legacy_asset::from_asset( op.steem_transferred ) ),
vests_converted( legacy_asset::from_asset( op.vests_converted ) ),
total_steem_from_vests( legacy_asset::from_asset( op.total_steem_from_vests ) )
{}

operator hardfork23_operation()const
{
legacy_hardfork23_operation op;
op.account = account;
op.sbd_transferred = sbd_transferred;
op.steem_transferred = steem_transferred;
op.vests_converted = vests_converted;
op.total_steem_from_vests = total_steem_from_vests;
return op;
}

account_name_type account;
legacy_asset sbd_transferred;
legacy_asset steem_transferred;
legacy_asset vests_converted;
legacy_asset total_steem_from_vests;
};

typedef fc::static_variant<
legacy_vote_operation,
legacy_comment_operation,
Expand Down Expand Up @@ -1140,7 +1169,8 @@ namespace steem { namespace plugins { namespace condenser_api {
legacy_producer_reward_operation,
legacy_clear_null_account_balance_operation,
legacy_proposal_pay_operation,
legacy_sps_fund_operation
legacy_sps_fund_operation,
legacy_hardfork23_operation
> legacy_operation;

struct legacy_operation_conversion_visitor
Expand Down Expand Up @@ -1387,6 +1417,12 @@ namespace steem { namespace plugins { namespace condenser_api {
return true;
}

bool operator()( const hardfork23_operation& op )const
{
l_op = legacy_hardfork23_operation( op );
return true;
}

// Should only be SMT ops
template< typename T >
bool operator()( const T& )const { return false; }
Expand Down Expand Up @@ -1568,6 +1604,11 @@ struct convert_from_legacy_operation_visitor
return operation( sps_fund_operation( op ) );
}

operation operator()( const legacy_hardfork23_operation& op )const
{
return operation( hardfork23_operation( op ) );
}

template< typename T >
operation operator()( const T& t )const
{
Expand Down Expand Up @@ -1693,5 +1734,6 @@ FC_REFLECT( steem::plugins::condenser_api::legacy_claim_account_operation, (crea
FC_REFLECT( steem::plugins::condenser_api::legacy_proposal_pay_operation, (receiver)(payment)(trx_id)(op_in_trx) )
FC_REFLECT( steem::plugins::condenser_api::legacy_sps_fund_operation, (additional_funds) )
FC_REFLECT( steem::plugins::condenser_api::legacy_create_proposal_operation, (creator)(receiver)(start_date)(end_date)(daily_pay)(subject)(permlink) )
FC_REFLECT( steem::plugins::condenser_api::legacy_hardfork23_operation, (account)(sbd_transferred)(steem_transferred)(vests_converted)(total_steem_from_vests) )

FC_REFLECT_TYPENAME( steem::plugins::condenser_api::legacy_operation )
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ const std::vector< std::string > default_seeds = {
"seed-east.steemit.com:2001", // steemit
"seed-central.steemit.com:2001", // steemit
"seed-west.steemit.com:2001", // steemit
"52.74.152.79:2001", // smooth.witness
"anyx.io:2001", // anyx
"seed.liondani.com:2016", // liondani
"gtg.steem.house:2001", // gtg
"seed.jesta.us:2001", // jesta
"lafonasteem.com:2001", // lafona
"steem-seed.altcap.io:40696", // ihashfury
"seed.roelandp.nl:2001", // roelandp
"seed.timcliff.com:2001", // timcliff
"steemseed.clayop.com:2001", // clayop
"seed.steemviz.com:2001", // ausbitbank
"steem-seed.lukestokes.info:2001", // lukestokes
"seed.steemian.info:2001", // drakos
"seed.followbtcnews.com:2001", // followbtcnews
"node.mahdiyari.info:2001", // mahdiyari
"seed.riversteem.com:2001", // riverhead
"seed1.blockbrothers.io:2001", // blockbrothers
"steemseed-fin.privex.io:2001", // privex
"seed.yabapmatt.com:2001" // yabapmatt
"sn1.steemit.com:2001", // Steemit, Inc.
"sn2.steemit.com:2001", // Steemit, Inc.
"sn3.steemit.com:2001", // Steemit, Inc.
"sn4.steemit.com:2001", // Steemit, Inc.
"sn5.steemit.com:2001", // Steemit, Inc.
"sn6.steemit.com:2001", // Steemit, Inc.
"seed.justyy.com:2001", // @justyy
"steem-seed.urbanpedia.com:2001", // @fuli
"steem-seed.61bts.com:2001", // @ety001
"seed-1.blockbrothers.io:2001", // @blockbrothers
"5.189.136.20:2001", // @maiyude
"steemseed-fin.privex.io:2001", // privex (FI)
"steemseed-se.privex.io:2001", // privex (SE)
"seed.steemhunt.com:2001", // @steemhunt Location: South Korea
"seed.steemzzang.com:2001", // @zzan.witnesses / @indo.witness
"seednode.dlike.io:2001", // @Dlike Location Germany
"seed.steemer.app:2001", // @Bukio
"seed.supporter.dev:2001", // @dev.supporters
"seed.goodhello.net:2001" // @helloworld.wit
};
#endif

Expand Down
1 change: 1 addition & 0 deletions libraries/plugins/rc/resource_count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ struct count_operation_visitor
void operator()( const clear_null_account_balance_operation& ) const {}
void operator()( const proposal_pay_operation& ) const {}
void operator()( const sps_fund_operation& ) const {}
void operator()( const hardfork23_operation& ) const {}

// Optional Actions
#ifdef IS_TEST_NET
Expand Down
2 changes: 2 additions & 0 deletions libraries/protocol/get_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ fc::variant_object get_config()
result["STEEM_UPVOTE_LOCKOUT_SECONDS"] = STEEM_UPVOTE_LOCKOUT_SECONDS;
result["STEEM_VESTING_FUND_PERCENT_HF16"] = STEEM_VESTING_FUND_PERCENT_HF16;
result["STEEM_VESTING_WITHDRAW_INTERVALS"] = STEEM_VESTING_WITHDRAW_INTERVALS;
result["STEEM_VESTING_WITHDRAW_INTERVALS_HF_23"] = STEEM_VESTING_WITHDRAW_INTERVALS_HF_23;
result["STEEM_VESTING_WITHDRAW_INTERVALS_PRE_HF_16"] = STEEM_VESTING_WITHDRAW_INTERVALS_PRE_HF_16;
result["STEEM_VESTING_WITHDRAW_INTERVAL_SECONDS"] = STEEM_VESTING_WITHDRAW_INTERVAL_SECONDS;
result["STEEM_VOTE_DUST_THRESHOLD"] = STEEM_VOTE_DUST_THRESHOLD;
Expand Down Expand Up @@ -234,6 +235,7 @@ fc::variant_object get_config()
result["STEEM_BLOCK_GENERATION_POSTPONED_TX_LIMIT"] = STEEM_BLOCK_GENERATION_POSTPONED_TX_LIMIT;
result["STEEM_PENDING_TRANSACTION_EXECUTION_LIMIT"] = STEEM_PENDING_TRANSACTION_EXECUTION_LIMIT;
result["STEEM_TREASURY_ACCOUNT"] = STEEM_TREASURY_ACCOUNT;
result["HIVE_TREASURY_ACCOUNT"] = HIVE_TREASURY_ACCOUNT;
result["STEEM_TREASURY_FEE"] = STEEM_TREASURY_FEE;
result["STEEM_PROPOSAL_MAINTENANCE_PERIOD"] = STEEM_PROPOSAL_MAINTENANCE_PERIOD;
result["STEEM_PROPOSAL_MAINTENANCE_CLEANUP"] = STEEM_PROPOSAL_MAINTENANCE_CLEANUP;
Expand Down
2 changes: 1 addition & 1 deletion libraries/protocol/hardfork.d/0-preamble.hf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
#ifdef IS_TEST_NET
#define STEEM_NUM_HARDFORKS 23
#else
#define STEEM_NUM_HARDFORKS 22
#define STEEM_NUM_HARDFORKS 23
#endif
28 changes: 28 additions & 0 deletions libraries/protocol/hardfork.d/0_22.hf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,32 @@

#define STEEM_HARDFORK_0_22_VERSION hardfork_version( 0, 22 )

#ifdef IS_TEST_NET
#define STEEM_PROTECTION_HARDFORK_TIME 1585735200 // Wed, 1 April 2020 10:00:00 UTC (6:00:00 ET)
#else
#define STEEM_PROTECTION_HARDFORK_TIME 1585994400 // Sat, 4 April 2020 10:00:00 UTC (10:00:00 ET)
#endif

namespace hardforkprotect
{

inline static const std::set< std::string >& get_hive_accounts()
{
static const std::set< std::string > hive_accounts
{
"freedom",
"pumpkin",
"blocktrades",
"gtg",
"good-karma",
"roelandp",
"steempress",
"darthknight",
};

return hive_accounts;
}

}

#endif
85 changes: 83 additions & 2 deletions libraries/protocol/hardfork.d/0_23.hf
Original file line number Diff line number Diff line change
@@ -1,9 +1,90 @@
#ifndef STEEM_HARDFORK_0_23
#define STEEM_HARDFORK_0_23 23
#define STEEM_SMT_HARDFORK STEEM_HARDFORK_0_23
// #define STEEM_SMT_HARDFORK STEEM_HARDFORK_0_23
#define STEEM_SMT_HARDFORK 24

#define STEEM_HARDFORK_0_23_TIME 1597970800 // Future 2020...
#define STEEM_HARDFORK_0_23_TIME 1589983200 // Wed, 20 May 2020 14:00:00 UTC (10:00:00 EDT)

#define STEEM_HARDFORK_0_23_VERSION hardfork_version( 0, 23 )


namespace hardforkprotect23
{

inline static const std::set< std::string >& get_hive_accounts23()
{
static const std::set< std::string > hive_accounts23
{
"abusereports",
"berniesanders",
"kingdong",
"nextgencrypto",
"ngc",
"ozchartart",
"sirvotesalot",
"sockpuppet",
"thecyclist",
"xx0xx",
"xxxxxxxxxx",
"z8teyb289qav9z",
"agent14",
"curatorhulk",
"dhenz",
"drbanner",
"gokuisreal",
"johnmadden",
"realself",
"theycallmedan",
"arsahk",
"blocktrades",
"darthknight",
"kevtorin",
"kriborin",
"lessys",
"acidyo",
"ats-david",
"ausbitbank",
"bittrix",
"clappy",
"drakos",
"fefemz",
"freedom",
"gtg",
"howo",
"jawnz",
"klobu",
"likwid",
"liondani",
"neoxian",
"netuoso",
"ocd-witness",
"pfunk",
"pharesim",
"roelandp",
"roundbeargames",
"sooty",
"steempress",
"themarkymark",
"therealwolf",
"timetickertickin",
"transisto",
"znnuksfe",
"mottler",
"mottler-1",
"smooth",
"smooth.witness",
"smooth-a",
"smooth-b",
"smooth-c",
"smooth-d",
"smooth-e",
"smooth-f",
"safari"
};

return hive_accounts23;
}

}

#endif
Loading

0 comments on commit a58daad

Please sign in to comment.