diff --git a/disperser/apiserver/config.go b/disperser/apiserver/config.go index a4121427d3..e9c5041057 100644 --- a/disperser/apiserver/config.go +++ b/disperser/apiserver/config.go @@ -8,6 +8,7 @@ import ( "log" "os" "strconv" + "strings" "time" "github.com/Layr-Labs/eigenda/common" @@ -164,9 +165,11 @@ func ReadAllowlistFromFile(f string) (Allowlist, error) { } for _, entry := range allowlistEntries { - rateInfoByQuorum, ok := allowlist[entry.Account] + // normalize account/address to lowercase + account := strings.ToLower(entry.Account) + rateInfoByQuorum, ok := allowlist[account] if !ok { - allowlist[entry.Account] = map[core.QuorumID]PerUserRateInfo{ + allowlist[account] = map[core.QuorumID]PerUserRateInfo{ core.QuorumID(entry.QuorumID): { Name: entry.Name, Throughput: common.RateParam(entry.ByteRate), diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index 578cf5622b..5699271678 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -325,16 +325,10 @@ func (s *DispersalServer) getAccountRate(origin, authenticatedAddress string, qu // Check if the address is in the allowlist if len(authenticatedAddress) > 0 { + // Normalize to non-checksummed (lowercase) address + authenticatedAddress = strings.ToLower(authenticatedAddress) + quorumRates, ok := s.rateConfig.Allowlist[authenticatedAddress] - if !ok { - // check fallback address (non-checksummed) - fallbackAuthenticatedAddress := strings.ToLower(authenticatedAddress) - quorumRates, ok = s.rateConfig.Allowlist[fallbackAuthenticatedAddress] - if ok { - s.logger.Warn("authenticated address found via fallback lookup", "authenticatedAddress", authenticatedAddress, "fallback", fallbackAuthenticatedAddress) - authenticatedAddress = fallbackAuthenticatedAddress - } - } if ok { rateInfo, ok := quorumRates[quorumID] if ok { @@ -351,7 +345,6 @@ func (s *DispersalServer) getAccountRate(origin, authenticatedAddress string, qu } else { s.logger.Warn("authenticated address not found in allowlist", "authenticatedAddress", authenticatedAddress) } - } // Check if the origin is in the allowlist