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

feat(prover): fix a SGX proof producer issue #477

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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