Skip to content

Fix historical miniblock address validation#194

Open
fjh1997 wants to merge 1 commit into
deroproject:devfrom
fjh1997:fix/historical-miniblock-address-validation
Open

Fix historical miniblock address validation#194
fjh1997 wants to merge 1 commit into
deroproject:devfrom
fjh1997:fix/historical-miniblock-address-validation

Conversation

@fjh1997

@fjh1997 fjh1997 commented Jul 12, 2026

Copy link
Copy Markdown

Description

Add_Complete_Block validates miniblock miner registration before the candidate block is added. The existing check derives the 25-topo maturity snapshot from the node's local tip, so a syncing node at topo 28 validating candidate topo 29 checks topo 3 instead of topo 4. A miner registration that is valid for the candidate can therefore be rejected as miner address not registered, preventing synchronization.

This change selects the validation snapshot from the candidate block's tips, while retaining the existing local-tip fallback and 16-byte address-prefix lookup. It also adds boundary coverage for the maturity window and early-chain clamping.

Related issue: none.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This will require a HardFork to be enabled

Which part is impacted?

  • Wallet
  • Daemon
  • Miner
  • Explorer
  • Simulator
  • Misc (documentation, comments, text...)

Test plan

  • go test ./...
  • Added unit cases for candidate topo 29/30, early-chain behavior, and negative bounds

Checklist

  • I have performed a self-review of my code
  • I have commented the new exported validation method
  • My changes generate no new warnings

License

I am contributing and releasing the code under the DERO Research License.

Made with Cursor

Validate miner registration against the candidate block's maturity window so syncing nodes do not reject valid blocks using the local tip state.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant