Skip to content

Spark: clear all state on reset - #1943

Open
navidR wants to merge 1 commit into
firoorg:masterfrom
navidR:dev/navidr/complete-spark-state-reset
Open

Spark: clear all state on reset#1943
navidR wants to merge 1 commit into
firoorg:masterfrom
navidR:dev/navidr/complete-spark-state-reset

Conversation

@navidR

@navidR navidR commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

CSparkState::Reset() currently leaves the linking-tag transaction index and extended mint metadata populated. Clear both containers so reset restores constructor-equivalent empty state and cannot expose stale entries after a rebuild or between tests.

@codeant-ai

codeant-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR ef5eac3 Aug 31, 2026 · 00:35 00:37

@codeant-ai

codeant-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai Bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Aug 31, 2026
@codeant-ai

codeant-ai Bot commented Aug 31, 2026

Copy link
Copy Markdown

User description

CSparkState::Reset() currently leaves the linking-tag transaction index and extended mint metadata populated. Clear both containers so reset restores constructor-equivalent empty state and cannot expose stale entries after a rebuild or between tests.


CodeAnt-AI Description

Fully clear Spark state when resetting

What Changed

  • Reset now removes linking-tag transaction records and extended mint metadata along with the existing Spark state
  • Rebuilding or reusing state no longer exposes entries left over from a previous session

Impact

✅ No stale Spark records after reset
✅ Cleaner state between rebuilds
✅ More reliable test isolation

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 37c0019e-5dea-4559-a5a4-668b577255df

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0c771 and ef5eac3.

📒 Files selected for processing (1)
  • src/spark/state.cpp

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


Summary by CodeRabbit

  • Bug Fixes
    • Resetting Spark state now fully clears transaction tag and extended mint metadata information, preventing stale data from persisting after a reset.

Walkthrough

CSparkState::Reset() now clears the ltagTxhash and extendedMintMetaInfo maps, preventing these containers from retaining data after a Spark state reset.

Changes

Spark state reset

Layer / File(s) Summary
Clear all Spark state containers
src/spark/state.cpp
CSparkState::Reset() now clears the ltagTxhash and extendedMintMetaInfo maps.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to ef5ea

The change makes Spark reset fully clear its retained metadata, preventing stale entries after rebuilds or between tests. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: levonpetrosyan93

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: Spark state reset now clears all state.
Description check ✅ Passed The description clearly states the required PR intention, identifies both containers, and explains the stale-state problem. The optional Code changes brief section is omitted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T00:37:09.210036Z ef5eac3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@reubenyap reubenyap left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current head and traced CSparkState::Reset against the state members, rebuild path, and mobile spend RPC. Clearing the linking-tag index and extended mint metadata completes the reset without changing the live update behavior. The full CI matrix is also green. I found no actionable issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants