From 3794caf8c0b3a6cc0d4b0692b0ca69e57fcabc05 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 11 Jan 2024 23:47:59 +0800 Subject: [PATCH] feat(prover): check guardian prover contract address (#497) --- prover/prover.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prover/prover.go b/prover/prover.go index dec75dcab..75058d0e2 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -297,6 +297,11 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { // Guardian prover heartbeat sender if p.IsGuardianProver() { + // Check guardian prover contract address is correct. + if _, err := p.rpc.GuardianProver.MinGuardians(&bind.CallOpts{Context: ctx}); err != nil { + return fmt.Errorf("failed to get MinGuardians from guardian prover contract: %w", err) + } + p.guardianProverSender = guardianproversender.New( p.cfg.L1ProverPrivKey, p.cfg.GuardianProverHealthCheckServerEndpoint,