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
a4f00f61
Unverified
Commit
a4f00f61
authored
Sep 20, 2023
by
Ethen Pociask
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/epociask/optimism
into indexer.client
parents
ef98e305
c5732fc5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
22 deletions
+33
-22
Makefile
Makefile
+2
-4
Makefile
op-bootnode/Makefile
+12
-0
main.go
op-bootnode/cmd/main.go
+5
-10
game.go
op-challenger/game/fault/types/game.go
+14
-8
No files found.
Makefile
View file @
a4f00f61
...
...
@@ -89,10 +89,8 @@ devnet-up:
@
if
[
!
-e
op-program/bin
]
;
then
\
make cannon-prestate
;
\
fi
$(
shell
./ops/scripts/newer-file.sh .devnet/allocs-l1.json ./packages/contracts-bedrock
)
if
[
$
(
.SHELLSTATUS
)
-ne
0
]
;
then
\
make devnet-allocs
;
\
fi
./ops/scripts/newer-file.sh .devnet/allocs-l1.json ./packages/contracts-bedrock
\
||
make devnet-allocs
PYTHONPATH
=
./bedrock-devnet python3 ./bedrock-devnet/main.py
--monorepo-dir
=
.
.PHONY
:
devnet-up
...
...
op-bootnode/Makefile
View file @
a4f00f61
...
...
@@ -10,5 +10,17 @@ LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
op-bootnode
:
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-bootnode ./cmd
clean
:
rm
-f
bin/op-bootnode
test
:
go
test
-v
./...
lint
:
golangci-lint run
-E
goimports,sqlclosecheck,bodyclose,asciicheck,misspell,errorlint
--timeout
5m
-e
"errors.As"
-e
"errors.Is"
./...
.PHONY
:
\
op-bootnode
\
clean
\
test
\
lint
op-bootnode/cmd/main.go
View file @
a4f00f61
...
...
@@ -3,21 +3,16 @@ package main
import
(
"os"
"github.com/ethereum-optimism/optimism/op-bootnode/bootnode"
"github.com/ethereum-optimism/optimism/op-bootnode/flags"
"github.com/ethereum/go-ethereum/log"
"github.com/urfave/cli/v2"
"github.com/ethereum-optimism/optimism/op-bootnode/bootnode"
"github.com/ethereum-optimism/optimism/op-bootnode/flags"
oplog
"github.com/ethereum-optimism/optimism/op-service/log"
)
func
main
()
{
// Set up logger with a default INFO level in case we fail to parse flags,
// otherwise the final critical log won't show what the parsing error was.
log
.
Root
()
.
SetHandler
(
log
.
LvlFilterHandler
(
log
.
LvlInfo
,
log
.
StreamHandler
(
os
.
Stdout
,
log
.
TerminalFormat
(
true
)),
),
)
oplog
.
SetupDefaults
()
app
:=
cli
.
NewApp
()
app
.
Flags
=
flags
.
Flags
...
...
op-challenger/game/fault/types/game.go
View file @
a4f00f61
...
...
@@ -51,6 +51,10 @@ type extendedClaim struct {
type
gameState
struct
{
agreeWithProposedOutput
bool
root
claimEntry
// contractIndicies maps a contract index to it's extended claim.
// This is used to perform O(1) parent lookups.
contractIndicies
map
[
int
]
*
extendedClaim
// claims maps a claim entry to it's extended claim.
claims
map
[
claimEntry
]
*
extendedClaim
depth
uint64
}
...
...
@@ -59,15 +63,18 @@ type gameState struct {
// The provided [Claim] is used as the root node.
func
NewGameState
(
agreeWithProposedOutput
bool
,
root
Claim
,
depth
uint64
)
*
gameState
{
claims
:=
make
(
map
[
claimEntry
]
*
extendedClaim
)
parents
:=
make
(
map
[
int
]
*
extendedClaim
)
rootClaimEntry
:=
makeClaimEntry
(
root
)
claims
[
rootClaimEntry
]
=
&
extendedClaim
{
self
:
root
,
children
:
make
([]
claimEntry
,
0
),
}
parents
[
root
.
ContractIndex
]
=
claims
[
rootClaimEntry
]
return
&
gameState
{
agreeWithProposedOutput
:
agreeWithProposedOutput
,
root
:
rootClaimEntry
,
claims
:
claims
,
contractIndicies
:
parents
,
depth
:
depth
,
}
}
...
...
@@ -106,10 +113,12 @@ func (g *gameState) Put(claim Claim) error {
return
errors
.
New
(
"no parent claim"
)
}
parent
.
children
=
append
(
parent
.
children
,
makeClaimEntry
(
claim
))
g
.
claims
[
makeClaimEntry
(
claim
)]
=
&
extendedClaim
{
claimWithExtension
:
=
&
extendedClaim
{
self
:
claim
,
children
:
make
([]
claimEntry
,
0
),
}
g
.
claims
[
makeClaimEntry
(
claim
)]
=
claimWithExtension
g
.
contractIndicies
[
claim
.
ContractIndex
]
=
claimWithExtension
return
nil
}
...
...
@@ -150,11 +159,8 @@ func (g *gameState) getParent(claim Claim) *extendedClaim {
if
claim
.
IsRoot
()
{
return
nil
}
// TODO(inphi): refactor gameState for faster parent lookups
for
_
,
c
:=
range
g
.
claims
{
if
c
.
self
.
ContractIndex
==
claim
.
ParentContractIndex
{
return
c
}
if
parent
,
ok
:=
g
.
contractIndicies
[
claim
.
ParentContractIndex
];
ok
{
return
parent
}
return
nil
}
...
...
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