Skip to content

WFE: Two changes to NewRegistration key-value rate limits#7258

Merged
beautifulentropy merged 4 commits into
mainfrom
refund-after-check-completion
Jan 23, 2024
Merged

WFE: Two changes to NewRegistration key-value rate limits#7258
beautifulentropy merged 4 commits into
mainfrom
refund-after-check-completion

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Jan 11, 2024

Copy link
Copy Markdown
Member

Make NewRegistration more consistent with the implementation in NewOrder (#7201):

  • Construct transactions just once,
  • use batched spending instead of multiple spend calls, and
  • do not attempt a refund for requests that fail due to RateLimit errors.

Part of #5545

@beautifulentropy beautifulentropy requested a review from a team as a code owner January 11, 2024 22:18
@beautifulentropy beautifulentropy changed the title WFE: Only refund NewRegistration key-value limits after check completion WFE: Fix two issues with key-value rate limit refunds Jan 11, 2024
@beautifulentropy beautifulentropy changed the title WFE: Fix two issues with key-value rate limit refunds WFE: Fix two issues with NewRegistration key-value rate limit refunds Jan 11, 2024
pgporada
pgporada previously approved these changes Jan 12, 2024
@pgporada pgporada requested a review from a team January 12, 2024 16:19
Comment thread wfe2/wfe.go Outdated
Comment thread wfe2/wfe.go
@beautifulentropy beautifulentropy force-pushed the refund-after-check-completion branch from 1c908ce to 7ad61fd Compare January 16, 2024 21:54
@beautifulentropy beautifulentropy changed the title WFE: Fix two issues with NewRegistration key-value rate limit refunds WFE: Two changes to NewRegistration key-value rate limits Jan 17, 2024
@beautifulentropy beautifulentropy force-pushed the refund-after-check-completion branch 2 times, most recently from 9d21e51 to 5d19c16 Compare January 17, 2024 19:29
@beautifulentropy beautifulentropy force-pushed the refund-after-check-completion branch from 5d19c16 to 5f32b90 Compare January 17, 2024 19:32

@aarongable aarongable left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one optional improvement.

Comment thread wfe2/wfe.go
defer func() {
if !newRegistrationSuccessful {
go wfe.refundNewAccountLimits(ctx, ip)
if !newRegistrationSuccessful && !errIsRateLimit {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't touch the newRegistrationSuccessful bool in this PR, so feel free to ignore me, but could this become

if err != nil && !errors.Is(err, berrors.RateLimit) {

? Rather than carrying around these two bools, I think the conditional can be computed here from variables we already have access to.

@beautifulentropy beautifulentropy merged commit 21044c5 into main Jan 23, 2024
@beautifulentropy beautifulentropy deleted the refund-after-check-completion branch January 23, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants