From 1bbb0ce25cfcfc76e56efecec12db2a0126b0e4f Mon Sep 17 00:00:00 2001 From: David Date: Sun, 7 Apr 2024 09:10:48 +0800 Subject: [PATCH] feat(prover_producer): update `SGXRequestProofBodyParam` --- .github/workflows/docker.yml | 2 +- prover/proof_producer/sgx_producer.go | 29 +++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1491c56..faa5ce491 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main] + branches: [main,SGXRequestProofBodyParam] tags: - "v*" diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go index c7294287c..ee4eb03cd 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. @@ -154,13 +162,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, + }, }}, }