Commit Graph

2409 Commits

Author SHA1 Message Date
Brian Tiger Chow
a2f321f0f6 fix(bitswap/testnet) test typo
@jbenet

previous impl read...

        if !bytes.Equal(nextPeer.ID(), from.ID()) {

was translated to...

        if nextPeer == from {
2014-12-21 11:08:58 -05:00
Juan Batiz-Benet
4e8c28029a updated seccat 2014-12-21 05:45:32 -08:00
Juan Batiz-Benet
86a553596a removed old spipe 2014-12-21 05:45:32 -08:00
Juan Batiz-Benet
d21f20d3a5 Commands learned to use peer.ID 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
e6fc31bbc4 Network: added notion of versions (h1) to h3 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
8768c1f8e7 ipns now uses peer.ID 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
7410a37ef3 core now uses peer.ID 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
e906dd723f diagnostics now uses peer.ID 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
9da5a61d3d Bitswap now uses peer.ID
The only problem is a panic in bitswap/testnet :(
Not sure what's going on.
2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
eb67edfa97 mocknet: now with keys and addrs
To _really_ simulate the network, mocknet needs
to provide proper addrs and keys. Otherwise
services that depend on some of the network's
functionality (like exchanging keys) will fail oddly.

cc @maybebtc
2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
16c25efbcb dht: more tests pass 2014-12-21 05:45:31 -08:00
Juan Batiz-Benet
334557f9d5 IDService (replaces handshake3) 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
992898d1eb net: Network has Protocols() and Conn stream chg 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
17da5ca74a handshake3: ressurect the message 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
e6412c8f8b secio: remove old debug statements 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
da734fa4c8 swarm: learned to use a ConnHandler 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
3a78669209 dht: protocol change
Send + Recv compressed multiaddrs (bytes). this makes
for much smaller addresses, as string addresses are
inflated for human readability. compare:

```
consider: "/ip4/192.168.10.10/tcp/13456"
string: 0x2f6970342f3139322e3136382e31302e31302f7463702f3133343536
packed: 0x04c0a80a0a063490
```
2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
fccdf863e1 dht: three tests pass 2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
0cdc2e0adf dht: split out online record verification
Online record verification -- meaning record verification
that might cause messages to other peers -- presents a
way to perform an attack on a dht node: forge a record and
make the node attempt to fetch the public key to verify.
This becomes a very powerful amplification attack if
online verification is done for records _received passively_.
This means records that were received as the result of a
PUT_VALUE or ADD_PROVIDER. Thus we only accept records we
can verify offline (whose public keys we already have). In
practice this is not at all a problem for us, because
typical connections are encrypted: we've already exchanged
public keys.
2014-12-21 05:45:30 -08:00
Juan Batiz-Benet
cb2e560c32 swarm: add remote pubkey to peerstore 2014-12-21 05:45:29 -08:00
Juan Batiz-Benet
01f7792a4a net: expose local/remote keys on conn 2014-12-21 05:45:29 -08:00
Juan Batiz-Benet
1a432ad69b util: fractional context 2014-12-20 22:28:25 -08:00
Juan Batiz-Benet
d837017bd3 peer: major refactor. builds 2014-12-20 21:26:51 -08:00
Juan Batiz-Benet
c9e4dcbcd6 peerstore: convenience functions 2014-12-20 21:08:04 -08:00
Juan Batiz-Benet
523a576dc2 net/ dialer interface exposes peerstore 2014-12-20 20:06:17 -08:00
Juan Batiz-Benet
e6923ad969 peerstore: PeerInfo func 2014-12-20 14:23:33 -08:00
Juan Batiz-Benet
238ee50110 dht/pb use peer.PeerInfo 2014-12-20 14:02:30 -08:00
Juan Batiz-Benet
74f530e79b routing/mock now uses peer.ID and peer.PeerInfo 2014-12-20 13:51:14 -08:00
Juan Batiz-Benet
7aca07e2be Routing interface uses peer.PeerInfo
Providers are records that need Addresses. The routing
system needs to provide -- not only the ID, but also --
the peer's Addresses. A peer.PeerInfo is a small struct
to pass around a peer.ID and []ma.Multiaddr.
2014-12-20 13:49:22 -08:00
Juan Batiz-Benet
0b12fd65df peer.PeerInfo comment accuracy 2014-12-20 13:39:36 -08:00
Juan Batiz-Benet
02e5692397 kbucket now uses peer.ID 2014-12-20 13:26:52 -08:00
Juan Batiz-Benet
4391ba4ff4 testutil: use crand for PeerID gen
RandPeerID generates random "valid" peer IDs. it does not
NEED to generate keys because it is as if we lost the key
right away. fine to read some randomness and hash it. to
generate proper keys and an ID, use:

  sk, pk, _ := testutil.RandKeyPair()
  id, _ := peer.IDFromPublicKey(pk)

Also added RandPeerIDFatal helper
2014-12-20 13:26:27 -08:00
Juan Batiz-Benet
3c5f484d58 latency metrics 2014-12-19 23:49:36 -08:00
Juan Batiz-Benet
5931546507 updated peer/queue + peerset 2014-12-19 22:24:31 -08:00
Juan Batiz-Benet
423cd2cc8d peer: added a PeerInfo struct
PeerInfo is a small struct used to pass around a peer with
a set of addresses and keys. This is not meant to be a
complete view of the system, but rather to model updates to
the peerstore. It is used by things like the routing system.
2014-12-19 22:23:09 -08:00
Juan Batiz-Benet
20068c8637 peer: added hex enc/dec 2014-12-19 22:22:54 -08:00
Juan Batiz-Benet
a6491df052 backpressure bugfix: w.o.w.
i dont even know how that was passing
2014-12-19 21:56:57 -08:00
Juan Batiz-Benet
b8a3c3d770 backpressure now uses peer.ID 2014-12-19 21:56:30 -08:00
Juan Batiz-Benet
fc56ffee00 mocknet now uses peer.ID 2014-12-19 21:29:12 -08:00
Juan Batiz-Benet
b70f40113d network now uses peer.ID 2014-12-19 21:29:05 -08:00
Juan Batiz-Benet
8ec6f3d34c testutil: RandKeyPair 2014-12-19 21:28:41 -08:00
Juan Batiz-Benet
e535b0e520 swarm now uses peer.ID 2014-12-19 21:05:18 -08:00
Juan Batiz-Benet
35f1d3c236 threadsafe SeededRand 2014-12-19 21:01:14 -08:00
Juan Batiz-Benet
6818090249 peerstore: added privkey holding 2014-12-19 20:10:47 -08:00
Juan Batiz-Benet
618794cbed Moved PeerNetParams + shortened tests 2014-12-19 19:58:17 -08:00
Juan Batiz-Benet
d1b5450875 secio: comment out hyperverbose debugging
this is really only useful when debugging that one pkg.

I wish "debug" could be easily set on only one "pkg" at a time,
making everything else Info+.
2014-12-19 19:46:04 -08:00
Juan Batiz-Benet
57c7ffab44 conn: with new peer.ID 2014-12-19 19:44:59 -08:00
Juan Batiz-Benet
fbee577d3b secio: at last! bugfix found. 2014-12-19 19:36:01 -08:00
Juan Batiz-Benet
16497ed7a3 more secio debugging 2014-12-19 19:35:50 -08:00
Juan Batiz-Benet
c49580044d peer fix: String() uses Pretty 2014-12-19 19:15:37 -08:00