Skip to content

Create Coretime E2E Tests #299

@rockbmb

Description

@rockbmb

Summary

Implement end-to-end tests for coretime operations, ideally between coretime system parachains and relay chains.

Background

The broker pallet provides extrinsics to manage coretime allocation.
There are no E2E tests for coretime features, and PET is a decent place to start.

Broker functions to test

Administrative Functions

  • configure: Set broker parameters (admin only)
  • reserve: Reserve cores for permanent workloads (admin only)
  • unreserve: Cancel workload reservations (admin only)
  • set_lease: Reserve cores for limited periods (admin only)
  • start_sales: Begin bulk coretime sales rotation (admin only)
  • request_core_count: Request change to available core count (admin only)
  • notify_core_count: Notify core count changes (admin only)
  • notify_revenue: Notify revenue from on-demand sales (admin only)
  • force_reserve: Reserve core for workload immediately (admin only)
  • remove_lease: Remove a lease (admin only)
  • remove_assignment: Remove assignment from workplan (admin only)
  • swap_leases: Swap leases between tasks (admin only)

Market Operations

  • purchase: Buy bulk coretime in ongoing sale
  • renew: Renew bulk coretime for existing cores
  • transfer: Transfer region ownership between accounts
  • partition: Split regions into non-overlapping parts
  • interlace: Split regions into overlapping parts with complementary masks

Assignment and Pooling

  • assign: Assign regions to specific tasks (final or provisional)
  • pool: Place regions into instantaneous coretime pool
  • claim_revenue: Claim revenue from pool participation
  • purchase_credit: Buy on-demand coretime credits

Auto-Renewal

  • enable_auto_renew: Enable automatic core renewal (sovereign account only)
  • disable_auto_renew: Disable automatic core renewal (sovereign account only)

Cleanup

  • drop_region: Remove expired regions
  • drop_contribution: Remove expired pool contributions
  • drop_history: Remove expired historical records
  • drop_renewal: Remove expired renewal records

Test Scenarios

  • Complete sale lifecycle from start to purchase
  • Region management (transfer, partition, interlace)
  • Task assignment and pool participation
  • Revenue claiming and credit purchasing
  • Auto-renewal enabling/disabling and operation
  • Cross-chain core count modifications
  • Immediate core reservation and assignment
  • Lease management and swapping
  • Administrative cleanup of expired records

As in previous E2E suites, tests should verify extrinsic execution/failures causes + events.
Features which require non-signed origins (root or admin) should rely on XCM containing a Transact.send wrapper over the broker extrinsic, with the appropriate origin, scheduled to be sent from the relay chain to the coretime SP.

In the case of cross-chain communication (e.g. core count modification requests) similar scheduler+XCM workarounds may also be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    e2e testsRelated to end-to-end testsenhancementNew feature or request

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions