Commit Graph

221 Commits

Author SHA1 Message Date
Jakub Sztandera
9c194aa7e2
fix: remove bloom filter check on Put call in blockstore
To prevent put we need to have conclusive information if item is
contained in the repo, bloom filter won't give this information.
It only says if it is for sure not contained.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2017-03-14 00:57:13 +01:00
Jeromy
2884c84343 Implement basic filestore 'no-copy' functionality
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2017-03-06 00:37:24 -08:00
Jeromy
b4eeff2d84 update go-multihash and bubble up deps
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2017-02-12 12:25:41 -08:00
Jakub Sztandera
cc61e5bb1a
test: Bloom filter, basic filter test
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-12-07 08:23:59 +01:00
Mib Kd743naq
a7abc9cdcc Fix bad formatting introduced by e855047ec
License: MIT
Signed-off-by: Mib Kd743naq <mib.kd743naq@gmail.com>
2016-12-02 05:25:27 +01:00
Kevin Atkinson
aaaab9508c blockstore.AllKeyChan: fix/cleanup error handling
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-30 18:21:24 -05:00
Kevin Atkinson
24aa42d85d blockstore.AllKeyChan: avoid channels by using the new NextSync method
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-30 17:50:19 -05:00
Jeromy Johnson
f8635ba01f Merge pull request #3407 from ipfs/kevina/dskey-minalloc
ds-help: avoid unnecessary allocs when posssible and make use of RawKey
2016-11-30 14:48:14 -08:00
Jeromy Johnson
e855047ec8 Merge pull request #3418 from ipfs/kevina/rmblock-noblock
"block rm": make channel large enough to avoid blocking
2016-11-30 10:52:32 -08:00
Kevin Atkinson
1c7e2b2456 ds-help: avoid unnecessary allocs when posssible and make use of RawKey
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-29 12:49:21 -05:00
Jeromy
53d47669da bubble up go-datastore deps
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-11-28 22:29:38 -08:00
Kevin Atkinson
ba383eda00 "block rm": make channel large enough to avoid blocking
Make the channel for the output of RmBlocks large enough to hold any
result to avoid blocking while holding the GCLock.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-23 18:04:12 -05:00
Jeromy
396c629301 update to newer ipld node interface with Copy and better Tree
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-11-15 18:00:49 -08:00
Jeromy Johnson
bc21966b0a Merge pull request #3384 from ipfs/kevina/blockstore-kill-debug-stmt
blockstore: remove expensive debug statement in AllKeysChan
2016-11-14 17:38:25 -08:00
Kevin Atkinson
62c380b001 blockstore: remove expensive debug statement in AllKeysChan
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-14 16:57:40 -05:00
Kevin Atkinson
d48d90447b blockstore: fix TODO and avoid calling ds.NewKey
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-14 01:49:39 -05:00
Kevin Atkinson
ffe9d7dae4 Separate out the G.C. Locking from the Blockstore interface.
Factored out of #3257 (Add support for multiple blockstores).

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-11-02 21:56:34 -04:00
Richard Littauer
9843e86258 Changed so only explicit ipfs cli commands are lowercased
License: MIT
Signed-off-by: Richard Littauer <richard.littauer@gmail.com>
2016-10-27 22:55:13 -07:00
Jeromy
eac13abaec update to new cid and ipld node packages
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-25 09:54:04 -07:00
Jeromy Johnson
6f3ae5da29 Merge pull request #3307 from ipfs/feat/raw-nodes
Implement 'Raw Node' node type
2016-10-24 11:59:27 -07:00
Jeromy
9796a03624 update HashOnRead validation to properly support cids
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-18 16:03:26 -07:00
Jeromy Johnson
716aa867f5 Merge pull request #3310 from ipfs/kevina/cid2dskey
ds-help: add helper functions to convert from Cid to DsKey and the reverse
2016-10-18 10:24:20 -07:00
Jeromy
ded60a7356 unixfs: allow use of raw merkledag nodes for unixfs files
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-17 16:51:39 -07:00
Kevin Atkinson
c4fbe348f8 ds-help: add helper func to convert from Cid to DsKey and the reverse
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-10-17 18:13:07 -04:00
Jeromy
01aee44679 merkledag: change 'Node' to be an interface
Also change existing 'Node' type to 'ProtoNode' and use that most
everywhere for now. As we move forward with the integration we will try
and use the Node interface in more places that we're currently using
ProtoNode.

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-12 08:16:03 -07:00
Jeromy Johnson
015d476c4f Merge pull request #3297 from ipfs/feat/bitswap-cid
bitswap: protocol extension to handle cids
2016-10-12 10:13:30 -04:00
Jakub Sztandera
9854683daa test: check if NewWriteThrough is not calling Has
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-10-11 15:04:07 -04:00
Jeromy
f4d7369c4a bitswap: protocol extension to handle cids
This change adds the /ipfs/bitswap/1.1.0 protocol. The new protocol
adds a 'payload' field to the protobuf message and deprecates the
existing 'blocks' field. The 'payload' field is an array of pairs of cid
prefixes and block data. The cid prefixes are used to ensure the correct
codecs and hash functions are used to handle the block on the receiving
end.

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-10 08:19:31 -07:00
Jeromy
282bdc4816 cid: integrate cid into bitswap and blockstores
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-08 12:14:58 -07:00
Jeromy
1f9ec4e3ed update to libp2p 4.0.1 and propogate other changes
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-10-05 22:12:43 -07:00
Jeromy
5457a85cef
Merge branch 'version/0.4.3-rc4'
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-20 19:10:10 -07:00
Jeromy Johnson
e10453b67b Merge pull request #3220 from ipfs/deps/extract-dht
routing: use extracted dht and routing code
2016-09-19 19:38:37 -07:00
Jeromy Johnson
87ecb92fce Merge pull request #3225 from ipfs/kevina/rm-block-refactor
"block rm": move core functionally into blockstore_util package
2016-09-19 19:30:46 -07:00
Jeromy
d0e0123426 Remove now unused code
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-19 18:28:00 -07:00
Kevin Atkinson
d04308240d "block rm": Document RemovedBlock. Interface tweaks.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-09-15 14:55:46 -04:00
Kevin Atkinson
6b2b976c57 "block rm": just return "error" in ProcRmOutput
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-09-15 04:15:59 -04:00
Kevin Atkinson
5901e57dfc "block rm": move core functionally into blockstore_util package
Note: this code can not go in the "blockstore" package due to a
circular dependency with the "pin" package.

License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-09-15 04:15:44 -04:00
Jakub Sztandera
c7d89662a1
metrics: do not run bloom fillrate collector when metrics are inactive
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:10 +02:00
Jakub Sztandera
a5899a4fb9
deps: update go-metrics-interface and -prometheus to 0.1.2
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:10 +02:00
Jakub Sztandera
5f0be2eaa9
blockstore: add Bloom fill ratio metric
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:10 +02:00
Jakub Sztandera
95dca1ecdf
blockstore: update bbloom
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:09 +02:00
Jakub Sztandera
d1237f1c90
blockstore: change order of newARCCachedBS parmaeters
so the context is first one

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:09 +02:00
Jakub Sztandera
66a031f17c
blockstore: move ARC cache below the bloom cache
ARC cache is influenced by requests and bloom isn't
This means that if bloom is able to remove some requests caching them in
ARC is pointless.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:09 +02:00
Jakub Sztandera
3251c29f15
metrics: add hit counter for ARC and bloom caches
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-13 14:00:09 +02:00
George Antoniadis
6859b8ccd8 Extract key and datastore
License: MIT
Signed-off-by: George Antoniadis <george@noodles.gr>
2016-09-09 15:52:25 +01:00
Jeromy Johnson
3babf40e74 Merge pull request #3187 from ipfs/feat/cidv0
Rework go-ipfs to use content IDs version 0
2016-09-09 10:14:39 -04:00
Jeromy Johnson
531b89abc9 Merge pull request #3143 from ipfs/feat/bs/rename-hashonread
blockstore: rename RuntimeHashing to HashOnRead
2016-09-08 09:30:03 -04:00
Jeromy
c8fe495934 integrate CIDv0
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-09-07 13:32:32 -07:00
Jakub Sztandera
27279cdefe
blockstore: change unit of bloom filter to byte from bits
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-06 20:20:19 +02:00
Jakub Sztandera
d080ff19dd
test: add test case for PutMany on bloom filter skipping add to bloom
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-06 09:56:23 +02:00
Jakub Sztandera
4c86d7a4f8
test: add test case for PutMany using cache to eliminate the call
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-06 09:56:23 +02:00
Jakub Sztandera
c4323c0bcf
blockstore: fix PutMany with cache logic
Thanks @whyrusleeping for noticing it.

Removed PutMany logic in bloom cache as it can't help with anything.
Fixed ARC cache to use filtered results instad of all blocks.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-09-06 09:56:23 +02:00
Jakub Sztandera
dfc58c791d
blockstore: rename RuntimeHashing to HashOnRead
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-29 21:53:40 +02:00
Jeromy
05b197df2d update deps for libp2p 3.4.0
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-08-25 19:02:55 -07:00
Jeromy Johnson
01ffc15283 Merge pull request #3086 from ipfs/feat/test-cover-blocks
test: 82% coverage on blocks
2016-08-18 16:45:18 -07:00
Jeromy Johnson
10048ceca9 Merge pull request #2962 from ipfs/kevina/block-rm
Add "ipfs block rm" command.
2016-08-18 13:27:26 -07:00
Jeromy Johnson
1a4361e71c Merge pull request #3074 from ipfs/feat/test-cover-blockstore
test: 81% coverage on blockstore
2016-08-18 11:02:42 -07:00
Jakub Sztandera
4ed8c3e5d9
test: fix typo in blockstore test
Also format imports

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-18 18:09:33 +02:00
Kevin Atkinson
bf7c5b3037 Fix bug in arccache.DeleteBlock() method.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-08-16 19:26:17 -04:00
Jakub Sztandera
7febd606d4
test: fixup style and add more checks to blockstore tests
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-16 18:59:36 +02:00
Jeromy Johnson
8c237ce5d2 Merge pull request #3084 from ipfs/feat/test-cover-blocks-set
test: 100% coverage on blocks/set
2016-08-16 09:31:24 -07:00
Jakub Sztandera
594c946606
docs: decapitalize error message in blocks.go
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-16 17:36:18 +02:00
Jakub Sztandera
21cbb90960
test: 100% coverage for blocks/blocksutil
This was easy.

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-16 13:03:20 +02:00
Jakub Sztandera
a63b5c38b7
test: make the test bit cleaner
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-16 12:53:27 +02:00
Jakub Sztandera
2408f866c5
blocks: rename errWrongHash to ErrWrongHash
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-16 12:42:18 +02:00
Jakub Sztandera
68d5197265
test: do explicit error check
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@ipfs.io>
2016-08-15 17:23:44 +02:00
Jakub Sztandera
233a622ed0
test: 81% coverage on blockstore
Coverage report available at: https://ipfs.io/ipfs/QmTuMtwGCfHrbYyZdQ1RaGNwS2MGsmAkjA8AaB69N7Ya1g/coverage.html#file0

Part of #3053

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@ipfs.io>
2016-08-15 16:21:52 +02:00
Jakub Sztandera
fcdf52735e test: 82% coverage on blocks
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-15 12:47:50 +02:00
Jakub Sztandera
9437b3af61 test: 100% coverage on blocks/set
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-15 12:03:43 +02:00
Jakub Sztandera
61b481628a blockstore: cleanup the style removing some mess from the refactor
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-03 13:54:37 +02:00
Jakub Sztandera
9543ed6ca1 blockstore: cleanup style a bit
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-02 15:03:27 +01:00
Jakub Sztandera
4183902e46 blockstore: extract ARC cache from Bloom cache
it removes race condition that would happen during various calls

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-08-02 01:10:48 +01:00
Jeromy
e8addf5ee3 use batching datastore for providers storage
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-26 10:48:25 -07:00
Jeromy Johnson
4e67003f5a Merge pull request #2953 from ipfs/feature/blocks-bloom-no-rebuild
core: do not run bloom in case of ephemeral node
2016-07-10 13:34:44 -07:00
Kevin Atkinson
9e6cc1f112 Increase channel buffer size in blockstore.AllKeysChan().
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-07-10 15:41:58 -04:00
Jakub Sztandera
58526b25b5 blocks/blockstore: shift insertion of TODO context to tests
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-10 15:16:42 +02:00
Jakub Sztandera
af7778213c block/blockstore: bloomcache PutMany logic was not adding to ARC
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-08 21:17:32 +02:00
Jakub Sztandera
61a3d127e7 blocks/blockstore: improve logic a bit
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-08 21:17:32 +02:00
Jakub Sztandera
016d3d97ef blocks/blockstore: introduce context passing to blockstore
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-08 21:17:32 +02:00
Jakub Sztandera
3035aa8935 blocks/blockstore: add CacheOpts - structure of cache config
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-08 20:53:11 +02:00
Jakub Sztandera
f13506c11a blocks/blockstore: style cleanup of bloomcache
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-04 20:34:46 +02:00
Jakub Sztandera
e92e6662a7 test: fix races in bloomcache tests
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-04 20:34:07 +02:00
Jakub Sztandera
98f877af81 blocks/blockstorage: use automic for bloom.active
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-04 20:12:13 +02:00
Jakub Sztandera
5d83d89f36 blocks/blockstore: Add bloom filter
Replace write_cache with bloom_cache
Improve ARC caching
Fix small issue in case of AllKeysChan fails
deps: Update go-datastore
blocks/blockstore: Invalidate ARC cache before deletin block
deps: Update go-datastore

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-07-03 22:16:28 +02:00
Jeromy
0aafa6db8c update go-datastore changes 0.1.2
License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-01 22:40:57 -07:00
Jeromy
0782c4dc03 encode keys to datastore with base32 standard encoding
Fixes #2601

Also bump version to 0.4.3-dev

License: MIT
Signed-off-by: Jeromy <why@ipfs.io>
2016-07-01 14:15:06 -07:00
Jakub Sztandera
f2686965ac tests: Add test to RuntimeHashing option of blockstore
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-24 22:21:01 +02:00
Jakub Sztandera
989e91b1c4 blockstore: add fetch rehashing
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-24 22:20:58 +02:00
Jakub Sztandera
ce8c8a7a71 Update go-log in whole dependency tree (#2898)
* Update golog in go-ipfs

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-secio for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-crypto for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p-peer for go-log

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Import peersore, it wasn't imported

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update peerstore

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update peer

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update secio

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>

* Update go-libp2p

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-24 09:38:07 -07:00
Jakub Sztandera
5a08e9e08a Remove failing blockstore test with context
Why is it failing:
process is started, cancel() is called,
between we satart listening to the channels
in select statemnet there is race of three things
that can happent:
 1. Task can complete
 2. Task can start closing <- expected
 3. Task already closed

This race causes failures of the test.

It is basing heavily on race of conditions where
the task not closing, nor the task is completed
before channels are being listened.

It is quite impossible to resolve without
adding bunch of timings in there, which we
want to avoid, as there is no atomic
"send message on channel and select" in Golang

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-15 21:06:34 +02:00
Jakub Sztandera
a14bd71749 Move golang-lru to gx
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-12 10:02:44 +02:00
Jakub Sztandera
cafd81c8c6 Import go-datastore to gx
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-12 08:47:15 +02:00
Jakub Sztandera
6217e1f141 Remove go-datastore from Godeps
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-12 08:23:43 +02:00
Jakub Sztandera
eaccd07505 Update go-log
https://github.com/ipfs/go-log/pull/3

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-06-09 23:37:09 +02:00
Kevin Atkinson
dbabcf9681 Rename blocks.RawBlock to blocks.BasicBlock.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-06-01 17:14:16 -04:00
Jakub Sztandera
e86bf92f31 Migrate hamming to gx from Godeps
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2016-05-19 06:45:19 +02:00
jbenet
0ddafe603a add error checking for nil keys
Checks in:
- blockstore
- blockservice
- dagservice
- bitswap

Do not anger the pokemans #2715

License: MIT
Signed-off-by: Juan Benet <juan@benet.ai>
2016-05-16 23:03:28 -07:00
Kevin Atkinson
b84cbec2b6 Make blocks.Block an interface.
License: MIT
Signed-off-by: Kevin Atkinson <k@kevina.org>
2016-05-05 18:02:11 -04:00
Hector Sanjuan
57b494a70c Update go-log to 1.1.0 and fix calls to go-log.Uuid
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2016-05-04 23:17:21 +02:00
Jeromy
e79e1d31e9 remove a ton of unused godeps
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-04-13 11:23:10 -07:00