diff --git a/cmd/root.go b/cmd/root.go index b8ce1923820b784983d3bdcc7a5f0ad1b75f31cc..e8eef0b454727b42ebe7bd91d86b4b8a894848e9 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -312,7 +312,9 @@ var rootCmd = &cobra.Command{ paramsUnsafe := params.GetDefaultUnsafe() wg := &sync.WaitGroup{} sendCnt := int(viper.GetUint("sendCount")) - paramsE2E.UseExcluded = viper.GetBool("splitSends") + if viper.GetBool("splitSends") { + paramsE2E.UseExcluded = true + } wg.Add(sendCnt) go func() { //sendDelay := time.Duration(viper.GetUint("sendDelay")) diff --git a/go.mod b/go.mod index 6f9084e263a93e7c3dd46066a3f083b193b1c19d..534f22b61abe313ac55659f9f02825966650a079 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( gitlab.com/elixxir/comms v0.0.4-0.20211208211635-ad88fa2850b0 gitlab.com/elixxir/crypto v0.0.7-0.20211208211534-e1c1462d945f gitlab.com/elixxir/ekv v0.1.5 - gitlab.com/elixxir/primitives v0.0.3-0.20211216205607-021a9c8c943a + gitlab.com/elixxir/primitives v0.0.3-0.20211217162004-35f6c2257db2 gitlab.com/xx_network/comms v0.0.4-0.20211202195810-9dfc0b6cdb28 gitlab.com/xx_network/crypto v0.0.5-0.20211014163843-57b345890686 gitlab.com/xx_network/primitives v0.0.4-0.20211014163031-53405cf191fb diff --git a/go.sum b/go.sum index 42586cbc2b4ff696cdf050e851b7bd97f257f277..9b5ba83551d8064a7b674d97a78622e199d043c9 100644 --- a/go.sum +++ b/go.sum @@ -266,8 +266,8 @@ gitlab.com/elixxir/primitives v0.0.0-20200804170709-a1896d262cd9/go.mod h1:p0Vel gitlab.com/elixxir/primitives v0.0.0-20200804182913-788f47bded40/go.mod h1:tzdFFvb1ESmuTCOl1z6+yf6oAICDxH2NPUemVgoNLxc= gitlab.com/elixxir/primitives v0.0.1/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2YKnw5c+LJCE= gitlab.com/elixxir/primitives v0.0.3-0.20211208211148-752546cf2e46/go.mod h1:zZy8AlOISFm5IG4G4sylypnz7xNBfZ5mpXiibqJT8+8= -gitlab.com/elixxir/primitives v0.0.3-0.20211216205607-021a9c8c943a h1:joGFEIC3+kMzXkHXDAPLqg8X2HaGi2rGn3/dFrn1wEs= -gitlab.com/elixxir/primitives v0.0.3-0.20211216205607-021a9c8c943a/go.mod h1:vIelJqbvbhJ/dRqb+1AsICGliqcFJzPiNP+TpXsKBi8= +gitlab.com/elixxir/primitives v0.0.3-0.20211217162004-35f6c2257db2 h1:j34iZKqA8oZF/GfqZGJSOWVlNsHURtgN64l/Xcfx1DI= +gitlab.com/elixxir/primitives v0.0.3-0.20211217162004-35f6c2257db2/go.mod h1:vIelJqbvbhJ/dRqb+1AsICGliqcFJzPiNP+TpXsKBi8= gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw= gitlab.com/xx_network/comms v0.0.4-0.20211202195810-9dfc0b6cdb28 h1:CEZJfCiV6F6GQnWiYqoEjlzL2KpLipRy/ccV2smgf0E= gitlab.com/xx_network/comms v0.0.4-0.20211202195810-9dfc0b6cdb28/go.mod h1:wR9Vx0KZLrIs0g2Efcp0UwFPStjcDRWkg/DJLVQI2vw= diff --git a/network/message/sendCmix.go b/network/message/sendCmix.go index 042a35757944e2570cab5873491071f517334b6a..a34c627f0f274e0e6ad9486c4ad40ccf4c41c0eb 100644 --- a/network/message/sendCmix.go +++ b/network/message/sendCmix.go @@ -112,8 +112,14 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, // TODO: does this conflict with the attempted object? // Check excluded rounds for the selected best round - if cmixParams.UseExcluded && cmixParams.ExcludedRounds != nil && cmixParams.ExcludedRounds.Has(bestRound.GetRoundId()) { - continue + if cmixParams.UseExcluded && cmixParams.ExcludedRounds != nil { + if cmixParams.ExcludedRounds.Has(bestRound.GetRoundId()) { + jww.WARN.Printf("Round %d is excluded, skipping...", bestRound.ID) + continue + } else { + cmixParams.ExcludedRounds.Insert(bestRound.GetRoundId()) + jww.WARN.Printf("Added %d to excluded rounds", bestRound.ID) + } } // Determine whether the selected round contains any Nodes @@ -186,9 +192,6 @@ func sendCmixHelper(sender *gateway.Sender, msg format.Message, // Return if it sends properly gwSlotResp := result.(*pb.GatewaySlotResponse) if gwSlotResp.Accepted { - if cmixParams.UseExcluded && cmixParams.ExcludedRounds != nil { - cmixParams.ExcludedRounds.Insert(bestRound.ID) - } m := fmt.Sprintf("Successfully sent to EphID %v "+ "(source: %s) in round %d (msgDigest: %s), "+ "elapsed: %s numRoundTries: %d", ephID.Int64(), diff --git a/network/message/sendE2E.go b/network/message/sendE2E.go index 52d202393cc8817f2bf9ffd8acace69fb9df72eb..f1c2982b4f45b4260990ae5cdb4e9978ed53dc18 100644 --- a/network/message/sendE2E.go +++ b/network/message/sendE2E.go @@ -98,6 +98,8 @@ func (m *Manager) SendE2E(msg message.Send, param params.E2E, param.IdentityPreimage = partner.GetE2EPreimage() } + jww.DEBUG.Printf("Excluded %+v", param.ExcludedRounds) + //send the cmix message, each partition in its own thread wg.Add(1) go func(i int) { diff --git a/network/message/sendManyCmix.go b/network/message/sendManyCmix.go index d37d48342cb85e0667442cce72dabc45e0e2502d..e218cafdf99d97ab16ecadb28de0ae2b97cc6329 100644 --- a/network/message/sendManyCmix.go +++ b/network/message/sendManyCmix.go @@ -205,7 +205,7 @@ func sendManyCmixHelper(sender *gateway.Sender, gwSlotResp := result.(*pb.GatewaySlotResponse) if gwSlotResp.Accepted { if param.UseExcluded && param.ExcludedRounds != nil { - param.ExcludedRounds.Insert(bestRound.ID) + param.ExcludedRounds.Insert(bestRound.GetRoundId()) } m := fmt.Sprintf("Successfully sent to EphIDs %s (sources: [%s]) "+ "in round %d", ephemeralIDsString, recipientString, bestRound.ID)