Commit Graph

245 Commits

Author SHA1 Message Date
Matt Hess 08dcd0a640 release.yml:
- Fixed alpine builds (shell: alpine.sh --root for apk)
  - Added proper dependencies and comprehensive curl cmake options
  - Disabled gRPC for all release builds (not used by Salvium)
  - Updated macOS runners to macos-15-intel/macos-15

  CMakeLists.txt:
  - Changed WITH_GRPC default to OFF (merge mining not used)

  side_chain.cpp:
  - Cleaned up chain_recovery log formatting
2025-12-27 18:05:29 +00:00
Matt Hess 0654c7258d Changed debug logs from level 3 to level 5, fixed shadowVariable warning from LOG_CATEGORY macro, Added shadowVariable to cppcheck/suppressions, Fixed variable lock shadowing outer variable 2025-12-26 17:56:54 +00:00
Matt Hess ea27306a79 Loglevel fix 2025-12-26 15:47:50 +00:00
Matt Hess 694c672d0c Fix chain_recovery to properly rebuild from checkpoint 2025-12-26 14:06:40 +00:00
Matt Hess d4cd458cdf Guard fetch_mainchain_block calls with is_main_thread(), Speed up MSAN sync test 2025-12-25 17:44:55 +00:00
Matt Hess 63f277c5ae Port fix 37889→38889, Complete Salvium rewrite of README, Docker Salvium updates, XMRAmount → SALAmount, Merge mining warning 2025-12-25 03:45:19 +00:00
Matt Hess 4f4b3d4753 auto i → const auto, fix test_sync condition - previous setup would never pass based on new mining state conditional 2025-12-24 16:49:42 +00:00
Matt Hess fbb73f9658 Fix unit test crashes for Carrot v1 block format 2025-12-23 23:33:32 +00:00
Matt Hess aa7c789743 Fixed sync test option, set default min diff 2025-12-23 01:34:53 +00:00
Matt Hess 72d7263e14 Fixed consensus ID format mismatch, riscv64 SIGSEGV, shadow variable 2025-12-22 22:45:35 +00:00
Matt Hess 33bb2a81a6 Added redis backend support for storage alternative to empower nextgen observer 2025-12-22 19:12:25 +00:00
Matt Hess 328a145af7 Fixed linker errors for coverage.yml action, Fixed reorder error for test-sync.yml, Fixed const issues for cppcheck.yml, removed unused log_category_prefix var, Renamed prefix to addr_prefix 2025-12-18 01:04:32 +00:00
Matt Hess 4ddfa22d1b Fixed implicit widening multiplication error, Removed unused "this", Fixed narrowing conversion, Made m_verified and m_invalid mutable, Removed else-after-return, Removed unused num_full_blocks and last_block_size var all to make clang-tidy happy 2025-12-18 00:52:40 +00:00
Matt Hess 9266f28d22 fix one critical bug and mostly code quality/cleanup items for portability, minor cleanup for compile on mac, fixed null check, Remove redundant TX_VERSION check 2025-12-17 22:53:56 +00:00
Matt Hess 184d05e40b added mainchain prefetch, ADDRESS_LENGTH buffer overflow fixed, Salvium address validation messages corrected 2025-12-17 04:30:53 +00:00
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