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

Commit

Permalink
feat(prover): always use the oracle prover private key when an oracle…
Browse files Browse the repository at this point in the history
… prover starting a server (#395)
  • Loading branch information
davidtaikocha committed Sep 19, 2023
1 parent bb1f756 commit a026816
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,6 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) {
return err
}

// Prover server
if p.srv, err = server.New(&server.NewProverServerOpts{
ProverPrivateKey: p.cfg.L1ProverPrivKey,
MinProofFee: p.cfg.MinProofFee,
MaxExpiry: p.cfg.MaxExpiry,
CapacityManager: p.capacityManager,
}); err != nil {
return err
}

// Configs
protocolConfigs, err := p.rpc.TaikoL1.GetConfig(&bind.CallOpts{Context: ctx})
if err != nil {
Expand Down Expand Up @@ -214,6 +204,20 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) {
return err
}

// Prover server
proverServerOpts := &server.NewProverServerOpts{
ProverPrivateKey: p.cfg.L1ProverPrivKey,
MinProofFee: p.cfg.MinProofFee,
MaxExpiry: p.cfg.MaxExpiry,
CapacityManager: p.capacityManager,
}
if p.cfg.OracleProver {
proverServerOpts.ProverPrivateKey = p.cfg.OracleProverPrivateKey
}
if p.srv, err = server.New(proverServerOpts); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit a026816

Please sign in to comment.