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.
cleanup_escrowremoves the escrow entry but leaves related mappings such asEscrowIdMapand 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:
EscrowIdMapconsistently when terminal escrows are cleaned.Acceptance criteria: