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: dispute game v2 specification #266

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: dispute game v2 specification #266

wants to merge 1 commit into from

Conversation

clabby
Copy link
Member

@clabby clabby commented Jul 8, 2024

Overview

Note

Heavy WIP. Needs some fleshing out.

This PR introduces a specification for the Dispute Game V2, featuring:

  1. Improvements to the incentive design.
  2. Optimizations to interactions required to perform the dispute.
  3. Better abstractions for layering multiple bisection operations.
    • Multi-proof support.

Copy link
Member Author

clabby commented Jul 8, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @clabby and the rest of your teammates on Graphite Graphite

@clabby clabby self-assigned this Jul 8, 2024

The Dispute Game V2 is a new version of the dispute game protocol that allows for chaining several
[subcontexts](#isubcontext) together in order to enable multi-proofs. In addition, it features advancements
in the incentive system, mitigating the effects of the ["proof of whale"][pow] issue in the current design.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "current design" won't age well, perhaps "previous design" is better

With branch claims, the cost of the bond now scales with the _length of the branch_, rather than the
_depth of the claim_. That is, branch claims made higher up in the tree cost more to make.

The calculation of the bond is left to the implementor. It _must_ be a pure function of the definition $B(l)$, where
Copy link
Contributor

Choose a reason for hiding this comment

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

We will want to specify the bond function in this document eventually

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we want to get that specific when it comes to the implementation details? The requirement for l being the scalar should be enough to hold the required invariant of the design. Further impl details can be up to the implementor of it.

trace between two blocks. In this `BisectionGame` implementation, the `enterSubcontext` function simply passes the
arguments to the FPVM contract's `step` function to determine validity at the leaf level.

#### `ZKVerifier`
Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Contributor

@ajsutton ajsutton left a comment

Choose a reason for hiding this comment

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

I really like this overall. It gives us a lot more flexibility and is a big improvement on the proof of whale problem. Working through the details of bonds is going to be critical though as we risk making it very expensive to make proposals or wind up with a proof of computational whale problem if its cheap to make the honest actor execute a lot of full cannon runs.


#### Bond Calculation

With branch claims, the cost of the bond now scales with the _length of the branch_, rather than the
Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand correctly, this would mean that the largest bond is paid when first creating the game. That's the single most common operation though since its what op-proposer does so this would very significantly increase the capital requirements for running op-proposer.

Comment on lines +333 to +334
Here, assuming trace extension is active in `[12,16)`, the honest actor may short-circuit this dispute immediately,
without performing further bisection by entering the verifier subcontext with `11` -> `12`. The dishonest actor, on the
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not following how this works. Assuming the malicious user is posting the correct values right up until the last trace index, the value at 12 would be valid and the only invalid claim would be 15. So if the honest actor enters the sub context with 11 -> 12 wouldn't it just resolve that 12 is valid and support the dishonest actor?

Admittedly, the invalid value at trace index15 has been provided by the dishonest actor in gindex 3 so the honest actor could post 7 and 14 and be assured that the subcontext 14->15 will resolve in their favour.


/// @notice Create and enter the subcontext. To be called by the parent context.
/// @param `_opaqueData` - The opaque data passed to the subcontext.
/// @param `opaqueData_` - The opaque return data passed back to the
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Missing end of sentence

Comment on lines +505 to +507
Because of the low-cost to challenge a valid game and require a verification subcontext to be entered, the challenger
is opened up to DoS attack. However, assuming the cost of proving off-chain outweighs the best-case bond, the system
is still economically sound.
Copy link
Contributor

Choose a reason for hiding this comment

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

The need for large bonds here to pay for the cost of running the challenger is directly at odds with the need to keep bonds low to avoid needing huge amounts of capital to run op-proposer.

implemented. The main goal of this change is to create an abstraction for a layered `IDisputeGame` over ordered data,
with each layer being unaware of others.

### `ISubContext`

Choose a reason for hiding this comment

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

I think this is the part of the dispute game which could use the most extra thinking. The reason I have this feeling is because SubContexts feel too similar to our current nested claim structure. It would be nice to do more exploration to see if it is possible or reasonable create a dispute game which has a single flat tree but that itself executes the multi-proofs.

@protolambda has had interesting ideas around how we can shape the dispute tree to achieve really interesting results & I think that it might be possible to reuse some of those designs to achieve the same goal as SubContext but without introducing recursive games which resemble our recursive claims

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it would be great to discuss in-tree (same bisection game) sub-contexts that can serve the encapsulation of proving the interop state-transition in a series of smaller programs to prove. And there's a parallel here to ZK proof folding schemes that may be interesting to look at.

Choose a reason for hiding this comment

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

@protolambda has a DB design which seems like it could be used for this. Adding checkpoints at powers of 2 which are easy to compute so that when we bisect the tree it is easy to retrieve all of the information until you get really deep at which point you generate the specific block trace or the specific block ZKP

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.

5 participants