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

Better handle SP1 errors #39

Merged
merged 3 commits into from
Feb 6, 2025
Merged

Better handle SP1 errors #39

merged 3 commits into from
Feb 6, 2025

Conversation

nuke-web3
Copy link
Member

Fixes #36 (at least in part)

@nuke-web3 nuke-web3 self-assigned this Feb 5, 2025
@nuke-web3 nuke-web3 force-pushed the n/handle_program_errors branch from b303b4c to 5e7f22f Compare February 5, 2025 23:21
Comment on lines +581 to +584
// TODO: We cannot clone KeccakInclusionToDataRootProofInput thus we cannot insert into a JobStatus::DataAvalibile(proof_input)
// So we just redo the work from scratch for the DA side as a stupid workaround
job_status =
JobStatus::Failed(e.clone(), Some(JobStatus::DataAvailabilityPending.into()));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not great. Interally to that type,there is a hasher that isn't Copy/Clone we likely can't get (at least directly.

Thinking of other ways that don't need a clone here 🤔

Comment on lines -642 to +701
data_base
.insert(
job_key,
bincode::serialize(&update_status)
.map_err(|e| InclusionServiceError::GeneralError(e.to_string()))?,
)
.map_err(|e| InclusionServiceError::GeneralError(e.to_string()))?;
(&self.queue_db, &self.finished_db)
.transaction(|(queue_tx, finished_tx)| {
finished_tx.remove(job_key.clone())?;
queue_tx.insert(
job_key.clone(),
bincode::serialize(&update_status)
.expect("Always given serializable job status"),
)?;
Ok::<(), sled::transaction::ConflictableTransactionError<InclusionServiceError>>(())
})
.map_err(|e| InclusionServiceError::InternalError(e.to_string()))?;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated fix to ensure we always have jobs finished OR in queue.

@nuke-web3 nuke-web3 marked this pull request as ready for review February 6, 2025 15:04
@nuke-web3 nuke-web3 requested a review from S1nus February 6, 2025 15:04
@nuke-web3 nuke-web3 merged commit dd72cff into main Feb 6, 2025
@nuke-web3 nuke-web3 deleted the n/handle_program_errors branch February 6, 2025 15:05
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.

Handle ZK network errors
1 participant