fix: return error when proof vec is empty instead of submitting empty bytes#2095
Open
amathxbt wants to merge 1 commit into
Open
fix: return error when proof vec is empty instead of submitting empty bytes#2095amathxbt wants to merge 1 commit into
amathxbt wants to merge 1 commit into
Conversation
… bytes legacy_proof_bytes is derived with .first().cloned().unwrap_or_default(). If proof generation somehow produces an empty Vec the default is an empty Vec<u8>, which is then forwarded to the orchestrator as the proof payload. The orchestrator silently rejects the empty submission, the node loses the task reward, and nothing in the log indicates what went wrong. Add a NoProofs variant to SubmitError and return it immediately when proofs_bytes is empty, surfacing the failure clearly in logs and telemetry.
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.
Problem
ProofSubmitter::submit_proofderiveslegacy_proof_byteswith:If
proof_result.proofsis empty for any reason,unwrap_or_default()silently substitutes an emptyVec<u8>. That empty bytes slice is then forwarded to the orchestrator as the proof payload. The orchestrator rejects the empty submission, the node loses the task reward, and nothing in the logs indicates that the proof was empty — the submission path returnsOk.Fix
NoProofsvariant toSubmitError.Err(SubmitError::NoProofs)immediately whenproofs_bytes.is_empty(), before any network call is attempted.This surfaces the failure clearly in logs and lets analytics correctly attribute it as a local error rather than a submission error.