Skip to content

ContractModule: Add bounded cleanup for terminal escrow and associated indexes #19

Description

@grantfox-oss

cleanup_escrow removes the escrow entry but leaves related mappings such as EscrowIdMap and dispute votes. This can strand storage and make future idempotent calls return commitments that no longer resolve.

Affected areas: app/contract/contracts/src/escrow.rs, app/contract/contracts/src/storage.rs, app/contract/contracts/src/escrow_id.rs, app/contract/contracts/src/events.rs, app/contract/contracts/src/storage_test.rs, backend indexer/docs.

Implementation scope:

  • Track reverse mapping from commitment to escrow ID or store cleanup metadata.
  • Remove or tombstone EscrowIdMap consistently when terminal escrows are cleaned.
  • Clean dispute votes for terminal disputed escrows within a bounded arbiter list.
  • Emit cleanup events for indexers.

Acceptance criteria:

  • Cleanup cannot leave an escrow ID pointing to a missing active escrow without a tombstone state.
  • Associated dispute votes are removed or made unreachable in a documented way.
  • Idempotent retry behavior after cleanup is deterministic and tested.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't workingenhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions