Skip to content

Incomplete Cleanup for LockedTokens in prune_market #187

@hman38705

Description

@hman38705

Description
The prune_market function (Line 243) explicitly removes the DataKey::Market(market_id) record. However, it completely ignores other data structures associated with that market, such as DataKey::LockedTokens(market_id, ...) and DataKey::VoteTally(market_id, ...). This leaves zombie data in the ledger that can never be reached, leading to state expansion.

Requirements and context

  • Ensure all related storage keys are cleared during market pruning.
  • Provide a mechanism to iterate and remove voter-specific data.

Suggested execution

  • Fork the repo and create a branch: git checkout -b fix/issue-84-deep-pruning
  • Refactor the pruning logic.

Implementation changes

  • Update markets.rs (around line 262) to include deletions for associated voting and locking keys.

Test and commit

  • Verify that the total storage footprint for a market drops to zero after pruning.

Example commit message
fix: implement deep pruning to clear all associated market state records

Guidelines

  • State hygiene.
  • Timeframe: 48 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions