Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(taiko-client): remove useless flags about raiko #17302

Merged
merged 9 commits into from
May 24, 2024
21 changes: 0 additions & 21 deletions packages/taiko-client/cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,6 @@ var (
Category: proverCategory,
EnvVars: []string{"RAIKO_HOST"},
}
RaikoL1Endpoint = &cli.StringFlag{
Name: "raiko.l1",
Usage: "L1 RPC endpoint which will be sent to the Raiko service",
Category: proverCategory,
EnvVars: []string{"RAIKO_L1"},
}
RaikoL1BeaconEndpoint = &cli.StringFlag{
Name: "raiko.l1Beacon",
Usage: "L1 beacon RPC endpoint which will be sent to the Raiko service",
Category: proverCategory,
EnvVars: []string{"RAIKO_L1_BEACON"},
}
RaikoL2Endpoint = &cli.StringFlag{
Name: "raiko.l2",
Usage: "L2 RPC endpoint which will be sent to the Raiko service",
Category: proverCategory,
EnvVars: []string{"RAIKO_L2"},
}
StartingBlockID = &cli.Uint64Flag{
Name: "prover.startingBlockID",
Usage: "If set, prover will start proving blocks from the block with this ID",
Expand Down Expand Up @@ -229,9 +211,6 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{
L2WSEndpoint,
L2HTTPEndpoint,
RaikoHostEndpoint,
RaikoL1Endpoint,
RaikoL1BeaconEndpoint,
RaikoL2Endpoint,
L1ProverPrivKey,
MinOptimisticTierFee,
MinSgxTierFee,
Expand Down
20 changes: 0 additions & 20 deletions packages/taiko-client/prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ type Config struct {
Allowance *big.Int
GuardianProverHealthCheckServerEndpoint *url.URL
RaikoHostEndpoint string
RaikoL1Endpoint string
RaikoL1BeaconEndpoint string
RaikoL2Endpoint string
L1NodeVersion string
L2NodeVersion string
BlockConfirmations uint64
Expand Down Expand Up @@ -119,20 +116,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
return nil, errors.New("--prover.l2NodeVersion flag is required if guardian prover is set")
}
}
var (
raikoL1Endpoint = c.String(flags.RaikoL1Endpoint.Name)
raikoL1BeaconEndpoint = c.String(flags.RaikoL1BeaconEndpoint.Name)
raikoL2Endpoint = c.String(flags.RaikoL2Endpoint.Name)
)
if raikoL1Endpoint == "" {
raikoL1Endpoint = c.String(flags.L1HTTPEndpoint.Name)
}
if raikoL1BeaconEndpoint == "" {
raikoL1BeaconEndpoint = c.String(flags.L1BeaconEndpoint.Name)
}
if raikoL2Endpoint == "" {
raikoL2Endpoint = c.String(flags.L2HTTPEndpoint.Name)
}

minOptimisticTierFee, err := utils.GWeiToWei(c.Float64(flags.MinOptimisticTierFee.Name))
if err != nil {
Expand Down Expand Up @@ -176,9 +159,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
ProverSetAddress: common.HexToAddress(c.String(flags.ProverSetAddress.Name)),
L1ProverPrivKey: l1ProverPrivKey,
RaikoHostEndpoint: c.String(flags.RaikoHostEndpoint.Name),
RaikoL1Endpoint: raikoL1Endpoint,
RaikoL1BeaconEndpoint: raikoL1BeaconEndpoint,
RaikoL2Endpoint: raikoL2Endpoint,
StartingBlockID: startingBlockID,
Dummy: c.Bool(flags.Dummy.Name),
GuardianProverMinorityAddress: common.HexToAddress(c.String(flags.GuardianProverMinority.Name)),
Expand Down
3 changes: 0 additions & 3 deletions packages/taiko-client/prover/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ func (p *Prover) initProofSubmitters(
case encoding.TierSgxID:
producer = &proofProducer.SGXProofProducer{
RaikoHostEndpoint: p.cfg.RaikoHostEndpoint,
L1Endpoint: p.cfg.RaikoL1Endpoint,
L1BeaconEndpoint: p.cfg.RaikoL1BeaconEndpoint,
L2Endpoint: p.cfg.RaikoL2Endpoint,
ProofType: proofProducer.ProofTypeSgx,
Dummy: p.cfg.Dummy,
}
Expand Down
29 changes: 10 additions & 19 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,19 @@ const (
// 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
}

// RaikoRequestProofBody represents the JSON body for requesting the proof.
type RaikoRequestProofBody struct {
L2RPC string `json:"rpc"`
L1RPC string `json:"l1_rpc"`
L1BeaconRPC string `json:"beacon_rpc"`
Block *big.Int `json:"block_number"`
Prover string `json:"prover"`
Graffiti string `json:"graffiti"`
Type string `json:"proof_type"`
SGX *SGXRequestProofBodyParam `json:"sgx"`
RISC0 RISC0RequestProofBodyParam `json:"risc0"`
Block *big.Int `json:"block_number"`
Prover string `json:"prover"`
Graffiti string `json:"graffiti"`
Type string `json:"proof_type"`
SGX *SGXRequestProofBodyParam `json:"sgx"`
RISC0 RISC0RequestProofBodyParam `json:"risc0"`
}

// SGXRequestProofBodyParam represents the JSON body of RaikoRequestProofBody's `sgx` field.
Expand Down Expand Up @@ -164,13 +158,10 @@ func (s *SGXProofProducer) callProverDaemon(ctx context.Context, opts *ProofRequ
// requestProof sends a RPC request to proverd to try to get the requested proof.
func (s *SGXProofProducer) requestProof(opts *ProofRequestOptions) (*RaikoRequestProofBodyResponse, error) {
reqBody := RaikoRequestProofBody{
Type: s.ProofType,
Block: opts.BlockID,
L2RPC: s.L2Endpoint,
L1RPC: s.L1Endpoint,
L1BeaconRPC: s.L1BeaconEndpoint,
Prover: opts.ProverAddress.Hex()[2:],
Graffiti: opts.Graffiti,
Type: s.ProofType,
Block: opts.BlockID,
Prover: opts.ProverAddress.Hex()[2:],
Graffiti: opts.Graffiti,
SGX: &SGXRequestProofBodyParam{
Setup: false,
Bootstrap: false,
Expand Down
Loading