Commit 1ed7d004 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6588 from ethereum-optimism/refcell/cannon-preimage-offset

feat(cannon): Proof PreimageOffset Field
parents cc5c95b2 132348fe
...@@ -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