Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalize allowlist lookups to use lowercase non-checksummed authenticated address #838

Merged
merged 4 commits into from
Oct 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,15 @@ func (s *DispersalServer) getAccountRate(origin, authenticatedAddress string, qu
// Check if the address is in the allowlist
if len(authenticatedAddress) > 0 {
quorumRates, ok := s.rateConfig.Allowlist[authenticatedAddress]
pschork marked this conversation as resolved.
Show resolved Hide resolved
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 {
Expand All @@ -339,7 +348,10 @@ func (s *DispersalServer) getAccountRate(origin, authenticatedAddress string, qu
rates.Name = rateInfo.Name
return rates, key, nil
}
} else {
s.logger.Warn("authenticated address not found in allowlist", "authenticatedAddress", authenticatedAddress)
}

}

// Check if the origin is in the allowlist
Expand Down
Loading