fix validate_share panic after on_set_new_prev_hash in custom-work mode#2156
Open
rx18-eng wants to merge 2 commits into
Open
fix validate_share panic after on_set_new_prev_hash in custom-work mode#2156rx18-eng wants to merge 2 commits into
rx18-eng wants to merge 2 commits into
Conversation
Author
|
@plebhash would appreciate a review from you ! |
Signed-off-by: rx18-eng <remopanda78@gmail.com>
Signed-off-by: rx18-eng <remopanda78@gmail.com>
eef2244 to
7ad4da2
Compare
Author
|
I fixed the failing semver check ! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Body
Closes #2155.
JobStore::deactivate_jobmethod that movesactive_jobintopast_jobsExtendedChannel::on_set_new_prev_hashfalse arm now callsdeactivate_job()beforemark_past_jobs_as_stale(), so the old active goes through past then stale and late shares for it returnStaleinstead of panickingStandardChannel::on_set_new_prev_hashreordered sojob_id_to_target.clear()only runs afteractivate_future_job(...)returns true, so the error path can't corrupt stateexpect("job target must exist")sites invalidate_share(extended.rs:675,standard.rs:597) replaced withok_or(ShareValidationError::InvalidJobId)?Two new tests
test_set_new_prev_hash_without_future_jobs_marks_active_as_staleinextended.rsreproduces the panic from the issue and assertsErr(Stale)after the fixtest_set_new_prev_hash_without_future_jobs_preserves_stateinstandard.rsconfirms state survives the error and the next share validates without panicBoth tests fail with the original panic on unpatched code; full crate suite passes (74/74) after the fix.