Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-pubsub
Commits
919d81fd
Commit
919d81fd
authored
Jan 22, 2020
by
Yusef Napora
Committed by
vyzo
Mar 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
track changes to peer records in -core
parent
5b0ec14e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
85 additions
and
74 deletions
+85
-74
gossipsub.go
gossipsub.go
+30
-19
pb/rpc.pb.go
pb/rpc.pb.go
+54
-54
pb/rpc.proto
pb/rpc.proto
+1
-1
No files found.
gossipsub.go
View file @
919d81fd
...
...
@@ -3,6 +3,7 @@ package pubsub
import
(
"context"
"fmt"
"github.com/libp2p/go-libp2p-core/record"
"math/rand"
"time"
...
...
@@ -13,7 +14,6 @@ import (
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p-core/routing"
)
const
(
...
...
@@ -93,7 +93,7 @@ type GossipSubRouter struct {
type
connectInfo
struct
{
p
peer
.
ID
s
r
r
*
r
outing
.
SignedRoutingStat
e
s
p
r
*
r
ecord
.
Envelop
e
}
func
(
gs
*
GossipSubRouter
)
Protocols
()
[]
protocol
.
ID
{
...
...
@@ -306,19 +306,23 @@ func (gs *GossipSubRouter) pxConnect(peers []*pb.PeerInfo) {
continue
}
var
srr
*
routing
.
SignedRoutingState
var
err
error
if
pi
.
SignedAddrs
!=
nil
{
var
srr
*
record
.
Envelope
if
pi
.
SignedPeerRecord
!=
nil
{
// the peer sent us a signed record; ensure that it is valid
sr
r
,
err
=
r
outing
.
UnmarshalSignedRoutingState
(
pi
.
SignedAddrs
)
envelope
,
r
,
err
:
=
r
ecord
.
ConsumeEnvelope
(
pi
.
SignedPeerRecord
,
peer
.
PeerRecordEnvelopeDomain
)
if
err
!=
nil
{
log
.
Warningf
(
"error unmarshalling routing record obtained through px: %s"
,
err
)
continue
}
if
srr
.
PeerID
!=
p
{
log
.
Warningf
(
"bogus routing record obtained through px: peer ID %s doesn't match expected peer %s"
,
srr
.
PeerID
,
p
)
rec
,
ok
:=
r
.
(
*
peer
.
PeerRecord
)
if
!
ok
{
log
.
Warnf
(
"bogus routing record obtained through px: envelope payload is not PeerRecord"
)
}
if
rec
.
PeerID
!=
p
{
log
.
Warnf
(
"bogus routing record obtained through px: peer ID %s doesn't match expected peer %s"
,
rec
.
PeerID
,
p
)
continue
}
srr
=
envelope
}
toconnect
=
append
(
toconnect
,
connectInfo
{
p
,
srr
})
...
...
@@ -347,8 +351,12 @@ func (gs *GossipSubRouter) connector() {
}
log
.
Debugf
(
"connecting to %s"
,
ci
.
p
)
if
ci
.
srr
!=
nil
{
gs
.
p
.
host
.
Peerstore
()
.
AddCertifiedAddrs
(
ci
.
srr
,
peerstore
.
TempAddrTTL
)
cab
,
ok
:=
peerstore
.
GetCertifiedAddrBook
(
gs
.
p
.
host
.
Peerstore
())
if
ok
&&
ci
.
spr
!=
nil
{
err
:=
cab
.
ProcessPeerRecord
(
ci
.
spr
,
peerstore
.
TempAddrTTL
)
if
err
!=
nil
{
log
.
Debugf
(
"error processing peer record: %s"
,
err
)
}
}
ctx
,
cancel
:=
context
.
WithTimeout
(
gs
.
p
.
ctx
,
GossipSubConnectionTimeout
)
...
...
@@ -822,21 +830,24 @@ func (gs *GossipSubRouter) makePrune(p peer.ID, topic string) *pb.ControlPrune {
return
p
!=
xp
})
cab
,
peerstoreSupportsSignedAddrs
:=
peerstore
.
GetCertifiedAddrBook
(
gs
.
p
.
host
.
Peerstore
())
px
:=
make
([]
*
pb
.
PeerInfo
,
0
,
len
(
peers
))
for
_
,
p
:=
range
peers
{
// see if we have a signed
address
record to send back; if we don't, just send
// see if we have a signed
peer
record to send back; if we don't, just send
// the peer ID and let the pruned peer find them in the DHT -- we can't trust
// unsigned address records through px anyway.
srr
:=
gs
.
p
.
host
.
Peerstore
()
.
SignedRoutingState
(
p
)
var
saddrs
[]
byte
var
err
error
if
srr
!=
nil
{
saddrs
,
err
=
srr
.
Marshal
()
if
err
!=
nil
{
log
.
Warningf
(
"error marshaling signed routing state for %s: %s"
,
p
,
err
)
var
recordBytes
[]
byte
if
peerstoreSupportsSignedAddrs
{
spr
:=
cab
.
GetPeerRecord
(
p
)
var
err
error
if
spr
!=
nil
{
recordBytes
,
err
=
spr
.
Marshal
()
if
err
!=
nil
{
log
.
Warnf
(
"error marshaling signed peer record for %s: %s"
,
p
,
err
)
}
}
}
px
=
append
(
px
,
&
pb
.
PeerInfo
{
PeerID
:
[]
byte
(
p
),
Signed
Addrs
:
saddr
s
})
px
=
append
(
px
,
&
pb
.
PeerInfo
{
PeerID
:
[]
byte
(
p
),
Signed
PeerRecord
:
recordByte
s
})
}
return
&
pb
.
ControlPrune
{
TopicID
:
&
topic
,
Peers
:
px
}
...
...
pb/rpc.pb.go
View file @
919d81fd
...
...
@@ -589,7 +589,7 @@ func (m *ControlPrune) GetPeers() []*PeerInfo {
type PeerInfo struct {
PeerID []byte `protobuf:"bytes,1,opt,name=peerID" json:"peerID,omitempty"`
Signed
Addrs
[]byte `protobuf:"bytes,2,opt,name=signed
Addrs
" json:"signed
Addrs
,omitempty"`
Signed
PeerRecord
[]byte `protobuf:"bytes,2,opt,name=signed
PeerRecord
" json:"signed
PeerRecord
,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
...
...
@@ -635,9 +635,9 @@ func (m *PeerInfo) GetPeerID() []byte {
return nil
}
func (m *PeerInfo) GetSigned
Addrs
() []byte {
func (m *PeerInfo) GetSigned
PeerRecord
() []byte {
if m != nil {
return m.Signed
Addrs
return m.Signed
PeerRecord
}
return nil
}
...
...
@@ -835,48 +835,48 @@ func init() {
func init() { proto.RegisterFile("rpc.proto", fileD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0x0
f
, 0x
f6
, 0xfb, 0x
8
d, 0xff, 0x
a
8, 0x
0e, 0xda
, 0x
fb
, 0x
fe
, 0x
87
,
0x
06
, 0x9
1
, 0x
c
1, 0xf
1
, 0x
c1
, 0x
51
, 0xa
3
, 0x
d2
, 0x
fc
, 0x
4a
, 0x4
0
, 0x
57, 0xd
e, 0xe
8
, 0x
e
b, 0x
05
,
0x
27
, 0x
5
b, 0x
7f
, 0x
9
f, 0x
46
, 0x
3e
, 0x
4b
, 0x
3e
, 0x
36
, 0x
c
1, 0x
38
, 0xe
3
, 0x
97
, 0x
03
, 0x
37
, 0x
99
,
0x
f0
, 0x
99
, 0x
99
, 0x
79
, 0x
c
2, 0x
7e
, 0x
8a
, 0x
8d
, 0x
ae
, 0x1
9
, 0x
5a
, 0x
03
, 0x
e3
, 0x7
0
, 0x
b0
, 0x
c3
,
0x
fa
, 0x
bd
, 0x
45
, 0x
5
b, 0x
6f
, 0x
cd
, 0x
ef
, 0x
57
, 0x
2d
, 0xf
2
, 0x
f3
, 0x
aa
, 0x
45
, 0x
7e
, 0x
5d
, 0x
b5
,
0x
c8, 0x9f, 0x00, 0x00, 0x00
, 0xff, 0x
ff
, 0x5
8
, 0xd
6
, 0x
7d
, 0x
1f, 0x77
, 0x05, 0x00, 0x00,
}
func (m *RPC) Marshal() (dAtA []byte, err error) {
...
...
@@ -1271,11 +1271,11 @@ func (m *PeerInfo) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintRpc(dAtA, i, uint64(len(m.PeerID)))
i += copy(dAtA[i:], m.PeerID)
}
if m.Signed
Addrs
!= nil {
if m.Signed
PeerRecord
!= nil {
dAtA[i] = 0x12
i++
i = encodeVarintRpc(dAtA, i, uint64(len(m.Signed
Addrs
)))
i += copy(dAtA[i:], m.Signed
Addrs
)
i = encodeVarintRpc(dAtA, i, uint64(len(m.Signed
PeerRecord
)))
i += copy(dAtA[i:], m.Signed
PeerRecord
)
}
if m.XXX_unrecognized != nil {
i += copy(dAtA[i:], m.XXX_unrecognized)
...
...
@@ -1616,8 +1616,8 @@ func (m *PeerInfo) Size() (n int) {
l = len(m.PeerID)
n += 1 + l + sovRpc(uint64(l))
}
if m.Signed
Addrs
!= nil {
l = len(m.Signed
Addrs
)
if m.Signed
PeerRecord
!= nil {
l = len(m.Signed
PeerRecord
)
n += 1 + l + sovRpc(uint64(l))
}
if m.XXX_unrecognized != nil {
...
...
@@ -2895,7 +2895,7 @@ func (m *PeerInfo) Unmarshal(dAtA []byte) error {
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Signed
Addrs
", wireType)
return fmt.Errorf("proto: wrong wireType = %d for field Signed
PeerRecord
", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
...
...
@@ -2922,9 +2922,9 @@ func (m *PeerInfo) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Signed
Addrs
= append(m.Signed
Addrs
[:0], dAtA[iNdEx:postIndex]...)
if m.Signed
Addrs
== nil {
m.Signed
Addrs
= []byte{}
m.Signed
PeerRecord
= append(m.Signed
PeerRecord
[:0], dAtA[iNdEx:postIndex]...)
if m.Signed
PeerRecord
== nil {
m.Signed
PeerRecord
= []byte{}
}
iNdEx = postIndex
default:
...
...
pb/rpc.proto
View file @
919d81fd
...
...
@@ -50,7 +50,7 @@ message ControlPrune {
message
PeerInfo
{
optional
bytes
peerID
=
1
;
optional
bytes
signed
Addrs
=
2
;
optional
bytes
signed
PeerRecord
=
2
;
}
message
TopicDescriptor
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment