Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

swarm/storage: Filehasher prototypes #969

Closed
wants to merge 50 commits into from

Conversation

nolash
Copy link
Contributor

@nolash nolash commented Oct 20, 2018

This PR outlines prototypes for the next generation content hashing engine in swarm.

It includes:

  • FileHasher - A doubly linked object chain of levels, batches and chunks, where batches are in pools that can be reserved and released at need. Hashes asynchronously.
  • Collection FileSplitter,FilePadder, FileChunker that attempt to demonstrate the chained writing concept that the end result should culminate in. FileSplitter also tries a different approach for async writing than AltFileHasher and FileHasher
  • AltFileHasher - A linear, finite size state object where hashing is done in one batch-size buffer for each level. Hashes asynchronously, and currently performs the tests at about 1/3 the speed of FileHasher
  • ReferenceFileHasher - A single buffer object where hashes of higher levels are prepended to the buffer as hashing is performed. Hashes synchronously (only for correctness).

NOTE: During this work a bug was found in the previous hasher implementations, leading to incorrect hashes in "danglig chunk" configuations. Currently ReferenceFileHasher from this branch is considered to be the source of truth for file hashing in Swarm (perhaps we should merge that to the codebase separately).


TODO: Add a thorough and legible description of how all this actually works.

zelig and others added 23 commits October 20, 2018 12:13
returns 5fcbddf3030d1a261b80f5a069b731f1f5e90c52df4b18036b43434cda8f3305 regardless of data
Fails on chunksize*128^2
Also hangs on smaller tree pool in bmt
alt filehasher hangs on dangling chunk, wip fix
Hangs intermittently, review concurrency in write state vars
@nolash nolash force-pushed the chunker-refactor-deepdirect-alt branch from 3fc60bb to 55b331c Compare March 9, 2019 22:52
@acud acud removed the do-not-merge label Jul 1, 2019
@nolash nolash closed this Nov 10, 2019
@nolash nolash deleted the chunker-refactor-deepdirect-alt branch November 10, 2019 13:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants