Skip to content

Add storage optimization for large batch records in bulk_payment #553

Description

@Wilfred007

What

Bulk_payment stores all batch records in instance storage which has a 64KB limit. Each BatchRecord is 200+ bytes, so after ~300 batches the contract hits limits.

Why

The contract becomes permanently unusable after enough batches. Cross_asset_payment correctly uses persistent storage.

Scope

In scope: Move batch records to persistent storage, add TTL for old records, storage usage query
Out of scope: Off-chain storage

Acceptance Criteria

  • Batch records in persistent storage (not instance)
  • Old records have TTL for cleanup
  • Storage usage queryable
  • No 64KB limit issue

Technical Context

  • contracts/bulk_payment/src/lib.rs lines 152, 244 — instance storage
  • contracts/cross_asset_payment/src/lib.rs line 172 — persistent storage (correct)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaigncontractSmart Contract developmentmediumModerate tasks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions