Files
p2pool-salvium/sidechain_config.json
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

15 lines
361 B
JSON

// p2pool side-chain settings
//
// If you change anything here, you'll most likely be mining alone on a different p2pool side-chain!!!
//
// Fixed difficulty for miners that connect to your node must be set in their config.json
//
{
"name": "salvium_main",
"password": "",
"block_time": 10,
"min_diff": 10000,
"pplns_window": 2160,
"uncle_penalty": 20
}