Compare commits
10 Commits
v0.6.0-rc2
...
v0.6.2
| Author | SHA1 | Date | |
|---|---|---|---|
| afc2518ef7 | |||
| a9406b158d | |||
| e45643e157 | |||
| 1df18ca6a4 | |||
| 91b2ec275a | |||
| e45fdb863c | |||
| cb2f9d3f75 | |||
| 59025bb27b | |||
| 204c6fc778 | |||
| 4d1c84fcaf |
@@ -1,4 +1,4 @@
|
||||
# Salvium Zero v0.6.0-rc2
|
||||
# Salvium Zero v0.6.2
|
||||
|
||||
Copyright (c) 2023-2024, Salvium
|
||||
Portions Copyright (c) 2014-2023, The Monero Project
|
||||
@@ -172,7 +172,7 @@ invokes cmake commands as needed.
|
||||
|
||||
```bash
|
||||
cd salvium
|
||||
git checkout release-v0.18
|
||||
git checkout v0.6.2
|
||||
make
|
||||
```
|
||||
|
||||
@@ -251,7 +251,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
|
||||
```bash
|
||||
git clone https://github.com/salvium/salvium
|
||||
cd salvium
|
||||
git checkout v0.6.0-rc2
|
||||
git checkout v0.6.2
|
||||
```
|
||||
|
||||
* Build:
|
||||
@@ -370,10 +370,10 @@ application.
|
||||
cd salvium
|
||||
```
|
||||
|
||||
* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v0.6.0-rc2'. If you don't care about the version and just want binaries from master, skip this step:
|
||||
* If you would like a specific [version/tag](https://github.com/salvium/salvium/tags), do a git checkout for that version. eg. 'v0.6.2'. If you don't care about the version and just want binaries from master, skip this step:
|
||||
|
||||
```bash
|
||||
git checkout v0.6.0-rc2
|
||||
git checkout v0.6.2
|
||||
```
|
||||
|
||||
* If you are on a 64-bit system, run:
|
||||
|
||||
Binary file not shown.
@@ -70,8 +70,6 @@ namespace cryptonote {
|
||||
{
|
||||
if (version < 2)
|
||||
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1;
|
||||
if (version < 5)
|
||||
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2;
|
||||
return CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace cryptonote {
|
||||
// N=45, 55, 70, 90, 120 for T=600, 240, 120, 90, and 60
|
||||
|
||||
const int64_t T = static_cast<int64_t>(target_seconds);
|
||||
size_t N = DIFFICULTY_WINDOW;
|
||||
size_t N = DIFFICULTY_WINDOW_V2;
|
||||
|
||||
if (timestamps.size() > N) {
|
||||
timestamps.resize(N + 1);
|
||||
@@ -261,7 +261,7 @@ namespace cryptonote {
|
||||
}
|
||||
size_t n = timestamps.size();
|
||||
assert(n == cumulative_difficulties.size());
|
||||
assert(n <= DIFFICULTY_WINDOW);
|
||||
assert(n <= DIFFICULTY_WINDOW_V2);
|
||||
// If new coin, just "give away" first 5 blocks at low difficulty
|
||||
if ( n < 6 ) { return 1; }
|
||||
// If height "n" is from 6 to N, then reset N to n-1.
|
||||
|
||||
@@ -87,9 +87,11 @@
|
||||
|
||||
#define DIFFICULTY_TARGET_V2 120 // seconds
|
||||
#define DIFFICULTY_TARGET_V1 60 // seconds - before first fork
|
||||
#define DIFFICULTY_WINDOW_V2 70 // blocks
|
||||
#define DIFFICULTY_WINDOW 720 // blocks
|
||||
#define DIFFICULTY_LAG 15 // !!!
|
||||
#define DIFFICULTY_CUT 60 // timestamps to cut after sorting
|
||||
#define DIFFICULTY_BLOCKS_COUNT_V2 DIFFICULTY_WINDOW_V2
|
||||
#define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG
|
||||
|
||||
|
||||
@@ -222,7 +224,7 @@
|
||||
#define HF_VERSION_ENABLE_ORACLE 255
|
||||
#define HF_VERSION_SLIPPAGE_YIELD 255
|
||||
|
||||
#define TESTNET_VERSION 11
|
||||
#define TESTNET_VERSION 12
|
||||
#define STAGENET_VERSION 1
|
||||
|
||||
#define PER_KB_FEE_QUANTIZATION_DECIMALS 8
|
||||
|
||||
@@ -888,6 +888,15 @@ start:
|
||||
uint64_t height;
|
||||
auto new_top_hash = get_tail_id(height); // get it again now that we have the lock
|
||||
++height;
|
||||
|
||||
uint8_t version = get_current_hard_fork_version();
|
||||
size_t difficulty_blocks_count;
|
||||
if (version == 1) {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT;
|
||||
} else {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT_V2;
|
||||
}
|
||||
|
||||
if (!(new_top_hash == top_hash)) D=0;
|
||||
ss << "Re-locked, height " << height << ", tail id " << new_top_hash << (new_top_hash == top_hash ? "" : " (different)") << std::endl;
|
||||
top_hash = new_top_hash;
|
||||
@@ -900,15 +909,15 @@ start:
|
||||
bool check = false;
|
||||
if (m_reset_timestamps_and_difficulties_height)
|
||||
m_timestamps_and_difficulties_height = 0;
|
||||
if (m_timestamps_and_difficulties_height != 0 && ((height - m_timestamps_and_difficulties_height) == 1) && m_timestamps.size() >= DIFFICULTY_BLOCKS_COUNT)
|
||||
if (m_timestamps_and_difficulties_height != 0 && ((height - m_timestamps_and_difficulties_height) == 1) && m_timestamps.size() >= difficulty_blocks_count)
|
||||
{
|
||||
uint64_t index = height - 1;
|
||||
m_timestamps.push_back(m_db->get_block_timestamp(index));
|
||||
m_difficulties.push_back(m_db->get_block_cumulative_difficulty(index));
|
||||
|
||||
while (m_timestamps.size() > DIFFICULTY_BLOCKS_COUNT)
|
||||
while (m_timestamps.size() > difficulty_blocks_count)
|
||||
m_timestamps.erase(m_timestamps.begin());
|
||||
while (m_difficulties.size() > DIFFICULTY_BLOCKS_COUNT)
|
||||
while (m_difficulties.size() > difficulty_blocks_count)
|
||||
m_difficulties.erase(m_difficulties.begin());
|
||||
|
||||
m_timestamps_and_difficulties_height = height;
|
||||
@@ -921,7 +930,7 @@ start:
|
||||
std::vector<difficulty_type> difficulties_from_cache = difficulties;
|
||||
|
||||
{
|
||||
uint64_t offset = height - std::min <uint64_t> (height, static_cast<uint64_t>(DIFFICULTY_BLOCKS_COUNT));
|
||||
uint64_t offset = height - std::min <uint64_t> (height, static_cast<uint64_t>(difficulty_blocks_count));
|
||||
if (offset == 0)
|
||||
++offset;
|
||||
|
||||
@@ -968,7 +977,6 @@ start:
|
||||
|
||||
size_t target = get_difficulty_target();
|
||||
difficulty_type diff;
|
||||
uint8_t version = get_current_hard_fork_version();
|
||||
if (version == 1) {
|
||||
diff = next_difficulty(timestamps, difficulties, target);
|
||||
} else {
|
||||
@@ -1033,11 +1041,17 @@ size_t Blockchain::recalculate_difficulties(boost::optional<uint64_t> start_heig
|
||||
std::vector<uint64_t> timestamps;
|
||||
std::vector<difficulty_type> difficulties;
|
||||
uint8_t version = get_current_hard_fork_version();
|
||||
timestamps.reserve(DIFFICULTY_BLOCKS_COUNT + 1);
|
||||
difficulties.reserve(DIFFICULTY_BLOCKS_COUNT + 1);
|
||||
size_t difficulty_blocks_count;
|
||||
if (version == 1) {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT;
|
||||
} else {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT_V2;
|
||||
}
|
||||
timestamps.reserve(difficulty_blocks_count + 1);
|
||||
difficulties.reserve(difficulty_blocks_count + 1);
|
||||
if (start_height > 1)
|
||||
{
|
||||
for (uint64_t i = 0; i < DIFFICULTY_BLOCKS_COUNT; ++i)
|
||||
for (uint64_t i = 0; i < difficulty_blocks_count; ++i)
|
||||
{
|
||||
uint64_t height = start_height - 1 - i;
|
||||
if (height == 0)
|
||||
@@ -1082,9 +1096,9 @@ size_t Blockchain::recalculate_difficulties(boost::optional<uint64_t> start_heig
|
||||
timestamps.push_back(m_db->get_block_timestamp(height));
|
||||
difficulties.push_back(recalculated_cum_diff);
|
||||
}
|
||||
if (timestamps.size() > DIFFICULTY_BLOCKS_COUNT)
|
||||
if (timestamps.size() > difficulty_blocks_count)
|
||||
{
|
||||
CHECK_AND_ASSERT_THROW_MES(timestamps.size() == DIFFICULTY_BLOCKS_COUNT + 1, "Wrong timestamps size: " << timestamps.size());
|
||||
CHECK_AND_ASSERT_THROW_MES(timestamps.size() == difficulty_blocks_count + 1, "Wrong timestamps size: " << timestamps.size());
|
||||
timestamps.erase(timestamps.begin());
|
||||
difficulties.erase(difficulties.begin());
|
||||
}
|
||||
@@ -1309,16 +1323,22 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
|
||||
std::vector<uint64_t> timestamps;
|
||||
std::vector<difficulty_type> cumulative_difficulties;
|
||||
uint8_t version = get_current_hard_fork_version();
|
||||
|
||||
size_t difficulty_blocks_count;
|
||||
if (version == 1) {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT;
|
||||
} else {
|
||||
difficulty_blocks_count = DIFFICULTY_BLOCKS_COUNT_V2;
|
||||
}
|
||||
|
||||
// if the alt chain isn't long enough to calculate the difficulty target
|
||||
// based on its blocks alone, need to get more blocks from the main chain
|
||||
if(alt_chain.size()< DIFFICULTY_BLOCKS_COUNT)
|
||||
if(alt_chain.size()< difficulty_blocks_count)
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
||||
|
||||
// Figure out start and stop offsets for main chain blocks
|
||||
size_t main_chain_stop_offset = alt_chain.size() ? alt_chain.front().height : bei.height;
|
||||
size_t main_chain_count = DIFFICULTY_BLOCKS_COUNT - std::min(static_cast<size_t>(DIFFICULTY_BLOCKS_COUNT), alt_chain.size());
|
||||
size_t main_chain_count = difficulty_blocks_count - std::min(static_cast<size_t>(difficulty_blocks_count), alt_chain.size());
|
||||
main_chain_count = std::min(main_chain_count, main_chain_stop_offset);
|
||||
size_t main_chain_start_offset = main_chain_stop_offset - main_chain_count;
|
||||
|
||||
@@ -1333,7 +1353,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
|
||||
}
|
||||
|
||||
// make sure we haven't accidentally grabbed too many blocks...maybe don't need this check?
|
||||
CHECK_AND_ASSERT_MES((alt_chain.size() + timestamps.size()) <= DIFFICULTY_BLOCKS_COUNT, false, "Internal error, alt_chain.size()[" << alt_chain.size() << "] + vtimestampsec.size()[" << timestamps.size() << "] NOT <= DIFFICULTY_WINDOW[]" << DIFFICULTY_BLOCKS_COUNT);
|
||||
CHECK_AND_ASSERT_MES((alt_chain.size() + timestamps.size()) <= difficulty_blocks_count, false, "Internal error, alt_chain.size()[" << alt_chain.size() << "] + vtimestampsec.size()[" << timestamps.size() << "] NOT <= DIFFICULTY_WINDOW[]" << difficulty_blocks_count);
|
||||
|
||||
for (const auto &bei : alt_chain)
|
||||
{
|
||||
@@ -1345,8 +1365,8 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
|
||||
// and timestamps from it alone
|
||||
else
|
||||
{
|
||||
timestamps.resize(static_cast<size_t>(DIFFICULTY_BLOCKS_COUNT));
|
||||
cumulative_difficulties.resize(static_cast<size_t>(DIFFICULTY_BLOCKS_COUNT));
|
||||
timestamps.resize(static_cast<size_t>(difficulty_blocks_count));
|
||||
cumulative_difficulties.resize(static_cast<size_t>(difficulty_blocks_count));
|
||||
size_t count = 0;
|
||||
size_t max_i = timestamps.size()-1;
|
||||
// get difficulties and timestamps from most recent blocks in alt chain
|
||||
@@ -1355,7 +1375,7 @@ difficulty_type Blockchain::get_next_difficulty_for_alternative_chain(const std:
|
||||
timestamps[max_i - count] = bei.bl.timestamp;
|
||||
cumulative_difficulties[max_i - count] = bei.cumulative_difficulty;
|
||||
count++;
|
||||
if(count >= DIFFICULTY_BLOCKS_COUNT)
|
||||
if(count >= difficulty_blocks_count)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -6108,7 +6128,7 @@ void Blockchain::cancel()
|
||||
}
|
||||
|
||||
#if defined(PER_BLOCK_CHECKPOINT)
|
||||
static const char expected_block_hashes_hash[] = "b8639efef99951207b401131ed9f88e37c856a693d237fc6fad349b929aa1059";
|
||||
static const char expected_block_hashes_hash[] = "3cb6d33c311e54f2b8439a3e4cc047f6b9b74db9fd92955f1db131a5dfce1edf";
|
||||
void Blockchain::load_compiled_in_block_hashes(const GetCheckpointsCallback& get_checkpoints)
|
||||
{
|
||||
if (get_checkpoints == nullptr || !m_fast_sync)
|
||||
|
||||
@@ -112,8 +112,8 @@ namespace cryptonote
|
||||
|
||||
uint64_t get_transaction_weight_limit(uint8_t version)
|
||||
{
|
||||
// from v8, limit a tx to 50% of the minimum block weight
|
||||
if (version >= 8)
|
||||
// from v2, limit a tx to 50% of the minimum block weight
|
||||
if (version >= 2)
|
||||
return get_min_block_weight(version) / 2 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
|
||||
else
|
||||
return get_min_block_weight(version) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
|
||||
|
||||
@@ -35,8 +35,8 @@ const hardfork_t mainnet_hard_forks[] = {
|
||||
// version 1 from the start of the blockchain
|
||||
{ 1, 1, 0, 1341378000 },
|
||||
|
||||
// version 2 starts from block 1000, which is on or around the 20th of March, 2016. Fork time finalised on 2015-09-20. No fork voting occurs for the v2 fork.
|
||||
//{ 2, 1000, 0, 1442763710 },
|
||||
// version 2 starts from block 89800, which is on or around the 4th of November, 2024. Fork time finalised on 2024-10-21. No fork voting occurs for the v2 fork.
|
||||
{ 2, 89800, 0, 1729518000 },
|
||||
};
|
||||
const size_t num_mainnet_hard_forks = sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]);
|
||||
const uint64_t mainnet_hard_fork_version_1_till = ((uint64_t)-1);
|
||||
|
||||
@@ -705,9 +705,9 @@ namespace nodetool
|
||||
std::set<std::string> full_addrs;
|
||||
if (m_nettype == cryptonote::TESTNET)
|
||||
{
|
||||
full_addrs.insert("152.42.130.46:29080");
|
||||
full_addrs.insert("45.55.138.87:29080");
|
||||
full_addrs.insert("209.97.164.15:29080");
|
||||
full_addrs.insert("72.5.43.63:29080");
|
||||
full_addrs.insert("195.85.114.217:29080");
|
||||
full_addrs.insert("206.188.197.72:29080");
|
||||
}
|
||||
else if (m_nettype == cryptonote::STAGENET)
|
||||
{
|
||||
@@ -720,9 +720,9 @@ namespace nodetool
|
||||
}
|
||||
else
|
||||
{
|
||||
full_addrs.insert("152.42.130.46:19080");
|
||||
full_addrs.insert("45.55.138.87:19080");
|
||||
full_addrs.insert("209.97.164.15:19080");
|
||||
full_addrs.insert("193.149.187.26:19080");
|
||||
full_addrs.insert("67.217.228.15:19080");
|
||||
full_addrs.insert("216.245.184.4:19080");
|
||||
}
|
||||
return full_addrs;
|
||||
}
|
||||
|
||||
@@ -6942,7 +6942,7 @@ bool simple_wallet::transfer_main(
|
||||
{
|
||||
// figure out what tx will be necessary
|
||||
std::vector<tools::wallet2::pending_tx> ptx_vector;
|
||||
uint64_t bc_height, unlock_block = 0;
|
||||
uint64_t unlock_block = 0;
|
||||
std::string err;
|
||||
switch (transfer_type)
|
||||
{
|
||||
@@ -6959,12 +6959,6 @@ bool simple_wallet::transfer_main(
|
||||
ptx_vector = m_wallet->create_transactions_2(dsts, source_asset, dest_asset, cryptonote::transaction_type::STAKE, fake_outs_count, unlock_block /* unlock_time */, priority, extra, m_current_subaddress_account, subaddr_indices, subtract_fee_from_outputs);
|
||||
break;
|
||||
case TransferLocked:
|
||||
bc_height = get_daemon_blockchain_height(err);
|
||||
if (!err.empty())
|
||||
{
|
||||
fail_msg_writer() << tr("failed to get blockchain height: ") << err;
|
||||
return false;
|
||||
}
|
||||
unlock_block = locked_blocks;
|
||||
ptx_vector = m_wallet->create_transactions_2(dsts, source_asset, dest_asset, cryptonote::transaction_type::TRANSFER, fake_outs_count, unlock_block /* unlock_time */, priority, extra, m_current_subaddress_account, subaddr_indices, subtract_fee_from_outputs);
|
||||
break;
|
||||
@@ -8043,7 +8037,7 @@ bool simple_wallet::return_payment(const std::vector<std::string> &args_)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (td.m_tx.version >= HF_VERSION_ENABLE_N_OUTS) {
|
||||
if (td.m_tx.version >= TRANSACTION_VERSION_N_OUTS) {
|
||||
if (td.m_tx.return_address_list.empty() || td.m_tx.return_address_change_mask.empty()) {
|
||||
fail_msg_writer() << tr("invalid return_address_list for txid ") << args_[0];
|
||||
return true;
|
||||
@@ -8380,7 +8374,7 @@ bool simple_wallet::supply_info(const std::vector<std::string> &args) {
|
||||
message_writer(console_color_default, false) << boost::format(tr("SUPPLY INFO"));
|
||||
|
||||
// For each asset, print the circulating supply and value
|
||||
boost::multiprecision::uint128_t total_supply = 0;
|
||||
//boost::multiprecision::uint128_t total_supply = 0;
|
||||
for (auto supply_asset: supply_amounts) {
|
||||
|
||||
// get supply
|
||||
@@ -8410,7 +8404,10 @@ bool simple_wallet::yield_info(const std::vector<std::string> &args) {
|
||||
// EXPERIMENTAL - change to get_yield_summary_info() method
|
||||
uint64_t t_burnt, t_supply, t_locked, t_yield, yps, ybi_size;
|
||||
std::vector<std::tuple<size_t, std::string, uint64_t, uint64_t>> yield_payouts;
|
||||
bool ok = m_wallet->get_yield_summary_info(t_burnt, t_supply, t_locked, t_yield, yps, ybi_size, yield_payouts);
|
||||
if (!m_wallet->get_yield_summary_info(t_burnt, t_supply, t_locked, t_yield, yps, ybi_size, yield_payouts)) {
|
||||
fail_msg_writer() << "failed to get yield info. Make sure you are connected to a daemon.";
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the chain height
|
||||
const uint64_t blockchain_height = m_wallet->get_blockchain_current_height();
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#define DEF_SALVIUM_VERSION_TAG "@VERSIONTAG@"
|
||||
#define DEF_SALVIUM_VERSION "0.6.0-rc2"
|
||||
#define DEF_SALVIUM_VERSION "0.6.2"
|
||||
#define DEF_MONERO_VERSION_TAG "release"
|
||||
#define DEF_MONERO_VERSION "0.18.3.3"
|
||||
#define DEF_MONERO_RELEASE_NAME "Zero"
|
||||
|
||||
@@ -11796,8 +11796,8 @@ uint64_t wallet2::get_upper_transaction_weight_limit()
|
||||
{
|
||||
if (m_upper_transaction_weight_limit > 0)
|
||||
return m_upper_transaction_weight_limit;
|
||||
uint64_t full_reward_zone = use_fork_rules(5, 10) ? CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 : use_fork_rules(2, 10) ? CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 : CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1;
|
||||
if (use_fork_rules(8, 10))
|
||||
uint64_t full_reward_zone = use_fork_rules(2, 0) ? CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 : CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1;
|
||||
if (use_fork_rules(2, 0))
|
||||
return full_reward_zone / 2 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
|
||||
else
|
||||
return full_reward_zone - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace wallet_args
|
||||
command_line::add_arg(desc_params, arg_max_concurrency);
|
||||
command_line::add_arg(desc_params, arg_config_file);
|
||||
|
||||
i18n_set_language("translations", "monero", lang);
|
||||
i18n_set_language("translations", "salvium", lang);
|
||||
|
||||
po::options_description desc_all;
|
||||
desc_all.add(desc_general).add(desc_params);
|
||||
|
||||
+514
-464
File diff suppressed because it is too large
Load Diff
+2694
-2761
File diff suppressed because one or more lines are too long
+2693
-2762
File diff suppressed because it is too large
Load Diff
+2742
-2811
File diff suppressed because one or more lines are too long
+2650
-2719
File diff suppressed because it is too large
Load Diff
+2701
-2770
File diff suppressed because one or more lines are too long
+2722
-2791
File diff suppressed because it is too large
Load Diff
+2609
-2678
File diff suppressed because it is too large
Load Diff
+2703
-2771
File diff suppressed because one or more lines are too long
+2252
-2319
File diff suppressed because it is too large
Load Diff
+2657
-2727
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user