@@ -44,18 +44,18 @@ type SymbolFileKeyDetails struct {
4444
4545// GenerateSelfHealingChallenge worker checks the ping info and identify self-healing tickets and their recipients
4646func (task * SHTask ) GenerateSelfHealingChallenge (ctx context.Context ) error {
47- log .WithContext (ctx ).Infoln ("Self Healing Worker has been invoked" )
47+ log .WithContext (ctx ).Infoln ("Generate Self Healing Worker has been invoked" )
4848
4949 watchlistPingInfos , err := task .retrieveWatchlistPingInfo (ctx )
5050 if err != nil {
5151 log .WithContext (ctx ).WithError (err ).Error ("retrieveWatchlistPingInfo" )
5252 return errors .Errorf ("error retrieving watchlist ping info" )
5353 }
54- log .WithContext (ctx ).Info ("watchlist ping history has been retrieved" )
54+ log .WithContext (ctx ).Debug ("watchlist ping history has been retrieved" )
5555
5656 shouldTrigger , watchlistPingInfos := task .shouldTriggerSelfHealing (watchlistPingInfos )
5757 if ! shouldTrigger {
58- log .WithContext (ctx ).WithField ("no_of_nodes_on_watchlist" , len (watchlistPingInfos )).Info ("not enough nodes on the watchlist, skipping further processing" )
58+ log .WithContext (ctx ).WithField ("no_of_nodes_on_watchlist" , len (watchlistPingInfos )).Debug ("not enough nodes on the watchlist, skipping further processing" )
5959 return nil
6060 }
6161 log .WithContext (ctx ).Info ("self-healing has been triggered, proceeding with the identification of files & recipients" )
@@ -67,18 +67,18 @@ func (task *SHTask) GenerateSelfHealingChallenge(ctx context.Context) error {
6767 log .WithContext (ctx ).WithError (err ).Error ("error retrieving symbol file keys from NFT & action tickets" )
6868 return errors .Errorf ("error retrieving symbol file keys" )
6969 }
70- log .WithContext (ctx ).WithField ("total_keys" , len (keys )).Info ("all the keys from NFT and action tickets have been listed" )
70+ log .WithContext (ctx ).WithField ("total_keys" , len (keys )).Debug ("all the keys from NFT and action tickets have been listed" )
7171
7272 mapOfClosestNodesAgainstKeys := task .createClosestNodesMapAgainstKeys (ctx , keys , watchlistPingInfos )
7373 if len (mapOfClosestNodesAgainstKeys ) == 0 {
7474 log .WithContext (ctx ).Error ("unable to create map of closest nodes against keys" )
7575 return nil
7676 }
77- log .WithContext (ctx ).Info ("map of closest nodes against keys have been created" )
77+ log .WithContext (ctx ).Debug ("map of closest nodes against keys have been created" )
7878
7979 selfHealingTicketsMap := task .identifySelfHealingTickets (ctx , watchlistPingInfos , mapOfClosestNodesAgainstKeys , symbolFileKeyMap )
8080 if len (selfHealingTicketsMap ) == 0 {
81- log .WithContext (ctx ).Info ("no tickets required self-healing" )
81+ log .WithContext (ctx ).Debug ("no tickets required self-healing" )
8282
8383 if err := task .updateWatchlist (ctx , watchlistPingInfos ); err != nil {
8484 log .WithContext (ctx ).WithError (err ).Error ("error updating watchlist ping info" )
@@ -92,7 +92,7 @@ func (task *SHTask) GenerateSelfHealingChallenge(ctx context.Context) error {
9292 if err != nil {
9393 log .WithContext (ctx ).WithError (err ).Error ("error identifying challenge recipients" )
9494 }
95- log .WithContext (ctx ).WithField ("challenge_recipients" , len (challengeRecipientMap )).Info ("challenge recipients have been identified" )
95+ log .WithContext (ctx ).WithField ("challenge_recipients" , len (challengeRecipientMap )).Debug ("challenge recipients have been identified" )
9696
9797 blockNum , err := task .PastelClient .GetBlockCount (ctx )
9898 if err != nil {
@@ -123,7 +123,7 @@ func (task *SHTask) GenerateSelfHealingChallenge(ctx context.Context) error {
123123 if err := task .updateWatchlist (ctx , watchlistPingInfos ); err != nil {
124124 log .WithContext (ctx ).WithError (err ).Error ("error updating watchlist ping info" )
125125 }
126- log .WithContext (ctx ).Info ("watchlist has been adjusted" )
126+ log .WithContext (ctx ).Info ("self-healing triggered & watchlist has been adjusted" )
127127
128128 return nil
129129}
@@ -185,7 +185,7 @@ func (service *SHService) ListSymbolFileKeysFromNFTAndActionTickets(ctx context.
185185 if err != nil {
186186 return keys , symbolFileKeyMap , err
187187 }
188- log .WithContext (ctx ).WithField ("count" , len (regTickets )).Info ("Reg tickets retrieved" )
188+ log .WithContext (ctx ).WithField ("count" , len (regTickets )).Debug ("Reg tickets retrieved" )
189189
190190 for i := 0 ; i < len (regTickets ); i ++ {
191191 decTicket , err := pastel .DecodeNFTTicket (regTickets [i ].RegTicketData .NFTTicket )
@@ -209,10 +209,10 @@ func (service *SHService) ListSymbolFileKeysFromNFTAndActionTickets(ctx context.
209209 return keys , symbolFileKeyMap , err
210210 }
211211 if len (actionTickets ) == 0 {
212- log .WithContext (ctx ).WithField ("count" , len (actionTickets )).Info ("no action tickets retrieved" )
212+ log .WithContext (ctx ).WithField ("count" , len (actionTickets )).Debug ("no action tickets retrieved" )
213213 return keys , symbolFileKeyMap , nil
214214 }
215- log .WithContext (ctx ).WithField ("count" , len (actionTickets )).Info ("Action tickets retrieved" )
215+ log .WithContext (ctx ).WithField ("count" , len (actionTickets )).Debug ("Action tickets retrieved" )
216216
217217 for i := 0 ; i < len (actionTickets ); i ++ {
218218 decTicket , err := pastel .DecodeActionTicket (actionTickets [i ].ActionTicketData .ActionTicket )
@@ -283,7 +283,7 @@ func (task *SHTask) identifyClosestNodes(ctx context.Context, key string, nodesO
283283}
284284
285285func (task * SHTask ) identifySelfHealingTickets (ctx context.Context , watchlistPingInfos types.PingInfos , keyClosestNodesMap map [string ][]string , symbolFileKeyMap map [string ]SymbolFileKeyDetails ) map [string ]SymbolFileKeyDetails {
286- log .WithContext (ctx ).Info ("identifying tickets for self healing" )
286+ log .WithContext (ctx ).Debug ("identifying tickets for self healing" )
287287 selfHealingTicketsMap := make (map [string ]SymbolFileKeyDetails )
288288
289289 for key , closestNodes := range keyClosestNodesMap {
@@ -348,7 +348,7 @@ func (task *SHTask) identifyChallengeRecipients(ctx context.Context, selfHealing
348348
349349 challengeRecipients := task .SHService .GetNClosestSupernodeIDsToComparisonString (ctx , 1 , string (dataHash ), task .filterWatchlistAndCurrentNode (watchlist , listOfSupernodes ))
350350 if len (challengeRecipients ) < 1 {
351- log .WithContext (ctx ).WithField ("file_hash" , dataHash ).Info ("no closest nodes have found against the file" )
351+ log .WithContext (ctx ).WithField ("file_hash" , dataHash ).Debug ("no closest nodes have found against the file" )
352352 continue
353353 }
354354 recipient := challengeRecipients [0 ]
@@ -482,10 +482,10 @@ func (task *SHTask) getDataHash(nftTicket *pastel.NFTTicket, cascadeTicket *past
482482}
483483
484484func (task * SHTask ) prepareAndSendSelfHealingMessage (ctx context.Context , challengeRecipientMap map [string ][]SymbolFileKeyDetails , triggerID string , nodesOnWatchlist string ) error {
485- log .WithContext (ctx ).WithField ("method" , "prepareAndSendSelfHealingMessage" ).Info ("method has been invoked" )
485+ log .WithContext (ctx ).WithField ("method" , "prepareAndSendSelfHealingMessage" ).Debug ("method has been invoked" )
486486
487487 var err error
488- log .WithContext (ctx ).Info ("retrieving block no and verbose" )
488+ log .WithContext (ctx ).Debug ("retrieving block no and verbose" )
489489 currentBlockCount , err := task .SuperNodeService .PastelClient .GetBlockCount (ctx )
490490 if err != nil {
491491 log .WithContext (ctx ).WithError (err ).Error ("could not get current block count" )
@@ -502,7 +502,7 @@ func (task *SHTask) prepareAndSendSelfHealingMessage(ctx context.Context, challe
502502 challengeTickets := getTicketsForSelfHealingChallengeMessage (ticketsDetails , challengeRecipient )
503503
504504 log .WithContext (ctx ).WithField ("recipient_id" , challengeRecipient ).
505- WithField ("total_tickets" , len (challengeTickets )).Info ("sending for self-healing" )
505+ WithField ("total_tickets" , len (challengeTickets )).Debug ("sending for self-healing" )
506506
507507 msgData := types.SelfHealingMessageData {
508508 ChallengerID : task .nodeID ,
@@ -534,7 +534,7 @@ func (task *SHTask) prepareAndSendSelfHealingMessage(ctx context.Context, challe
534534 continue
535535 }
536536 }
537- log .WithContext (ctx ).Info ("self-healing messages have been sent" )
537+ log .WithContext (ctx ).Debug ("self-healing messages have been sent" )
538538
539539 return nil
540540}
@@ -601,7 +601,7 @@ func (task *SHTask) GetNodeToConnect(ctx context.Context, nodeID string) (*paste
601601func (task * SHTask ) SendMessage (ctx context.Context , challengeMessage types.SelfHealingMessage , processingSupernodeAddr string ) error {
602602 logger := log .WithContext (ctx ).WithField ("trigger_id" , challengeMessage .TriggerID )
603603
604- logger .Info ("sending self-healing challenge to processing supernode address: " + processingSupernodeAddr )
604+ logger .Debug ("sending self-healing challenge to processing supernode address: " + processingSupernodeAddr )
605605
606606 ctx , cancel := context .WithTimeout (ctx , timeoutDuration )
607607 defer cancel ()
0 commit comments