Compare commits
56 commits
master
...
feature/56
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93910083a3 | ||
|
|
07dad6bcf2 | ||
|
|
64682a079c | ||
|
|
664379a8c1 | ||
|
|
b79df7db07 | ||
|
|
b6e4fc5c3c | ||
|
|
f6c6ac2cc8 | ||
|
|
56e15b8e80 | ||
|
|
60207813b0 | ||
|
|
18589ab198 | ||
|
|
c1aa13192d | ||
|
|
1520585b17 | ||
|
|
c055445e6a | ||
|
|
675eba96bb | ||
|
|
270751cb86 | ||
|
|
8e2d3cf2f6 | ||
|
|
9d687b97d2 | ||
|
|
113790d956 | ||
|
|
e24de4f199 | ||
|
|
15ebbfe6bb | ||
|
|
917e09a80b | ||
|
|
646b421308 | ||
|
|
dd2a531364 | ||
|
|
ae0a895daf | ||
|
|
8530228189 | ||
|
|
85fb3fee67 | ||
|
|
2c9fd332d4 | ||
|
|
fb01043e55 | ||
|
|
a1186372d2 | ||
|
|
3a51723e51 | ||
|
|
f23244cde0 | ||
|
|
fee7bc99fa | ||
|
|
6cf31b1075 | ||
|
|
97eaf4575a | ||
|
|
d367c308b8 | ||
|
|
838a9820f1 | ||
|
|
3e1f38d972 | ||
|
|
dfd3dfae09 | ||
|
|
1f72b4fbd6 | ||
|
|
3ee2439d5b | ||
|
|
cfecfb457b | ||
|
|
25bbacaa88 | ||
|
|
0175a7d0ec | ||
|
|
fd492ca196 | ||
|
|
2a6c917e4c | ||
|
|
6fe15f27b0 | ||
|
|
d2374aeed9 | ||
|
|
6f792db52d | ||
|
|
1b61016693 | ||
|
|
0f375777c2 | ||
|
|
a2ce65e1ef | ||
|
|
432876a677 | ||
|
|
948e7dd5e4 | ||
|
|
b21f9c4282 | ||
|
|
1586531e13 | ||
|
|
8e0e20eb6f |
20 changed files with 296 additions and 309 deletions
|
|
@ -118,7 +118,8 @@ LIST(APPEND BOOST_COMPONENTS thread
|
||||||
chrono
|
chrono
|
||||||
unit_test_framework
|
unit_test_framework
|
||||||
context
|
context
|
||||||
locale)
|
locale
|
||||||
|
regex)
|
||||||
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
|
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
|
||||||
|
|
||||||
IF( WIN32 )
|
IF( WIN32 )
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,14 @@ cd peerplays
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
# If you want to build Mainnet node
|
# If you want to build Mainnet node
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
|
||||||
# If you want to build Testnet node
|
# If you want to build Testnet node
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PEERPLAYS_TESTNET=1
|
mkdir build-testnet
|
||||||
|
cd build-testnet
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PEERPLAYS_TESTNET=1 ..
|
||||||
|
|
||||||
# Update -j flag depending on your current system specs;
|
# Update -j flag depending on your current system specs;
|
||||||
# Recommended 4GB of RAM per 1 CPU core
|
# Recommended 4GB of RAM per 1 CPU core
|
||||||
|
|
|
||||||
|
|
@ -2197,7 +2197,7 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
||||||
case vote_id_type::committee: {
|
case vote_id_type::committee: {
|
||||||
auto itr = committee_idx.find(id);
|
auto itr = committee_idx.find(id);
|
||||||
if (itr != committee_idx.end())
|
if (itr != committee_idx.end())
|
||||||
result.emplace_back(variant(*itr, 2)); // Depth of committee_member_object is 1, add 1 to be safe
|
result.emplace_back(variant(*itr, 1));
|
||||||
else
|
else
|
||||||
result.emplace_back(variant());
|
result.emplace_back(variant());
|
||||||
break;
|
break;
|
||||||
|
|
@ -2205,7 +2205,7 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
||||||
case vote_id_type::witness: {
|
case vote_id_type::witness: {
|
||||||
auto itr = witness_idx.find(id);
|
auto itr = witness_idx.find(id);
|
||||||
if (itr != witness_idx.end())
|
if (itr != witness_idx.end())
|
||||||
result.emplace_back(variant(*itr, 2)); // Depth of witness_object is 1, add 1 here to be safe
|
result.emplace_back(variant(*itr, 1));
|
||||||
else
|
else
|
||||||
result.emplace_back(variant());
|
result.emplace_back(variant());
|
||||||
break;
|
break;
|
||||||
|
|
@ -2213,15 +2213,11 @@ vector<variant> database_api_impl::lookup_vote_ids(const vector<vote_id_type> &v
|
||||||
case vote_id_type::worker: {
|
case vote_id_type::worker: {
|
||||||
auto itr = for_worker_idx.find(id);
|
auto itr = for_worker_idx.find(id);
|
||||||
if (itr != for_worker_idx.end()) {
|
if (itr != for_worker_idx.end()) {
|
||||||
result.emplace_back(variant(*itr, 4)); // Depth of worker_object is 3, add 1 here to be safe.
|
result.emplace_back(variant(*itr, 1));
|
||||||
// If we want to extract the balance object inside,
|
|
||||||
// need to increase this value
|
|
||||||
} else {
|
} else {
|
||||||
auto itr = against_worker_idx.find(id);
|
auto itr = against_worker_idx.find(id);
|
||||||
if (itr != against_worker_idx.end()) {
|
if (itr != against_worker_idx.end()) {
|
||||||
result.emplace_back(variant(*itr, 4)); // Depth of worker_object is 3, add 1 here to be safe.
|
result.emplace_back(variant(*itr, 1));
|
||||||
// If we want to extract the balance object inside,
|
|
||||||
// need to increase this value
|
|
||||||
} else {
|
} else {
|
||||||
result.emplace_back(variant());
|
result.emplace_back(variant());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -386,14 +386,23 @@ vector<uint64_t> database::get_random_numbers(uint64_t minimum, uint64_t maximum
|
||||||
|
|
||||||
bool database::is_asset_creation_allowed(const string &symbol)
|
bool database::is_asset_creation_allowed(const string &symbol)
|
||||||
{
|
{
|
||||||
|
time_point_sec now = head_block_time();
|
||||||
|
std::unordered_set<std::string> post_son_hf_symbols = {"ETH", "USDT", "BNB", "ADA", "DOGE", "XRP", "USDC", "DOT", "UNI", "BUSD", "BCH", "LTC", "SOL", "LINK", "MATIC", "THETA",
|
||||||
|
"WBTC", "XLM", "ICP", "DAI", "VET", "ETC", "TRX", "FIL", "XMR", "EGR", "EOS", "SHIB", "AAVE", "CRO", "ALGO", "AMP", "BTCB",
|
||||||
|
"BSV", "KLAY", "CAKE", "FTT", "LEO", "XTZ", "TFUEL", "MIOTA", "LUNA", "NEO", "ATOM", "MKR", "FEI", "WBNB", "UST", "AVAX",
|
||||||
|
"STEEM", "HIVE", "HBD", "SBD", "BTS"};
|
||||||
if (symbol == "BTC")
|
if (symbol == "BTC")
|
||||||
{
|
{
|
||||||
if (head_block_time() < HARDFORK_SON_TIME)
|
if (now < HARDFORK_SON_TIME)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (post_son_hf_symbols.find(symbol) != post_son_hf_symbols.end())
|
||||||
|
{
|
||||||
|
if (now >= HARDFORK_SON_TIME)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} }
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,6 @@ struct worker_pay_visitor
|
||||||
worker.pay_worker(pay, db);
|
worker.pay_worker(pay, db);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void database::update_worker_votes()
|
void database::update_worker_votes()
|
||||||
{
|
{
|
||||||
auto& idx = get_index_type<worker_index>();
|
auto& idx = get_index_type<worker_index>();
|
||||||
|
|
@ -186,28 +185,6 @@ void database::update_worker_votes()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void database::hotfix_2024()
|
|
||||||
{
|
|
||||||
if (head_block_time() >= HARDFORK_HOTFIX_2024_TIME)
|
|
||||||
{
|
|
||||||
if (get_chain_id().str() == "6b6b5f0ce7a36d323768e534f3edb41c6d6332a541a95725b98e28d140850134")
|
|
||||||
{
|
|
||||||
const auto& vb_idx = get_index_type<vesting_balance_index>().indices().get<by_id>();
|
|
||||||
auto vbo = vb_idx.find(vesting_balance_id_type(388));
|
|
||||||
if (vbo != vb_idx.end())
|
|
||||||
{
|
|
||||||
if (vbo->owner == account_id_type(14786))
|
|
||||||
{
|
|
||||||
modify(*vbo, [&]( vesting_balance_object& _vbo)
|
|
||||||
{
|
|
||||||
_vbo.owner = account_id_type(0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void database::pay_sons_before_hf_ethereum()
|
void database::pay_sons_before_hf_ethereum()
|
||||||
{
|
{
|
||||||
const auto now = head_block_time();
|
const auto now = head_block_time();
|
||||||
|
|
@ -2533,7 +2510,6 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g
|
||||||
update_active_committee_members();
|
update_active_committee_members();
|
||||||
update_active_sons();
|
update_active_sons();
|
||||||
update_worker_votes();
|
update_worker_votes();
|
||||||
hotfix_2024();
|
|
||||||
|
|
||||||
const dynamic_global_property_object& dgpo = get_dynamic_global_properties();
|
const dynamic_global_property_object& dgpo = get_dynamic_global_properties();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
#ifndef HARDFORK_HOTFIX_2024_TIME
|
|
||||||
#ifdef BUILD_PEERPLAYS_TESTNET
|
|
||||||
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
|
||||||
#else
|
|
||||||
#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00"))
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
@ -594,7 +594,6 @@ namespace graphene { namespace chain {
|
||||||
const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||||
void update_son_wallet( const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
void update_son_wallet( const flat_map<sidechain_type, vector<son_sidechain_info> >& new_active_sons );
|
||||||
void update_worker_votes();
|
void update_worker_votes();
|
||||||
void hotfix_2024();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
double calculate_vesting_factor(const account_object& stake_account);
|
double calculate_vesting_factor(const account_object& stake_account);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,13 @@ endif()
|
||||||
unset(ENABLE_PEERPLAYS_ASSET_DEPOSITS)
|
unset(ENABLE_PEERPLAYS_ASSET_DEPOSITS)
|
||||||
unset(ENABLE_PEERPLAYS_ASSET_DEPOSITS CACHE)
|
unset(ENABLE_PEERPLAYS_ASSET_DEPOSITS CACHE)
|
||||||
|
|
||||||
target_link_libraries( peerplays_sidechain PRIVATE curl graphene_plugin sha3 zmq bitcoin-system bitcoin-protocol bitcoin-client bitcoin-explorer )
|
target_link_libraries( peerplays_sidechain PRIVATE curl graphene_plugin sha3 zmq
|
||||||
|
/usr/local/lib/libbitcoin-explorer.a
|
||||||
|
/usr/local/lib/libbitcoin-client.a
|
||||||
|
/usr/local/lib/libbitcoin-system.a
|
||||||
|
/usr/local/lib/libbitcoin-protocol.a
|
||||||
|
/usr/local/lib/libbitcoin-network.a
|
||||||
|
/usr/local/lib/libboost_regex.a )
|
||||||
target_include_directories( peerplays_sidechain
|
target_include_directories( peerplays_sidechain
|
||||||
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -875,10 +875,13 @@ void peerplays_sidechain_plugin_impl::on_applied_block(const signed_block &b) {
|
||||||
if (first_block_skipped) {
|
if (first_block_skipped) {
|
||||||
if(son_processing_enabled) {
|
if(son_processing_enabled) {
|
||||||
schedule_son_processing();
|
schedule_son_processing();
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
const fc::time_point now_fine = fc::time_point::now();
|
const fc::time_point now_fine = fc::time_point::now();
|
||||||
const fc::time_point_sec now = now_fine + fc::microseconds( 500000 );
|
const fc::time_point_sec now = now_fine + fc::microseconds( 500000 );
|
||||||
if (plugin.database().get_slot_time(1) >= now) {
|
if( plugin.database().get_slot_time(1) >= now )
|
||||||
|
{
|
||||||
son_processing_enabled = true;
|
son_processing_enabled = true;
|
||||||
schedule_son_processing();
|
schedule_son_processing();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue