From 41c201937aa5613e3d4d81a3478f2c67a942b387 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 7 Apr 2024 09:22:21 +0800 Subject: [PATCH] feat(prover_producer): update `SGXRequestProofBodyParam` (#691) --- prover/proof_producer/sgx_producer.go | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go index c7294287c..7c99438f5 100644 --- a/prover/proof_producer/sgx_producer.go +++ b/prover/proof_producer/sgx_producer.go @@ -41,13 +41,21 @@ type SGXRequestProofBody struct { // SGXRequestProofBodyParam represents the JSON body of RequestProofBody's `param` field. type SGXRequestProofBodyParam struct { - Type string `json:"type"` - Block *big.Int `json:"block"` - L2RPC string `json:"l2Rpc"` - L1RPC string `json:"l1Rpc"` - L1BeaconRPC string `json:"l1BeaconRpc"` - Prover string `json:"prover"` - Graffiti string `json:"graffiti"` + Type string `json:"proofType"` + Block *big.Int `json:"blockNumber"` + L2RPC string `json:"rpc"` + L1RPC string `json:"l1Rpc"` + L1BeaconRPC string `json:"beaconRpc"` + Prover string `json:"prover"` + Graffiti string `json:"graffiti"` + ProofParam *ProofParam `json:"proofParam"` +} + +// ProofParam represents the JSON body of SGXRequestProofBodyParam's `proofParam` field. +type ProofParam struct { + Setup bool `json:"setup"` + Bootstrap bool `json:"bootstrap"` + Prove bool `json:"prove"` } // SGXRequestProofBodyResponse represents the JSON body of the response of the proof requests. @@ -63,7 +71,6 @@ type SGXRequestProofBodyResponse struct { // RaikoHostOutput represents the JSON body of SGXRequestProofBodyResponse's `result` field. type RaikoHostOutput struct { - Type string `json:"type"` Proof string `json:"proof"` } @@ -154,13 +161,18 @@ func (s *SGXProofProducer) requestProof(opts *ProofRequestOptions) (*RaikoHostOu ID: common.Big1, Method: "proof", Params: []*SGXRequestProofBodyParam{{ - Type: "Sgx", + Type: "sgx", Block: opts.BlockID, L2RPC: s.L2Endpoint, L1RPC: s.L1Endpoint, L1BeaconRPC: s.L1BeaconEndpoint, Prover: opts.ProverAddress.Hex()[2:], Graffiti: opts.Graffiti, + ProofParam: &ProofParam{ + Setup: false, + Bootstrap: true, + Prove: true, + }, }}, }