From b4db24d97d930695b9940c08dd1f42ceca587143 Mon Sep 17 00:00:00 2001 From: Prashant Yadav <34992934+prashantkumar1982@users.noreply.github.com> Date: Wed, 1 May 2024 18:42:55 -0700 Subject: [PATCH 1/2] Make Error logging more useful for SendTransaction errors --- common/client/multi_node.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/client/multi_node.go b/common/client/multi_node.go index fa413df91aa..dcd53062b3f 100644 --- a/common/client/multi_node.go +++ b/common/client/multi_node.go @@ -663,13 +663,17 @@ func (c *multiNode[CHAIN_ID, SEQ, ADDR, BLOCK_HASH, TX, TX_HASH, EVENT, EVENT_OP func aggregateTxResults(resultsByCode sendTxErrors) (txResult error, err error) { severeErrors, hasSevereErrors := findFirstIn(resultsByCode, sendTxSevereErrors) successResults, hasSuccess := findFirstIn(resultsByCode, sendTxSuccessfulCodes) + var severeErrorsList error + for _, severeError := range severeErrors { + severeErrorsList = multierr.Append(severeErrorsList, severeError) + } if hasSuccess { // We assume that primary node would never report false positive txResult for a transaction. // Thus, if such case occurs it's probably due to misconfiguration or a bug and requires manual intervention. if hasSevereErrors { const errMsg = "found contradictions in nodes replies on SendTransaction: got success and severe error" // return success, since at least 1 node has accepted our broadcasted Tx, and thus it can now be included onchain - return successResults[0], fmt.Errorf(errMsg) + return successResults[0], multierr.Combine(fmt.Errorf(errMsg), severeErrorsList) } // other errors are temporary - we are safe to return success @@ -677,7 +681,7 @@ func aggregateTxResults(resultsByCode sendTxErrors) (txResult error, err error) } if hasSevereErrors { - return severeErrors[0], nil + return severeErrorsList, nil } // return temporary error From 7f88a8b4d30ea3fba8c218dceb9f4a5af5cdf66e Mon Sep 17 00:00:00 2001 From: Prashant Yadav <34992934+prashantkumar1982@users.noreply.github.com> Date: Wed, 1 May 2024 18:46:33 -0700 Subject: [PATCH 2/2] import fix --- common/client/multi_node.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/client/multi_node.go b/common/client/multi_node.go index dcd53062b3f..d30b7aa81a0 100644 --- a/common/client/multi_node.go +++ b/common/client/multi_node.go @@ -11,7 +11,8 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - + "go.uber.org/multierr" + "github.com/smartcontractkit/chainlink-common/pkg/assets" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/services"