Skip to content

Commit

Permalink
Lower rate limits error level from implicit audit to warn
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulentropy committed Aug 15, 2024
1 parent 08170d7 commit 9616e33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions ra/ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -1311,13 +1311,13 @@ func (ra *RegistrationAuthorityImpl) countCertificateIssued(ctx context.Context,
var transactions []ratelimits.Transaction
txns, err := ra.txnBuilder.CertificatesPerDomainSpendOnlyTransactions(regId, orderDomains)
if err != nil {
ra.log.Errf("building rate limit transactions at finalize: %s", err)
ra.log.Warningf("building rate limit transactions at finalize: %s", err)
}
transactions = append(transactions, txns...)

txn, err := ra.txnBuilder.CertificatesPerFQDNSetSpendOnlyTransaction(orderDomains)
if err != nil {
ra.log.Errf("building rate limit transaction at finalize: %s", err)
ra.log.Warningf("building rate limit transaction at finalize: %s", err)
}
transactions = append(transactions, txn)

Expand All @@ -1326,7 +1326,7 @@ func (ra *RegistrationAuthorityImpl) countCertificateIssued(ctx context.Context,
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return
}
ra.log.Errf("spending against rate limits at finalize: %s", err)
ra.log.Warningf("spending against rate limits at finalize: %s", err)
}
}

Expand Down Expand Up @@ -1861,15 +1861,15 @@ func (ra *RegistrationAuthorityImpl) countFailedValidation(ctx context.Context,

txn, err := ra.txnBuilder.FailedAuthorizationsPerDomainPerAccountSpendOnlyTransaction(regId, name)
if err != nil {
ra.log.Errf("building rate limit transaction for the %s rate limit: %s", ratelimits.FailedAuthorizationsPerDomainPerAccount, err)
ra.log.Warningf("building rate limit transaction for the %s rate limit: %s", ratelimits.FailedAuthorizationsPerDomainPerAccount, err)
}

_, err = ra.limiter.Spend(ctx, txn)
if err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return
}
ra.log.Errf("spending against the %s rate limit: %s", ratelimits.FailedAuthorizationsPerDomainPerAccount, err)
ra.log.Warningf("spending against the %s rate limit: %s", ratelimits.FailedAuthorizationsPerDomainPerAccount, err)
}
}

Expand Down
10 changes: 5 additions & 5 deletions wfe2/wfe.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,14 +662,14 @@ func (wfe *WebFrontEndImpl) checkNewAccountLimits(ctx context.Context, ip net.IP

_, err = wfe.limiter.BatchSpend(ctx, txns)
if err != nil {
wfe.log.Errf("checking newAccount limits: %s", err)
wfe.log.Warningf("checking newAccount limits: %s", err)
return nil
}

return func() {
_, err := wfe.limiter.BatchRefund(ctx, txns)
if err != nil {
wfe.log.Errf("refunding newAccount limits: %s", err)
wfe.log.Warningf("refunding newAccount limits: %s", err)
}
}
}
Expand Down Expand Up @@ -2038,7 +2038,7 @@ func (wfe *WebFrontEndImpl) checkNewOrderLimits(ctx context.Context, regId int64

txns, err := wfe.txnBuilder.NewOrderLimitTransactions(regId, names, isRenewal)
if err != nil {
wfe.log.Errf("building new order limit transactions: %v", err)
wfe.log.Warningf("building new order limit transactions: %v", err)
return nil
}

Expand All @@ -2047,14 +2047,14 @@ func (wfe *WebFrontEndImpl) checkNewOrderLimits(ctx context.Context, regId int64
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return nil
}
wfe.log.Errf("checking newOrder limits: %s", err)
wfe.log.Warningf("checking newOrder limits: %s", err)
return nil
}

return func() {
_, err := wfe.limiter.BatchRefund(ctx, txns)
if err != nil {
wfe.log.Errf("refunding newOrder limits: %s", err)
wfe.log.Warningf("refunding newOrder limits: %s", err)
}
}
}
Expand Down

0 comments on commit 9616e33

Please sign in to comment.