Skip to content

fix: return error when proof vec is empty instead of submitting empty bytes#2095

Open
amathxbt wants to merge 1 commit into
nexus-xyz:mainfrom
amathxbt:fix/submitter-empty-proof-bytes
Open

fix: return error when proof vec is empty instead of submitting empty bytes#2095
amathxbt wants to merge 1 commit into
nexus-xyz:mainfrom
amathxbt:fix/submitter-empty-proof-bytes

Conversation

@amathxbt
Copy link
Copy Markdown

@amathxbt amathxbt commented May 7, 2026

Problem

ProofSubmitter::submit_proof derives legacy_proof_bytes with:

let legacy_proof_bytes = proofs_bytes.first().cloned().unwrap_or_default();

If proof_result.proofs is empty for any reason, unwrap_or_default() silently substitutes an empty Vec<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 returns Ok.

Fix

  • Add a NoProofs variant to SubmitError.
  • Return Err(SubmitError::NoProofs) immediately when proofs_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.

… 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.
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.

1 participant