diff --git a/pkg/check/act/act.go b/pkg/check/act/act.go index fb93da06d..59a3c440c 100644 --- a/pkg/check/act/act.go +++ b/pkg/check/act/act.go @@ -217,14 +217,23 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int c.logger.Info("ACT grantees listed after patch") */ // download act file + c.logger.Infof("ACT file download started from publisher: %s", fileAddress.String()) + size0, hash0, err0 := upClient.DownloadActFile(ctx, fileAddress, &api.DownloadOptions{Act: &act, ActPublicKey: &publisher, ActHistoryAddress: &history}) + if err0 != nil { + return fmt.Errorf("node %s: %w", upNodeName, err0) + } + if !bytes.Equal(file.Hash(), hash0) { + c.logger.Infof("Node %s. ACT file hash not equal. Uploaded size: %d Downloaded size: %d File: %s", upNodeName, file.Size(), size0, fileAddress.String()) + return errors.New("ACT file retrieval - hash error") + } + // download act file his := gFile.HistroryAddress() - c.logger.Infof("ACT file download started: %s", fileAddress.String()) + c.logger.Infof("ACT file download started from client2: %s", fileAddress.String()) _, _, err1 := client2.DownloadActFile(ctx, fileAddress, &api.DownloadOptions{Act: &act, ActPublicKey: &publisher, ActHistoryAddress: &his}) if err1 != nil { - return fmt.Errorf("node %s: %w", nodeName1, err1) + return fmt.Errorf("node %s: %w", nodeName2, err1) } - - return errors.New("ACT file retrieval - hash error") + return /* if !bytes.Equal(file.Hash(), hash1) { c.logger.Infof("Node %s. ACT file hash not equal. Uploaded size: %d Downloaded size: %d File: %s", nodeName1, file.Size(), size1, file.Address().String())