From 6f5dd0b1b83cd41149f18aeb6afb0dd85166d2de Mon Sep 17 00:00:00 2001 From: hopeyen <60078528+hopeyen@users.noreply.github.com> Date: Fri, 6 Dec 2024 01:31:58 +0700 Subject: [PATCH] fix: no local flags for skipping socket registry, only warn (#964) --- core/eth/reader.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/core/eth/reader.go b/core/eth/reader.go index bf5aa5bb0..d494b014b 100644 --- a/core/eth/reader.go +++ b/core/eth/reader.go @@ -166,10 +166,18 @@ func (t *Reader) updateContractBindings(blsOperatorStateRetrieverAddr, eigenDASe return err } + var contractSocketRegistry *socketreg.ContractSocketRegistry socketRegistryAddr, err := contractIRegistryCoordinator.SocketRegistry(&bind.CallOpts{}) if err != nil { - t.logger.Error("Failed to fetch SocketRegistry address", "err", err) - return err + t.logger.Warn("Failed to fetch SocketRegistry address", "err", err) + // TODO: don't panic until there is socket registry deployment + // return err + } else { + contractSocketRegistry, err = socketreg.NewContractSocketRegistry(socketRegistryAddr, t.ethClient) + if err != nil { + t.logger.Error("Failed to fetch SocketRegistry contract", "err", err) + return err + } } contractSocketRegistry, err := socketreg.NewContractSocketRegistry(socketRegistryAddr, t.ethClient) @@ -678,6 +686,9 @@ func (t *Reader) GetReservationWindow(ctx context.Context) (uint32, error) { } func (t *Reader) GetOperatorSocket(ctx context.Context, operatorId core.OperatorID) (string, error) { + if t.bindings.SocketRegistry == nil { + return "", errors.New("socket registry not enabled") + } socket, err := t.bindings.SocketRegistry.GetOperatorSocket(&bind.CallOpts{ Context: ctx, }, [32]byte(operatorId))