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

feat(prover): always use the oracle prover private key when an oracle… #395

Merged
merged 1 commit into from
Sep 19, 2023
Merged
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
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