Repository navigation
feat(core): the $10 payer rule and the lock file of a mainnet run - #42
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two more rules of the mainnet opt-in, which this version does not have. Exported from core, called by nothing:
stellar:pubnetis 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: onstellar:pubnetreads 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: takeswasit-mainnet.lockin 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.