Fix RandomX validation exploit: verify nSolution contains valid RandomX hash

- Add CheckRandomXSolution() to validate RandomX PoW in nSolution field
- Add ASSETCHAINS_RANDOMX_VALIDATION activation height per chain
  (DRAGONX: 2838976, TUMIN: 1200, others: height 1)
- Add CRandomXInput serializer for deterministic RandomX hash input
- Fix CheckProofOfWork() to properly reject invalid PoW (was missing
  SMART_CHAIN_SYMBOL check, allowing bypass)
- Call CheckRandomXSolution() in hush_checkPOW and CheckBlockHeader

Without this fix, attackers could submit blocks with invalid RandomX
hashes that passed validation, as CheckProofOfWork returned early
during block loading and the nSolution field was never verified.
This commit is contained in:
Your Name
2026-03-03 13:47:47 -06:00
parent 7e1b5701a6
commit 28007893d7
9 changed files with 197 additions and 0 deletions

1
.gitignore vendored
View File

@@ -167,3 +167,4 @@ REGTEST_7776
src/cc/librogue.so
src/cc/games/prices
src/cc/games/tetris
release-linux/