Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
a0e433d8
Commit
a0e433d8
authored
Feb 26, 2021
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
fixed so that known rounds are unique per user identity
parent
fee15cdf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
network/follow.go
+1
-4
1 addition, 4 deletions
network/follow.go
network/rounds/retrieve.go
+6
-7
6 additions, 7 deletions
network/rounds/retrieve.go
storage/session.go
+0
-18
0 additions, 18 deletions
storage/session.go
with
7 additions
and
29 deletions
network/follow.go
+
1
−
4
View file @
a0e433d8
...
@@ -229,12 +229,9 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
...
@@ -229,12 +229,9 @@ func (m *manager) follow(rng csprng.Source, comms followNetworkComms) {
return
m
.
round
.
Checker
(
rid
,
filterList
,
identity
)
return
m
.
round
.
Checker
(
rid
,
filterList
,
identity
)
}
}
// get the bit vector of rounds that have been checked
checkedRounds
:=
m
.
Session
.
GetCheckedRounds
()
// loop through all rounds the client does not know about and the gateway
// loop through all rounds the client does not know about and the gateway
// does, checking the bloom filter for the user to see if there are
// does, checking the bloom filter for the user to see if there are
// messages for the user (bloom not implemented yet)
// messages for the user (bloom not implemented yet)
checkedRounds
.
RangeUncheckedMaskedRange
(
gwRoundsState
,
roundChecker
,
identity
.
KR
.
RangeUncheckedMaskedRange
(
gwRoundsState
,
roundChecker
,
firstRound
,
lastRound
+
1
,
int
(
m
.
param
.
MaxCheckedRounds
))
firstRound
,
lastRound
+
1
,
int
(
m
.
param
.
MaxCheckedRounds
))
}
}
This diff is collapsed.
Click to expand it.
network/rounds/retrieve.go
+
6
−
7
View file @
a0e433d8
...
@@ -17,7 +17,6 @@ import (
...
@@ -17,7 +17,6 @@ import (
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/ephemeral"
)
)
type
messageRetrievalComms
interface
{
type
messageRetrievalComms
interface
{
...
@@ -41,7 +40,7 @@ func (m *Manager) processMessageRetrieval(comms messageRetrievalComms,
...
@@ -41,7 +40,7 @@ func (m *Manager) processMessageRetrieval(comms messageRetrievalComms,
done
=
true
done
=
true
case
rl
:=
<-
m
.
lookupRoundMessages
:
case
rl
:=
<-
m
.
lookupRoundMessages
:
ri
:=
rl
.
roundInfo
ri
:=
rl
.
roundInfo
bundle
,
err
:=
m
.
getMessagesFromGateway
(
ri
,
comms
,
rl
.
identity
.
EphId
)
bundle
,
err
:=
m
.
getMessagesFromGateway
(
ri
,
comms
,
rl
.
identity
)
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
WARN
.
Printf
(
"Failed to get messages for round %v: %s"
,
jww
.
WARN
.
Printf
(
"Failed to get messages for round %v: %s"
,
ri
.
ID
,
err
)
ri
.
ID
,
err
)
...
@@ -57,7 +56,7 @@ func (m *Manager) processMessageRetrieval(comms messageRetrievalComms,
...
@@ -57,7 +56,7 @@ func (m *Manager) processMessageRetrieval(comms messageRetrievalComms,
}
}
func
(
m
*
Manager
)
getMessagesFromGateway
(
roundInfo
*
pb
.
RoundInfo
,
func
(
m
*
Manager
)
getMessagesFromGateway
(
roundInfo
*
pb
.
RoundInfo
,
comms
messageRetrievalComms
,
ephid
ephemeral
.
Id
)
(
message
.
Bundle
,
error
)
{
comms
messageRetrievalComms
,
identity
reception
.
IdentityUse
)
(
message
.
Bundle
,
error
)
{
rid
:=
id
.
Round
(
roundInfo
.
ID
)
rid
:=
id
.
Round
(
roundInfo
.
ID
)
...
@@ -69,11 +68,11 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
...
@@ -69,11 +68,11 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
}
}
jww
.
INFO
.
Printf
(
"Getting messages for RoundID %v for EphID %d "
+
jww
.
INFO
.
Printf
(
"Getting messages for RoundID %v for EphID %d "
+
"via Gateway: %s"
,
rid
,
e
ph
i
d
,
gwHost
.
GetId
())
"via Gateway: %s"
,
rid
,
identity
.
E
ph
I
d
,
gwHost
.
GetId
())
// send the request
// send the request
msgReq
:=
&
pb
.
GetMessages
{
msgReq
:=
&
pb
.
GetMessages
{
ClientID
:
e
ph
i
d
[
:
],
ClientID
:
identity
.
E
ph
I
d
[
:
],
RoundID
:
uint64
(
rid
),
RoundID
:
uint64
(
rid
),
}
}
msgResp
,
err
:=
comms
.
RequestMessages
(
gwHost
,
msgReq
)
msgResp
,
err
:=
comms
.
RequestMessages
(
gwHost
,
msgReq
)
...
@@ -87,7 +86,7 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
...
@@ -87,7 +86,7 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
if
!
msgResp
.
GetHasRound
()
{
if
!
msgResp
.
GetHasRound
()
{
rid
:=
id
.
Round
(
roundInfo
.
ID
)
rid
:=
id
.
Round
(
roundInfo
.
ID
)
m
.
p
.
Done
(
rid
)
m
.
p
.
Done
(
rid
)
m
.
Session
.
GetCheckedRounds
()
.
Check
(
rid
)
identity
.
KR
.
Check
(
rid
)
return
message
.
Bundle
{},
errors
.
Errorf
(
"host %s does not have "
+
return
message
.
Bundle
{},
errors
.
Errorf
(
"host %s does not have "
+
"roundID: %d"
,
gwHost
.
String
(),
rid
)
"roundID: %d"
,
gwHost
.
String
(),
rid
)
}
}
...
@@ -111,7 +110,7 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
...
@@ -111,7 +110,7 @@ func (m *Manager) getMessagesFromGateway(roundInfo *pb.RoundInfo,
Round
:
rid
,
Round
:
rid
,
Messages
:
make
([]
format
.
Message
,
len
(
msgs
)),
Messages
:
make
([]
format
.
Message
,
len
(
msgs
)),
Finish
:
func
()
{
Finish
:
func
()
{
m
.
Session
.
GetCheckedRounds
()
.
Check
(
rid
)
identity
.
KR
.
Check
(
rid
)
m
.
p
.
Done
(
rid
)
m
.
p
.
Done
(
rid
)
},
},
}
}
...
...
This diff is collapsed.
Click to expand it.
storage/session.go
+
0
−
18
View file @
a0e433d8
...
@@ -25,7 +25,6 @@ import (
...
@@ -25,7 +25,6 @@ import (
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/cyclic"
"gitlab.com/elixxir/crypto/fastRNG"
"gitlab.com/elixxir/crypto/fastRNG"
"gitlab.com/elixxir/ekv"
"gitlab.com/elixxir/ekv"
"gitlab.com/elixxir/primitives/knownRounds"
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/crypto/csprng"
"gitlab.com/xx_network/crypto/large"
"gitlab.com/xx_network/crypto/large"
"gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/crypto/signature/rsa"
...
@@ -57,7 +56,6 @@ type Session struct {
...
@@ -57,7 +56,6 @@ type Session struct {
criticalMessages
*
utility
.
E2eMessageBuffer
criticalMessages
*
utility
.
E2eMessageBuffer
criticalRawMessages
*
utility
.
CmixMessageBuffer
criticalRawMessages
*
utility
.
CmixMessageBuffer
garbledMessages
*
utility
.
MeteredCmixMessageBuffer
garbledMessages
*
utility
.
MeteredCmixMessageBuffer
checkedRounds
*
utility
.
KnownRounds
reception
*
reception
.
Store
reception
*
reception
.
Store
}
}
...
@@ -129,11 +127,6 @@ func New(baseDir, password string, u userInterface.User, cmixGrp,
...
@@ -129,11 +127,6 @@ func New(baseDir, password string, u userInterface.User, cmixGrp,
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to create raw critical message buffer"
)
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to create raw critical message buffer"
)
}
}
s
.
checkedRounds
,
err
=
utility
.
NewKnownRounds
(
s
.
kv
,
checkedRoundsKey
,
knownRounds
.
NewKnownRound
(
CheckRoundsMaxSize
))
if
err
!=
nil
{
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to create checked rounds buffer"
)
}
s
.
conversations
=
conversation
.
NewStore
(
s
.
kv
)
s
.
conversations
=
conversation
.
NewStore
(
s
.
kv
)
s
.
partition
=
partition
.
New
(
s
.
kv
)
s
.
partition
=
partition
.
New
(
s
.
kv
)
...
@@ -192,11 +185,6 @@ func Load(baseDir, password string, rng *fastRNG.StreamGenerator) (*Session, err
...
@@ -192,11 +185,6 @@ func Load(baseDir, password string, rng *fastRNG.StreamGenerator) (*Session, err
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to load session"
)
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to load session"
)
}
}
s
.
checkedRounds
,
err
=
utility
.
LoadKnownRounds
(
s
.
kv
,
checkedRoundsKey
,
CheckRoundsMaxSize
)
if
err
!=
nil
{
return
nil
,
errors
.
WithMessage
(
err
,
"Failed to load session"
)
}
s
.
conversations
=
conversation
.
NewStore
(
s
.
kv
)
s
.
conversations
=
conversation
.
NewStore
(
s
.
kv
)
s
.
partition
=
partition
.
New
(
s
.
kv
)
s
.
partition
=
partition
.
New
(
s
.
kv
)
...
@@ -253,12 +241,6 @@ func (s *Session) GetGarbledMessages() *utility.MeteredCmixMessageBuffer {
...
@@ -253,12 +241,6 @@ func (s *Session) GetGarbledMessages() *utility.MeteredCmixMessageBuffer {
return
s
.
garbledMessages
return
s
.
garbledMessages
}
}
func
(
s
*
Session
)
GetCheckedRounds
()
*
utility
.
KnownRounds
{
s
.
mux
.
RLock
()
defer
s
.
mux
.
RUnlock
()
return
s
.
checkedRounds
}
func
(
s
*
Session
)
Conversations
()
*
conversation
.
Store
{
func
(
s
*
Session
)
Conversations
()
*
conversation
.
Store
{
s
.
mux
.
RLock
()
s
.
mux
.
RLock
()
defer
s
.
mux
.
RUnlock
()
defer
s
.
mux
.
RUnlock
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment