Skip to content
Snippets Groups Projects
Commit 4ee33929 authored by Jake Taylor's avatar Jake Taylor
Browse files

Merge remote-tracking branch 'origin/release' into release

parents 8b94d188 f6780561
Branches
Tags
No related merge requests found
...@@ -26,5 +26,5 @@ func TrackResults(resultsCh chan ds.EventReturn, numResults int) (bool, int, int ...@@ -26,5 +26,5 @@ func TrackResults(resultsCh chan ds.EventReturn, numResults int) (bool, int, int
} }
} }
return (numTimeOut + numRoundFail) > 0, numRoundFail, numTimeOut return (numTimeOut + numRoundFail) == 0, numRoundFail, numTimeOut
} }
...@@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable { ...@@ -101,11 +101,7 @@ func (t *testNetworkManagerGeneric) GetStoppable() stoppable.Stoppable {
func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) { func InitTestingContextGeneric(i interface{}) (*storage.Session, interfaces.NetworkManager) {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
...@@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable { ...@@ -208,11 +204,7 @@ func (t *testNetworkManagerFullExchange) GetStoppable() stoppable.Stoppable {
func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) { func InitTestingContextFullExchange(i interface{}) (*storage.Session, *switchboard.Switchboard, interfaces.NetworkManager) {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
...@@ -64,10 +64,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) { ...@@ -64,10 +64,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
protoIds, err := ephemeral.GetIdsByRange(ourId, receptionStore.GetIDSize(), protoIds, err := ephemeral.GetIdsByRange(ourId, receptionStore.GetIDSize(),
now, now.Sub(lastCheck)) now, now.Sub(lastCheck))
jww.INFO.Printf("Now: %d, LastCheck: %v (%v), Different: %v (%v)", jww.DEBUG.Printf("Now: %d, LastCheck: %v (%v), Different: %v (%v)",
now.UnixNano(), lastCheck, lastCheck, now.Sub(lastCheck), now.Sub(lastCheck)) now.UnixNano(), lastCheck, lastCheck, now.Sub(lastCheck), now.Sub(lastCheck))
jww.INFO.Printf("protoIds Count: %d", len(protoIds)) jww.DEBUG.Printf("protoIds Count: %d", len(protoIds))
if err != nil { if err != nil {
jww.FATAL.Panicf("Could not generate "+ jww.FATAL.Panicf("Could not generate "+
...@@ -80,6 +80,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) { ...@@ -80,6 +80,10 @@ func track(session *storage.Session, ourId *id.ID, stop *stoppable.Single) {
jww.INFO.Printf("Number of Identities Generated: %d", jww.INFO.Printf("Number of Identities Generated: %d",
len(identities)) len(identities))
jww.INFO.Printf("Current Identity: %d (source: %s), Start: %s, End: %s",
identities[len(identities)-1].EphId.Int64(), identities[len(identities)-1].Source,
identities[len(identities)-1].StartValid, identities[len(identities)-1].EndValid)
// Add identities to storage if unique // Add identities to storage if unique
for _, identity := range identities { for _, identity := range identities {
// Track if identity has been generated already // Track if identity has been generated already
...@@ -147,7 +151,9 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity, ...@@ -147,7 +151,9 @@ func generateIdentities(protoIds []ephemeral.ProtoIdentity,
// then the current time is stored // then the current time is stored
func checkTimestampStore(session *storage.Session) error { func checkTimestampStore(session *storage.Session) error {
if _, err := session.Get(TimestampKey); err != nil { if _, err := session.Get(TimestampKey); err != nil {
now, err := marshalTimestamp(time.Unix(0, 0)) // only generate from the last hour because this is a new id, it
// couldn't receive messages yet
now, err := marshalTimestamp(time.Now().Add(-1*time.Hour))
if err != nil { if err != nil {
return errors.Errorf("Could not marshal new timestamp for storage: %v", err) return errors.Errorf("Could not marshal new timestamp for storage: %v", err)
} }
......
...@@ -85,6 +85,8 @@ func sendCmixHelper(msg format.Message, recipient *id.ID, param params.CMIX, ins ...@@ -85,6 +85,8 @@ func sendCmixHelper(msg format.Message, recipient *id.ID, param params.CMIX, ins
jww.FATAL.Panicf("Failed to generate ephemeral ID: %+v", err) jww.FATAL.Panicf("Failed to generate ephemeral ID: %+v", err)
} }
jww.INFO.Printf("Sending to EphID %v (source: %s)", ephID.Int64(), recipient)
stream := rng.GetStream() stream := rng.GetStream()
ephID, err = ephID.Fill(uint(bestRound.AddressSpaceSize), stream) ephID, err = ephID.Fill(uint(bestRound.AddressSpaceSize), stream)
if err != nil { if err != nil {
......
...@@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID { ...@@ -243,11 +243,7 @@ func getSessionIDFromBaseKey(baseKey *cyclic.Int) SessionID {
// FOR TESTING PURPOSES ONLY // FOR TESTING PURPOSES ONLY
func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID { func GetSessionIDFromBaseKeyForTesting(baseKey *cyclic.Int, i interface{}) SessionID {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("GetSessionIDFromBaseKeyForTesting is restricted to testing only. Got %T", i)
......
...@@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error { ...@@ -290,11 +290,7 @@ func (s *Session) Delete(key string) error {
// FOR TESTING ONLY // FOR TESTING ONLY
func InitTestingSession(i interface{}) *Session { func InitTestingSession(i interface{}) *Session {
switch i.(type) { switch i.(type) {
case *testing.T: case *testing.T, *testing.M, *testing.B, *testing.PB:
break
case *testing.M:
break
case *testing.B:
break break
default: default:
globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i) globals.Log.FATAL.Panicf("InitTestingSession is restricted to testing only. Got %T", i)
......
...@@ -2,10 +2,10 @@ package ud ...@@ -2,10 +2,10 @@ package ud
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
pb "gitlab.com/elixxir/comms/mixmessages" pb "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages" "gitlab.com/xx_network/comms/messages"
jww "github.com/spf13/jwalterweatherman"
) )
type confirmFactComm interface { type confirmFactComm interface {
......
...@@ -2,11 +2,11 @@ package ud ...@@ -2,11 +2,11 @@ package ud
import ( import (
"github.com/pkg/errors" "github.com/pkg/errors"
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/comms/mixmessages" "gitlab.com/elixxir/comms/mixmessages"
"gitlab.com/elixxir/primitives/fact" "gitlab.com/elixxir/primitives/fact"
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/messages" "gitlab.com/xx_network/comms/messages"
jww "github.com/spf13/jwalterweatherman"
) )
type removeFactComms interface { type removeFactComms interface {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment