📖
Dev Documents
  • README
  • Basic Concepts
    • TEA Developer Prerequisites
    • The TEA Economic Revolution for Developers
    • The Future of Layer-2s
    • What Makes a Web3 App?
    • Magic of the State Machine
  • Step by Step Tutorial
    • Install Dev Environment
    • Hello World
      • Step 1: Build sample-actor and Run Unit Test
      • Step 2: Start the Local Dev Environment
      • Sample Actor Code Walkthrough
      • Sample Front-end Code Walkthrough
      • 025_understand_request_and_response
    • Deploy Hello World on Testnet
    • Add Login Feature
      • Sample-actor Code Walkthrough - Login Branch
        • tea_sdk_utils
      • Sample Front-end Walkthrough - Login Branch
    • SQL
      • Sample Txn Executor
      • Sample Actor
      • Sample Front-end
    • Reward Fund Transfer
      • Sample Txn Executor
    • Retweet Task
      • Retweet Frontend
      • Retweet Sample Actor
      • Retweet Txn Executor
      • Retweet FAQ
    • Gas Fees
      • Query logs
      • A deep dive into gas measurement and settlement
    • Summary
  • Billing
    • Billing FAQ
    • Gas Fee Billing
    • Gas & Fuse Limits
    • Local Debugging Environment
    • State Maintainer Billing
    • TApp Billing
  • Example TApps
  • Advanced TApps
    • TEA Party TApp Intro
    • TEA Party Code Walkthrough
  • Functions
    • Actors vs Functions
    • Function Calls Between Native & Wasm
    • Native vs Wasm Functions
  • Glossary
    • Actor
    • Adapter
    • App AES Key
    • AuthKey
    • back_end_actor
    • Birth Control
    • Blockchain Listener
    • Capability
    • CML Auctions
    • Commands
    • Consensus
    • Context
    • Conveyor
    • Conveyor: Mutable vs Immutable
    • enclave
    • Followup
    • Front-end
    • GlueSQL
    • GPS
    • Hosting Actor Handlers
    • Hosting CML
    • hosting_profitability
    • Magic of WASM
    • mini-runtime
    • OrbitDb
    • Order of Txns
    • party-actor
    • party-fe
    • Party-state-actor
    • Providers
    • Public Service
    • queries
    • Remote Attestation
    • Staking to Hosting CML
    • Staking to TApp
    • State
    • State Machine
    • State Machine Actor
    • State Machine Replica
    • TEA ID
    • TPM
    • Transactions
    • VMH - Virtual Messaging Hub
    • Where Messages are Stored
Powered by GitBook
On this page
  1. Billing

Gas & Fuse Limits

PreviousGas Fee BillingNextLocal Debugging Environment

Last updated 1 year ago

The TEA Project uses a fuse design to ensure that developer's code doesn't use more gas than expected (e.g. infinite loops, recursion).

In the TEA Project design, there's a soft limit known as the gas limit in addition to a hard limit where the fuse kicks in.

  • The end-user has a gas limit which they acknowledge they're responsible for when using the TApp.

  • The developer has a security deposit that's charged whenever an actor uses more than the gas limit up until the fuse point where their entire security deposit is slashed.

Each actor has its own security deposit that the developer must fund. These security deposits correlate to the memory quota of the actor which is the max amount of memory that actor can use. This memory quota is set by the TEA Project and is the same for each actor. The larger the memory quota, the higher the security deposit.

The fuse limit sits above the gas limit and is also set by the TEA Project.

The following table summarizes what happens when these two levels, gas limit and fuse, are breached.

Exit Stage
Exit Status
Payment Responsibility

Up to & including the gas limit.

Actor exits normally, memory is released.

End-user pays for any gas amount up to the gas limit.

Exceeded gas limit but not yet reached the fuse level.

Actor exits normally, memory is released.

Developer pays for any gas amount above the gas limit, which is paid to the hosting miner.

Fuse is tripped.

Actor is terminated by the mini runtime, and memory is set to be garbage collected.

Dev deposit is slashed completely when fuse is tripped and is paid to the hosting miner.

The developer can run their code in a to get an idea of each actor’s memory usage as well as test for edge cases which cause high utilization.

test environment