-
Notifications
You must be signed in to change notification settings - Fork 20.9k
swarm: Directory manifest type #14349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ok we should start writing this up in a wiki or gist to see the whole picture. In general the direction is to hide manifests. they should not be the format used for directory indexes. When downloading the compacted trie style manifest is, however. Even in such cases the problem only occurs if there are paths with and without the slash, e.g., A related issue is the ability to set the default entries for each directory as path, e.g., an index.html.
this is equivalent (is downloaded as):
|
There was some talk at the swarm orange summit 2018 about different types of manifest beyond the current simple type. |
this will generally obsolete the current manifest type and will make it a special case needed only for traversals. it will also obsolete most fields on current manifest type as they will not be needed anymore. i think this change will make current traversal code's more complex in order to reach the exact same functionality it posses today. we would have to traverse both types anyway. a more favourable solution would be to just add a bool flag on the current manifest type. |
You mean a bool flag "ismanifest=true"? sure, that's how you'd show that this manifest is of directory type, but the rules are more than just having empty dirs, it must also include no filenames ending in / for example. no? |
in this regard, a trie split and a directory manifest are both cases of manifests. i mean a flag to denote |
@justelad I think it is worth zooming out and perhaps coming up with a more robust design. Having the trie represented at the level of the manifest is, in my opinion, mixing two different abstractions into one. I think the system should be layered:
|
@lmars I agree with you and I think this is evident from my comment in the swarm manifest SIP. The idea to ditch the trie design was not accepted so far in the team |
who is 'the team' here? who makes that decision? whose answer / input do you need? |
@lmars @homotopycolimit @zelig let's continue this conversation at https://github.com/ethersphere/swarm as the Swarm codebase lives there from now on. |
Collections of files are currently modelled using JSON manifests containing a list of entries, with each entry having a path, hash and some file attributes like size, content type, mode etc.
The manifests are stored as a trie such that multiple files which share a common prefix are represented by a sub-manifest.
Consider storing a collection of three files named
foo.txt
,files/01.txt
andfiles/02.txt
, these would be represented by the following:This representation leads to added complexity when treating this collection like a Unix filesystem (e.g. mounting it with FUSE or listing files in a directory), and is actually less performant than if the manifests just represented directory indexes (compare looking up
f
->iles/0
->{1,2}.txt
to an equivalent directory based lookupfiles
->0{1,2}.txt
).Files can also contain a trailing slash which is also problematic (there is no way to access a file named
files/
in a Unix filesystem as it would be treated like a directory lookup).To solve these issues, we propose adding an explicit "directory" manifest type which is more like a traditional Unix filesystem:
application/bzz-manifest+json
are equivalent to directory inodes (i.e. a list of files or subdirectories)/
characterThis makes it easier to traverse the collection like a Unix filesystem, and also solves the issue of files which have trailing slashes being inaccessible in a FUSE mount (since they are no longer permitted).
The above collection of files would then be represented by:
/cc @zelig @homotopycolimit
The text was updated successfully, but these errors were encountered: