Consensus: reject duplicate Spark mint coins - #1902
Draft
reubenyap wants to merge 1 commit into
Draft
Conversation
Reject duplicate Spark mint coins within a block or against the active chain before mutating Spark state. Track mint reservations per transaction pool so duplicate transactions are rejected and conflicts are evicted symmetrically.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR intention
Prevent duplicate Spark mint coins from corrupting the relationship between Spark coin-group counts, block-index mint entries, and the active minted-coin map. A duplicate can otherwise be counted and indexed more than once while the map stores it once, making a later disconnect capable of removing the wrong occurrence or hitting an assertion.
Provenance: this PR splits and reconstructs the duplicate-mint hardening from public commit
28251a690, authored June 19, 2026 on the publicspark-coin-type-fixbranch. That work predates the later external vulnerability report. This PR carries Firo's earlier hardening forward as a separate, current-masterchange. It was not initiated in response to that report.The earlier commit is not cherry-picked unchanged because it depends on its parent coin-type commit, only covers direct
OP_SPARKMINToutputs within one block, and has no dedicated tests. This reconstruction is independent of #1901 and also coversOP_SPARKSMINT, active-chain duplicates, and mempool behavior.Code changes brief
OP_SPARKMINTcoins andOP_SPARKSMINTcoins created by Spark spends through the shared completed mint vector.INT_MAXin this draft pending historical-chain review and coordinated deployment heights.Before this draft is made ready, the active histories must be scanned for pre-existing duplicate Spark coin identities and concrete network activation heights must be selected.
git diff --checkpasses. Local CMake configuration reached dependency discovery but could not complete because the available Windows environment lacksbls-dash; compilation and the new tests therefore still require CI.