Skip to content

Commit

Permalink
Fix: Allow multiple quorums in allowlist (Layr-Labs#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Mar 5, 2024
1 parent 780e1be commit 9827a87
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions disperser/apiserver/rate_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,19 @@ func ReadCLIConfig(c *cli.Context) (RateConfig, error) {
log.Printf("invalid allowlist entry: failed to convert throughput from string: %s", allowlistEntry)
continue
}
allowlist[ip] = map[core.QuorumID]PerUserRateInfo{
core.QuorumID(quorumID): {
rateInfoByQuorum, ok := allowlist[ip]
if !ok {
allowlist[ip] = map[core.QuorumID]PerUserRateInfo{
core.QuorumID(quorumID): {
Throughput: common.RateParam(byteRate),
BlobRate: common.RateParam(blobRate * blobRateMultiplier),
},
}
} else {
rateInfoByQuorum[core.QuorumID(quorumID)] = PerUserRateInfo{
Throughput: common.RateParam(byteRate),
BlobRate: common.RateParam(blobRate * blobRateMultiplier),
},
}
}
}

Expand Down

0 comments on commit 9827a87

Please sign in to comment.