Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(prover): fix a SGX proof producer issue (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Dec 18, 2023
1 parent 1750a4b commit cd742f7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
11 changes: 5 additions & 6 deletions cmd/flags/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion prover/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cd742f7

Please sign in to comment.