Skip to content

feat(contract): implement bounded resumable settlement and void refunds #359

Description

@karagozemin

Difficulty

Hard — production engineering across multiple components; a small cleanup or test-only patch does not complete this issue.

Context

The contract permits up to 500 bidders while settle iterates over all bidders and performs transfers in one call. Extend existing conservation tests into a bounded settlement protocol whose progress survives separate transactions.

Starting points

Scope

  • Design explicit payout progress with bounded batch size for settlement and void refunds.
  • Freeze the clearing result before payouts and preserve current winner, tie-breaking and refund amounts.
  • Prevent already-paid entries from being paid again under repeated or overlapping permissionless calls.
  • Update generated bindings, SDK/keeper orchestration and user-visible progress.

Acceptance criteria

  • A maximum-bidder round completes through bounded calls with recorded CPU/memory/read/write budgets.
  • After every successful batch, original escrow equals paid amounts plus remaining obligations.
  • Repeated and overlapping batches cannot duplicate operator payment, winner surplus or loser refunds.
  • An interrupted or failed batch can resume from confirmed state without skipping obligations.
  • Settled/fully-refunded status is emitted only after all obligations are completed.
  • Tests cover cleared and voided rounds, zero surplus, final short batch and invalid cursors.

Verification

Run contract property/model tests and a 500-bidder resource regression fixture. Interrupt the keeper between every batch and compare final balances with the original settlement model. Document deployment/ABI compatibility without deploying.

Out of scope

Changing bid ranking, fees, token choice, introducing discretionary withdrawals, or executing public-network deployments.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions