Skip to content
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: Proofs: AnchorStateRegistry, OptimismPortal incident response improvements #472

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

wildmolasses
Copy link

- Withdrawal transaction's target must not be the OptimismPortal address.
- Withdrawal game's root claim must be equal to the hashed outputRootProof input.
- Must verify that the hash of this withdrawal is stored in the L2toL1MessagePasser contract on L2.
- A withdrawal can only be proven once unless the dispute game it proved against resolves against the favor of the root
Copy link
Contributor

@smartcontracts smartcontracts Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same proof submitter cannot reprove the same withdrawal unless the dispute game previously used to prove the withdrawal is now an invalid game

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and withdrawal was not finalized"

correct?


### `getLatestValidGame`

Returns **latest valid game**, or reverts if there is no **latest valid game**.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns the anchor game if the anchor game is a valid game. Reverts if the anchor game is an invalid game

- Calling game must only register itself (and not some other game).
- TODO: determine any invariants around registry ordering.

### `tryUpdateLatestValidGame`
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### `tryUpdateLatestValidGame`
### `tryUpdateAnchorGame`


Proves a withdrawal transaction.

- Withdrawal game must not be a **maybe valid game**.
Copy link
Contributor

@smartcontracts smartcontracts Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Withdrawal game must not be a **maybe valid game**.
- Withdrawal game must be a **maybe valid game**.


## Top-Level Invariants

- The contract will only assert **valid games** are valid.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be expanded a bit

  • Must always correctly represent the state of a given game (valid, invalid, maybe valid)

are corner cases where the resolved game rebukes its platonic, game-theoretic ideal, resolving incorrectly. The anchor
state registry appreciates this and affords games and their dependents probabalistic validity by enforcing a game
finality delay, and adding additional dependencies like blacklisting and game retirement. These concessions improve the
confidence in resolved games, and calcify the assumptions upon which withdrawals and other dependents rest.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this section articulate the motivations correctly? is it missing anything?


> See [Fault Dispute Game](fault-dispute-game.md)

A dispute game is a contract that resolves an L2 state claim.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If something is (or should) be defined elsewhere, does it still make sense to define it here w/ link?

- Game was created by the dispute game factory.
- Game is not **blacklisted**.
- Game was created while it was the respected game type.
- Game status is not `CHALLENGER_WINS`.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notice I removed the "validity timestamp" condition here -- that created somewhat frustrating clashes when trying to define "anchor game" and "recent valid game," so I refactored the timestamp stuff out to a "retired game" concept where:

  • an anchor game must be a valid game (must not be retired when set but can get retired and will still be valid as its claim and anchor state are still correct)
  • the "recent valid game" is the anchor game but if it's been retired it will throw

does that feel any cleaner?

However, the interface would have to change: instead of isGameValid, we'd use isGameValidAndNotRetired which seems a little clunkier. Any thoughts?


- Existing audit on `FaultDisputeGame`. Note: Existing audit does not yet cover the second property above (that a game
correctly reports whether its game type was the respected game type when created).
- Integration testing.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it appropriate to call integration testing a mitigation?

correctly reports whether its game type was the respected game type when created).
- Integration testing.

### aFDG-002: Fault dispute games with correct claims resolve correctly at some regular rate
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keen on your perspective here, is this a needed dependency for tryUpdateAnchorGame?


#### Mitigations

- Existing incentives in fault proof system design.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very open to suggestions on how to phrase these mitigations!

- Existing audit on the `DisputeGameFactory`.
- Integration testing.

### aDGF-002: Games created by the DisputeGameFactory will be monitored
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumption factors heavily into the 2 assumptions that follow it. Is this correctly articulated?


- Stakeholder incentives.

### aASR-001: Incorrectly resolving games will be blacklisted within the dispute game finality delay period
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually an assumption we're making? If not, what assumptions should we make about blacklisting?


- Stakeholder incentives / processes.

### aASR-002: If a larger dispute game bug is found, all games will be retired before the first incorrect game's dispute game finality delay period has passed
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this assumption correct?


#### Impact

**Severity: Critical**
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just guessing at severity, please make suggestions otherwise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants