-
Notifications
You must be signed in to change notification settings - Fork 54
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
feat(contracts): implement OPSuccinctPermissionedFaultDisputeGame
#370
Conversation
|
/// @notice An address that is allowed to challenge games. | ||
address internal immutable CHALLENGER; | ||
/// @notice An address that is allowed to propose games. | ||
address internal immutable PROPOSER; | ||
|
||
modifier onlyChallenger() { | ||
if (msg.sender != CHALLENGER) { | ||
revert BadAuth(); | ||
} | ||
_; | ||
} | ||
|
||
modifier onlyProposer() { | ||
if (msg.sender != PROPOSER) { | ||
revert BadAuth(); | ||
} | ||
_; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One concern I have with this design is that in most practical settings to reach Stage 1, you want to have multiple challengers and proposers.
Do you think it's better to have a pass-through contract where games can be created where this logic can be validated?
Or do you want to allow passing arrays for both of these arguments?
My worry with this design is that it's not easily extensible.
@ratankaliani made a very good point #370 (comment) But in CWIA pattern, we can't have immutable args with types of array or mapping. However, it seems better to have an entrypoint contract that wraps over the Factory since:
|
The
OPSuccinctPermissionedFaultDisputeGame
is a specialized child contract of theOPSuccinctFaultDisputeGame
that implements role-based access control to restrict who can participate in the game. This contract can serve as a fallback in cases where a permissionless system is undesirable or if the existing permissionless system encounters issues.Overview
In a typical fault proof system, multiple entities may freely propose and challenge state roots in order to reach consensus. However, permissionless designs can introduce complexity and costs that some networks might prefer to avoid. By contrast, the
OPSuccinctPermissionedFaultDisputeGame
restricts participation via two new roles: a Proposer and a Challenger.Each relevant interaction—including prove, challenge, resolve—is accessible only to addresses that have been granted one of these roles. Furthermore, the initialize() function is exclusively reserved for the Proposer.
In the event that you wish to switch back to a permissionless approach, the
RESPECTED_GAME_TYPE
parameter in theOptimismPortal
can be changed to switch back.Optimism's implementation
See PermissionedDisputeGame.sol