Skip to content

Commit

Permalink
feat: Reject results and file uploads for timed out jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
bgins committed Feb 18, 2025
1 parent 4902e7f commit 7570f78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/solver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,10 @@ func (solverServer *solverServer) addResult(results data.Result, res corehttp.Re
if deal == nil {
return nil, fmt.Errorf("deal not found")
}
if deal.State == data.GetAgreementStateIndex("JobTimedOut") {
log.Trace().Msgf("attempted results post for timed out job with deal ID: %s", deal.ID)
return nil, fmt.Errorf("job with deal ID %s timed out", deal.ID)
}
signerAddress, err := http.CheckSignature(req)
if err != nil {
log.Error().Err(err).Msgf("error checking signature")
Expand Down Expand Up @@ -595,6 +599,10 @@ func (solverServer *solverServer) uploadFiles(res corehttp.ResponseWriter, req *
log.Error().Msgf("deal not found")
return err
}
if deal.State == data.GetAgreementStateIndex("JobTimedOut") {
log.Trace().Msgf("attempted file upload for timed out job with deal ID: %s", deal.ID)
return fmt.Errorf("job with deal ID %s timed out", deal.ID)
}
signerAddress, err := http.CheckSignature(req)
if err != nil {
log.Error().Err(err).Msgf("error checking signature")
Expand Down

0 comments on commit 7570f78

Please sign in to comment.