diff --git a/Makefile b/Makefile index bd6383ff69c75244eaf1b62ef3cc9c0fb91c5154..c768b96b73846faf5dfc619e6d0df019b6979cb5 100644 --- a/Makefile +++ b/Makefile @@ -20,12 +20,12 @@ build: go mod tidy update_release: - GOFLAGS="" go get -u gitlab.com/xx_network/primitives@release - GOFLAGS="" go get -u gitlab.com/elixxir/primitives@release - GOFLAGS="" go get -u gitlab.com/xx_network/crypto@release - GOFLAGS="" go get -u gitlab.com/elixxir/crypto@release - GOFLAGS="" go get -u gitlab.com/xx_network/comms@release - GOFLAGS="" go get -u gitlab.com/elixxir/comms@release + GOFLAGS="" go get gitlab.com/xx_network/primitives@release + GOFLAGS="" go get gitlab.com/elixxir/primitives@release + GOFLAGS="" go get gitlab.com/xx_network/crypto@release + GOFLAGS="" go get gitlab.com/elixxir/crypto@release + GOFLAGS="" go get gitlab.com/xx_network/comms@release + GOFLAGS="" go get gitlab.com/elixxir/comms@"hotfix/clientErrorSource" update_master: GOFLAGS="" go get gitlab.com/xx_network/primitives@master diff --git a/api/version_vars.go b/api/version_vars.go index 7a6a80ad7afc287095b1f57d7b6f7f975171495d..9aebc779e8fc4e03875ccdab0f6015119a888179 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 -// 2021-05-05 15:53:47.443011 -0500 CDT m=+0.014473892 +// 2021-05-06 10:10:45.1245738 -0700 PDT m=+0.084774901 package api -const GITVERSION = `b6f474ae fixed sendCmix time delay and the interface for bindings time now` +const GITVERSION = `04e19162 bumped connection timeout to 3.5 seconds` const SEMVER = "2.4.0" const DEPENDENCIES = `module gitlab.com/elixxir/client @@ -24,7 +24,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.20210505205202-1d4c18a7fcb2 + gitlab.com/elixxir/comms v0.0.4-0.20210506164842-7a132fdd895a gitlab.com/elixxir/crypto v0.0.7-0.20210504210535-3077ddf9984d gitlab.com/elixxir/ekv v0.1.5 gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e @@ -32,9 +32,10 @@ require ( gitlab.com/xx_network/crypto v0.0.5-0.20210504210244-9ddabbad25fd gitlab.com/xx_network/primitives v0.0.4-0.20210504205835-db68f11de78a golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 - golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect - google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 // indirect - google.golang.org/grpc v1.34.0 // indirect + golang.org/x/net v0.0.0-20210505214959-0714010a04ed // indirect + golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 // indirect + google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3 // indirect + google.golang.org/grpc v1.37.0 // indirect google.golang.org/protobuf v1.26.0-rc.1 gopkg.in/ini.v1 v1.62.0 // indirect ) diff --git a/go.mod b/go.mod index c6234ea8322579e76604ee872b1410839c3b6eb0..878070162dced974243d3df1f3c0e782067b9457 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,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.20210506161214-6371db79ce6f + gitlab.com/elixxir/comms v0.0.4-0.20210506164842-7a132fdd895a gitlab.com/elixxir/crypto v0.0.7-0.20210504210535-3077ddf9984d gitlab.com/elixxir/ekv v0.1.5 gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e @@ -25,9 +25,10 @@ require ( gitlab.com/xx_network/crypto v0.0.5-0.20210504210244-9ddabbad25fd gitlab.com/xx_network/primitives v0.0.4-0.20210504205835-db68f11de78a golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 - golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect - google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 // indirect - google.golang.org/grpc v1.34.0 // indirect + golang.org/x/net v0.0.0-20210505214959-0714010a04ed // indirect + golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 // indirect + google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3 // indirect + google.golang.org/grpc v1.37.0 // indirect google.golang.org/protobuf v1.26.0-rc.1 gopkg.in/ini.v1 v1.62.0 // indirect ) diff --git a/go.sum b/go.sum index e07685770c61db52aa8e701d5040959f292fcbf5..b9539f147b41685801ce68d7f124eabae6ccb54f 100644 --- a/go.sum +++ b/go.sum @@ -253,10 +253,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.20210505205202-1d4c18a7fcb2 h1:8aL4V7FaKkDb5iPdJ1rlFFhrHrLWUtbmBjw4BysXzEA= -gitlab.com/elixxir/comms v0.0.4-0.20210505205202-1d4c18a7fcb2/go.mod h1:VN0fNE7GFMrkZwRGnqA7fNNRAXDA4CCP6su/FQQ68RI= -gitlab.com/elixxir/comms v0.0.4-0.20210506161214-6371db79ce6f h1:0hvU+6Y+JGFnBu8ZSMk0ukNuYg+GAnVKD8Yo4VwSdao= -gitlab.com/elixxir/comms v0.0.4-0.20210506161214-6371db79ce6f/go.mod h1:7ff+A4Nom55mKiRW7qWsN7LDjGay4OZwiaaIVXZ4hdk= +gitlab.com/elixxir/comms v0.0.4-0.20210506164842-7a132fdd895a h1:4I+vdRt4LC/wNK68ExnQlJb1WyfK3FqcDfSTiMT4ssA= +gitlab.com/elixxir/comms v0.0.4-0.20210506164842-7a132fdd895a/go.mod h1:7ff+A4Nom55mKiRW7qWsN7LDjGay4OZwiaaIVXZ4hdk= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4 h1:28ftZDeYEko7xptCZzeFWS1Iam95dj46TWFVVlKmw6A= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.3 h1:znCt/x2bL4y8czTPaaFkwzdgSgW3BJc/1+dxyf1jqVw= @@ -273,9 +271,9 @@ gitlab.com/elixxir/primitives v0.0.1/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2Y gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e h1:6Z5qAqI/xoWYPMVcItUDYEkOe84YWS1FJa+qjWGcJ2c= gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e/go.mod h1:4pNgiFEQQ11hHCXBRQJN1w9AIuKa1HTlPTxs9UYOXFA= gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw= -gitlab.com/xx_network/comms v0.0.4-0.20210505204621-a93ded09b1ff/go.mod h1:RkNZ0CjeXKRhEFdUeAdCAF6QuK8sO1j2bUg9oqK0OEA= gitlab.com/xx_network/comms v0.0.4-0.20210505205155-48daa8448ad7 h1:0oQfe8YZ51kYKEj1w9UN2ls0Kp2AHRO6CUbkF/T/UH4= gitlab.com/xx_network/comms v0.0.4-0.20210505205155-48daa8448ad7/go.mod h1:RkNZ0CjeXKRhEFdUeAdCAF6QuK8sO1j2bUg9oqK0OEA= +gitlab.com/xx_network/crypto v0.0.3 h1:MDQX71yKLLGC9cgvp9gzJ5b4bShPeYuoqk9tFsCjqIE= gitlab.com/xx_network/crypto v0.0.3/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE= gitlab.com/xx_network/crypto v0.0.4 h1:lpKOL5mTJ2awWMfgBy30oD/UvJVrWZzUimSHlOdZZxo= gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= @@ -350,6 +348,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201029221708-28c70e62bb1d/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210505214959-0714010a04ed h1:V9kAVxLvz1lkufatrpHuUVyJ/5tR3Ms7rk951P4mI98= +golang.org/x/net v0.0.0-20210505214959-0714010a04ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -381,8 +381,9 @@ golang.org/x/sys v0.0.0-20201014080544-cc95f250f6bc/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d h1:jbzgAvDZn8aEnytae+4ou0J0GwFZoHR0hOrTg4qH8GA= golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c= +golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -392,6 +393,8 @@ golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -434,8 +437,8 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1 h1:Zk6zlGXdtYdcY5TL+VrbTfmifvk3VvsXopCpszsHPBA= -google.golang.org/genproto v0.0.0-20210105202744-fe13368bc0e1/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3 h1:sg8vLDNIxFPHTchfhH1E3AI32BL3f23oie38xUWnJM8= +google.golang.org/genproto v0.0.0-20201030142918-24207fddd1c3/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/network/follow.go b/network/follow.go index 259e9b2a0390f9f78fee741c1ba32f75e23dd660..dff6b589a5dcf7a798ea35270e1c19f89b9f9f4b 100644 --- a/network/follow.go +++ b/network/follow.go @@ -23,12 +23,14 @@ package network // instance import ( + "bytes" "fmt" jww "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/interfaces" "gitlab.com/elixxir/client/network/rounds" pb "gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/primitives/knownRounds" + "gitlab.com/elixxir/primitives/states" "gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/crypto/csprng" "gitlab.com/xx_network/primitives/id" @@ -154,50 +156,56 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source, // 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 { - // - // // Ignore irrelevant updates - // if update.State != uint32(states.COMPLETED) && update.State != uint32(states.FAILED) { - // continue - // } - // - // for _, clientErr := range update.ClientErrors { - // // If this Client appears in the ClientError - // if bytes.Equal(clientErr.ClientId, m.Session.GetUser().TransmissionID.Marshal()) { - // - // // Obtain relevant NodeGateway information - // // TODO ??? - // nGw, err := m.Instance.GetNodeAndGateway(gwHost.GetId()) - // if err != nil { - // jww.ERROR.Printf("Unable to get NodeGateway: %+v", err) - // return - // } - // nid, err := nGw.Node.GetNodeId() - // if err != nil { - // jww.ERROR.Printf("Unable to get NodeID: %+v", err) - // return - // } - // - // // 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) - // m.Instance.GetAddGatewayChan() <- nGw - // } - // } - //} + for _, update := range pollResp.Updates { + + // Ignore irrelevant updates + if update.State != uint32(states.COMPLETED) && update.State != uint32(states.FAILED) { + continue + } + + for _, clientErr := range update.ClientErrors { + // If this Client appears in the ClientError + if bytes.Equal(clientErr.ClientId, m.Session.GetUser().TransmissionID.Marshal()) { + + // Obtain relevant NodeGateway information + // TODO ??? + nid, err := id.Unmarshal(clientErr.Source) + if err != nil { + jww.ERROR.Printf("Unable to get NodeID: %+v", err) + return + } + //m.Instance.GetNodeAndGateway(gwHost.GetId()) + //if err != nil { + // jww.ERROR.Printf("Unable to get NodeGateway: %+v", err) + // return + //} + //nid, err := nGw.Node.GetNodeId() + nGw, err := m.Instance.GetNodeAndGateway(nid) + if err != nil { + jww.ERROR.Printf("Unable to get gateway: %+v", err) + return + } + + // 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) + m.Instance.GetAddGatewayChan() <- nGw + } + } + } } // ---- Identity Specific Round Processing -----