Skip to content

Commit

Permalink
Fix swallowing ActiveSet creation errors during updates (#5924)
Browse files Browse the repository at this point in the history
## Motivation

When processing an update and creating an ActiveSets, database related errors could be swallowed
  • Loading branch information
ivan4th committed May 10, 2024
1 parent 65d3eed commit 078f85d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,11 @@ func (app *App) listenToUpdates(ctx context.Context) {
Epoch: epoch,
Set: set,
}
activesets.Add(app.db, id, activeSet)
err := activesets.Add(app.db, id, activeSet)
if err != nil && !errors.Is(err, sql.ErrObjectExists) {
app.errCh <- fmt.Errorf("error storing ActiveSet: %w", err)
return nil
}

app.hOracle.UpdateActiveSet(epoch, set)
app.proposalBuilder.UpdateActiveSet(epoch, set)
Expand Down

0 comments on commit 078f85d

Please sign in to comment.