Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
95c7ef5c
Unverified
Commit
95c7ef5c
authored
Sep 28, 2023
by
inphi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specs: Honest challenger for new resolution
parent
068c89b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
10 deletions
+30
-10
honest-challenger-fdg.md
specs/honest-challenger-fdg.md
+30
-10
No files found.
specs/honest-challenger-fdg.md
View file @
95c7ef5c
...
...
@@ -64,7 +64,13 @@ then it must dispute claims positioned at odd depths in the game tree.
Otherwise, it disputes claims positioned at even depths in the game tree.
This means an honest challenger only responds to claims made by the opposing team.
The next step is to determine whether the claim has a valid commitment (i.e.
`ClaimHash`
).
The next step is to determine if the claim, now known to be for the opposing team,
disputes another claim the honest challenger _agrees_ with.
An honest challenger agrees with a claim iff every other claim along its path to the
root claim commits to a valid
`ClaimHash`
. Thus, an honest challenger avoids supporting
invalid claims on the same team.
The last step is to determine whether the claim has a valid commitment (i.e.
`ClaimHash`
).
If the
`ClaimHash`
matches the honest challenger's at the same trace index, then we
disagree with the claim's stance by moving to
[
defend
](
./fault-dispute-game.md#defend
)
.
Otherwise, the claim is
[
attacked
](
./fault-dispute-game.md#attack
)
.
...
...
@@ -77,18 +83,28 @@ class Team(Enum):
CHALLENGER
=
1
class
Claim
:
parent
:
Claim
position
:
uint64
claim_hash
:
ClaimHash
MAX_TRACE
=
2
**
MAX_GAME_DEPTH
def
agree_with
(
claim
:
Claim
,
chal_trace
:
List
[
ClaimHash
,
MAX_TRACE
]):
if
chal_trace
[
claim
.
trace_index
]
!=
claim
.
claim_hash
:
return
False
grand_parent
=
claim
.
parent
.
parent
if
claim
.
parent
is
not
None
else
None
if
grand_parent
is
not
None
:
return
agree_with
(
grand_parent
)
return
True
def
respond
(
claim
:
Claim
,
chal
:
Team
,
chal_trace
:
List
[
ClaimHash
,
MAX_TRACE
]):
if
depth
(
claim
.
position
)
%
2
!=
chal
.
value
:
if
chal_trace
[
trace_index
(
claim
.
position
)]
==
claim
.
claim_hash
:
defend
()
else
:
attack
()
else
:
pass
# no response
if
claim
.
parent
is
None
or
agree_with
(
claim
.
parent
,
chal_trace
):
if
chal_trace
[
trace_index
(
claim
.
position
)]
==
claim
.
claim_hash
:
defend
()
else
:
attack
()
else
:
pass
# avoid supporting invalid claims on the same team
```
In attack or defense, the honest challenger submit a
`ClaimHash`
corresponding to the
...
...
@@ -111,10 +127,14 @@ invalid `ClaimHash` commitments. Otherwise, it issues a _defense step_.
## Resolution
When the
[
chess clock
](
./fault-dispute-game.md#game-clock
)
of a
`FaultDisputeGame`
team
runs out, the game can be resolved.
The honest challenger does this by calling the
`resolve`
function on the
`FaultDisputeGame`
contract.
When the
[
chess clock
](
./fault-dispute-game.md#game-clock
)
of a
[
subgame root
](
./fault-dispute-game.md#resolution
)
has run out, the subgame can be resolved.
The honest challenger should resolve all subgames in bottom-up order, until the subgame
rooted at the FDG root is resolved.
The honest challenger accomplishes this by calling the
`resolveClaim`
function on the
`FaultDisputeGame`
contract. Once the root claim's subgame is resolved,
the challenger then finally calls the
`resolve`
function to resolve the entire game.
The
`FaultDisputeGame`
does not put a time cap on resolution - because of the liveness
assumption on honest challengers and the bonds attached to the claims they’ve countered,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment