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
34b26718
Unverified
Commit
34b26718
authored
Aug 29, 2023
by
mergify[bot]
Committed by
GitHub
Aug 29, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into aj/challenger-server-in-docker
parents
4f550389
d8526825
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
8 deletions
+26
-8
player.go
op-challenger/game/fault/player.go
+24
-6
player_test.go
op-challenger/game/fault/player_test.go
+1
-1
rollup-node-p2p.md
specs/rollup-node-p2p.md
+1
-1
No files found.
op-challenger/game/fault/player.go
View file @
34b26718
...
...
@@ -18,9 +18,7 @@ import (
"github.com/ethereum/go-ethereum/log"
)
type
Actor
interface
{
Act
(
ctx
context
.
Context
)
error
}
type
actor
func
(
ctx
context
.
Context
)
error
type
GameInfo
interface
{
GetGameStatus
(
context
.
Context
)
(
types
.
GameStatus
,
error
)
...
...
@@ -28,7 +26,7 @@ type GameInfo interface {
}
type
GamePlayer
struct
{
a
gent
A
ctor
a
ct
a
ctor
agreeWithProposedOutput
bool
loader
GameInfo
logger
log
.
Logger
...
...
@@ -53,6 +51,25 @@ func NewGamePlayer(
loader
:=
NewLoader
(
contract
)
status
,
err
:=
loader
.
GetGameStatus
(
ctx
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to fetch game status: %w"
,
err
)
}
if
status
!=
types
.
GameStatusInProgress
{
logger
.
Info
(
"Game already resolved"
,
"status"
,
status
)
// Game is already complete so skip creating the trace provider, loading game inputs etc.
return
&
GamePlayer
{
logger
:
logger
,
loader
:
loader
,
agreeWithProposedOutput
:
cfg
.
AgreeWithProposedOutput
,
completed
:
true
,
// Act function does nothing because the game is already complete
act
:
func
(
ctx
context
.
Context
)
error
{
return
nil
},
},
nil
}
gameDepth
,
err
:=
loader
.
FetchGameDepth
(
ctx
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"failed to fetch the game depth: %w"
,
err
)
...
...
@@ -88,10 +105,11 @@ func NewGamePlayer(
}
return
&
GamePlayer
{
a
gent
:
NewAgent
(
loader
,
int
(
gameDepth
),
provider
,
responder
,
updater
,
cfg
.
AgreeWithProposedOutput
,
logger
)
,
a
ct
:
NewAgent
(
loader
,
int
(
gameDepth
),
provider
,
responder
,
updater
,
cfg
.
AgreeWithProposedOutput
,
logger
)
.
Act
,
agreeWithProposedOutput
:
cfg
.
AgreeWithProposedOutput
,
loader
:
loader
,
logger
:
logger
,
completed
:
status
!=
types
.
GameStatusInProgress
,
},
nil
}
...
...
@@ -102,7 +120,7 @@ func (g *GamePlayer) ProgressGame(ctx context.Context) bool {
return
true
}
g
.
logger
.
Trace
(
"Checking if actions are required"
)
if
err
:=
g
.
a
gent
.
A
ct
(
ctx
);
err
!=
nil
{
if
err
:=
g
.
act
(
ctx
);
err
!=
nil
{
g
.
logger
.
Error
(
"Error when acting on game"
,
"err"
,
err
)
}
if
status
,
err
:=
g
.
loader
.
GetGameStatus
(
ctx
);
err
!=
nil
{
...
...
op-challenger/game/fault/player_test.go
View file @
34b26718
...
...
@@ -157,7 +157,7 @@ func setupProgressGameTest(t *testing.T, agreeWithProposedRoot bool) (*testlog.C
logger
.
SetHandler
(
handler
)
gameState
:=
&
stubGameState
{
claimCount
:
1
}
game
:=
&
GamePlayer
{
a
gent
:
gameState
,
a
ct
:
gameState
.
Act
,
agreeWithProposedOutput
:
agreeWithProposedRoot
,
loader
:
gameState
,
logger
:
logger
,
...
...
specs/rollup-node-p2p.md
View file @
34b26718
...
...
@@ -147,7 +147,7 @@ TODO: the connection gater does currently not gate by IP address on the dial Acc
#### Transport security
[
Libp2p-noise
][
libp2p-noise
]
,
`XX`
handshake, with the
the
`secp256k1`
P2P identity, as popularized in Eth2.
[
Libp2p-noise
][
libp2p-noise
]
,
`XX`
handshake, with the
`secp256k1`
P2P identity, as popularized in Eth2.
The TLS option is available as well, but
`noise`
should be prioritized in negotiation.
#### Protocol negotiation
...
...
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