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.
- Replace Monero hardfork schedule with Salvium's
- v1-v10 transitions at correct block heights
- Fixes peer banning due to version mismatch (error 87)
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.