Skip to content

Commit

Permalink
Merge branch 'master' into relay-authentication
Browse files Browse the repository at this point in the history
Signed-off-by: Cody Littley <[email protected]>
  • Loading branch information
cody-littley committed Nov 19, 2024
2 parents fb7ec51 + afd5894 commit 6325f0c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
7 changes: 3 additions & 4 deletions relay/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package main

import (
"fmt"
"github.com/Layr-Labs/eigenda/common/geth"
"github.com/Layr-Labs/eigenda/relay/limiter"
"time"

"github.com/Layr-Labs/eigenda/common"
"github.com/Layr-Labs/eigenda/common/aws"
"github.com/Layr-Labs/eigenda/common/geth"
core "github.com/Layr-Labs/eigenda/core/v2"
"github.com/Layr-Labs/eigenda/relay"
"github.com/Layr-Labs/eigenda/relay/cmd/flags"
"github.com/Layr-Labs/eigenda/relay/limiter"
"github.com/urfave/cli"
"time"
)

// Config is the configuration for the relay Server.
Expand Down
4 changes: 0 additions & 4 deletions relay/limiter/chunk_rate_limiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ type ChunkRateLimiter struct {

// per-client limiters

// Note: in its current form, these expose a DOS vector, since an attacker can create many clients IDs
// and force these maps to become arbitrarily large. This will be remedied when auth
// is implemented, as only auth will happen prior to rate limiting.

// perClientOpLimiter enforces per-client rate limits on the maximum rate of GetChunk operations
perClientOpLimiter map[string]*rate.Limiter

Expand Down
2 changes: 1 addition & 1 deletion relay/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ func (s *Server) GetBlob(ctx context.Context, request *pb.GetBlobRequest) (*pb.G
func (s *Server) GetChunks(ctx context.Context, request *pb.GetChunksRequest) (*pb.GetChunksReply, error) {

// TODO(cody-littley):
// - auth
// - timeouts

if len(request.ChunkRequests) <= 0 {
Expand All @@ -233,6 +232,7 @@ func (s *Server) GetChunks(ctx context.Context, request *pb.GetChunksRequest) (*

clientID := string(request.RequesterId)
err = s.chunkRateLimiter.BeginGetChunkOperation(time.Now(), clientID)

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 6325f0c

Please sign in to comment.