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
5e4996fe
Unverified
Commit
5e4996fe
authored
Jul 27, 2023
by
Adrian Sutton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-challenger: Fix cannon invocation.
parent
9f4c1182
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
executor.go
op-challenger/fault/cannon/executor.go
+4
-3
executor_test.go
op-challenger/fault/cannon/executor_test.go
+14
-10
No files found.
op-challenger/fault/cannon/executor.go
View file @
5e4996fe
...
...
@@ -58,11 +58,12 @@ func (e *Executor) GenerateProof(ctx context.Context, dir string, i uint64) erro
if
err
!=
nil
{
return
fmt
.
Errorf
(
"find starting snapshot: %w"
,
err
)
}
proofIndexStr
:=
strconv
.
FormatUint
(
i
,
10
)
args
:=
[]
string
{
"run"
,
"--input"
,
start
,
"--proof-at"
,
proofIndexStr
,
"--proof-fmt"
,
filepath
.
Join
(
dir
,
proofsDir
,
proofIndexStr
+
".json"
),
"--proof-at"
,
"="
+
strconv
.
FormatUint
(
i
,
10
),
"--stop-at"
,
"="
+
strconv
.
FormatUint
(
i
+
1
,
10
),
"--proof-fmt"
,
filepath
.
Join
(
dir
,
proofsDir
,
"%d.json"
),
"--snapshot-at"
,
"%"
+
strconv
.
FormatUint
(
uint64
(
e
.
snapshotFreq
),
10
),
"--snapshot-fmt"
,
filepath
.
Join
(
e
.
dataDir
,
snapsDir
,
"%d.json"
),
"--"
,
...
...
op-challenger/fault/cannon/executor_test.go
View file @
5e4996fe
...
...
@@ -32,10 +32,12 @@ func TestGenerateProof(t *testing.T) {
return
input
,
nil
}
var
binary
string
var
subcommand
string
args
:=
make
(
map
[
string
]
string
)
executor
.
cmdExecutor
=
func
(
ctx
context
.
Context
,
l
log
.
Logger
,
b
string
,
a
...
string
)
error
{
binary
=
b
for
i
:=
0
;
i
<
len
(
a
);
i
+=
2
{
subcommand
=
a
[
0
]
for
i
:=
1
;
i
<
len
(
a
);
i
+=
2
{
args
[
a
[
i
]]
=
a
[
i
+
1
]
}
return
nil
...
...
@@ -43,15 +45,17 @@ func TestGenerateProof(t *testing.T) {
err
:=
executor
.
GenerateProof
(
context
.
Background
(),
cfg
.
CannonDatadir
,
150
_000_000
)
require
.
NoError
(
t
,
err
)
require
.
Equal
(
t
,
cfg
.
CannonBin
,
binary
)
require
.
Contains
(
t
,
args
,
"--input"
,
input
)
require
.
Contains
(
t
,
args
,
"--proof-at"
,
"150000000"
)
require
.
Contains
(
t
,
args
,
"--snapshot-at"
,
"%500"
)
require
.
Contains
(
t
,
args
,
"--"
,
cfg
.
CannonServer
)
require
.
Contains
(
t
,
args
,
"--l1"
,
cfg
.
L1EthRpc
)
require
.
Contains
(
t
,
args
,
"--l2"
,
cfg
.
CannonL2
)
require
.
Contains
(
t
,
args
,
"--datadir"
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
preimagesDir
))
require
.
Contains
(
t
,
args
,
"--proof-fmt"
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
"150000000.json"
))
require
.
Contains
(
t
,
args
,
"--snapshot-fmt"
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
snapsDir
,
"%d.json"
))
require
.
Equal
(
t
,
"run"
,
subcommand
)
require
.
Equal
(
t
,
input
,
args
[
"--input"
])
require
.
Equal
(
t
,
"=150000000"
,
args
[
"--proof-at"
])
require
.
Equal
(
t
,
"=150000001"
,
args
[
"--stop-at"
])
require
.
Equal
(
t
,
"%500"
,
args
[
"--snapshot-at"
])
require
.
Equal
(
t
,
cfg
.
CannonServer
,
args
[
"--"
])
require
.
Equal
(
t
,
cfg
.
L1EthRpc
,
args
[
"--l1"
])
require
.
Equal
(
t
,
cfg
.
CannonL2
,
args
[
"--l2"
])
require
.
Equal
(
t
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
preimagesDir
),
args
[
"--datadir"
])
require
.
Equal
(
t
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
proofsDir
,
"%d.json"
),
args
[
"--proof-fmt"
])
require
.
Equal
(
t
,
filepath
.
Join
(
cfg
.
CannonDatadir
,
snapsDir
,
"%d.json"
),
args
[
"--snapshot-fmt"
])
}
func
TestRunCmdLogsOutput
(
t
*
testing
.
T
)
{
...
...
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