-
Notifications
You must be signed in to change notification settings - Fork 265
fp updates #732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fp updates #732
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c66be94
fp updates
cpengilly b56cd55
Apply suggestions from code review
cpengilly 8f7c3e4
update explainer based on soyboy feedback
cpengilly 76ec8f0
Merge branch 'fp-updates' of https://github.com/ethereum-optimism/doc…
cpengilly 9565357
lint fixes
cpengilly 499b8ff
Apply suggestions from code review
cpengilly 63b74de
feat: update a bunch of stuff
smartcontracts eb3ed07
address adrian feedback
cpengilly 033f8e4
Apply suggestions from code review
cpengilly fb2546f
Apply suggestions from code review
cpengilly 6f62c55
Update fp-changes.mdx
cpengilly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"overview": "Overview", | ||
"explainer": "Fault Proofs Explainer", | ||
"fp-components": "FP System Components", | ||
"cannon": "FPVM: Cannon", | ||
"mips": "MIPS.sol" | ||
"mips": "MIPS.sol", | ||
"fp-security": "FP Mainnet Security" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
title: Fault Proofs Explainer | ||
lang: en-US | ||
description: Learn about the OP Stack's fault proof system. | ||
--- | ||
|
||
import { Callout } from 'nextra/components' | ||
import Image from 'next/image' | ||
|
||
# Fault Proofs Explainer | ||
|
||
Fault Proofs are an important part of an Optimistic Rollup system like the OP Stack. | ||
Users withdraw ETH and tokens from OP Stack chains like OP Mainnet by submitting a withdrawal proof that shows the withdrawal was actually included in the OP Stack chain. | ||
Fault Proofs allow users to permissionlessly submit and challenge the proposals about the state of an OP Stack chain that are used to prove withdrawals. | ||
|
||
On June 10, 2024, Fault Proofs were officially added to the OP Stack and were activated on OP Mainnet. | ||
This Fault Proofs upgrade moves the OP Stack closer to technical decentralization by: | ||
* allowing anyone to make proposals about the state of the L2 | ||
* allowing anyone to challenge proposals made by other users | ||
* allowing users to send messages from L2 to L1 without the need for a trusted third party | ||
* allowing users to trigger withdrawals from L2 to L1 without the need for a trusted third party | ||
* introducing a modular fault proof design that can easily integrate additional proving mechanisms | ||
|
||
Although the fault proof game is permissionless, the Optimism Security Council acting as the Guardian role provides a backstop in case of a failure in the fault proof game. | ||
Each proposal must wait for a delay period during which the Guardian can prevent invalid proposals from being used to withdraw ETH or tokens through a number of safety hatches. | ||
The Guardian can also choose to shift the system to use a PermissionedDisputeGame, in which only specific `PROPOSER` and `CHALLENGER` roles can submit and challenge proposals. | ||
|
||
## Permissionless Proposals | ||
|
||
"Proposals" or "State Proposals" are claims about the state of an OP Stack chain that are submitted to Ethereum through the `DisputeGameFactory` contract. | ||
Proposals can be used for many things but are most commonly used by end-users to prove that they created a withdrawal on an OP Stack chain. | ||
With the Fault Proofs upgrade to the OP Stack, proposals become permissionless and can be submitted by anyone. | ||
|
||
See the permissionless fault proofs diagram below for more details: | ||
|
||
<br /> | ||
<Image src="/img/op-stack/protocol/fp-permissionless.png" alt="Permissionless Fault Proofs flow" width={700} height={600} /> | ||
|
||
## Permissionless Challenges | ||
|
||
Because anyone can submit a proposal, it's important that invalid proposals can be challenged. | ||
In [Optimistic Rollups like OP Stack Chains](/stack/protocol/rollup/overview) there is a \~1 week challenge period during which users can challenge a proposal if they believe it to be incorrect. | ||
With the Fault Proofs upgrade to the OP Stack, challenges become permissionless and can be submitted by anyone. | ||
Any user can run a node for the OP Stack chain in question and use the `op-challenger` tool to participate in the dispute process. | ||
|
||
## Modular Design and Multi-layer Security | ||
|
||
The OP Stack Fault Proof system is [modular in design](/stack/protocol/fault-proofs/fp-components#system-design--modularity) and lays the groundwork for achieving a "multi-proof" system. This allows the OP Stack to support multiple proof systems alongside the initial [Cannon](/stack/protocol/fault-proofs/cannon) proof system. | ||
With multiple proof systems in place, the OP Stack can be more resilient to potential attacks and bugs in any one proof system. | ||
|
||
Additionally, the following [security safeguards](/stack/protocol/fault-proofs/fp-security) have been built around the game, as follows: | ||
|
||
* An off chain monitoring system has been set up to monitor all proposed roots and ensure they align with the correct state. See [`op-dispute-mon`](https://github.com/ethereum-optimism/optimism/blob/develop/op-dispute-mon/README.md?plain=1) for more details. | ||
* After a root is finalized through a game, an additional delay called the "airgap window" has been added before withdrawals can occur. During this period, the `GUARDIAN` role can reject the root. | ||
* A contract called `DelayedWETH` has been set up to hold the bonds and only allow payouts after a delay, so that bonds can be redirected towards the correct recipient in the case that a game resolves incorrectly. | ||
|
||
## Next Steps | ||
|
||
* Ready to get started? Review the [FP Components](fp-components) to learn how the different components work together to enhance decentralization in the Optimism ecosystem. | ||
* See the [Fault Proof Mainnet Security](/stack/protocol/fault-proofs/fp-security) to understand changes to `OptimismPortal` and `FaultDisputeGame` contracts. | ||
* For more info about how the FP system works under the hood, [check out the specs](https://specs.optimism.io/fault-proof/index.html). | ||
|
||
## FAQs | ||
|
||
### How many steps/transactions are required to settle a dispute (worst-case scenario)? | ||
|
||
The maximum depth of a game is 73, but there can be any number of claims and counter-claims within a dispute game. | ||
Due to the permissionless structure where many different actors can participate in the same game, a single claim may be countered by any number of different counter-claims, effectively combining multiple disputes into a single game. | ||
|
||
### Are there any dependencies to consider when proposing a new state root (in the event of sequencer and proposer failure)? | ||
|
||
Users can complete the full withdrawal cycle without depending on any privileged action. | ||
The Guardian role can override the system by pausing withdrawals, blacklisting games, or reverting to a permissioned system. | ||
As a result, the trust assumption is reduced to requiring only that the Guardian role does not act to intervene, inline with the stage 1 requirements. | ||
### Since the roles of proposer and challenger will be open to everyone, are guides available outlining the best practices for running them? | ||
|
||
It's not expected that normal users run `op-proposer` to regularly propose output roots. | ||
Users would generally just propose a single output root if they need to withdraw and the chain operator isn't proposing outputs for them via direct calls to the `DisputeGameFactory` via Etherscan or using the [`create-game`](https://github.com/ethereum-optimism/optimism/tree/develop/op-challenger#create-game) subcommand of `op-challenger`. | ||
Documentation for `op-challenger` is forthcoming. | ||
|
||
### How much ETH should a chain operator put aside to operate the fault proof system? | ||
|
||
The nominal operating cost of running FPs (i.e., assuming no invalid proposals or malicious actors) will depend on the initial bond set for the `FaultDisputeGame` and the frequency of posting proposals. | ||
Assuming OP Mainnet parameters, where proposals will be posted hourly, that's 0.08 ETH per hour. | ||
Assuming a 7 day dispute window, you'll need roughly 14 ETH (including gas costs) to make proposals. | ||
If chains are using the similar FP deploy configs as OP Mainnet, it's recommended to stick to a 0.08 ETH initial bond. | ||
|
||
However, the capital requirements for operating a FP chain in itself is much larger than 14 ETH. | ||
An operator that secures their chain using FPs must be willing to stake a lot of ETH to secure the chain. | ||
One may decide the capital requirements aren't worth it, and use only a Permissioned FP system. | ||
The capital requirements will be improved in the later stages of Fault Proofs to make it more feasible for smaller chains. | ||
|
||
### How large are the bonds expected to be needed to sustain and win a dispute? | ||
|
||
The bonds are sized based on the anticipated cost to post a counter claim as well as to deter spamming invalid claims. | ||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
As an example, on OP Sepolia, the game [`0xcf8f181497DAD07277781517A76cb131C54A1BEE`](https://sepolia.etherscan.io/address/0xcf8f181497DAD07277781517A76cb131C54A1BEE) shows the escalating bond sizes. | ||
The list-claims subcommand of op-challenger can also provide a good view of the claims in the game: | ||
|
||
``` | ||
./op-challenger/bin/op-challenger list-claims --l1-eth-rpc <SEPOLIA_L1> --game-address 0xcf8f181497DAD07277781517A76cb131C54A1BEE | ||
``` | ||
|
||
cpengilly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
See the [specs](https://specs.optimism.io/experimental/fault-proof/stage-one/bond-incentives.html) for more details. |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.