diff --git a/go.mod b/go.mod index d974c2257daff089aa4a2579a0646633d27f90c8..9007e77466fa549a3b7c21ae414bfe60b15ae2ed 100644 --- a/go.mod +++ b/go.mod @@ -15,10 +15,10 @@ require ( gitlab.com/elixxir/comms v0.0.4-0.20220214214811-4a1bd320aa45 gitlab.com/elixxir/crypto v0.0.7-0.20220211185439-4a6d9f41f8ab gitlab.com/elixxir/ekv v0.1.6 - gitlab.com/elixxir/primitives v0.0.3-0.20220211185255-f9bc3df21e1d - gitlab.com/xx_network/comms v0.0.4-0.20220211184526-00dc9cfe8e2e - gitlab.com/xx_network/crypto v0.0.5-0.20220211184244-5803ecaafd59 - gitlab.com/xx_network/primitives v0.0.4-0.20220211183913-d6f5fd114a2a + gitlab.com/elixxir/primitives v0.0.3-0.20220104173924-275cb9d7834f + gitlab.com/xx_network/comms v0.0.4-0.20220126231737-fe2338016cce + gitlab.com/xx_network/crypto v0.0.5-0.20211227194420-f311e8920467 + gitlab.com/xx_network/primitives v0.0.4-0.20220214225457-636c7b31cb78 golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 google.golang.org/grpc v1.42.0 diff --git a/go.sum b/go.sum index beb9dfdd74d6c53b7a11998623d594806b26bef4..1bf022a4864332c1529c47c94e9b26dc479a4d24 100644 --- a/go.sum +++ b/go.sum @@ -301,8 +301,8 @@ gitlab.com/xx_network/primitives v0.0.0-20200803231956-9b192c57ea7c/go.mod h1:wt gitlab.com/xx_network/primitives v0.0.0-20200804183002-f99f7a7284da/go.mod h1:OK9xevzWCaPO7b1wiluVJGk7R5ZsuC7pHY5hteZFQug= gitlab.com/xx_network/primitives v0.0.2/go.mod h1:cs0QlFpdMDI6lAo61lDRH2JZz+3aVkHy+QogOB6F/qc= gitlab.com/xx_network/primitives v0.0.4-0.20211222205802-03e9d7d835b0/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= -gitlab.com/xx_network/primitives v0.0.4-0.20220211183913-d6f5fd114a2a h1:40zC/55U9ouXBe1BpL5smRdsVh+LVDFQ1EvS+ZX1vSg= -gitlab.com/xx_network/primitives v0.0.4-0.20220211183913-d6f5fd114a2a/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= +gitlab.com/xx_network/primitives v0.0.4-0.20220214225457-636c7b31cb78 h1:ZtX91rUOadX+Z46ATb0iJLFNOiGy6RqegEyzmqlYis8= +gitlab.com/xx_network/primitives v0.0.4-0.20220214225457-636c7b31cb78/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= gitlab.com/xx_network/ring v0.0.3-0.20210527191221-ce3f170aabd5 h1:FY+4Rh1Q2rgLyv10aKJjhWApuKRCR/054XhreudfAvw= gitlab.com/xx_network/ring v0.0.3-0.20210527191221-ce3f170aabd5/go.mod h1:aLzpP2TiZTQut/PVHR40EJAomzugDdHXetbieRClXIM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index 8cd4e5ec43ccdb80475e52d226284b2bbb9c08eb..a7db6d51f80e38bad648ccff338dc68409d6cb05 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -27,6 +27,8 @@ import ( "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id/ephemeral" "gitlab.com/xx_network/primitives/netTime" + "gitlab.com/xx_network/primitives/rateLimiting" + "strings" "time" ) @@ -117,7 +119,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, remainingTime := cmixParams.Timeout - elapsed bestRound, err := instance.GetWaitingRounds().GetUpcomingRealtime(remainingTime, attempted, sendTimeBuffer) if err != nil { - jww.WARN.Printf("[SendCMIX-%s] Failed to GetUpcomingRealtime " + + jww.WARN.Printf("[SendCMIX-%s] Failed to GetUpcomingRealtime "+ "(msgDigest: %s): %+v", cmixParams.DebugTag, msg.Digest(), err) } if bestRound == nil { @@ -139,7 +141,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, } } if containsBlacklisted { - jww.WARN.Printf("[SendCMIX-%s]Round %d contains blacklisted node, " + + jww.WARN.Printf("[SendCMIX-%s]Round %d contains blacklisted node, "+ "skipping...", cmixParams.DebugTag, bestRound.ID) continue } @@ -147,7 +149,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, // Retrieve host and key information from round firstGateway, roundKeys, err := processRound(instance, session, nodeRegistration, bestRound, recipient.String(), msg.Digest()) if err != nil { - jww.WARN.Printf("[SendCMIX-%s]SendCmix failed to process round" + + jww.WARN.Printf("[SendCMIX-%s]SendCmix failed to process round"+ " (will retry): %v", cmixParams.DebugTag, err) continue } @@ -165,7 +167,7 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, jww.INFO.Printf("[SendCMIX-%s] Sending to EphID %d (%s), "+ "on round %d (msgDigest: %s, ecrMsgDigest: %s) "+ - "via gateway %s", cmixParams.DebugTag, + "via gateway %s", cmixParams.DebugTag, ephID.Int64(), recipient, bestRound.ID, msg.Digest(), encMsg.Digest(), firstGateway.String()) @@ -213,6 +215,13 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, // if the comm errors or the message fails to send, continue retrying. if err != nil { + if strings.Contains(err.Error(), rateLimiting.ClientRateLimitErr) { + jww.ERROR.Printf("[SendCMIX-%s] SendCmix failed to send to EphID %d (%s) on "+ + "round %d: %+v", cmixParams.DebugTag, ephID.Int64(), recipient, + bestRound.ID, err) + return 0, ephemeral.Id{}, err + } + jww.ERROR.Printf("[SendCMIX-%s] SendCmix failed to send to EphID %d (%s) on "+ "round %d, trying a new round: %+v", cmixParams.DebugTag, ephID.Int64(), recipient, bestRound.ID, err)