Commit Graph

230 Commits

Author SHA1 Message Date
Matt Hess 11b545e91b Add CAP exchange protocol, Deadlock fix, Sync stuck fix with retry mechanism 2025-12-17 00:29:41 +00:00
Matt Hess 940f1cabe8 Revert "Remove compact/pruned blob code - it displeases the carrot"
This reverts commit d5a8bbcc4a.
2025-12-11 02:26:30 +00:00
Matt Hess d5a8bbcc4a Remove compact/pruned blob code - it displeases the carrot 2025-12-10 15:56:49 +00:00
Matt Hess 4a2bec3f29 Add sync mode to prevent mining during sidechain load
- Added m_readyToMine flag to SideChain
- Display LOADING SIDECHAIN banner at startup
- Delay stratum server and mining until sidechain sync completes
- Display MINING IS NOW ENABLED when ready
- Prevents premature mining that caused peer bans and chain splits

P2PServer starts immediately for sync, but stratum port doesn't
open until sidechain is fully loaded and after pruning completes
2025-12-09 18:52:32 +00:00
Matt Hess 0a7d287c40 Moved verbose DEBUG and diagnostic logging from level 0 to level 6 to reduce console spam during normal operation 2025-12-08 23:56:25 +00:00
Matt Hess 1d319325e5 Fix merkle tree calculation for mempool transactions
- Fixed m_transactionHashes to preserve mempool txs across template updates
- Changed merkle calculation to use merkle_hash() with all transactions
- Removed hardcoded 2-transaction merkle assumption for HF10+
- Synchronized m_poolBlockTemplate->m_transactions with m_transactionHashes
- Commented out premature m_transactionHashes.clear()
- Updated monerod references to salviumd
- Enhanced difficulty debug logging (lo/hi components)
2025-12-08 23:03:32 +00:00
Matt Hess 728d6c2cbf Fix Carrot v1 protocol TX handling for peer synchronization
Root cause: Merkle verification failures (error 659) and peer bans occurred
because protocol TX was not consistently present in m_transactions[1].

Parser fix (pool_block_parser.inl):
- Skip dummy transactions[0] entry when populating m_transactions
- Add protocol TX computation after parsing for Carrot v1 blocks

Block template fix (block_template.cpp):
- Insert protocol TX at position [1] during block creation in update()
- Insert protocol TX during select_mempool_transactions()

get_pow_hash fix (pool_block.cpp):
- Ensure protocol TX is populated before serialize_mainchain_data()

The protocol TX must be at m_transactions[1] before ANY serialization
occurs, otherwise sender and receiver compute different merkle roots.

Tested: Multiple restart cycles with two nodes, no bans, chains stay synced.
2025-12-07 23:57:46 +00:00
Matt Hess 00fb078004 Implement genesis reconciliation protocol for sidechain stability
Problem: P2Pool nodes starting at different times or experiencing network
issues would create independent genesis blocks, resulting in incompatible
chains. Nodes would ban each other for invalid blocks that were actually
valid on a different chain. Cache resume after restart frequently failed
due to genesis mismatch between nodes.

Solution:  Oldest compatible genesis wins protocol that coordinates
genesis selection across peers before mining begins.

New P2P message GENESIS_INFO exchanges:
- Genesis block hash
- Genesis timestamp
- Genesis mainchain height
- Protocol version

Startup behavior:
- Wait up to 90 seconds for peer genesis info (with progress logging)
- Adopt oldest genesis from compatible peers
- Only create own genesis if no peers respond

Late joiner reconciliation:
- Running nodes that receive older genesis from new peer will purge
  their sidechain and re-sync to the older chain
- Cache files deleted on purge to prevent reload of stale blocks

Protocol versioning:
- PROTOCOL_VERSION constant at top of side_chain.h
- Increment only on consensus-breaking changes
- Version mismatch logs warning, prevents genesis adoption

Tiebreaker: When timestamps match, lexicographically lower hash wins.
2025-12-05 23:44:53 +00:00
Matt Hess ec4f5d914d Removed --donate-time CLI option and donatetime console command, Removed time-based donation tracking, Replace time-based donation with deterministic blockchain-height-based donation, All nodes calculate donation mode identically based on block height, Eliminated need for sidechain file on mainnet - defualts to salvium_main now 2025-11-17 04:10:38 +00:00
Matt Hess 735eb6737f fixed communication issue with tx version relay 2025-11-16 21:01:21 +00:00
Matt Hess 35e05d4f56 set default display network names to salvium values 2025-11-16 14:48:09 +00:00
Matt Hess 56fbf8bcb1 set default network names to salvium values 2025-11-16 14:29:22 +00:00
Matt Hess 21f1422fb2 log text update 2025-11-16 02:53:24 +00:00
Matt Hess 8e17597227 fixed display coin name, added default seeds 2025-11-13 07:02:48 +00:00
Matt Hess 8fa225b909 Revert "Add consensus-enforced 0.3% dev fee"
This reverts commit 2a41ad9670.
2025-11-13 04:59:08 +00:00
Matt Hess 6a21f04600 Revert "Fix dev fee implementation for peer synchronization"
This reverts commit 8ff12ad180.
2025-11-13 04:59:00 +00:00
Matt Hess 8ff12ad180 Fix dev fee implementation for peer synchronization
- Add dev fee output in get_outputs_blob() for sidechain validation
- Fix extra nonce size calculation to account for dev fee weight
- Fix size estimation in busy mempool handler to account for dev fee
- Add debug logging for mainchain data serialization
- Fixes peer banning due to sidechain ID mismatch (error 502)
2025-11-12 22:26:47 +00:00
Matt Hess 2a41ad9670 Add consensus-enforced 0.3% dev fee 2025-11-12 17:34:00 +00:00
SChernykh 25a5361777 Wallet: added checks for FCMP++ compatibility 2025-10-23 12:58:45 +02:00
SChernykh 801c131172 P2P: save/load onion peers, added onion seed nodes 2025-10-20 19:07:29 +02:00
SChernykh f6353a6939 Fixed compile errors 2025-10-20 15:06:56 +02:00
SChernykh cb9fc89b22 Added --onion-address command line option to support incoming TOR connections 2025-10-20 13:06:45 +02:00
SChernykh e2f0ec7c69 De-duplicate tx hashes and pub keys to save memory (off by default) (#382)
P2Pool-main: 8.2 MB saved
P2Pool-mini: 66 MB saved
P2Pool-nano: 25.2 MB saved

The feature is available only when building from source and is intended for use on low-memory systems (for example, a VPS server with < 1 GB RAM).

It only makes sense to use with `--no-cache --no-randomx` in the command line because cache and RandomX hasher take much more memory.
2025-10-18 12:21:16 +02:00
SChernykh 741aaf95a8 Removed old fork code 2025-10-04 12:41:35 +02:00
SChernykh 6b4c39f4c9 SideChain: added some extra checks, removed const_cast 2025-10-01 18:05:26 +02:00
SChernykh e1da9ff4d3 Fixed cppcheck errors 2025-10-01 16:39:42 +02:00
SChernykh 82f3982175 Fixed wallet payout log message for subaddresses 2025-09-27 10:13:37 +02:00
SChernykh 0184a3139c CI: revised clang-tidy list of checks 2025-09-25 18:46:22 +02:00
SChernykh 04d195d5cd Added support for mining to a subaddress 2025-09-22 14:24:11 +02:00
SChernykh e62f653b9d Fixed the initial sync stalling sometimes 2025-07-15 16:18:18 +02:00
SChernykh 964f4c8065 Updated copyright 2025-07-14 20:30:33 +02:00
SChernykh c421324b73 SideChain: fixed a synchronization blocker bug 2025-06-21 01:06:36 +02:00
SChernykh b589d373ea P2Pool-nano: display correct parameters at start-up 2025-05-28 17:47:18 +02:00
SChernykh e0c1d9377c P2Pool-nano support 2025-05-28 15:04:11 +02:00
SChernykh 70298cd065 Merge mining donation support 2025-05-13 17:18:29 +02:00
SChernykh d1dd95d9c9 Set thread names for better debugging 2025-03-13 11:19:58 +01:00
SChernykh e95cc65c43 Fixed cppcheck errors 2024-12-24 10:26:47 +01:00
SChernykh dd7e2a477f Renamed --config command line parameter 2024-12-17 14:36:40 +01:00
SChernykh fb8e2a71e0 Fixed global init/shutdown order 2024-12-04 14:30:20 +01:00
SChernykh cf325e0e76 Updated rapidjson 2024-12-02 17:44:08 +01:00
SChernykh fd0a7ea0c7 Faster initial sync
0.5-1 seconds saved on verification after removing the repeated `get_shares` calls
2024-11-22 18:42:51 +01:00
SChernykh 031a1c2eea SideChain: more fine-grained locks 2024-10-29 12:36:39 +01:00
SChernykh 37bf8554fc CI: save a minidump if it hangs on shutdown 2024-07-20 19:55:49 +02:00
SChernykh a188ca7fad Fixed CI errors 2024-06-03 21:11:16 +02:00
SChernykh 9cd9055913 Print merge mining status 2024-06-03 17:31:18 +02:00
SChernykh 59b693d2f3 P2Pool version: add patch number 2024-05-28 22:41:37 +02:00
SChernykh 406aa72112 Merge branch 'master' into merge-mining 2024-05-22 16:21:46 +02:00
SChernykh 9fd85942e0 Fixed cppcheck error 2024-05-22 16:18:40 +02:00
SChernykh 899a908409 Added hardfork code 2024-05-14 22:48:59 +02:00
SChernykh a847baf331 Revert "Fixed include paths"
This reverts commit 1b0103c119.
2024-04-23 18:10:09 +02:00