Skip to content
Snippets Groups Projects
Commit d6749cfd authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'hotfix/GetRoundResultsFix' into 'release'

attempt to fix GetRoundResults by making the follower only send one RoundEvent...

See merge request !144
parents 600973a5 a48993c9
No related branches found
No related tags found
2 merge requests!170Release,!144attempt to fix GetRoundResults by making the follower only send one RoundEvent...
......@@ -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 {
......
// 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
......
......@@ -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
......
......@@ -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=
......
......@@ -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 {
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment