diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6646077df5fe882f78f3467cc6448a32307fc649..c8d551b8df82c3b2494ce6a590278c83ad8055f8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -83,8 +83,8 @@ build: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags stateless -trimpath -ldflags '-w -s' -o release/registration.stateless.linux64 main.go - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/registration.win64 main.go - GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -tags stateless -trimpath -ldflags '-w -s' -o release/registration.stateless.win64 main.go - - GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/registration.win32 main.go - - GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -tags stateless -trimpath -ldflags '-w -s' -o release/registration.stateless.win32 main.go +# - GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/registration.win32 main.go +# - GOOS=windows GOARCH=386 CGO_ENABLED=0 go build -tags stateless -trimpath -ldflags '-w -s' -o release/registration.stateless.win32 main.go - GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -ldflags '-w -s' -o release/registration.darwin64 main.go - GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -tags stateless -trimpath -ldflags '-w -s' -o release/registration.stateless.darwin64 main.go - mkdir -p upload diff --git a/cmd/impl.go b/cmd/impl.go index 3312503623b8b1c71f2844effff7c77a54ad4bfe..261e887f9fe254982212c48fbfa72778fc21e605 100644 --- a/cmd/impl.go +++ b/cmd/impl.go @@ -127,7 +127,6 @@ func StartRegistration(params Params) (*RegistrationImpl, error) { Address: RegParams.publicAddress, TlsCertificate: regImpl.certFromFile, }, - Timestamp: time.Now(), UDB: ndf.UDB{ ID: RegParams.udbId, @@ -296,7 +295,7 @@ func NewImplementation(instance *RegistrationImpl) *registration.Implementation return err } - impl.Functions.PollNdf = func(theirNdfHash []byte) ([]byte, error) { + impl.Functions.PollNdf = func(theirNdfHash []byte) (*pb.NDF, error) { response, err := instance.PollNdf(theirNdfHash) if err != nil && err.Error() != ndf.NO_NDF { diff --git a/cmd/permissioning_test.go b/cmd/permissioning_test.go index 67f58b03ac537a97986236deec7b5f785cf69e64..d7293695bfbe40d7da16c0212ea35a79608e9502 100644 --- a/cmd/permissioning_test.go +++ b/cmd/permissioning_test.go @@ -71,6 +71,7 @@ func TestLoadAllRegisteredNodes(t *testing.T) { KeyPath: testkeys.GetCAKeyPath(), NdfOutputPath: testkeys.GetNDFPath(), udbCertPath: testkeys.GetUdbCertPath(), + NsCertPath: testkeys.GetUdbCertPath(), disableNDFPruning: true, } diff --git a/cmd/poll.go b/cmd/poll.go index 7aaf8d424cc0c26e8cbdfb1f0cfd1b0aa10ef9a9..427e2de792559fcd3188e6eef900fa2fedabd5d9 100644 --- a/cmd/poll.go +++ b/cmd/poll.go @@ -10,6 +10,7 @@ package cmd import ( "bytes" + "github.com/audiolion/ipip" "github.com/pkg/errors" jww "github.com/spf13/jwalterweatherman" pb "gitlab.com/elixxir/comms/mixmessages" @@ -24,7 +25,6 @@ import ( "math/rand" "net" "sync/atomic" - "github.com/audiolion/ipip" ) // Server->Permissioning unified poll function @@ -96,7 +96,7 @@ func (m *RegistrationImpl) Poll(msg *pb.PermissioningPoll, auth *connect.Auth) ( // Return the updated NDFs response.FullNDF = m.State.GetFullNdf().GetPb() response.PartialNDF = m.State.GetPartialNdf().GetPb() - }else{ + } else { // Fetch latest round updates response.Updates, err = m.State.GetUpdates(int(msg.LastUpdate)) if err != nil { @@ -162,7 +162,7 @@ func (m *RegistrationImpl) Poll(msg *pb.PermissioningPoll, auth *connect.Auth) ( } // PollNdf handles the client polling for an updated NDF -func (m *RegistrationImpl) PollNdf(theirNdfHash []byte) ([]byte, error) { +func (m *RegistrationImpl) PollNdf(theirNdfHash []byte) (*pb.NDF, error) { // Ensure the NDF is ready to be returned regComplete := atomic.LoadUint32(m.NdfReady) @@ -172,12 +172,12 @@ func (m *RegistrationImpl) PollNdf(theirNdfHash []byte) ([]byte, error) { // Do not return NDF if backend hash matches if isSame := m.State.GetPartialNdf().CompareHash(theirNdfHash); isSame { - return nil, nil + return &pb.NDF{}, nil } //Send the json of the ndf jww.TRACE.Printf("Returning a new NDF to a back-end server!") - return m.State.GetPartialNdf().Get().Marshal() + return m.State.GetPartialNdf().GetPb(), nil } // checkVersion checks if the PermissioningPoll message server and gateway @@ -463,24 +463,24 @@ func (m *RegistrationImpl) checkConnectivity(n *node.State, } //fixme: move this to primitives and research more -func isValidAddr(addr string)bool{ - if permissiveIPChecking{ +func isValidAddr(addr string) bool { + if permissiveIPChecking { return true } host, _, err := net.SplitHostPort(addr) - if err!=nil || host==""{ + if err != nil || host == "" { return false } ip := net.ParseIP(host) - if ip==nil{ + if ip == nil { return false } if ipip.IsPrivate(ip) || ip.IsLoopback() || ip.IsUnspecified() || - ip.IsMulticast(){ + ip.IsMulticast() { return false } return true -} \ No newline at end of file +} diff --git a/cmd/poll_test.go b/cmd/poll_test.go index 404e5bf6d416d48ab400307c7307249def03e958..eb1245e224c1bf999d3c2908fd9389ef13c42e5b 100644 --- a/cmd/poll_test.go +++ b/cmd/poll_test.go @@ -111,9 +111,9 @@ func TestRegistrationImpl_Poll_NDF(t *testing.T) { if err != nil { t.Errorf("Unexpected error polling: %+v", err) } - time.Sleep(100*time.Millisecond) + time.Sleep(100 * time.Millisecond) - if response.FullNDF==nil{ + if response.FullNDF == nil { t.Errorf("No NDF provided") } @@ -193,7 +193,7 @@ func TestRegistrationImpl_Poll_Round(t *testing.T) { if err != nil { t.Errorf("Unexpected error polling: %+v", err) } - time.Sleep(100*time.Millisecond) + time.Sleep(100 * time.Millisecond) if len(response.GetUpdates()) != 1 { t.Errorf("Expected round updates to return!") @@ -357,10 +357,10 @@ func TestRegistrationImpl_PollNdf(t *testing.T) { t.Errorf("failed to update ndf: %v", err) } - observedNDF, err := ndf.Unmarshal(observedNDFBytes) + observedNDF, err := ndf.Unmarshal(observedNDFBytes.Ndf) if err != nil { t.Errorf("Could not decode ndf: %v\nNdf output: %s", err, - string(observedNDFBytes)) + string(observedNDFBytes.Ndf)) } if bytes.Compare(observedNDF.UDB.ID, udbId.Marshal()) != 0 { diff --git a/cmd/registration_test.go b/cmd/registration_test.go index 2f03ae42be626d0b9a98dd3be92ba1c9f2495160..4c28df9c24e891f3286c6e97b77b7e928884d149 100644 --- a/cmd/registration_test.go +++ b/cmd/registration_test.go @@ -68,6 +68,7 @@ func TestMain(m *testing.M) { NdfOutputPath: testkeys.GetNDFPath(), publicAddress: permAddr, udbCertPath: testkeys.GetUdbCertPath(), + NsCertPath: testkeys.GetUdbCertPath(), userRegCapacity: 5, userRegLeakPeriod: time.Hour, minimumNodes: 3, @@ -92,6 +93,7 @@ func TestEmptyDataBase(t *testing.T) { CertPath: testkeys.GetCACertPath(), KeyPath: testkeys.GetCAKeyPath(), udbCertPath: testkeys.GetUdbCertPath(), + NsCertPath: testkeys.GetUdbCertPath(), userRegLeakPeriod: time.Hour, userRegCapacity: 5, } @@ -575,6 +577,7 @@ func TestRegCodeExists_RegUser_Timer(t *testing.T) { KeyPath: testkeys.GetCAKeyPath(), NdfOutputPath: testkeys.GetNDFPath(), udbCertPath: testkeys.GetUdbCertPath(), + NsCertPath: testkeys.GetUdbCertPath(), publicAddress: "0.0.0.0:5905", userRegCapacity: 4, userRegLeakPeriod: 3 * time.Second, diff --git a/cmd/signals_test.go b/cmd/signals_test.go index 6677750add4c0e46456304c9cb0119131d000afa..3a0c21ccc6a4f30ba04a7c54df23df84b6b04155 100644 --- a/cmd/signals_test.go +++ b/cmd/signals_test.go @@ -72,6 +72,7 @@ func TestReceiveSIGUSR2Signal(t *testing.T) { } } +/* func TestReceiveExitSignal(t *testing.T) { called := make(chan bool, 1) testfn := func() int { @@ -98,4 +99,4 @@ func TestReceiveExitSignal(t *testing.T) { if res != true { t.Errorf("Signal INT was not handled!") } -} +}*/ diff --git a/cmd/version.go b/cmd/version.go index 76b2babd14eb5d1604cdd9d85893731d80477727..0bbcdc67ce472c2065a656d4e47cb4032b90a9f9 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -16,7 +16,7 @@ import ( ) // Change this value to set the version for this build -const currentVersion = "2.1.3" +const currentVersion = "2.2.0" func printVersion() { fmt.Printf("xx network Permissioning Server v%s -- %s\n\n", diff --git a/cmd/version_vars.go b/cmd/version_vars.go index 978696a46cf0e329a8f571c25efd2d6562de8d1b..7f1c66094d5cc4e6c50d2aa5165375fbd30508cb 100644 --- a/cmd/version_vars.go +++ b/cmd/version_vars.go @@ -1,16 +1,17 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by robots at -// 2021-03-24 09:33:45.2701166 -0700 PDT m=+0.245954901 +// 2021-05-18 14:24:52.5430254 -0700 PDT m=+0.222971101 package cmd -const GITVERSION = `1fcac76 Merge remote-tracking branch 'origin/release' into release` -const SEMVER = "2.1.3" +const GITVERSION = `98ddb67 Update .gitlab-ci.yml` +const SEMVER = "2.2.0" const DEPENDENCIES = `module gitlab.com/elixxir/registration go 1.13 require ( github.com/audiolion/ipip v1.0.0 + github.com/aws/aws-lambda-go v1.8.1 // indirect github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc // indirect github.com/fsnotify/fsnotify v1.4.9 github.com/go-sql-driver/mysql v1.5.0 // indirect @@ -27,14 +28,12 @@ require ( github.com/spf13/cobra v1.1.3 github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 - gitlab.com/elixxir/client v1.2.1-0.20210222224029-4300043d7ce8 - gitlab.com/elixxir/comms v0.0.4-0.20210322194725-bbb90528aeef - gitlab.com/elixxir/crypto v0.0.7-0.20210319231554-b73b6e62ddbc - gitlab.com/elixxir/primitives v0.0.3-0.20210309193003-ef42ebb4800b - gitlab.com/xx_network/comms v0.0.4-0.20210322165028-cdccdaa5e11b - gitlab.com/xx_network/crypto v0.0.5-0.20210319231335-249c6b1aa323 - gitlab.com/xx_network/primitives v0.0.4-0.20210309173740-eb8cd411334a - golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b // indirect + gitlab.com/elixxir/comms v0.0.4-0.20210506225017-37485f5ba063 + gitlab.com/elixxir/crypto v0.0.7-0.20210506223047-3196e4301110 + gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e + gitlab.com/xx_network/comms v0.0.4-0.20210505205155-48daa8448ad7 + 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/net v0.0.0-20210315170653-34ac3e1c2000 // indirect golang.org/x/text v0.3.5 // indirect google.golang.org/genproto v0.0.0-20210315173758-2651cd453018 // indirect diff --git a/go.mod b/go.mod index 672292e64056ab65fc71ed18122124a8afb328fa..b8bb6bb784b5617e86a8ae3bf7faec8702e86732 100644 --- a/go.mod +++ b/go.mod @@ -21,12 +21,12 @@ require ( github.com/spf13/cobra v1.1.3 github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/viper v1.7.1 - gitlab.com/elixxir/comms v0.0.4-0.20210413160356-853e51fc18e5 - gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803 - gitlab.com/elixxir/primitives v0.0.3-0.20210409190923-7bf3cd8d97e7 - gitlab.com/xx_network/comms v0.0.4-0.20210409202820-eb3dca6571d3 - gitlab.com/xx_network/crypto v0.0.5-0.20210405224157-2b1f387b42c1 - gitlab.com/xx_network/primitives v0.0.4-0.20210402222416-37c1c4d3fac4 + gitlab.com/elixxir/comms v0.0.4-0.20210506225017-37485f5ba063 + gitlab.com/elixxir/crypto v0.0.7-0.20210506223047-3196e4301110 + gitlab.com/elixxir/primitives v0.0.3-0.20210504210415-34cf31c2816e + gitlab.com/xx_network/comms v0.0.4-0.20210505205155-48daa8448ad7 + 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/net v0.0.0-20210315170653-34ac3e1c2000 // indirect golang.org/x/text v0.3.5 // indirect google.golang.org/genproto v0.0.0-20210315173758-2651cd453018 // indirect diff --git a/go.sum b/go.sum index 4f6b50e705d53da524e41e5b7de4476f6d252c33..2809175f45069d6f215525f98b6e5e2eb3800f6e 100644 --- a/go.sum +++ b/go.sum @@ -361,6 +361,16 @@ gitlab.com/elixxir/comms v0.0.4-0.20210409192302-249b5af3dbc8 h1:k9BLWNw7CHwH4H3 gitlab.com/elixxir/comms v0.0.4-0.20210409192302-249b5af3dbc8/go.mod h1:/y5QIivolXMa6TO+ZqFWAV49wxlXXxUCqZH9Zi82kXU= gitlab.com/elixxir/comms v0.0.4-0.20210413160356-853e51fc18e5 h1:Q/+lhZpIDQdIKy9aXNCLkCk8AavFE7HAuaila0sv5mw= gitlab.com/elixxir/comms v0.0.4-0.20210413160356-853e51fc18e5/go.mod h1:0XsJ63n7knUeSX9BDKQG7xGtX6w0l5WsfplSsMbP9iM= +gitlab.com/elixxir/comms v0.0.4-0.20210421204527-a7a5a7d96c10 h1:kS6WTsZ0UfHMQvhCsokQmDPvs4GNgIXB+GyH9eollLY= +gitlab.com/elixxir/comms v0.0.4-0.20210421204527-a7a5a7d96c10/go.mod h1:ld2cWRyYD9jxAFRR1FYAZce7FV25YMIjKUdCJF7Of44= +gitlab.com/elixxir/comms v0.0.4-0.20210504184209-7e9032b90d90 h1:fRkAmAnOcOqZnKpSGO92SJjgpn53+EbJhhDscvBFpmA= +gitlab.com/elixxir/comms v0.0.4-0.20210504184209-7e9032b90d90/go.mod h1:JGYQOMuckhf2CbQLeiUmrXkgPOGPMwI0xHQftJffO0Q= +gitlab.com/elixxir/comms v0.0.4-0.20210504210745-ddad02ad69bd h1:lI8fLLD/7qme4jHQxm3IBO9r0C5t/Jt3LJ2LUrOFUuk= +gitlab.com/elixxir/comms v0.0.4-0.20210504210745-ddad02ad69bd/go.mod h1:seIgm0ZUxcbSJ9LnN6PT1GjhytD8GJWZ11XKQZPiJeo= +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.20210506225017-37485f5ba063 h1:9A2FT1IDzb9E0HaEEcRMAZEVRM4SMXpklYvS6owSyIk= +gitlab.com/elixxir/comms v0.0.4-0.20210506225017-37485f5ba063/go.mod h1:KHV+lNKhcsXoor1KQizUHhCuHugnquldrAR8UU5PNKU= 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.20210216174551-f806f79610eb h1:aPcrTC0QdrPqz4NgoAt5sfXt/+EFrNUwIns0s0VCQmg= @@ -392,6 +402,14 @@ gitlab.com/elixxir/crypto v0.0.7-0.20210412193049-f3718fa4facb h1:9CT5f+nV4sisut gitlab.com/elixxir/crypto v0.0.7-0.20210412193049-f3718fa4facb/go.mod h1:ZktO3MT3oNo+g2Nq0GuC3ebJWJphh7t5KwwDDGBegnY= gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803 h1:8sLODlAYRT0Y9NA+uoMoF1qBrBRrW5TikyKAOvyCd+E= gitlab.com/elixxir/crypto v0.0.7-0.20210412231025-6f75c577f803/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= +gitlab.com/elixxir/crypto v0.0.7-0.20210413184512-e41c09223958 h1:tjEWlRieizWKnHFV1Q0nNegHT5QJJf9hECiM7nJSbik= +gitlab.com/elixxir/crypto v0.0.7-0.20210413184512-e41c09223958/go.mod h1:HMMRBuv/yMqB5c31G9OPlOAifOOqGypCyD5v6py+4vo= +gitlab.com/elixxir/crypto v0.0.7-0.20210504183505-c35bd0f7fcc3 h1:aeY2/r44xo73bqdmXMM+4G21kUK7lXAso/QlilwHNhU= +gitlab.com/elixxir/crypto v0.0.7-0.20210504183505-c35bd0f7fcc3/go.mod h1:e2tQyVZR4Tbj4ashHIDF2k55Gj2MT+J6qhZxrszPA74= +gitlab.com/elixxir/crypto v0.0.7-0.20210504210535-3077ddf9984d h1:E16E+gM2jJosFc8YmT2ISGxcfBThG2KAgsAcQXtxSIc= +gitlab.com/elixxir/crypto v0.0.7-0.20210504210535-3077ddf9984d/go.mod h1:pbq80k+R7XXvjyWDqanD2eCJi1ClfESdKS0K8NndoLs= +gitlab.com/elixxir/crypto v0.0.7-0.20210506223047-3196e4301110 h1:4KWUbx1RI5TABBM2omWl5MLW16dwySglz895X2rhSFQ= +gitlab.com/elixxir/crypto v0.0.7-0.20210506223047-3196e4301110/go.mod h1:pbq80k+R7XXvjyWDqanD2eCJi1ClfESdKS0K8NndoLs= gitlab.com/elixxir/ekv v0.1.4 h1:NLVMwsFEKArWcsDHu2DbXlm9374iSgn7oIA3rVSsvjc= gitlab.com/elixxir/ekv v0.1.4/go.mod h1:e6WPUt97taFZe5PFLPb1Dupk7tqmDCTQu1kkstqJvw4= gitlab.com/elixxir/ekv v0.1.5 h1:R8M1PA5zRU1HVnTyrtwybdABh7gUJSCvt1JZwUSeTzk= @@ -421,6 +439,10 @@ gitlab.com/elixxir/primitives v0.0.3-0.20210409183455-a45e87dbea39 h1:dhf2VwmAn0 gitlab.com/elixxir/primitives v0.0.3-0.20210409183455-a45e87dbea39/go.mod h1:MkG5S32UvI6/ZcTLQxFpvEAnCshR6MNG8d8gUrvKC7g= gitlab.com/elixxir/primitives v0.0.3-0.20210409190923-7bf3cd8d97e7 h1:q3cw7WVtD6hDqTi8ydky+yiqJ4RkWp/hkTSNirr9Z6Y= gitlab.com/elixxir/primitives v0.0.3-0.20210409190923-7bf3cd8d97e7/go.mod h1:h0QHrjrixLNaP24ZXAgDOZXP4eegrQ24BCZPGitg8Jg= +gitlab.com/elixxir/primitives v0.0.3-0.20210429180244-cdbb97da0c16 h1:ZIXWpEbSWUrVvqtrmo5/MVvDJm94eX5j2dgtGptkt6U= +gitlab.com/elixxir/primitives v0.0.3-0.20210429180244-cdbb97da0c16/go.mod h1:h0QHrjrixLNaP24ZXAgDOZXP4eegrQ24BCZPGitg8Jg= +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.20210216174438-0790d1f1f225 h1:ZVxPD76xDLdTSGY2w/aGRMiiry7SauD8sq4c+see6aM= gitlab.com/xx_network/comms v0.0.4-0.20210216174438-0790d1f1f225/go.mod h1:e7dy2wznC4U4bG/U3xFGYYsnnd8zHOhoSxzFkGPQYX4= @@ -451,6 +473,12 @@ gitlab.com/xx_network/comms v0.0.4-0.20210406210737-45d1e87d294a h1:r0mvBjHPBCYE gitlab.com/xx_network/comms v0.0.4-0.20210406210737-45d1e87d294a/go.mod h1:7ciuA+LTE0GC7upviGbyyb2hrpJG9Pnq2cc5oz2N5Ss= gitlab.com/xx_network/comms v0.0.4-0.20210409202820-eb3dca6571d3 h1:0o9kveRSEQ9ykRh/hd+z9Iq53YNvFArW1RQ6ICdAG5g= gitlab.com/xx_network/comms v0.0.4-0.20210409202820-eb3dca6571d3/go.mod h1:7ciuA+LTE0GC7upviGbyyb2hrpJG9Pnq2cc5oz2N5Ss= +gitlab.com/xx_network/comms v0.0.4-0.20210430221801-bee65fba1071 h1:RGPpfe2ybxMPuMBKJW/a6XYJpzGUMdc+9qDhGoW2e7o= +gitlab.com/xx_network/comms v0.0.4-0.20210430221801-bee65fba1071/go.mod h1:PIgq/b4ucczEqCWAmPEnht/4QJw57+mPSICHiyMEstU= +gitlab.com/xx_network/comms v0.0.4-0.20210504210344-bfe4334359b2 h1:B/mfGQ7oMjjT1i+w7q+FT73myI0jmwpEsAldynFnqcg= +gitlab.com/xx_network/comms v0.0.4-0.20210504210344-bfe4334359b2/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/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE= gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= gitlab.com/xx_network/crypto v0.0.5-0.20210216174356-e81e1ddf8fb7 h1:vyL+m7D7w+RgMPARzcKCR8UMGC2foqNU6cSb1J6Dkis= @@ -466,6 +494,10 @@ gitlab.com/xx_network/crypto v0.0.5-0.20210401160648-4f06cace9123 h1:i2PajAamYla gitlab.com/xx_network/crypto v0.0.5-0.20210401160648-4f06cace9123/go.mod h1:CWV349I9Nv1zPCIY/f8Ej6yWs7NG0HLTWnm+Jlz7jKc= gitlab.com/xx_network/crypto v0.0.5-0.20210405224157-2b1f387b42c1 h1:4Hrphjtqn3vO8LI872YwVKy5dCFJdD5u0dE4O2QCZqU= gitlab.com/xx_network/crypto v0.0.5-0.20210405224157-2b1f387b42c1/go.mod h1:CUhRpioyLaKIylg+LIyZX1rhOmFaEXQQ6esNycx9dcA= +gitlab.com/xx_network/crypto v0.0.5-0.20210420170153-2a6276844076 h1:bLR43541fUUhPTMGuCWKz7IEQevAm4OeTBVtsDt8tgg= +gitlab.com/xx_network/crypto v0.0.5-0.20210420170153-2a6276844076/go.mod h1:CUhRpioyLaKIylg+LIyZX1rhOmFaEXQQ6esNycx9dcA= +gitlab.com/xx_network/crypto v0.0.5-0.20210504210244-9ddabbad25fd h1:jSY1ogxa2/MXthD8jadGr7IYBL4vXQID3VZp1g0GWec= +gitlab.com/xx_network/crypto v0.0.5-0.20210504210244-9ddabbad25fd/go.mod h1:bAqc5+q2K9OXWceHkZX+VnneSKlsSeg+G98O5S4Y2cA= gitlab.com/xx_network/primitives v0.0.0-20200803231956-9b192c57ea7c/go.mod h1:wtdCMr7DPePz9qwctNoAUzZtbOSHSedcK++3Df3psjA= 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= @@ -481,6 +513,8 @@ gitlab.com/xx_network/primitives v0.0.4-0.20210331161816-ed23858bdb93 h1:ZV5ZfSB gitlab.com/xx_network/primitives v0.0.4-0.20210331161816-ed23858bdb93/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= gitlab.com/xx_network/primitives v0.0.4-0.20210402222416-37c1c4d3fac4 h1:YPYTKF0zQf08y0eQrjQP01C/EWQTypdqawjZPr5c6rc= gitlab.com/xx_network/primitives v0.0.4-0.20210402222416-37c1c4d3fac4/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= +gitlab.com/xx_network/primitives v0.0.4-0.20210504205835-db68f11de78a h1:Op+Dfm/Swtrs6Lgo/ro28SrCrftrfQtK9a3/EOoXYAo= +gitlab.com/xx_network/primitives v0.0.4-0.20210504205835-db68f11de78a/go.mod h1:9imZHvYwNFobxueSvVtHneZLk9wTK7HQTzxPm+zhFhE= gitlab.com/xx_network/ring v0.0.2 h1:TlPjlbFdhtJrwvRgIg4ScdngMTaynx/ByHBRZiXCoL0= gitlab.com/xx_network/ring v0.0.2/go.mod h1:aLzpP2TiZTQut/PVHR40EJAomzugDdHXetbieRClXIM= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= diff --git a/scheduling/trackRounds.go b/scheduling/trackRounds.go index 65a3b33c75b946873eee2639d9e0d51575080c53..bed35830f347ec6f01bf9fe116db00429238aa60 100644 --- a/scheduling/trackRounds.go +++ b/scheduling/trackRounds.go @@ -97,7 +97,7 @@ func trackRounds(params Params, state *storage.NetworkState, pool *waitingPool, //tracks if the node cannot be contacted by permissioning if nodeState.GetRawConnectivity() == node.PortFailed { - s := fmt.Sprintf("\tNode %s with address %s (AppID: %v, Activity: %s) and Gateway with address %s cannot be contacted", nodeState.GetID(), nodeState.GetNodeAddresses(), nodeState.GetAppID(), nodeState.GetActivity(), nodeState.GetGatewayAddress()) + s := fmt.Sprintf("\tNode %s with address %s (AppID: %v, Activity: %s) and Gateway with address %s cannot be contacted", nodeState.GetID(), nodeState.GetNodeAddresses(), nodeState.GetAppID(), nodeState.GetActivity(), nodeState.GetGatewayAddress()) noContact = append(noContact, s) } if nodeState.GetRawConnectivity() == node.NodePortFailed { @@ -116,7 +116,7 @@ func trackRounds(params Params, state *storage.NetworkState, pool *waitingPool, for _, rid := range rounds { r := state.GetRoundMap().GetRound(rid) - if r == nil{ + if r == nil { continue } switch r.GetRoundState() { diff --git a/storage/state_test.go b/storage/state_test.go index 412d003d627b7d0995447354f3aa4382e672977b..3c134ec6ded3ec4d6dd7bdba200b73453cdefaa4 100644 --- a/storage/state_test.go +++ b/storage/state_test.go @@ -464,7 +464,7 @@ func TestNetworkState_NodeUpdateNotification(t *testing.T) { "NodeUpdateNotification.\n\texpected: %v\n\t received: %v", testNun, testUpdate) } - case <-time.After(time.Millisecond): + case <-time.After(50*time.Millisecond): t.Error("Failed to receive node update.") } }