Skip to content

Add createTasksBatch to default paymaster auto-whitelist #153

@hudsonhrh

Description

@hudsonhrh

Problem

The frontend's batch task-creation flow (poa-frontend PR #390) submits a single createTasksBatch(bytes32 pid, CreateTaskInput[] tasks) UserOp through the org's PaymasterHub. The paymaster rejects this call because the function selector is not in the org's allowed-selectors list — single createTask works fine because it is in the auto-whitelist, but the batch entry point was never added.

Repro (Test6 on Gnosis, passkey path, 3 drafts):

Paymaster rejected entry 1/2: validatePaymasterUserOp reverted
Details: AA33 reverted
0x2240f884
+ 0x3d93f0d090356d25e7a1614f0f8764b103ca99bc   (TaskManager)
+ 0xc18aa1c9                                     (createTasksBatch selector)

Both paymaster entries reject; self-funded fallback also fails (smart account has no xDAI). The batch UserOp itself is well-formed (one tx for N tasks, IPFS metadata uploaded, optimistic UI rolls back cleanly on failure) — the only thing missing is the paymaster permission.

Fix

In src/OrgDeployer.sol:

  1. _appendTaskManagerRules — append a 13th rule with selector keccak256(\"createTasksBatch(bytes32,(uint256,bytes,bytes32,address,uint256,bool)[])\")[0:4] (= 0xc18aa1c9). Confirm the canonical struct ordering against CreateTaskInput in TaskManager.sol.
  2. _buildDefaultPaymasterRules — bump the TaskManager(12) comment to TaskManager(13) and change uint256 count = 39;uint256 count = 40;.

That covers all new org deployments. Existing orgs still need a backfill — they were deployed before createTasksBatch existed, so their PaymasterHub rules are frozen at the old set. Suggested approach: either

  • piggy-back on script/upgrades/UpgradeTaskManagerCreateTasksBatch.s.sol to also call PaymasterHub.setRules on each known org, or
  • ship a small dedicated script (UpgradeAddBatchTaskPaymasterRule.s.sol) that admins can run per-org.

Test6 (0x263b2b29...4181f6b) is the immediate blocker — without backfill there, the frontend feature can't be exercised on the staging org.

Related

  • Frontend PR: poa-frontend#390 (feat(tasks): batch task creation via createTasksBatch with drafts mode)
  • createTasksBatch: support per-item assignee #152 (createTasksBatch: support per-item assignee) — separate ABI change, also needs its selector whitelisted once landed.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions