Skip to content

Commit

Permalink
fix ProverConfig::Validate to validate origin prover's config
Browse files Browse the repository at this point in the history
Signed-off-by: Masanori Yoshida <masanori.yoshida@datachain.jp>
  • Loading branch information
siburu committed Oct 20, 2023
1 parent 0e8f934 commit 53d6981
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions relay/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ func (pc ProverConfig) GetMrenclave() []byte {
}

func (pc ProverConfig) Validate() error {
// origin prover config validation
if err := pc.OriginProver.GetCachedValue().(core.ProverConfig).Validate(); err != nil {
return fmt.Errorf("failed to validate the origin prover's config: %v", err)
}

// lcp prover config validation
mrenclave, err := decodeMrenclaveHex(pc.Mrenclave)
if err != nil {
return err
Expand All @@ -54,6 +60,7 @@ func (pc ProverConfig) Validate() error {
if pc.KeyExpiration == 0 {
return fmt.Errorf("KeyExpiration must be greater than 0")
}

return nil
}

Expand Down

0 comments on commit 53d6981

Please # to comment.