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

Refactor handling submits batch to avoid stuck submits #403

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Sep 20, 2023

Previously round::batch was created on the first submit to the batch and deleted after the batch was flushed. However, there existed a corner case when the batch flush was scheduled but the submit was rejected (for example, a challenge already present in DB) leading to a situation when the batch was never flushed again.

An example of this happening on the devnet-405:
image

Some submits time out because the flush never happens.

This PR mitigates it by:

  • scheduling the flush when the first challenge is already put in the batch,
  • simplifying batch handling by keeping its instance and using batch.Reset() instead of nil-ing it and recreating.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #403 (b2596e0) into develop (38d99cd) will not change coverage.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           develop    #403   +/-   ##
=======================================
  Coverage     74.9%   74.9%           
=======================================
  Files           23      23           
  Lines         1906    1906           
=======================================
  Hits          1429    1429           
  Misses         359     359           
  Partials       118     118           
Files Changed Coverage Δ
registration/round.go 94.3% <100.0%> (ø)

@poszu poszu requested a review from fasmat September 20, 2023 14:39
@poszu poszu added this pull request to the merge queue Sep 20, 2023
Merged via the queue into develop with commit 7cbb631 Sep 20, 2023
12 checks passed
@fasmat fasmat deleted the refactor-round-batch branch September 20, 2023 15:30
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.

2 participants