juice

द्वारा convex-dev

Juice लेखांकन — CVM पर संगणना और बैंडविड्थ की लागत। लेन-देन निष्पादन लागत पर विचार करते समय, :JUICE विफलता का निदान करते समय, या…

npx skills add https://github.com/convex-dev/convex --skill juice

Juice Accounting

Juice prices computation and bandwidth. It is a flow: consumed and paid per transaction, never held. Storage is priced separately — see the memory skill.

Normative spec: https://docs.convex.world/docs/cad/juice.

The Calculation

Juice Fees     = Juice Consumed × Juice Price
Juice Consumed = Transaction Size Cost + Σ(cost of each operation executed)

Transaction Size Cost = TRANSACTION_PER_BYTE × storage size of the transaction

TRANSACTION_PER_BYTE is 20, so the size of the submitted transaction is itself a cost, independent of what it does. Compact transaction source is cheaper source.

Allowance

Every transaction carries a juice allowance:

  • Specified by the user, or the maximum available if unspecified
  • Capped at 10,000,000, bounding the cost of any single transaction
  • May not exceed what the origin account can actually pay

On a :JUICE failure the origin is charged the full allowance and every state change is rolled back. Running out is not free — it is the most expensive way for a transaction to fail. When execution cost is uncertain, estimate against a local network before submitting.

Price

Juice price lives in the CVM state and is readable from CVM code as *juice-price*. The genesis price is 10 (Constants.INITIAL_JUICE_PRICE, set 2024 and what Protonet runs; CAD007 was aligned to match in #697). A live network's price is whatever its genesis state carries.

CAD007 also specifies dynamic pricing — the price rising under sustained load and decaying towards a hard floor of 1 — but this is not yet implemented: nothing updates *juice-price* after genesis, so treat the price as constant today. Implementation is tracked in #408 / #423.

Dynamic pricing is the intended cryptoeconomic defence: sustaining an attack would mean paying exponentially rising prices, so a burst while prices are low could only delay confirmation, not exclude legitimate transactions.

Pricing New Operations

If you add a CVM op or runtime function, it needs a juice cost.

  • Every op MUST have a fixed positive cost — nothing executes free.
  • An op whose work scales with input size MUST have a cost that scales too.
  • The CVM MUST check sufficient juice before performing O(n) work, and raise :JUICE if it is not there.

That ordering is a security property, not an optimisation. If an attacker can trigger O(n) work having committed less than O(n) of juice, the asymmetry is a denial-of-service vector. Cost should track an upper bound on compute time, storage size or bandwidth — whichever dominates.

Relationship to Memory

A transaction short of memory allowance can buy memory from the pool using its remaining juice — so juice exhaustion can surface as a :MEMORY failure and vice versa. See the memory skill for that interaction.

convex-dev की और Skills

convex-lisp
convex-dev
Convex Lisp भाषा संदर्भ — CVM प्रथाएँ, लाइब्रेरी कोड कॉल करना, एक्टर परिभाषाएँ, जूस और त्रुटि कोड। CVM स्रोत लिखने या डीबग करने के समय उपयोग करें…
ecosystem
convex-dev
Convex पारिस्थितिकी तंत्र में अभिविन्यास — कौन सी चीज़ किस रिपॉज़िटरी में है, स्पेक्स और दस्तावेज़ कहाँ हैं, और कौन से क्लाइंट लाइब्रेरी मौजूद हैं। जब आपको संदर्भ की आवश्यकता हो तो उपयोग करें…
local-network
convex-dev
स्थानीय Convex परीक्षण नेटवर्क विकास के लिए चलाएं। लाइव नेटवर्क के विरुद्ध परिवर्तनों का परीक्षण करते समय, किसी सहकर्मी की समस्या को दोहराते समय, या जब कोई दूरस्थ नेटवर्क उपलब्ध न हो तब उपयोग करें।
protocol-versions
convex-dev
प्रोटोकॉल संस्करण, माइग्रेशन और v1 अपग्रेड — किन सेमेंटिक्स के आधार पर लिखना है, और नेटवर्क को फोर्क किए बिना CVM व्यवहार कैसे बदलें। तब उपयोग करें जब…
etch
convex-dev
Etch स्टोर का निरीक्षण और रखरखाव करें — Convex का सामग्री-संबोधित डेटाबेस। पीयर स्टोरेज की जांच, भ्रष्टाचार का निदान, कचरा संग्रहण, या… के समय उपयोग करें।
trust
convex-dev
Trust मॉनिटर — Convex का composable on-chain प्राधिकरण मॉडल। एक्सेस कंट्रोल लिखते समय, एक्टर फ़ंक्शन प्रतिबंधित करते समय, यह परिभाषित करते समय कि कौन मिंट कर सकता है या…
memory
convex-dev
मेमोरी लेखांकन और भत्ते — ऑन-चेन भंडारण की लागत, और इसे कैसे कम करें और पुनः प्राप्त करें। राज्य वृद्धि के बारे में तर्क करते समय, निदान करते समय उपयोग करें…
peer
convex-dev
Convex पीयर संचालित करें — नेटवर्क जेनेसिस बनाएं, शुरू करें, सूचीबद्ध करें, बैकअप लें, या इंस्टैंशिएट करें। नेटवर्क के विरुद्ध पीयर चलाते समय या नया नेटवर्क सेट करते समय उपयोग करें।