Skip to content

Commit

Permalink
Return error instead of overriding that with "unhealthy" in readers (#…
Browse files Browse the repository at this point in the history
…598)

Downstream functions should return errors when errors are returned when
calling RPC.
Otherwise, ChainHealthcheck will mark incorrectly chain as unhealthy.
  • Loading branch information
mateusz-sekara authored Mar 8, 2024
1 parent 34f74d3 commit 57d3de5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,7 @@ func (c *CommitStore) IsDestChainHealthy(context.Context) (bool, error) {
func (c *CommitStore) IsDown(ctx context.Context) (bool, error) {
unPausedAndHealthy, err := c.commitStore.IsUnpausedAndARMHealthy(&bind.CallOpts{Context: ctx})
if err != nil {
// If we cannot read the state, assume the worst
c.lggr.Errorw("Unable to read CommitStore IsUnpausedAndARMHealthy", "err", err)
return true, nil
return true, err
}
return !unPausedAndHealthy, nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,7 @@ func (c *CommitStore) IsDestChainHealthy(context.Context) (bool, error) {
func (c *CommitStore) IsDown(ctx context.Context) (bool, error) {
unPausedAndHealthy, err := c.commitStore.IsUnpausedAndARMHealthy(&bind.CallOpts{Context: ctx})
if err != nil {
// If we cannot read the state, assume the worst
c.lggr.Errorw("Unable to read CommitStore IsUnpausedAndARMHealthy", "err", err)
return true, nil
return true, err
}
return !unPausedAndHealthy, nil
}
Expand Down

0 comments on commit 57d3de5

Please sign in to comment.