Skip to content

Commit

Permalink
fix: no local flags for skipping socket registry, only warn (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen authored and pschork committed Dec 5, 2024
1 parent 035f844 commit 82af794
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions core/eth/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +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
}

contractSocketRegistry, err := socketreg.NewContractSocketRegistry(socketRegistryAddr, t.ethClient)
if err != nil {
t.logger.Error("Failed to fetch SocketRegistry contract", "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
}
}

t.bindings = &ContractBindings{
Expand Down Expand Up @@ -678,6 +680,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))
Expand Down

0 comments on commit 82af794

Please sign in to comment.