diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index f0c802b25..2fba90db1 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -26,12 +26,6 @@ var ( Required: true, Category: proverCategory, } - RaikoHostEndpoint = &cli.StringFlag{ - Name: "raiko.hostEndpoint", - Usage: "RPC endpoint of a Raiko host service", - Required: true, - Category: proverCategory, - } ) // Optional flags used by prover. @@ -46,6 +40,11 @@ var ( Usage: "Path of ZKEVM parameters file to use", Category: proverCategory, } + RaikoHostEndpoint = &cli.StringFlag{ + Name: "raiko.hostEndpoint", + Usage: "RPC endpoint of a Raiko host service", + Category: proverCategory, + } StartingBlockID = &cli.Uint64Flag{ Name: "prover.startingBlockID", Usage: "If set, prover will start proving blocks from the block with this ID", diff --git a/prover/config.go b/prover/config.go index 47da30987..d2730dc98 100644 --- a/prover/config.go +++ b/prover/config.go @@ -100,7 +100,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { if c.IsSet(flags.Allowance.Name) { amt, ok := new(big.Int).SetString(c.String(flags.Allowance.Name), 10) if !ok { - return nil, fmt.Errorf("error setting allowance config value: %v", c.String(flags.Allowance.Name)) + return nil, fmt.Errorf("invalid setting allowance config value: %v", c.String(flags.Allowance.Name)) } allowance = amt @@ -114,6 +114,10 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } } + if !c.IsSet(flags.GuardianProver.Name) && !c.IsSet(flags.RaikoHostEndpoint.Name) { + return nil, fmt.Errorf("raiko host not provided") + } + return &Config{ L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), diff --git a/prover/config_test.go b/prover/config_test.go index e27c62926..8e2c2ede3 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -89,7 +89,7 @@ func (s *ProverTestSuite) TestNewConfigFromCliContextGuardianProver() { })) } -func (s *ProverTestSuite) TestNewConfigFromCliContext_ProverKeyError() { +func (s *ProverTestSuite) TestNewConfigFromCliContextProverKeyError() { app := s.SetupApp() s.ErrorContains(app.Run([]string{ diff --git a/prover/proof_producer/sgx_producer.go b/prover/proof_producer/sgx_producer.go index 591c82b05..504a8b074 100644 --- a/prover/proof_producer/sgx_producer.go +++ b/prover/proof_producer/sgx_producer.go @@ -143,7 +143,7 @@ func (p *SGXProofProducer) callProverDaemon(ctx context.Context, opts *ProofRequ log.Debug("Proof generation output", "output", output) - proof = common.Hex2Bytes(output.Proof) + proof = common.Hex2Bytes(output.Proof[2:]) log.Info( "Proof generated", "height", opts.BlockID,