Skip to content

[Contracts] Remove deleted and removed gist ids from the per-cell index #1425

Closed

Description

@BigBen-7

Found in a repository audit of main (b472e6b). The facts below were checked against that commit.

Problem

delete_gist and remove_gist remove DataKey::Gist(id) but never touch DataKey::CellIndex(cell) (the key is referenced only when posting and listing). Dead ids accumulate forever, and list_gists_by_cell keeps iterating over them.

Fix

Load the gist's location_cell before removing it and remove its id from the cell's vector. Add tests that delete or remove a gist and check the index no longer contains it.

Acceptance criteria

  • Both delete paths prune the index
  • A test asserts listing and pagination after a delete
  • No other index behaviour changes

Notes

Scope: Light (about half a day or less). Location: contracts/src/lib.rs.

Activity

  1. added
    bugSomething isn't working
    contractsSoroban smart contract issues
    on Oct 12, 2026
  2. guptakumarranjeet150 commented on Oct 14, 2026

    @guptakumarranjeet150

    Hi team,

    I analyzed "[Contracts] Remove deleted and removed gist ids from the per-cell index" in PinSpace-Org/GistPin and have a concrete technical roadmap to resolve it.

    Technical Implementation Outline:

    1. Review contract state storage keys, TTL policies, and auth guards (Address::require_auth).
    2. Implement safe state transition logic with checked arithmetic preventing under/overflow.
    3. Write comprehensive Soroban unit tests covering standard flows, unauthorized callers, and reverts.
    4. Verify contract execution footprint passes Soroban CPU/memory budget limits.

    Please assign this issue to me. I will submit a clean, well-tested, and production-ready PR promptly!

  3. northersubair commented on Oct 17, 2026

    @northersubair
    Contributor

    @northersubair has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi, I'd like to work on this issue.

    I have hands-on experience with backend development, databases, and API design, as well as frontend work with React and modern CSS. I write tested, maintainable code and enjoy contributing to open source projects.

    I've looked into this issue closely and I'm confident in my ability to deliver a high-quality implementation here.

    Please assign this issue to me, I'd be happy to contribute.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @northersubair to this issue.

  4. drips-wave commented on Oct 17, 2026

    @drips-wave

    Congratulations, @northersubair! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @northersubair: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  5. grantfox-oss commented on Oct 17, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @northersubair's PR #1525 was approved and merged by @BigBen-7.

    🏆 @northersubair: You earned 40 FoxPoints for this contribution! Your current tier: Builder (2,068 total points). Track your full progress on GrantFox.

    👏 Great work, @northersubair! Keep contributing to PinSpace-Org.

  6. drips-wave commented on Oct 17, 2026

    @drips-wave

    This issue has been completed by @northersubair as part of the Stellar Wave Program's 10th Wave 🥳

    😎 @northersubair: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  7. added a commit that references this issue on Oct 17, 2026
    cf1a89f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingcontractsSoroban smart contract issues

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions