Skip to content

feat(core): the $10 payer rule and the lock file of a mainnet run - #42

Merged
dzakwannajmi merged 1 commit into
mainfrom
sow2/w3-i9-balance-lock
Nov 21, 2026
Merged

dzakwannajmi merged 1 commit into
mainfrom
sow2/w3-i9-balance-lock

Conversation

@dzakwannajmi

Copy link
Copy Markdown
Collaborator

Two more rules of the mainnet opt-in, which this version does not have. Exported from core, called by nothing: stellar:pubnet is still refused earlier.

The $5 cap holds one run. Two mainnet runs at once on one account would each get their own $5, so the account is the limit.

  • assertMainnetPayerBalance: on stellar:pubnet reads the payer's USDC balance once and refuses above $10 (exactly $10 passes) or when it cannot be read. What a failed read threw is not echoed (an RPC URL may carry a key). A test network reads nothing; any other network is refused.
  • acquireMainnetRunLock: takes wasit-mainnet.lock in the run's ledger folder, created exclusively (a symbolic link is refused). Any file there refuses the run; no run takes over or deletes another's lock. A run that exits releases it; a killed run leaves it, and a person reads its ledger before deleting it.

Not covered: another machine, or a run whose ledger is in another folder. The balance is the RPC's word.

Tests: core 957, cli 277, server 30, Action 196, 0 failures (Node 26 locally). Mutation pass: 29 of 33 caught; the four survivors still refuse. CHANGELOG [Unreleased] has one new bullet.

Two more rules of the mainnet opt-in, which this version does not have.
The $5 cap holds one run; two mainnet runs at once on one account would
each get their own $5. assertMainnetPayerBalance reads the payer's USDC
balance on stellar:pubnet and refuses above $10 or when it cannot be
read, so the account itself is the limit; on a test network it reads
nothing. acquireMainnetRunLock takes wasit-mainnet.lock in the run's
ledger folder; any file there refuses the run, and no run takes over
another's lock. Exported, called by nothing until the opt-in.
@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wasit Ready Ready Preview Nov 21, 2026 10:50am UTC

@dzakwannajmi
dzakwannajmi merged commit 04be519 into main Nov 21, 2026
5 checks passed
@dzakwannajmi
dzakwannajmi deleted the sow2/w3-i9-balance-lock branch November 21, 2026 10:53

This branch was successfully deployed

1 active deployment
Preview — 06b32701 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant