diff --git a/api/results.go b/api/results.go index 4f5668fc90a6fcf53d61d6a440fe7fb35f35e7b5..04e91e15e7c6e3407ecfab759dd9eb1f598d9885 100644 --- a/api/results.go +++ b/api/results.go @@ -152,17 +152,28 @@ func (c *Client) getRoundResults(roundList []id.Round, timeout time.Duration, roundCallback(false, true, roundsResults) return case roundReport := <-sendResults: - numResults-- // Skip if the round is nil (unknown from historical rounds) // they default to timed out, so correct behavior is preserved + roundId := roundReport.RoundInfo.GetRoundId() if roundReport.TimedOut { + roundInfo, err := networkInstance.GetRound(roundId) + // If we have the round in the buffer + if err == nil { + // Check if the round is done (completed or failed) or in progress + if states.Round(roundInfo.State) == states.COMPLETED { + roundsResults[roundId] = Succeeded + } else if states.Round(roundInfo.State) == states.FAILED { + roundsResults[roundId] = Failed + allRoundsSucceeded = false + } + return + } allRoundsSucceeded = false anyRoundTimedOut = true } else { // If available, denote the result - roundId := id.Round(roundReport.RoundInfo.ID) if states.Round(roundReport.RoundInfo.State) == states.COMPLETED { roundsResults[roundId] = Succeeded } else { diff --git a/api/version_vars.go b/api/version_vars.go index 8a44f54952836daac733cc3e151032f5e6b042cb..158d3df9e628bc4966be47b94441bf79cffb1e3f 100644 --- a/api/version_vars.go +++ b/api/version_vars.go @@ -1,9 +1,9 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by robots at -// 2022-01-04 12:45:01.875155 -0600 CST m=+0.041061278 +// 2022-01-28 13:54:19.313216 -0600 CST m=+0.285271189 package api -const GITVERSION = `1144194c Merge branch 'dev' into 'release'` +const GITVERSION = `17cd83e0 re-check ram storage before timing out GetRoundresults` const SEMVER = "4.0.0" const DEPENDENCIES = `module gitlab.com/elixxir/client @@ -26,11 +26,11 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 - gitlab.com/elixxir/comms v0.0.4-0.20220104174855-044783c5c1e6 - gitlab.com/elixxir/crypto v0.0.7-0.20220104174238-dbd761b30553 - gitlab.com/elixxir/ekv v0.1.5 + gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d + gitlab.com/elixxir/crypto v0.0.7-0.20220110170041-7e42f2e8b062 + gitlab.com/elixxir/ekv v0.1.6 gitlab.com/elixxir/primitives v0.0.3-0.20220104173924-275cb9d7834f - gitlab.com/xx_network/comms v0.0.4-0.20211227194445-c099754b3cda + 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.20211222205802-03e9d7d835b0 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 diff --git a/go.mod b/go.mod index cc3f5aedb7c9914fc324bec0f4dbbb4e953234ea..f2dd1611dfaaa9197a41c589bc864be29b39485c 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 - gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76 + gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d gitlab.com/elixxir/crypto v0.0.7-0.20220110170041-7e42f2e8b062 gitlab.com/elixxir/ekv v0.1.6 gitlab.com/elixxir/primitives v0.0.3-0.20220104173924-275cb9d7834f diff --git a/go.sum b/go.sum index 5b4b7cfb26db2da474002cb2d28fdf3abbfbdb8a..e0505afce0c8e5f8ec1f2b68f6ebb53b1a13158c 100644 --- a/go.sum +++ b/go.sum @@ -272,10 +272,8 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0= github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= -gitlab.com/elixxir/comms v0.0.4-0.20220126233028-dc64691c7d3e h1:RE2v+HOiDTCglR5+hxUuR+fkQHkZqya/HTSmg+EoqsQ= -gitlab.com/elixxir/comms v0.0.4-0.20220126233028-dc64691c7d3e/go.mod h1:pj1TXrpHKytF68y53BtCBRYhaiMJWquuVBk4iEN7wkk= -gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76 h1:bmc/tvLJOIciHRCcRhkZqYKDcH4F503BKUitocEcQk0= -gitlab.com/elixxir/comms v0.0.4-0.20220128144348-f01dc3227d76/go.mod h1:pj1TXrpHKytF68y53BtCBRYhaiMJWquuVBk4iEN7wkk= +gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d h1:207Okb8+amKnRzsKE/4ehl3eb6ZHkWXevq9TimOehzw= +gitlab.com/elixxir/comms v0.0.4-0.20220128193157-34178165415d/go.mod h1:pj1TXrpHKytF68y53BtCBRYhaiMJWquuVBk4iEN7wkk= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= gitlab.com/elixxir/crypto v0.0.7-0.20220110170041-7e42f2e8b062 h1:6LLdEX2U/jA3RakJh/cKtjckMYBBjrjyowoBEtIF9L4= diff --git a/network/follow.go b/network/follow.go index ec9e10a47cec044b0aa2b8e44ac93e53edd3f941..5f3491587a1c7a7e74ccf3695ccb6958c5d320ee 100644 --- a/network/follow.go +++ b/network/follow.go @@ -224,23 +224,12 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source, } // Update the address space size - // todo: this is a fix for incompatibility with the live network - // remove once the live network has been pushed to if len(m.Instance.GetPartialNdf().Get().AddressSpace) != 0 { m.addrSpace.Update(m.Instance.GetPartialNdf().Get().AddressSpace[0].Size) - } else { - m.addrSpace.Update(18) } - // NOTE: this updates rounds and updates the tracking of the health of the - // network + // NOTE: this updates rounds and updates the tracking of the health of the network if pollResp.Updates != nil { - err = m.Instance.RoundUpdates(pollResp.Updates) - if err != nil { - jww.ERROR.Printf("%+v", err) - return - } - // TODO: ClientErr needs to know the source of the error and it doesn't yet // Iterate over ClientErrors for each RoundUpdate for _, update := range pollResp.Updates { @@ -266,19 +255,11 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source, return } + // Mutate the update to indicate failure due to a ClientError // FIXME: Should be able to trigger proper type of round event // FIXME: without mutating the RoundInfo. Signature also needs verified // FIXME: before keys are deleted update.State = uint32(states.FAILED) - rnd, err := m.Instance.GetWrappedRound(id.Round(update.ID)) - if err != nil { - jww.ERROR.Printf("Failed to report client error: "+ - "Could not get round for event triggering: "+ - "Unable to get round %d from instance: %+v", - id.Round(update.ID), err) - break - } - m.Instance.GetRoundEvents().TriggerRoundEvent(rnd) // delete all existing keys and trigger a re-registration with the relevant Node m.Session.Cmix().Remove(nid) @@ -287,6 +268,13 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source, } } + // Trigger RoundEvents for all polled updates, including modified rounds with ClientErrors + err = m.Instance.RoundUpdates(pollResp.Updates) + if err != nil { + jww.ERROR.Printf("%+v", err) + return + } + newestTS := uint64(0) for i := 0; i < len(pollResp.Updates[len(pollResp.Updates)-1].Timestamps); i++ { if pollResp.Updates[len(pollResp.Updates)-1].Timestamps[i] != 0 { diff --git a/network/manager.go b/network/manager.go index c968102e2f5b04269c123c5d1b624ae7a865678a..bba264c6b63263a196d4bfc135f1db42649948ec 100644 --- a/network/manager.go +++ b/network/manager.go @@ -105,6 +105,7 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard, events: events, earliestRound: &earliest, } + m.addrSpace.Update(18) if params.VerboseRoundTracking { m.verboseRounds = NewRoundTracker()