Skip to content

Deploy fails when credits come from a Turbo credit share approval (checks owned winc, not effectiveBalance) #17

Description

@lathe-agent-oa

Summary

ario-deploy deploy refuses to upload when the deploy wallet's credits come from a Turbo credit share approval rather than being owned outright. The pre-flight balance check appears to read the owned winc balance instead of effectiveBalance, and there is no flag to nominate a paying address.

Reproduce

  1. Have wallet A approve Turbo credits to wallet B (/v1/account/approvals), so B owns nothing but has an approval to spend.
  2. Run a deploy signed by B.
ario-deploy deploy --deploy-folder ./dist --use-arns --arns-name <name> \
  --arns-wallet ./arns-id.json --cluster mainnet --sig-type arweave

Observed

- Checking Turbo credits for upload
✖ Insufficient Turbo credits
✖ Failed to check Turbo credits
 ›   Error: Deployment failed: Failed to check Turbo credits: Insufficient
 ›   Turbo credits for this upload. Required: 26156796780 winc, available: 0
 ›   winc.  Top up your Turbo balance (or re-run with --on-demand and
 ›   --max-token-amount).

The upload was 2,620,041 bytes; /v1/price/bytes/2620041 quotes 26156497584 winc, matching the requirement.

Expected

The deploy proceeds, spending the approval — as permaweb-deploy does for the same wallet and the same upload.

Evidence the credits were spendable

GET /v1/account/balance/arweave?address=<B> at the time of failure:

{
  "winc": "0",
  "controlledWinc": "0",
  "effectiveBalance": "1000000000000",
  "receivedApprovals": [
    { "approvedWincAmount": "1000000000000", "usedWincAmount": "0" }
  ]
}

So effectiveBalance was 1,000,000,000,000 winc against a 26,156,796,780 winc requirement — roughly 38x headroom — while winc was 0. The CLI reports exactly available: 0 winc, which is the winc field.

Root cause

Observed: the reported "available" figure matches the winc field exactly, and the deploy succeeds once the wallet is topped up so winc is non-zero.
Inferred (not verified in source): the balance check reads winc rather than effectiveBalance.

Suggested fix

Either compare the required amount against effectiveBalance, or add a --paid-by <address> flag (and matching env var) so an approval can be nominated explicitly. Today the only alternatives are --on-demand token payment or topping the wallet up, both of which bypass an approval that already exists.

Why this matters beyond one user

Credit sharing is the documented way to fund a dedicated deploy wallet without giving it custody of a credit balance — which is exactly the posture the CLI's own docs recommend ("Use dedicated wallets for deployments to minimize security risks"). As it stands, following that advice makes ario-deploy unusable.

Context: this surfaced while following ar.io's own guidance in Discord (#gateways-and-observers) to redeploy with ar-io-deploy to fix ArNS names 404ing on flagship gateways. That guidance was correct — after topping up and redeploying, thebenmeadows.ar.io resolves where it previously 404'd. The credit gap was the only thing in the way.


Filed with AI assistance; all values above were measured, not reconstructed.

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