Repository navigation
fix(bb-prover): replace a dead pooled bb verifier, by letting the instance heal itself #354
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
5a6ae4d
fix(bb-prover): evict dead bb instances from the BBJsFactory pool
fcarreiro edc4669
fix(bb-prover): report a dead bb verifier as unavailable, not as an i…
fcarreiro 380f299
fix(bb-prover): replace a dead borrowed bb instance on return and kee…
fcarreiro b615355
docs(bb-prover): state that verifyProof rejects when a proof cannot b…
fcarreiro bea5d94
fix(bb-prover): re-check waiting pool borrowers so a failed spawn can…
fcarreiro 6511439
fix(bb-prover): spawn no pooled bb instance after the factory is dest…
fcarreiro b2da317
fix(bb-prover): replace dead pooled bb instances from a periodic main…
fcarreiro 0f4d7cc
fix(bb-prover): destroy dead pooled bb instances a borrow dropped whe…
fcarreiro 0c55cd3
test(bb-prover): drop a pool test that the failed-spawn waiting test …
fcarreiro d644fd1
refactor(bb-prover): track borrowed pooled bb instances with a counte…
fcarreiro a25e7fc
refactor(bb-prover): count pooled bb instances with a single counter
fcarreiro e15069b
refactor(bb-prover): let the bb instance replace its own process, not…
charlielye effd9ca
fix(bb-prover): honour the retry flag on the proving path too
charlielye b8657fd
fix(bb-prover): a pool that fails to start must not wedge the factory
charlielye a1c1f77
test(bb-prover): fail every spawn attempt in the per-call unavailable…
charlielye 7a1f72f
refactor(bb-prover): share the retry check, and let the verifier opt …
charlielye 1962f60
fix(bb-prover): race pool startup against destroy only while the pool…
charlielye faad42f
refactor(bb-prover): make the bb.js pool a queue of slots that start …
charlielye 5948da5
test(bb-prover): gate the start in the pool shutdown tests with promi…
charlielye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Written by Claude on behalf of Facundo)
Ideally shutdown wouldn't wait here. Suppose a verification is starting this slot's bb when the node stops.
QueuedIVCVerifier.stop()destroys the factory and then waits inqueue.end()for that verification. The verification stays on thisawaituntil bb.js gives up the start, which takes up toSTARTUP_TIMEOUT_MS, 60 s. The class comment documents this and the shutdown test pins it, so it's deliberate, but a node stuck on a slow bb start then stops slowly too.To avoid the wait without bringing back the leak, race only the start against destruction, and detach the listener when the start settles. For example,
once('destroyed')on anEventEmitterbefore the start, andoffin afinally. Then nothing stays attached after a borrow, and a borrow that finds its slot started already doesn't race at all. On destroy the borrow releases the slot and throws. The abandoned start still has to destroy whatever it produces, e.g.void start.then(instance => instance.destroy(), () => {}).Not blocking.