Skip to content

Commit

Permalink
docs: add gas_costs.md (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
fakedev9999 authored Feb 22, 2025
1 parent cd21439 commit b13f7ef
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- [Deploy FP Contracts](./fault_proofs/deploy.md)
- [How to run the FP Proposer](./fault_proofs/proposer.md)
- [How to run the FP Challenger](./fault_proofs/challenger.md)
- [Gas Costs](./fault_proofs/gas_costs.md)
- [Experimental](./experimental/intro.md)
- [OptimismPortalV2](./experimental/optimism-portal-v2.md)
- [FAQ](./faq.md)
Expand Down
40 changes: 40 additions & 0 deletions book/fault_proofs/gas_costs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Gas Costs

For the most accurate gas estimates, always test with your specific use case and conditions.

Here are the typical gas costs for key operations in the fault proof system:

### Game Creation (Propose)
Creating a new game through the factory costs approximately 330,000 gas. This includes:
- Factory proxy delegation (~25,000 gas)
- Game proxy creation (~44,000 gas)
- Game initialization (~175,000 gas)
- Event emissions and state updates

### Challenge
Challenging a game costs approximately 85,000 gas. This includes:
- State validation checks
- Updating game status
- Setting challenge deadline
- Recording challenger address
- Event emissions

### Proving
Proving a game costs approximately 280,000~300,000 gas. This includes:
- Proof verification
- State updates
- Event emissions

### Resolution
Resolving a game costs approximately 85,000 gas for a standard resolution. This includes:
- Parent game validation
- Status checks and updates
- Bond distribution calculations
- Event emissions

### Credit Claiming
Claiming credit (bonds/rewards) costs approximately 85,000 gas. This includes:
- Game finalization checks
- Credit balance updates
- ETH transfers
- Event emissions

0 comments on commit b13f7ef

Please sign in to comment.