diff --git a/common/client/mock_node_client_test.go b/common/client/mock_node_client_test.go index ec83158a5ff..75d388b680f 100644 --- a/common/client/mock_node_client_test.go +++ b/common/client/mock_node_client_test.go @@ -5,8 +5,9 @@ package client import ( context "context" - types "github.com/smartcontractkit/chainlink/v2/common/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/common/types" ) // mockNodeClient is an autogenerated mock type for the NodeClient type diff --git a/common/client/mock_node_selector_test.go b/common/client/mock_node_selector_test.go index 996d064daa4..df605628e14 100644 --- a/common/client/mock_node_selector_test.go +++ b/common/client/mock_node_selector_test.go @@ -3,8 +3,9 @@ package client import ( - types "github.com/smartcontractkit/chainlink/v2/common/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/common/types" ) // mockNodeSelector is an autogenerated mock type for the NodeSelector type diff --git a/common/client/mock_send_only_client_test.go b/common/client/mock_send_only_client_test.go index b07e10ed8ce..4c71df1b317 100644 --- a/common/client/mock_send_only_client_test.go +++ b/common/client/mock_send_only_client_test.go @@ -5,8 +5,9 @@ package client import ( context "context" - types "github.com/smartcontractkit/chainlink/v2/common/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/common/types" ) // mockSendOnlyClient is an autogenerated mock type for the sendOnlyClient type diff --git a/common/client/mock_send_only_node_test.go b/common/client/mock_send_only_node_test.go index 4822c2620b8..3501ade758e 100644 --- a/common/client/mock_send_only_node_test.go +++ b/common/client/mock_send_only_node_test.go @@ -5,8 +5,9 @@ package client import ( context "context" - types "github.com/smartcontractkit/chainlink/v2/common/types" mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/common/types" ) // mockSendOnlyNode is an autogenerated mock type for the SendOnlyNode type diff --git a/common/client/multi_node.go b/common/client/multi_node.go index fa413df91aa..1b7090470b7 100644 --- a/common/client/multi_node.go +++ b/common/client/multi_node.go @@ -11,6 +11,7 @@ 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" @@ -663,13 +664,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" + 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 +682,7 @@ func aggregateTxResults(resultsByCode sendTxErrors) (txResult error, err error) } if hasSevereErrors { - return severeErrors[0], nil + return severeErrorsList, nil } // return temporary error