From 13e80f693eb7019d27d128fd02097801c65d0053 Mon Sep 17 00:00:00 2001 From: David Date: Mon, 6 May 2024 18:21:17 +0800 Subject: [PATCH] feat: change proof type --- driver/txlist_decompressor/txlist_decompressor.go | 1 + driver/txlist_decompressor/txlist_decompressor_test.go | 1 + prover/init.go | 2 ++ prover/proof_producer/sgx_producer.go | 8 +++++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/driver/txlist_decompressor/txlist_decompressor.go b/driver/txlist_decompressor/txlist_decompressor.go index 9018af0ac..a26edc1d9 100644 --- a/driver/txlist_decompressor/txlist_decompressor.go +++ b/driver/txlist_decompressor/txlist_decompressor.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" + "github.com/taikoxyz/taiko-client/internal/utils" ) diff --git a/driver/txlist_decompressor/txlist_decompressor_test.go b/driver/txlist_decompressor/txlist_decompressor_test.go index a816b9e5f..a2d676f10 100644 --- a/driver/txlist_decompressor/txlist_decompressor_test.go +++ b/driver/txlist_decompressor/txlist_decompressor_test.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/require" + "github.com/taikoxyz/taiko-client/internal/utils" ) diff --git a/prover/init.go b/prover/init.go index 1406bff57..b1f05bf1e 100644 --- a/prover/init.go +++ b/prover/init.go @@ -110,6 +110,7 @@ func (p *Prover) initProofSubmitters( L1Endpoint: p.cfg.RaikoL1Endpoint, L1BeaconEndpoint: p.cfg.RaikoL1BeaconEndpoint, L2Endpoint: p.cfg.RaikoL2Endpoint, + ProofType: proofProducer.ProofTypeSgx, Dummy: p.cfg.Dummy, } case encoding.TierGuardianID: @@ -118,6 +119,7 @@ func (p *Prover) initProofSubmitters( L1Endpoint: p.cfg.RaikoL1Endpoint, L1BeaconEndpoint: p.cfg.RaikoL1BeaconEndpoint, L2Endpoint: p.cfg.RaikoL2Endpoint, + ProofType: proofProducer.ProofTypeCpu, Dummy: p.cfg.Dummy, }, p.cfg.EnableLivenessBondProof) default: diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go index f306a8dfa..2113b1f6c 100644 --- a/prover/proof_producer/sgx_producer.go +++ b/prover/proof_producer/sgx_producer.go @@ -21,12 +21,18 @@ import ( "github.com/taikoxyz/taiko-client/internal/metrics" ) +const ( + ProofTypeSgx = "sgx" + ProofTypeCpu = "native" +) + // SGXProofProducer generates a SGX proof for the given block. type SGXProofProducer struct { RaikoHostEndpoint string // a proverd RPC endpoint L1Endpoint string // a L1 node RPC endpoint L1BeaconEndpoint string // a L1 beacon node RPC endpoint L2Endpoint string // a L2 execution engine's RPC endpoint + ProofType string // Proof type Dummy bool DummyProofProducer } @@ -161,7 +167,7 @@ func (s *SGXProofProducer) requestProof(opts *ProofRequestOptions) (*RaikoHostOu ID: common.Big1, Method: "proof", Params: []*SGXRequestProofBodyParam{{ - Type: "sgx", + Type: s.ProofType, Block: opts.BlockID, L2RPC: s.L2Endpoint, L1RPC: s.L1Endpoint,