From 71d453177ba33a5f2efb371bef74de4e8786ea9a Mon Sep 17 00:00:00 2001 From: Mateusz Sekara Date: Fri, 8 Mar 2024 17:18:41 +0100 Subject: [PATCH] Return error instead of overriding that with "unhealthy" in readers (#598) Downstream functions should return errors when errors are returned when calling RPC. Otherwise, ChainHealthcheck will mark incorrectly chain as unhealthy. --- .../plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go | 4 +--- .../plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go index bbff85f153..97c2c77eaa 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_0_0/commit_store.go @@ -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 } diff --git a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go index bc506355e2..54763ca9c2 100644 --- a/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go +++ b/core/services/ocr2/plugins/ccip/internal/ccipdata/v1_2_0/commit_store.go @@ -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 }