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
143e8ff6
Unverified
Commit
143e8ff6
authored
Sep 11, 2023
by
inphi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix challenger logic
parent
a8958868
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
22 deletions
+6
-22
honest-challenger-fdg.md
specs/honest-challenger-fdg.md
+6
-22
No files found.
specs/honest-challenger-fdg.md
View file @
143e8ff6
...
@@ -85,13 +85,7 @@ If the agent determines itself to be a Defender, aiming to delete an output root
...
@@ -85,13 +85,7 @@ If the agent determines itself to be a Defender, aiming to delete an output root
Otherwise, it disputes claims positioned at even depths in the game tree.
Otherwise, it disputes claims positioned at even depths in the game tree.
This means an honest challenger will only respond to claims made by the opposing team.
This means an honest challenger will only respond to claims made by the opposing team.
The next step is to determine if the claim, now determined to be on the opposing team,
The next step is to determine whether the claim has a valid commitment (i.e.
`ClaimHash`
).
disputes another claim it _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 ours at the same trace index, then we disagree with the claim's
If the
`ClaimHash`
matches ours at the same trace index, then we disagree with the claim's
stance by moving to
[
defend
](
./fault-dispute-game.md#defend
)
.
stance by moving to
[
defend
](
./fault-dispute-game.md#defend
)
.
Otherwise, the claim is
[
attacked
](
./fault-dispute-game.md#attack
)
.
Otherwise, the claim is
[
attacked
](
./fault-dispute-game.md#attack
)
.
...
@@ -104,28 +98,18 @@ class Team(Enum):
...
@@ -104,28 +98,18 @@ class Team(Enum):
CHALLENGER
=
1
CHALLENGER
=
1
class
Claim
:
class
Claim
:
parent
:
Claim
position
:
uint64
position
:
uint64
claim_hash
:
ClaimHash
claim_hash
:
ClaimHash
MAX_TRACE
=
2
**
MAX_GAME_DEPTH
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
]):
def
respond
(
claim
:
Claim
,
chal
:
Team
,
chal_trace
:
List
[
ClaimHash
,
MAX_TRACE
]):
if
depth
(
claim
.
position
)
%
2
!=
chal
.
value
:
if
depth
(
claim
.
position
)
%
2
!=
chal
.
value
:
if
claim
.
parent
is
None
or
agree_with
(
claim
.
parent
,
chal_trace
):
if
chal_trace
[
trace_index
(
claim
.
position
)]
==
claim
.
claim_hash
:
if
chal_trace
[
trace_index
(
claim
.
position
)]
==
claim
.
claim_hash
:
defend
()
defend
()
else
:
else
:
attack
()
attack
()
else
:
pass
# no response
else
:
pass
# no response
```
```
In attack or defense, the honest challenger MUST submit a
`ClaimHash`
corresponding to the state
In attack or defense, the honest challenger MUST submit a
`ClaimHash`
corresponding to the state
...
...
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