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) {
+4 -4
View File
@@ -389,16 +389,16 @@ template<> struct log::Stream::Entry<Hashrate>
}
};
struct XMRAmount
struct SALAmount
{
explicit FORCEINLINE XMRAmount(uint64_t data) : m_data(data) {}
explicit FORCEINLINE SALAmount(uint64_t data) : m_data(data) {}
uint64_t m_data;
};
template<> struct log::Stream::Entry<XMRAmount>
template<> struct log::Stream::Entry<SALAmount>
{
static NOINLINE void put(XMRAmount value, Stream* wrapper)
static NOINLINE void put(SALAmount value, Stream* wrapper)
{
constexpr uint64_t denomination = 100000000ULL;
+3 -3
View File
@@ -442,7 +442,7 @@ void p2pool::handle_tx(TxMempoolData& tx)
", fee = " << log::Gray() << static_cast<double>(tx.fee) / 1e6 << " um");
if (tx.fee >= HIGH_FEE_VALUE) {
LOGINFO(4, "high fee tx received: " << log::LightBlue() << tx.id << log::NoColor() << ", " << log::XMRAmount(tx.fee) << " - updating block template");
LOGINFO(4, "high fee tx received: " << log::LightBlue() << tx.id << log::NoColor() << ", " << log::SALAmount(tx.fee) << " - updating block template");
update_block_template_async();
}
@@ -661,7 +661,7 @@ void p2pool::handle_chain_main(ChainMain& data, const char* extra, const std::ve
LOGINFO(2, "new main chain block: height = " << log::Gray() << data.height << log::NoColor() <<
", id = " << log::LightBlue() << data.id << log::NoColor() <<
", timestamp = " << log::Gray() << data.timestamp << log::NoColor() <<
", reward = " << log::Gray() << log::XMRAmount(data.reward));
", reward = " << log::Gray() << log::SALAmount(data.reward));
if (!merkle_root.empty()) {
const PoolBlock* block = side_chain().find_block_by_merkle_root(merkle_root);
@@ -673,7 +673,7 @@ void p2pool::handle_chain_main(ChainMain& data, const char* extra, const std::ve
const uint64_t payout = block->get_payout(w);
if (payout) {
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightGreen() << params().m_displayWallet << log::LightCyan() << " got a payout of " << log::LightGreen() << log::XMRAmount(payout) << log::LightCyan() << " in block " << log::LightGreen() << data.height);
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightGreen() << params().m_displayWallet << log::LightCyan() << " got a payout of " << log::LightGreen() << log::SALAmount(payout) << log::LightCyan() << " in block " << log::LightGreen() << data.height);
}
else {
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightYellow() << params().m_displayWallet << log::LightCyan() << " didn't get a payout in block " << log::LightYellow() << data.height << log::LightCyan() << " because you had no shares in PPLNS window");
+2 -5
View File
@@ -243,15 +243,12 @@ Params::Params(int argc, char* const argv[])
}
#endif
/*
if ((strcmp(argv[i], "--merge-mine") == 0) && (i + 2 < argc)) {
m_mergeMiningHosts.emplace_back(argv[i + 1], argv[i + 2]);
i += 2;
LOGWARN(0, "Merge mining is not supported in Salvium P2Pool. --merge-mine flag ignored.");
i += 2; // Skip the two arguments (host and wallet)
ok = true;
}
*/
#ifdef WITH_TLS
if ((strcmp(argv[i], "--tls-cert") == 0) && (i + 1 < argc)) {
m_tlsCert = argv[++i];
+2 -2
View File
@@ -733,7 +733,7 @@ bool SideChain::add_external_block(PoolBlock& block, std::vector<hash>& missing_
const uint64_t payout = block.get_payout(w);
if (payout) {
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightGreen() << m_pool->params().m_displayWallet << log::LightCyan() << " got a payout of " << log::LightGreen() << log::XMRAmount(payout) << log::LightCyan() << " in block " << log::LightGreen() << data.height);
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightGreen() << m_pool->params().m_displayWallet << log::LightCyan() << " got a payout of " << log::LightGreen() << log::SALAmount(payout) << log::LightCyan() << " in block " << log::LightGreen() << data.height);
}
else {
LOGINFO(0, log::LightCyan() << "Your wallet " << log::LightYellow() << m_pool->params().m_displayWallet << log::LightCyan() << " didn't get a payout in block " << log::LightYellow() << data.height << log::LightCyan() << " because you had no shares in PPLNS window");
@@ -1236,7 +1236,7 @@ void SideChain::print_status(bool obtain_sidechain_lock) const
"\nYour wallet address = " << m_pool->params().m_displayWallet <<
"\nYour shares = " << our_blocks_in_window_total << " blocks (+" << our_uncles_in_window_total << " uncles, " << our_orphans << " orphans)"
<< our_blocks_in_window_chart << our_uncles_in_window_chart <<
"\nBlock reward share = " << block_share << "% (" << log::XMRAmount(your_reward) << ')' <<
"\nBlock reward share = " << block_share << "% (" << log::SALAmount(your_reward) << ')' <<
"\nAnchor point = " << get_latest_checkpoint_height() <<
"\nChain health = " << m_externalBlockFailures << " consecutive failures" << (m_recoveryMode.load() ? " [RECOVERY MODE]" : "")
);