Skip to content

Commit

Permalink
Make formatting fixes
Browse files Browse the repository at this point in the history
Signed-off-by: litt3 <102969658+litt3@users.noreply.github.com>
  • Loading branch information
litt3 committed Feb 25, 2025
1 parent c44fce7 commit 83c2623
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions api/clients/v2/relay/default_relay_url_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ func NewDefaultRelayUrlProvider(
relayRegistryAddress gethcommon.Address,
) (*DefaultRelayUrlProvider, error) {
relayRegistryContractCaller, err := relayRegistryBindings.NewContractEigenDARelayRegistryCaller(
relayRegistryAddress,
ethClient)
relayRegistryAddress, ethClient)
if err != nil {
return nil, fmt.Errorf("NewContractEigenDARelayRegistryCaller: %w", err)
}
Expand All @@ -47,6 +46,8 @@ func (rup *DefaultRelayUrlProvider) GetRelayUrl(ctx context.Context, relayKey v2

// GetRelayCount gets the number of relays that exist in the registry
func (rup *DefaultRelayUrlProvider) GetRelayCount(ctx context.Context) (uint32, error) {
// NextRelayKey initializes to 0, and is incremented each time a relay is added
// current logic doesn't support removing relays, so NextRelayKey therefore corresponds directly to relay count
relayCount, err := rup.relayRegistryCaller.NextRelayKey(&bind.CallOpts{Context: ctx})
if err != nil {
return 0, fmt.Errorf("get next relay key from EigenDARelayRegistry contract: %w", err)
Expand Down
4 changes: 3 additions & 1 deletion api/clients/v2/relay_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type relayClient struct {
// grpcRelayClients maps relay key to the gRPC client: `map[corev2.RelayKey]relaygrpc.RelayClient`
// these grpc relay clients are used to communicate with individual relays
grpcRelayClients sync.Map
// relayUrlProvider knows how to retrieve the relay URLs, and maintains an internal URL cache
// relayUrlProvider knows how to retrieve the relay URLs
relayUrlProvider relay.RelayUrlProvider
}

Expand Down Expand Up @@ -254,6 +254,8 @@ func (c *relayClient) initOnceGrpcConnection(ctx context.Context, key corev2.Rel
}
c.initOnceMutex.Unlock()

// TODO (litt3): should we implement a way to rebuild connections that break, or fail to initialize? as it currently
// stands, if this initialization fails, or a connection breaks, the relay client will never speak to that relay again
var initErr error
once.Do(
func() {
Expand Down
1 change: 1 addition & 0 deletions core/chainio.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ type Reader interface {
// GetDisperserAddress returns the disperser address with the given ID.
GetDisperserAddress(ctx context.Context, disperserID uint32) (gethcommon.Address, error)

// GetRelayRegistryAddress returns the Address of the EigenDARelayRegistry contract
GetRelayRegistryAddress() gethcommon.Address
}

Expand Down
4 changes: 2 additions & 2 deletions core/eth/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
type ContractBindings struct {
RegCoordinatorAddr gethcommon.Address
ServiceManagerAddr gethcommon.Address
RelayRegistryAddress gethcommon.Address
RelayRegistryAddress gethcommon.Address
DelegationManager *delegationmgr.ContractDelegationManager
OpStateRetriever *opstateretriever.ContractOperatorStateRetriever
BLSApkRegistry *blsapkreg.ContractBLSApkRegistry
Expand Down Expand Up @@ -243,7 +243,7 @@ func (t *Reader) updateContractBindings(blsOperatorStateRetrieverAddr, eigenDASe
t.bindings = &ContractBindings{
ServiceManagerAddr: eigenDAServiceManagerAddr,
RegCoordinatorAddr: registryCoordinatorAddr,
RelayRegistryAddress: relayRegistryAddress,
RelayRegistryAddress: relayRegistryAddress,
AVSDirectory: contractAVSDirectory,
SocketRegistry: contractSocketRegistry,
OpStateRetriever: contractBLSOpStateRetr,
Expand Down
2 changes: 1 addition & 1 deletion inabox/tests/integration_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var (
retrievalClientV2 clientsv2.RetrievalClient
numConfirmations int = 3
numRetries = 0
chainReader core.Reader
chainReader core.Reader

cancel context.CancelFunc
)
Expand Down

0 comments on commit 83c2623

Please sign in to comment.