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
9fa619e7
Commit
9fa619e7
authored
Aug 03, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the preimage offset to cannon's Proof output
parent
710ca379
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
24 deletions
+25
-24
README.md
cannon/README.md
+18
-19
run.go
cannon/cmd/run.go
+7
-5
No files found.
cannon/README.md
View file @
9fa619e7
...
@@ -39,25 +39,24 @@ make cannon
...
@@ -39,25 +39,24 @@ make cannon
# Note:
# Note:
# - The L2 RPC is an archive L2 node on OP goerli.
# - The L2 RPC is an archive L2 node on OP goerli.
# - The L1 RPC is a non-archive RPC, also change `--l1.rpckind` to reflect the correct L1 RPC type.
# - The L1 RPC is a non-archive RPC, also change `--l1.rpckind` to reflect the correct L1 RPC type.
./bin/cannon run
./bin/cannon run
\
--pprof
.cpu
--pprof
.cpu
\
--info-at
'%10000000'
--info-at
'%10000000'
\
--proof-at
never
--proof-at
never
\
--input
./state.json
--input
./state.json
\
--
--
../op-program/bin/op-program
\
../op-program/bin/op-program
--l2
http://127.0.0.1:8745
\
--l2
http://127.0.0.1:8745
--l1
http://127.0.0.1:8645
\
--l1
http://127.0.0.1:8645
--l1
.trustrpc
\
--l1
.trustrpc
--l1
.rpckind debug_geth
\
--l1
.rpckind debug_geth
--log
.format terminal
\
--log
.format terminal
--network
goerli
\
--l2
.head 0xedc79de4d616a9100fdd42192224580daee81ea3d6303de8089d48a6c1bf4816
--l1
.head 0x204f815790ca3bb43526ad60ebcc64784ec809bdc3550e82b54a0172f981efab
\
--network
goerli
--l2
.head 0xedc79de4d616a9100fdd42192224580daee81ea3d6303de8089d48a6c1bf4816
\
--l1
.head 0x204f815790ca3bb43526ad60ebcc64784ec809bdc3550e82b54a0172f981efab
--l2
.claim 0x530658ab1b1b3ff4829731fc8d5955f0e6b8410db2cd65b572067ba58df1f2b9
\
--l2
.claim 0x530658ab1b1b3ff4829731fc8d5955f0e6b8410db2cd65b572067ba58df1f2b9
--l2
.blocknumber 8813570
\
--l2
.blocknumber 8813570
--datadir
/tmp/fpp-database
\
--datadir
/tmp/fpp-database
--server
--server
# Add --proof-at '=12345' (or pick other pattern, see --help)
# Add --proof-at '=12345' (or pick other pattern, see --help)
# to pick a step to build a proof for (e.g. exact step, every N steps, etc.)
# to pick a step to build a proof for (e.g. exact step, every N steps, etc.)
...
...
cannon/cmd/run.go
View file @
9fa619e7
...
@@ -91,8 +91,9 @@ type Proof struct {
...
@@ -91,8 +91,9 @@ type Proof struct {
StateData
hexutil
.
Bytes
`json:"state-data"`
StateData
hexutil
.
Bytes
`json:"state-data"`
ProofData
hexutil
.
Bytes
`json:"proof-data"`
ProofData
hexutil
.
Bytes
`json:"proof-data"`
OracleKey
hexutil
.
Bytes
`json:"oracle-key,omitempty"`
OracleKey
hexutil
.
Bytes
`json:"oracle-key,omitempty"`
OracleValue
hexutil
.
Bytes
`json:"oracle-value,omitempty"`
OracleValue
hexutil
.
Bytes
`json:"oracle-value,omitempty"`
OracleOffset
uint32
`json:"oracle-offset,omitempty"`
StepInput
hexutil
.
Bytes
`json:"step-input"`
StepInput
hexutil
.
Bytes
`json:"step-input"`
OracleInput
hexutil
.
Bytes
`json:"oracle-input"`
OracleInput
hexutil
.
Bytes
`json:"oracle-input"`
...
@@ -304,7 +305,7 @@ func Run(ctx *cli.Context) error {
...
@@ -304,7 +305,7 @@ func Run(ctx *cli.Context) error {
}
}
if
snapshotAt
(
state
)
{
if
snapshotAt
(
state
)
{
if
err
:=
writeJSON
[
*
mipsevm
.
State
]
(
fmt
.
Sprintf
(
snapshotFmt
,
step
),
state
,
false
);
err
!=
nil
{
if
err
:=
writeJSON
(
fmt
.
Sprintf
(
snapshotFmt
,
step
),
state
,
false
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to write state snapshot: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to write state snapshot: %w"
,
err
)
}
}
}
}
...
@@ -332,8 +333,9 @@ func Run(ctx *cli.Context) error {
...
@@ -332,8 +333,9 @@ func Run(ctx *cli.Context) error {
proof
.
OracleInput
=
inp
proof
.
OracleInput
=
inp
proof
.
OracleKey
=
witness
.
PreimageKey
[
:
]
proof
.
OracleKey
=
witness
.
PreimageKey
[
:
]
proof
.
OracleValue
=
witness
.
PreimageValue
proof
.
OracleValue
=
witness
.
PreimageValue
proof
.
OracleOffset
=
witness
.
PreimageOffset
}
}
if
err
:=
writeJSON
[
*
Proof
]
(
fmt
.
Sprintf
(
proofFmt
,
step
),
proof
,
true
);
err
!=
nil
{
if
err
:=
writeJSON
(
fmt
.
Sprintf
(
proofFmt
,
step
),
proof
,
true
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to write proof data: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to write proof data: %w"
,
err
)
}
}
}
else
{
}
else
{
...
@@ -344,7 +346,7 @@ func Run(ctx *cli.Context) error {
...
@@ -344,7 +346,7 @@ func Run(ctx *cli.Context) error {
}
}
}
}
if
err
:=
writeJSON
[
*
mipsevm
.
State
]
(
ctx
.
Path
(
RunOutputFlag
.
Name
),
state
,
true
);
err
!=
nil
{
if
err
:=
writeJSON
(
ctx
.
Path
(
RunOutputFlag
.
Name
),
state
,
true
);
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to write state output: %w"
,
err
)
return
fmt
.
Errorf
(
"failed to write state output: %w"
,
err
)
}
}
return
nil
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