251 Commits

Author SHA1 Message Date
Jeromy
a3cdab1e3c return sentinel error for invalid records
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
0df847e059 send record fixes to peers who send outdated records
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
Jeromy
d8e0925111 Addressing comments from CR
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-30 22:50:50 -07:00
Jeromy
badc73888c Fix dht queries
Queries previously would sometimes only query three (alpha value) peers
before halting the operation. This PR changes the number of peers
grabbed from the routing table to start a query to K.

Dht nodes would also not respond with enough peers, as per the kademlia
paper, this has been changed to from 4 to 'K'.

The query mechanism itself also was flawed in that it would pull all the
peers it had yet to query out of the queue and 'start' the query for
them. The concurrency rate limiting was done inside the 'queryPeer'
method after the goroutine was spawned. This did not allow for peers
receiver from query replies to be properly queried in order of distance.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-29 09:47:47 -07:00
Jeromy
8d43181030 ipns record selection via sequence numbers
This commit adds a sequence number to the IpnsEntry protobuf
that is used to determine which among a set of entries for the same key
is the 'most correct'.

GetValues has been added to the routing interface to retrieve a set of
records from the dht, for the caller to select from.

GetValue (singular) will call GetValues, select the 'best' record, and
then update that record to peers we received outdated records from.
This will help keep the dht consistent.

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-29 09:47:41 -07:00
Jeromy
029a136759 use correct context for dht notifs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-12 16:08:57 -07:00
Jeromy
21ccd2d22c make ping its own protocol
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-13 19:19:25 -07:00
Jeromy
a84b8b7bed move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
Juan Batiz-Benet
05a4862040 remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
Jeromy Johnson
bdd00c9d73 Merge pull request #986 from ipfs/feat/dht-bw-usage
reduce dht bandwidth consumption
2015-03-31 18:15:18 -07:00
Ho-Sheng Hsiao
0f9082aa6c Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Jeromy
ad432fe84e reduce dht bandwidth consumption
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-03-30 07:54:17 -07:00
Jeromy
50738e56bd move signing options into a validation checker struct 2015-02-26 22:05:03 -08:00
Jeromy
a68a1e814a make signing dht put records optional 2015-02-26 22:05:03 -08:00
Jeromy
ac8d504ad3 make the providers manager respect contexts 2015-02-26 18:02:23 -08:00
Juan Batiz-Benet
bb48f1161c Merge pull request #819 from jbenet/x_net_context_leeroy
update context imports to golang.org/x/net
2015-02-25 03:17:28 -08:00
Henry
9bc5b3d5d3 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
66376057f8 error -> debug 2015-02-23 21:09:16 -08:00
Jeromy
5d1cd1014b dont potentially kill our memory 2015-02-23 21:09:16 -08:00
Jeromy
d88233353f add put and get dht commands to cli 2015-02-23 21:09:16 -08:00
Juan Batiz-Benet
243c85a4e4 dropped down log.Errors 2015-01-26 19:13:44 -08:00
Jeromy
20687447c7 correct notifications for findProviders 2015-01-25 01:41:06 +00:00
Brian Tiger Chow
7429f19731 remove prefix logger 2015-01-24 00:30:56 -08:00
Jeromy
4f4246dba5 respect verbose option a bit, and show query events for other commands 2015-01-24 05:32:50 +00:00
Jeromy
2c2de4d93d use a notification type strategy for the query events 2015-01-24 03:56:45 +00:00
Jeromy
c1e316a764 really ugly impl of 'ipfs dht query' command 2015-01-24 03:56:45 +00:00
Juan Batiz-Benet
8d7a79816a dht: kick off all the queries wit every node in our rt
s/kademlia calls for makign sure to query all peers we
have in our routing table, not just those closest. this
helps ensure most queries resolve properly.
2015-01-23 02:08:29 -08:00
Brian Tiger Chow
dc586ab20f demote dht logs 2015-01-20 23:43:21 -08:00
Jeromy
c1596f4ab6 move dht record code into new package 2015-01-19 08:07:58 +00:00
Jeromy
71f6e2552f fix fuse mounting issues
this time, without loading the private key on every startup
2015-01-19 08:05:52 +00:00
Juan Batiz-Benet
38c3e88e61 addr-explosion mitigated adding
mitigated adding our own addresses where received
from peers

see #573
2015-01-16 11:38:46 -08:00
Jeromy
52de86ae4f remove low signal log messages 2015-01-15 22:01:33 +00:00
Jeromy
ac9e3a3377 rewrite as single line defer logs 2015-01-15 04:45:34 +00:00
Jeromy
074439d419 starting to move important events over to EventBegin/Done 2015-01-15 04:17:17 +00:00
Jeromy
f2669289fa Address PR comments and add in more user feedback 2015-01-10 07:27:48 +00:00
Juan Batiz-Benet
92c24c08ae dht: even more logging. 2015-01-05 04:55:02 -08:00
Juan Batiz-Benet
f47e5375a4 dht: some provider debug logging 2015-01-05 00:16:52 -08:00
Juan Batiz-Benet
719cd7c51c swap net2 -> net 2015-01-02 08:46:46 -08:00
Juan Batiz-Benet
6bc26e01f3 net -> p2p/net
The net package is the next to move. It will be massaged
a bit still to fix the Network / "NetworkBackend" conflict.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
2b086634b2 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
fb661d5b31 routing: use debugerror 2015-01-02 08:36:32 -08:00
Jeromy
f57104bc6b Improve readability of getClosestPeers method.
Also remove older useless code.
2015-01-02 07:42:09 +00:00
Jeromy
2ec86a468d use query for getClosestPeers 2015-01-02 07:42:08 +00:00
Jeromy
0408e60ef6 some better logging and cleanup 2015-01-02 07:42:08 +00:00
Jeromy
72ac0bf268 a couple small fixes 2015-01-02 07:42:08 +00:00
Jeromy
0547622e00 rewrite of provides to better select peers to send RPCs to
refactor test peer creation to be deterministic and reliable

a bit of cleanup trying to figure out TestGetFailure

add test to verify deterministic peer creation

switch put RPC over to use getClosestPeers

rm 0xDEADC0DE

fix queries not searching peer if its not actually closer
2015-01-02 07:42:07 +00:00
Brian Tiger Chow
898ba6add9 wip with DHT
@whyrusleeping @jbenet this is a WIP with the DHT.

wip

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	epictest/addcat_test.go
	exchange/bitswap/testnet/peernet.go
	exchange/bitswap/testutils.go
	routing/mock/centralized_server.go
	routing/mock/centralized_test.go
	routing/mock/interface.go

fix(routing/mock) fill in function definition
2014-12-24 09:31:19 -05:00
Juan Batiz-Benet
ed7ef491e6 dht: helpful debugging for no closer peers 2014-12-23 09:03:26 -08:00
Juan Batiz-Benet
3b37c43171 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	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.
-	updated peer/queue + peerset
-	latency metrics
-	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
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Jeromy
de0913f98f clean peerset constructor names 2014-12-17 23:44:46 -08:00