Commit e81bed16 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6321 from ethereum-optimism/aj/cannon-separate-data

cannon: Include inputs in proof files
parents 5ac54ae2 44222bed
...@@ -88,6 +88,12 @@ type Proof struct { ...@@ -88,6 +88,12 @@ type Proof struct {
Pre common.Hash `json:"pre"` Pre common.Hash `json:"pre"`
Post common.Hash `json:"post"` Post common.Hash `json:"post"`
StateData hexutil.Bytes `json:"state-data"`
ProofData hexutil.Bytes `json:"proof-data"`
OracleKey hexutil.Bytes `json:"oracle-key,omitempty"`
OracleValue hexutil.Bytes `json:"oracle-value,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"`
} }
...@@ -314,6 +320,8 @@ func Run(ctx *cli.Context) error { ...@@ -314,6 +320,8 @@ func Run(ctx *cli.Context) error {
Step: step, Step: step,
Pre: preStateHash, Pre: preStateHash,
Post: postStateHash, Post: postStateHash,
StateData: witness.State,
ProofData: witness.MemProof,
StepInput: witness.EncodeStepInput(), StepInput: witness.EncodeStepInput(),
} }
if witness.HasPreimage() { if witness.HasPreimage() {
...@@ -322,6 +330,8 @@ func Run(ctx *cli.Context) error { ...@@ -322,6 +330,8 @@ func Run(ctx *cli.Context) error {
return fmt.Errorf("failed to encode pre-image oracle input: %w", err) return fmt.Errorf("failed to encode pre-image oracle input: %w", err)
} }
proof.OracleInput = inp proof.OracleInput = inp
proof.OracleKey = witness.PreimageKey[:]
proof.OracleValue = witness.PreimageValue
} }
if err := writeJSON[*Proof](fmt.Sprintf(proofFmt, step), proof, true); err != nil { if err := writeJSON[*Proof](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)
......
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