Port fix 37889→38889, Complete Salvium rewrite of README, Docker Salvium updates, XMRAmount → SALAmount, Merge mining warning

This commit is contained in:
Matt Hess
2025-12-25 03:44:02 +00:00
parent b226260f56
commit 63f277c5ae
9 changed files with 107 additions and 219 deletions
+7 -7
View File
@@ -379,9 +379,9 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const
const uint64_t max_reward = base_reward + total_tx_fees;
LOGINFO(3, "base reward = " << log::Gray() << log::XMRAmount(base_reward) << log::NoColor() <<
LOGINFO(3, "base reward = " << log::Gray() << log::SALAmount(base_reward) << log::NoColor() <<
", " << log::Gray() << m_mempoolTxs.size() << log::NoColor() <<
" transactions, fees = " << log::Gray() << log::XMRAmount(total_tx_fees) << log::NoColor() <<
" transactions, fees = " << log::Gray() << log::SALAmount(total_tx_fees) << log::NoColor() <<
", weight = " << log::Gray() << total_tx_weight);
if (!SideChain::split_reward(max_reward, m_shares, m_rewards)) {
@@ -531,11 +531,11 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const
}
#if TEST_MEMPOOL_PICKING_ALGORITHM
LOGINFO(3, "final_reward = " << log::XMRAmount(final_reward) << ", transactions = " << m_numTransactionHashes << ", final_weight = " << final_weight);
LOGINFO(3, "final_reward = " << log::SALAmount(final_reward) << ", transactions = " << m_numTransactionHashes << ", final_weight = " << final_weight);
uint64_t final_reward2;
fill_optimal_knapsack(data, base_reward, miner_tx_weight, final_reward2, final_fees, final_weight);
LOGINFO(3, "best_reward = " << log::XMRAmount(final_reward2) << ", transactions = " << m_numTransactionHashes << ", final_weight = " << final_weight);
LOGINFO(3, "best_reward = " << log::SALAmount(final_reward2) << ", transactions = " << m_numTransactionHashes << ", final_weight = " << final_weight);
if (final_reward2 < final_reward) {
LOGERR(1, "fill_optimal_knapsack has a bug, found solution is not optimal. Fix it!");
}
@@ -865,7 +865,7 @@ void BlockTemplate::update(const MinerData& data, const Mempool& mempool, const
}
LOGINFO(5, "P2POOL FIRST 200 BYTES: " << hex);
LOGINFO(3, "final reward = " << log::Gray() << log::XMRAmount(final_reward) << log::NoColor() <<
LOGINFO(3, "final reward = " << log::Gray() << log::SALAmount(final_reward) << log::NoColor() <<
", weight = " << log::Gray() << final_weight << log::NoColor() <<
", outputs = " << log::Gray() << m_poolBlockTemplate->m_outputAmounts.size() << log::NoColor() <<
", " << log::Gray() << m_numTransactionHashes << log::NoColor() <<
@@ -965,7 +965,7 @@ void BlockTemplate::fill_optimal_knapsack(const MinerData& data, uint64_t base_r
void BlockTemplate::select_mempool_transactions(const Mempool& mempool)
{
// Only choose transactions that were received 5 or more seconds ago, or high fee (>= 0.006 XMR) transactions
// Only choose transactions that were received 5 or more seconds ago, or high fee (>= 0.006 SAL) transactions
m_mempoolTxs.clear();
const uint64_t cur_time = seconds_since_epoch();
@@ -1007,7 +1007,7 @@ void BlockTemplate::select_mempool_transactions(const Mempool& mempool)
// Add a rough upper bound estimation of outputs' size. All outputs have <= 5 bytes for each output's reward (< 0.034359738368 XMR per output)
k += m_shares.size() * (5 /* reward */ + 1 /* tx_type */ + HASH_SIZE /* stealth address */ + 1 /* viewtag */);
// >= 0.034359738368 XMR is required for a 6 byte varint, add 1 byte per each potential 6-byte varint
// >= 0.034359738368 SAL is required for a 6 byte varint, add 1 byte per each potential 6-byte varint
{
uint64_t r = BASE_BLOCK_REWARD;
for (const auto& tx : m_mempoolTxs) {