Commit 9fa619e7 authored by Andreas Bigger's avatar Andreas Bigger

Add the preimage offset to cannon's Proof output

parent 710ca379
...@@ -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.)
......
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment