forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate encryption into dpa and chunker (ethereum#327)
* swarm: Integrate encryption into dpa and chunker This is not a fully functional change. Chunker api changed: it uses Putter and Getter interfaces to put and get chunks from the store and to do the encryption/decryption if needed. These putters and getters should also the hashing, so hashing related code could be removed from chunker. Some things are temporary, pyramid chunker doesn't work yet (only tree chunker), and hashing and putting in dpa is not parallelized. * swarm/storage: Use TreeChunker in DPA PyramydChunker doesn't work yet with Putter/Getter * swarm/storage: HasherStore needs a new hasher instance on every chunk creation This fixes the tests with pyramid chunker * swarm/storage: Add back tree/pyramid comparison in chunker test * swarm: Refactor chunker, new chunker instance is needed for each job Chunker code is much simpler if all data of the job is stored on the chunker object itself. * swarm/storage: Remove commented code * swarm/storage: Added comments * cmd/swarm: Remove Branches from config * swarm/storage: Remove commented code * swarm/network: Remove chunker from syncer * swarm/storage: Remove Chunker/Splitter/Joiner interfaces They are not used anymore * swarm/storage: Fix comment * swarm/storage: Reenable chunker_test.TestDataAppend * swarm/storage: Fix comments * swarm/storage, cmd/swarm: Add FakeChunkStore Instead of using a nil ChunkStore in hasherStore when we don't want the hasherStore to actually store the chunk data, now a FakeChunkStore instance should be used. Because of this the nil checks of the hasherStore.store could be removed. * swarm/storage: Use DefaultChunkSize az constant, not DefaultBranches The branches what is changing, and it is dependent on chunk size and hash size * swarm/storage: Remove unnecessary return statement * swarm/storage: Rename unfinishedChunk to unfinishedChunkData * swarm/storage: Move NewTreeSplitterParams to chunker.go It was in pyramid.go, although TreeSplitter is in chunker.go * swarm/storage: Minor cleanup incrementWorkerCount can be moved into runWorker remove obsolete comment * swarm/storage: Add TODO comment to chunker depth parameter Depth can only be 0 because of a bug: ethersphere/swarm#344 * swarm/storage: Fix padding in hasherStore There was a bug that data was not lengthened to padding * swarm/storage: Add unit test for hasherStore * swarm/storage: Decrease initial counter in span encryption * swarm/storage: Renames in benchmark tests * swarm/storage: Fixed pyramid benchmark test * swarm/storage: Convert TestHasherStore to table-driven test * swarm/storage, cmd/swarm: New MapChunkStore, simple ChunkStore implementation It is not just the test which needs this kind of implementation * swarm/storage: Cleanup on hashSize/chunkSize handling
- Loading branch information
Showing
31 changed files
with
1,012 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.