Skip to content

Consensus: reject wrapped Spark name validity#1850

Closed
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-correctness-bugs-d254
Closed

Consensus: reject wrapped Spark name validity#1850
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-correctness-bugs-d254

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 18, 2026

PR intention

Fix a critical Spark-name consensus validation bug where crafted sparkNameValidityBlocks values near UINT32_MAX could wrap when converted to signed int, bypassing max-validity checks and underflowing fee-year calculation.

Code changes brief

  • Use 64-bit unsigned arithmetic for Spark-name purchased/total validity checks and expiration carry-over.
  • Avoid signed sentinel arithmetic for existing expiration heights.
  • Add a regression test covering a wrapped validity value that must be rejected from mempool/block validation.

Validation performed:

  • git diff --check HEAD~1..HEAD
  • Attempted headless test configure: CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake -G Ninja -DBUILD_GUI=OFF -DWITH_ZMQ=OFF -DBUILD_TESTS=ON -S /workspace -B /workspace/build (blocked by missing Boost 1.81+ components in the environment).
Open in Web View Automation 

Co-authored-by: Reuben Yap <reuben@firo.org>
@reubenyap reubenyap closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants