diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index b27fd0fdb..1740db935 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -35,6 +35,21 @@ var ( Usage: "RPC endpoint of a Raiko host service", Category: proverCategory, } + RaikoL1Endpoint = &cli.StringFlag{ + Name: "raiko.l1Endpoint", + Usage: "L1 RPC endpoint which will be sent to the Raiko service", + Category: proverCategory, + } + RaikoL1BeaconEndpoint = &cli.StringFlag{ + Name: "raiko.l1BeaconEndpoint", + Usage: "L1 beacon RPC endpoint which will be sent to the Raiko service", + Category: proverCategory, + } + RaikoL2Endpoint = &cli.StringFlag{ + Name: "raiko.l2Endpoint", + Usage: "L2 RPC endpoint which will be sent to the Raiko service", + Category: proverCategory, + } StartingBlockID = &cli.Uint64Flag{ Name: "prover.startingBlockID", Usage: "If set, prover will start proving blocks from the block with this ID", @@ -177,6 +192,9 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ L2WSEndpoint, L2HTTPEndpoint, RaikoHostEndpoint, + RaikoL1Endpoint, + RaikoL1BeaconEndpoint, + RaikoL2Endpoint, L1ProverPrivKey, MinOptimisticTierFee, MinSgxTierFee, diff --git a/prover/config.go b/prover/config.go index a5cb9bd2c..de366e1d7 100644 --- a/prover/config.go +++ b/prover/config.go @@ -54,6 +54,9 @@ type Config struct { Allowance *big.Int GuardianProverHealthCheckServerEndpoint *url.URL RaikoHostEndpoint string + RaikoL1Endpoint string + RaikoL1BeaconEndpoint string + RaikoL2Endpoint string L1NodeVersion string L2NodeVersion string BlockConfirmations uint64 @@ -118,6 +121,21 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { return nil, fmt.Errorf("raiko host not provided") } + 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) + } + return &Config{ L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), @@ -130,6 +148,9 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { AssignmentHookAddress: common.HexToAddress(c.String(flags.ProverAssignmentHookAddress.Name)), L1ProverPrivKey: l1ProverPrivKey, RaikoHostEndpoint: c.String(flags.RaikoHostEndpoint.Name), + RaikoL1Endpoint: raikoL1Endpoint, + RaikoL1BeaconEndpoint: raikoL1BeaconEndpoint, + RaikoL2Endpoint: raikoL2Endpoint, StartingBlockID: startingBlockID, Dummy: c.Bool(flags.Dummy.Name), GuardianProverAddress: common.HexToAddress(c.String(flags.GuardianProver.Name)), diff --git a/prover/init.go b/prover/init.go index 5695bc515..389d0dc92 100644 --- a/prover/init.go +++ b/prover/init.go @@ -106,9 +106,9 @@ func (p *Prover) initProofSubmitters( case encoding.TierSgxID: producer = &proofProducer.SGXProofProducer{ RaikoHostEndpoint: p.cfg.RaikoHostEndpoint, - L1Endpoint: p.cfg.L1HttpEndpoint, - L1BeaconEndpoint: p.cfg.L1BeaconEndpoint, - L2Endpoint: p.cfg.L2HttpEndpoint, + L1Endpoint: p.cfg.RaikoL1Endpoint, + L1BeaconEndpoint: p.cfg.RaikoL1BeaconEndpoint, + L2Endpoint: p.cfg.RaikoL2Endpoint, Dummy: p.cfg.Dummy, } case encoding.TierGuardianID: