Skip to content

Split large policy applies into multiple transactions #2

@martinjms

Description

@martinjms

Problem

Sui PTBs are limited to 1024 commands per transaction. When applying policies in bulk via set_policy, each assembly needs ~(2 × rule_count + 1) commands. For a tribe leader managing 100+ assemblies with 20+ rules each, this exceeds the limit.

Example

  • 30 assemblies × 20 rules = ~1,230 commands → exceeds 1024 limit
  • 50 assemblies × 10 rules = ~1,050 commands → exceeds limit

Solution

The DApp should automatically split large "Apply" operations into multiple transactions:

  1. Calculate total command count before building the PTB
  2. If it exceeds ~900 commands (safety margin), split assemblies into batches
  3. Show progress: "Applying batch 1/3... sign transaction"
  4. Track which batches succeeded/failed and allow retry

Context

Real-world scale: a single player can own 30+ assemblies. A tribe leader managing infrastructure for 300 members will have significantly more. The PTB limit will be hit in production use.

This is not needed for the hackathon demo but is required for production.

🤖 Generated with Claude Code

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