tahoe-lafs objects #959

Open
opened 2010-02-15 23:34:21 +00:00 by warner · 10 comments

When Zooko and I did a run-through of our upcoming RSA talk at the
"friam" captalk meeting (12-feb-2010), Carl Hewitt asked the
question "what would it take to turn this Tahoe file/directory
graph into a graph of objects?". We generally understood
"objects" to mean "bundle of state and behavior", like in
object-oriented programming, whereas Tahoe's current file/directory
objects are just inert state (with any behavior coming from the
Tahoe client node that's processing it)..

This question prompted a lot of deep thinking around the table.
There is a very juicy idea lurking in this, but we all
metaphorically went off to separate corners to meditate on it.

Norm Hardy expressed his subsequent thoughts here:
http://cap-lore.com/BigStore/Tahoe.html .

Zooko, when asked a day later on IRC, mentioned these:

  1. we should make tahoe dirs extensible as suggested by someone
  2. we should have a meeting of the minds with friam especially
    Norm to understand how "opaque object" stuff can be implemented
    just by making the gateway be the security (and availability ?)
    domain for your opaque object.

The idea that came to me (Brian) was:

  • suppose we stored three things in a Tahoe file
  • a numerically-indexed list of childcaps (the "C-list")
  • an arbitrary chunk of serialized state
  • a chunk of code written in some confineable language (E or
    secure javascript), or perhaps an immutable reference to some
    external code file, share between lots of objects
  • Some subset of these three things might be mutable, or maybe
    they'd all be immutable. Some filecap points to this collection.
  • when a Tahoe client node loads this object, it runs the code and
    gives it access to:
    • the serialized state
    • the objects referenced by the childcaps (but not the caps
      themselves)
  • the object receives any webapi request messages aimed at its
    filecap, processes those requests itself, then can update its
    state and/or return a response

Much of the post-Carl's-question discussion was about how to
implement an "opaque boundary", which I interpreted to mean hiding
the childcaps from the confined code that gets run. The code would
be able to reference childcap[0] and send it messages, but
it wouldn't be allowed to know the actual childcap string (thus
helping the child maintain its own privacy).

I'm not sure where to go with these ideas, but they smell powerful.
One direction is a forwards-compatibility thing: with a
sufficiently general runtime environment for the bundled code, it
could be used to implement dirnodes, add-only collections,
revocable forwarders, all sorts of stuff that we haven't invented
yet. Those fancy things could work on Tahoe clients that were
written before the fancy thing was invented because they'd be
implemented by portable code that would come along with the object
being stored.

Our current dirnode actions (get child, add child, rename, list,
delete) could probably be implemented this way (with some
additional layer to hide new childcaps from the embedded code,
maybe an extra webapi service which adds childcaps to the C-list
and only informs the code about the new index).

This whole thing falls into the category of "mobile code", except
that instead of a behavior-laden object moving directly from one
machine to another, it's being stored in the grid and waking up
again later (in one or many places). These objects would have
control over their internal state (subject to the behavior of any
client node that was allowed to host one of them). Isolation
between these objects would be provided by the client nodes.

Something to brainstorm about, at any rate..

When Zooko and I did a run-through of our upcoming RSA talk at the "friam" captalk meeting (12-feb-2010), Carl Hewitt asked the question "what would it take to turn this Tahoe file/directory graph into a graph of **objects**?". We generally understood "objects" to mean "bundle of state and behavior", like in object-oriented programming, whereas Tahoe's current file/directory objects are just inert state (with any behavior coming from the Tahoe client node that's processing it).. This question prompted a lot of deep thinking around the table. There is a very juicy idea lurking in this, but we all metaphorically went off to separate corners to meditate on it. Norm Hardy expressed his subsequent thoughts here: <http://cap-lore.com/BigStore/Tahoe.html> . Zooko, when asked a day later on IRC, mentioned these: 1. we should make tahoe dirs extensible as suggested by someone 2. we should have a meeting of the minds with friam especially Norm to understand how "opaque object" stuff can be implemented just by making the gateway be the security (and availability ?) domain for your opaque object. The idea that came to me (Brian) was: * suppose we stored three things in a Tahoe file * a numerically-indexed list of childcaps (the "C-list") * an arbitrary chunk of serialized state * a chunk of code written in some confineable language (E or secure javascript), or perhaps an immutable reference to some external code file, share between lots of objects * Some subset of these three things might be mutable, or maybe they'd all be immutable. Some filecap points to this collection. * when a Tahoe client node loads this object, it runs the code and gives it access to: * the serialized state * the objects referenced by the childcaps (but not the caps themselves) * the object receives any webapi request messages aimed at its filecap, processes those requests itself, then can update its state and/or return a response Much of the post-Carl's-question discussion was about how to implement an "opaque boundary", which I interpreted to mean hiding the childcaps from the confined code that gets run. The code would be able to reference `childcap[0]` and send it messages, but it wouldn't be allowed to know the actual childcap string (thus helping the child maintain its own privacy). I'm not sure where to go with these ideas, but they smell powerful. One direction is a forwards-compatibility thing: with a sufficiently general runtime environment for the bundled code, it could be used to implement dirnodes, add-only collections, revocable forwarders, all sorts of stuff that we haven't invented yet. Those fancy things could work on Tahoe clients that were written before the fancy thing was invented because they'd be implemented by portable code that would come along with the object being stored. Our current dirnode actions (get child, add child, rename, list, delete) could probably be implemented this way (with some additional layer to hide new childcaps from the embedded code, maybe an extra webapi service which adds childcaps to the C-list and only informs the code about the new index). This whole thing falls into the category of "mobile code", except that instead of a behavior-laden object moving directly from one machine to another, it's being stored in the grid and waking up again later (in one or many places). These objects would have control over their internal state (subject to the behavior of any client node that was allowed to host one of them). Isolation between these objects would be provided by the client nodes. Something to brainstorm about, at any rate..
warner added the
c/unknown
p/major
t/enhancement
v/1.6.0
labels 2010-02-15 23:34:21 +00:00
warner added this to the undecided milestone 2010-02-15 23:34:21 +00:00

I'm not sure I understand Norm's terminology at http://cap-lore.com/BigStore/Tahoe.html but it looks like his proposal is the same as Brian's idea in the original post of this ticket.

I'm not sure I understand Norm's terminology at <http://cap-lore.com/BigStore/Tahoe.html> but it looks like his proposal is the same as Brian's idea in the original post of this ticket.

Norm wrote on http://cap-lore.com/BigStore/Tahoe.html:

This plan contravenes an implicit Tahoe dictum: “Trust no mechanism outside your physical control.”. The O-agents of a given RSA key pair rely on either tamper resistance, or more likely physical protection. I think that Tahoe also violates this property in their scheme for mutable objects. (I am not sure.) Such violation also seems necessary for revocation services. In all three cases the trust of externally instantiated objects impacts only those who specifically rely on them.

I don't think Tahoe-LAFS violates this property for our mutable files but to be sure let's see if we can restate the property in terms of "reliance sets" (as in MarkM's thesis).

The set of things that you rely on for the unforgeability of your mutable files is:

  1. the client (e.g. a web browser which is viewing the file or a unix shell which is catting the file to its stdout)
  2. the Tahoe-LAFS gateway

Note that a very common deployment pattern is that you run your own Tahoe-LAFS gateway on your local computer, so both of the items in the reliance set are running as user-space processes within the protection of your operating system and your machine.

So all of the items in the set of "things on which you rely for unforgeability of your mutable files" can be under your physical control.

Now, what about this notion of "Tahoe-LAFS objects"? My proposal for how to implement Tahoe-LAFS objects is simply to make a special client that implements the attenuated, revocable, filtered, or otherwise modified access and that itself has access to the underlying files. That Tahoe-LAFS client then serves its special kind of access out to another client. Let's call that Tahoe-LAFS client an "opaque object server". Then the set of "things on which you rely for the unforgeability of your mutable file" becomes:

  1. your client (such as a web browser or cmdline tool), which connects to the opaque object server
  2. the opaque object server, which connects to the Tahoe-LAFS gateway
  3. the Tahoe-LAFS gateway

(Note: the "opaque object server" is just what Norm mentioned early on his page when he wrote: "The obvious way to do this is to create a web server with the custom filter programmed in, and endow that server with the file handle to the original file.".)

Now here is where it gets confusing to me: we can't maintain the opacity property if you run the opaque object server on your own local machine! So now you can either have the unforgeability property within your physical control (by running all three elements of the reliance set on your own local machine) or you can have the opacity property (by running the opaque object server on a machine that you cannot hack), but not both.

(I haven't thought it through, but I suspect that the "distributed opaque object" proposals by Norm and by Brian will have the same choice.)

But you know what, the opaque object property is not something that the user actually wants. I'll be happy to run all three elements on my own machine and use the resulting "not really opaque" objects. The opacity property is a way to prevent me from doing something, not a way to offer me any useful property. So there must be someone else who wants this opacity property to be preserved, and whoever that is they should run the opaque object server (and the Tahoe-LAFS gateway that it uses) on their machine and give me remote access to the service provided by their opaque object server.

Norm wrote on <http://cap-lore.com/BigStore/Tahoe.html>: > This plan contravenes an implicit Tahoe dictum: “Trust no mechanism outside your physical control.”. The O-agents of a given RSA key pair rely on either tamper resistance, or more likely physical protection. I think that Tahoe also violates this property in their scheme for mutable objects. (I am not sure.) Such violation also seems necessary for revocation services. In all three cases the trust of externally instantiated objects impacts only those who specifically rely on them. I don't think Tahoe-LAFS violates this property for our mutable files but to be sure let's see if we can restate the property in terms of "reliance sets" (as in [MarkM's thesis](https://www.cypherpunks.to/erights/talks/thesis/markm-thesis.pdf)). The set of things that you rely on for the unforgeability of your mutable files is: 1. the client (e.g. a web browser which is viewing the file or a unix shell which is catting the file to its stdout) 2. the Tahoe-LAFS gateway Note that a very common deployment pattern is that you run your own Tahoe-LAFS gateway on your local computer, so both of the items in the reliance set are running as user-space processes within the protection of your operating system and your machine. So all of the items in the set of "things on which you rely for unforgeability of your mutable files" can be under your physical control. Now, what about this notion of "Tahoe-LAFS objects"? My proposal for how to implement Tahoe-LAFS objects is simply to make a special client that implements the attenuated, revocable, filtered, or otherwise modified access and that itself has access to the underlying files. That Tahoe-LAFS client then serves its special kind of access out to another client. Let's call that Tahoe-LAFS client an "opaque object server". Then the set of "things on which you rely for the unforgeability of your mutable file" becomes: 1. your client (such as a web browser or cmdline tool), which connects to the opaque object server 2. the opaque object server, which connects to the Tahoe-LAFS gateway 3. the Tahoe-LAFS gateway (Note: the "opaque object server" is just what Norm mentioned early on his page when he wrote: "The obvious way to do this is to create a web server with the custom filter programmed in, and endow that server with the file handle to the original file.".) Now here is where it gets confusing to me: we can't maintain the opacity property if you run the opaque object server on your own local machine! So now you can either have the unforgeability property within your physical control (by running all three elements of the reliance set on your own local machine) or you can have the opacity property (by running the opaque object server on a machine that you cannot hack), but not both. (I haven't thought it through, but I suspect that the "distributed opaque object" proposals by Norm and by Brian will have the same choice.) But you know what, the opaque object property is not something that the user actually wants. I'll be happy to run all three elements on my own machine and use the resulting "not really opaque" objects. The opacity property is a way to prevent me from doing something, not a way to offer me any useful property. So there must be someone else who wants this opacity property to be preserved, and whoever that is *they* should run the opaque object server (and the Tahoe-LAFS gateway that it uses) on *their* machine and give me remote access to the service provided by their opaque object server.

P.S. See http://allmydata.org/source/tahoe-lafs/trunk/docs/about.html for a diagram showing the client, web gateway, and storage servers along with reliance set analysis.

P.S. See <http://allmydata.org/source/tahoe-lafs/trunk/docs/about.html> for a diagram showing the client, web gateway, and storage servers along with reliance set analysis.
zooko changed title from "tahoe objects" concept to tahoe-lafs objects 2010-02-19 20:18:51 +00:00

Replying to zooko:

Now here is where it gets confusing to me: we can't maintain the opacity property if you run the opaque object server on your own local machine!

You can maintain the opacity property as far as the code running on that server is concerned. See below for why this is useful (for some, not all, possible uses of opacity).

So now you can either have the unforgeability property within your physical control (by running all three elements of the reliance set on your own local machine) or you can have the opacity property (by running the opaque object server on a machine that you cannot hack), but not both.

(I haven't thought it through, but I suspect that the "distributed opaque object" proposals by Norm and by Brian will have the same choice.)

But you know what, the opaque object property is not something that the user actually wants. I'll be happy to run all three elements on my own machine and use the resulting "not really opaque" objects. The opacity property is a way to prevent me from doing something, not a way to offer me any useful property.

That's not true in general. I think you're assuming that the code running
on the opaque object server is fully trusted by the user who controls
that server. But that code may not be fully trusted because it may have
bugs that are exploitable for a particular input, and/or it may have been
provided by another party.

The opacity helps in both these cases, since it allows enforcing confinement
between subcomponents or between the code and Tahoe files, or enforcing
other restrictions on the computational model, such as determinism. It also
helps in ways that are not only security-related -- basically anything that
depends on knowing the reachability graph (memory management, transactional
memory, various optimizations...). All of the advantages of using opaque/
partitioned capabilities rather than data capabilities where possible,
apply in this situation.

Replying to [zooko](/tahoe-lafs/trac/issues/959#issuecomment-376489): > Now here is where it gets confusing to me: we can't maintain the opacity property if you run the opaque object server on your own local machine! You can maintain the opacity property as far as the code running on that server is concerned. See below for why this is useful (for some, not all, possible uses of opacity). > So now you can either have the unforgeability property within your physical control (by running all three elements of the reliance set on your own local machine) or you can have the opacity property (by running the opaque object server on a machine that you cannot hack), but not both. > (I haven't thought it through, but I suspect that the "distributed opaque object" proposals by Norm and by Brian will have the same choice.) > But you know what, the opaque object property is not something that the user actually wants. I'll be happy to run all three elements on my own machine and use the resulting "not really opaque" objects. The opacity property is a way to prevent me from doing something, not a way to offer me any useful property. That's not true in general. I think you're assuming that the code running on the opaque object server is fully trusted by the user who controls that server. But that code may not be fully trusted because it may have bugs that are exploitable for a particular input, and/or it may have been provided by another party. The opacity helps in both these cases, since it allows enforcing confinement between subcomponents or between the code and Tahoe files, or enforcing other restrictions on the computational model, such as determinism. It also helps in ways that are not only security-related -- basically anything that depends on knowing the reachability graph (memory management, transactional memory, various optimizations...). All of the advantages of using opaque/ partitioned capabilities rather than data capabilities where possible, apply in this situation.
zooko modified the milestone from undecided to 2.0.0 2010-02-23 03:12:20 +00:00
Owner

I was thinking of a simpler scheme to distribute code around a grid: validation of writes/updates to enforce the syntax of files (such as directories). The code would be stateless, and have the only side-effect of either accepting or rejecting an update.

At present this would be useful for: 1) enforcing the syntax of an immutable file, and 2) enforcing correctness updates to immutable files. It would be even more useful with append-only files, since you could enforce new updates to be consistent with what's already present.

Ideally it would be run on each storage server as part of the decision to accept/reject an incoming share, but this has a couple of obvious problems: a) the server doesn't gave keys, so can't decrypt incoming content; b) even if it did, erasure encoding means that a given share can't be decrypted in isolation anyway; c) and even then, the validator could only be sure of inspecting a single segment. (But if you're fetching other shares of a given segment, then fetching other segments may not be a problem.)

It could also be run on a local gateway, to validate outgoing and incoming changes, which simplifies the problem. But this wouldn't prevent illegal updates from ill-behaved clients to immutable files.

A thought on how these validation functions might be implemented. The obvious would be to have something like:

if (valid(file)) then accept() else reject();

but perhaps it might be more interesting to do something like include the output of the validator in the file hash, so the validity is more deeply baked in:

 H = hash(file + validity(file))

And a merkle tree would allow you to validate/express validity for parts of the file rather than the whole thing (which is especially interesting if the leaves of the tree correlate to synatactic boundaries of the file rather than just splitting at particular byte boundaries).

But I don't know if that would let you express all the interesting things one would want to express.

There's some overlap with Schneier's idea of Clueless Agents: http://www.schneier.com/paper-clueless-agents.html

I was thinking of a simpler scheme to distribute code around a grid: validation of writes/updates to enforce the syntax of files (such as directories). The code would be stateless, and have the only side-effect of either accepting or rejecting an update. At present this would be useful for: 1) enforcing the syntax of an immutable file, and 2) enforcing correctness updates to immutable files. It would be even more useful with append-only files, since you could enforce new updates to be consistent with what's already present. Ideally it would be run on each storage server as part of the decision to accept/reject an incoming share, but this has a couple of obvious problems: a) the server doesn't gave keys, so can't decrypt incoming content; b) even if it did, erasure encoding means that a given share can't be decrypted in isolation anyway; c) and even then, the validator could only be sure of inspecting a single segment. (But if you're fetching other shares of a given segment, then fetching other segments may not be a problem.) It could also be run on a local gateway, to validate outgoing and incoming changes, which simplifies the problem. But this wouldn't prevent illegal updates from ill-behaved clients to immutable files. A thought on how these validation functions might be implemented. The obvious would be to have something like: if (valid(file)) then accept() else reject(); but perhaps it might be more interesting to do something like include the output of the validator in the file hash, so the validity is more deeply baked in: H = hash(file + validity(file)) And a merkle tree would allow you to validate/express validity for parts of the file rather than the whole thing (which is especially interesting if the leaves of the tree correlate to synatactic boundaries of the file rather than just splitting at particular byte boundaries). But I don't know if that would let you express all the interesting things one would want to express. There's some overlap with Schneier's idea of Clueless Agents: <http://www.schneier.com/paper-clueless-agents.html>
Owner

Oops, typo:

  1. enforcing correctness updates to mutable files
Oops, typo: 2) enforcing correctness updates to *mutable* files

Summary: A "C-list + blob" feature is a useful stepping-stone for both "live objects" and "arbitrary dag structures".

Note: As I write this, I haven't read all of the comments yet...

Responding to warner:

suppose we stored three things in a Tahoe file
* a numerically-indexed list of childcaps (the "C-list")
* an arbitrary chunk of serialized state
* a chunk of code written in some confineable language (E or secure javascript), or perhaps an immutable reference to some external code file, share between lots of objects

With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories". This is an interesting direction, even outside of a "live object code" feature.

The C-list would have the same confidentiality properties as current directory references, except they are unassociated with a filename, but they have a unique index for a given version of the cap contents. (Thus verification and repair would work in a similar fashion, although I'm less certain about how updates are implemented.)

Simple "monolithic" directories (similar to SDMF directories) could be implemented on top of this "C-list + blob" format to promote "our own dog food" cuisine, which would help work out bugs and usage issues. This implementation would have a blob which links file names and other link metadata to the C-list.

It's easy to imagine other data structures: sets, queues, trees whose edge labels are not filenames, etc... (In fact, a queue could have an empty blob, if we trust the writer to maintain the C-list order "correctly". A set is even simpler and has an empty blob and the C-list order is ignored.)

Of course, those data structure examples don't address distributed consistency issues, so I don't mean to imply desirable properties such as append-only or "eventually consistent ordering" or the like. See #796 for a discussion of some of those features.

Consider also, these proposed distinct (abstract) webapi calls:

  • get_raw(readcap) → C_list_and_blob_bytes
  • get_blob(readcap) → blob_bytes
  • get_clist(readcap) → C_list

Now, the blob could be html and javascript, so that a GET to the get_blob api will load that into a browser, and the javascript can then use the get_clist api to access references. Some pros/cons of this particular example:

  • Pros:
    • This is approaching a "live capabilities objects" feature.
    • It keeps the layering fairly distinct - lafs doesn't know about "live object code" very much, outside of standard http+browser tech.
    • Because the "C-list + blob" feature is a separate layer, this does not preclude other approaches to live objects, and it does not complicate other uses of "C-list + blob".
  • Cons:
    • This example is inefficient compared to a more direct implementation of "live objects".
      • Example: a webapi which knows the blob is javascript with a special interface could inject the C-list into the script in a well defined convention prior to responding to an http request. Thus, there'd only be one http request/response. (This would not use the proposed API above.)

I haven't figured out yet how to quarantine the javascript to have object-capabilities-like access control, in this scheme. However that problem seems similar to object-capabilities-restriction for javascript in current lafs.

**Summary:** A "C-list + blob" feature is a useful stepping-stone for both "live objects" and "arbitrary dag structures". Note: As I write this, I haven't read all of the comments yet... Responding to warner: > suppose we stored three things in a Tahoe file > * a numerically-indexed list of childcaps (the "C-list") > * an arbitrary chunk of serialized state > * a chunk of code written in some confineable language (E or secure javascript), or perhaps an immutable reference to some external code file, share between lots of objects With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories". This is an interesting direction, even outside of a "live object code" feature. The C-list would have the same confidentiality properties as current directory references, except they are unassociated with a filename, but they have a unique index for a given version of the cap contents. (Thus verification and repair would work in a similar fashion, although I'm less certain about how updates are implemented.) Simple "monolithic" directories (similar to SDMF directories) could be implemented on top of this "C-list + blob" format to promote "our own dog food" cuisine, which would help work out bugs and usage issues. This implementation would have a blob which links file names and other link metadata to the C-list. It's easy to imagine other data structures: sets, queues, trees whose edge labels are not filenames, etc... (In fact, a queue could have an empty blob, if we trust the writer to maintain the C-list order "correctly". A set is even simpler and has an empty blob and the C-list order is ignored.) Of course, those data structure examples don't address distributed consistency issues, so I don't mean to imply desirable properties such as append-only or "eventually consistent ordering" or the like. See #796 for a discussion of some of those features. Consider also, these proposed distinct (abstract) webapi calls: * `get_raw(readcap) → C_list_and_blob_bytes` * `get_blob(readcap) → blob_bytes` * `get_clist(readcap) → C_list` Now, the blob could be `html` and `javascript`, so that a `GET` to the `get_blob` api will load that into a browser, and the javascript can then use the `get_clist` api to access references. Some pros/cons of this particular example: * Pros: * This is approaching a "live capabilities objects" feature. * It keeps the layering fairly distinct - lafs doesn't know about "live object code" very much, outside of standard http+browser tech. * Because the "C-list + blob" feature is a separate layer, this does not preclude other approaches to live objects, and it does not complicate other uses of "C-list + blob". * Cons: * This example is inefficient compared to a more direct implementation of "live objects". * Example: a webapi which knows the blob is javascript with a special interface could inject the C-list into the script in a well defined convention prior to responding to an http request. Thus, there'd only be one http request/response. (This would not use the proposed API above.) I haven't figured out yet how to quarantine the javascript to have object-capabilities-like access control, in this scheme. However that problem seems similar to object-capabilities-restriction for javascript in current lafs.

Replying to nejucomo:

With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories".

I don't understand the distinction. Isn't the current LAFS files-and-directories structure already an arbitrary DAG? Just use incrementing integers as your filenames in your directories, and then that's a C-list. Or am I missing something?

Replying to [nejucomo](/tahoe-lafs/trac/issues/959#issuecomment-376496): > > With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories". I don't understand the distinction. Isn't the current LAFS files-and-directories structure already an arbitrary DAG? Just use incrementing integers as your filenames in your directories, and then that's a C-list. Or am I missing something?

Summary:

  1. Nejucomo brainstorms differences between a native C-List + blob feature, versus
  2. "emulating" that with existing lafs directories and files, and
  3. realizes that emulation is good enough, and
  4. abandons support for any new "C-List + blob" feature, and then
  5. asks if that "emulation" is good enough for live objects.

-then finally decides to post the whole brainstorm in case posterity finds anything useful in it. ;-)

Replying to [zooko]comment:13:

Replying to nejucomo:

With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories".

I don't understand the distinction. Isn't the current LAFS files-and-directories structure already an arbitrary DAG? Just use incrementing integers as your filenames in your directories, and then that's a C-list. Or am I missing something?

Yes, having an existing lafs directory to serve as a C-List and a separate lafs file to serve as the blob, and a third container directory to bind the two is already possible, at the cost of efficiency.

I'll call that "the emulation design" below (because it is emulating "C-List + blob" as a built-in feature). Let's contrast emulation with a built-in feature:

Emulation:

  • Requires three file nodes.
  • Requires the application to encode their data structure into lafs directory names or other edge metadata.
    • Is there a simple, safe way to encode arbitrary bytes into an edge name?
    • Is it possible to attach arbitrary metadata to edges?
  • Cannot guarantee consistency between the C-List-emulation and blob-emulation:
    • A reader must read these separately, thus has no guarantee the two reads return a consistent view.
  • Fits the current "files and directories" abstraction well, so the user interfaces map reasonably well.
    • For example, fuse interfaces know what to do.

By contrast:

Native C-List+Blob Feature:

  • Requires a single node for any application.
  • Allows the application to generate/interpret blob "directly".
  • Ensures mutation consistency between the C-List and blob in the same manner as single file-node mutable consistency is currently ensured.
  • Can represent directories as a particular application.
  • Breaks the notion of "just file and directories", introducing complexity into the user interfaces.
    • For example, what does a fuse interface do with an arbitrary C-List + blob?
      • It could do the "inverse" of the emulation above: Present a directory with a C-List subdirectory and a blob file. Now we have the same encoding problems as with emulation, except instead of the application which wrote the blob inventing the encoding, a completely unaware general application (ie: fuse interface) has to pick an encoding.

After brainstorming those differences, to me it seems like the primary advantage is mutation consistency properties.

It occurs to me that if it's already possible to encode arbitrary metadata in the node edges, when we already have C-List + blob where the blob is split up across the edge metadata.

Oh... I just realized: If the emulation container directory is mutable, but the C-List-emulation child and the blob child are immutable, this solves the consistency problem, right? A reader of the container directory knows that the immutable C-List cap and the immutable blob-file cap were written together by a single writer, and therefore their inter-relationships are as consistent as the writer.

Ok, now I'm pretty much satisfied that "C-List + blob" is unnecessary, at least for arbitrary DAGs.

Is this also true of the "live objects" proposal? If we require that the interpretation of a "C-List + blob + object-code" structure starts with a cap to a directory where C-List, blob, and object-code are separate but immutable files, is this a sufficient building block for live objects?

**Summary:** 1. Nejucomo brainstorms differences between a native C-List + blob feature, versus 1. "emulating" that with existing lafs directories and files, and 1. realizes that emulation is good enough, and 1. abandons support for any new "C-List + blob" feature, and then 1. asks if that "emulation" is good enough for live objects. -then finally decides to post the whole brainstorm in case posterity finds anything useful in it. ;-) Replying to [zooko]comment:13: > Replying to [nejucomo](/tahoe-lafs/trac/issues/959#issuecomment-376496): > > > > With only the first two of these bullets, the storage model becomes "arbitrary DAGs (Directed Acyclic Graphs)" instead of only "files or directories". > > I don't understand the distinction. Isn't the current LAFS files-and-directories structure already an arbitrary DAG? Just use incrementing integers as your filenames in your directories, and then that's a C-list. Or am I missing something? Yes, having an existing lafs directory to serve as a C-List and a separate lafs file to serve as the blob, and a third container directory to bind the two is already possible, at the cost of efficiency. I'll call that "the emulation design" below (because it is emulating "C-List + blob" as a built-in feature). Let's contrast emulation with a built-in feature: **Emulation:** * Requires three file nodes. * Requires the application to encode their data structure into lafs directory names or other edge metadata. * Is there a simple, safe way to encode arbitrary bytes into an edge name? * Is it possible to attach arbitrary metadata to edges? * Cannot guarantee consistency between the C-List-emulation and blob-emulation: * A reader must read these separately, thus has no guarantee the two reads return a consistent view. * Fits the current "files and directories" abstraction well, so the user interfaces map reasonably well. * For example, fuse interfaces know what to do. By contrast: **Native C-List+Blob Feature:** * Requires a single node for any application. * Allows the application to generate/interpret blob "directly". * Ensures mutation consistency between the C-List and blob in the same manner as single file-node mutable consistency is currently ensured. * Can represent directories as a particular application. * Breaks the notion of "just file and directories", introducing complexity into the user interfaces. * For example, what does a fuse interface do with an arbitrary C-List + blob? * It could do the "inverse" of the emulation above: Present a directory with a C-List subdirectory and a blob file. Now we have the same encoding problems as with emulation, except instead of the application which wrote the blob inventing the encoding, a completely unaware general application (ie: fuse interface) has to pick an encoding. After brainstorming those differences, to me it seems like the primary advantage is mutation consistency properties. It occurs to me that if it's already possible to encode arbitrary metadata in the node edges, when we already have C-List + blob where the blob is split up across the edge metadata. Oh... I just realized: If the emulation container directory is mutable, but the C-List-emulation child and the blob child are immutable, this solves the consistency problem, right? A reader of the container directory knows that the immutable C-List cap and the immutable blob-file cap were written together by a single writer, and therefore their inter-relationships are as consistent as the writer. Ok, now I'm pretty much satisfied that "C-List + blob" is unnecessary, at least for arbitrary DAGs. Is this also true of the "live objects" proposal? If we require that the interpretation of a "C-List + blob + object-code" structure starts with a cap to a directory where C-List, blob, and object-code are separate but *immutable* files, is this a sufficient building block for live objects?

Ticket retargeted after milestone closed (editing milestones)

Ticket retargeted after milestone closed (editing milestones)
meejah removed this from the 2.0.0 milestone 2021-03-30 18:40:46 +00:00
Sign in to join this conversation.
No labels
c/code
c/code-dirnodes
c/code-encoding
c/code-frontend
c/code-frontend-cli
c/code-frontend-ftp-sftp
c/code-frontend-magic-folder
c/code-frontend-web
c/code-mutable
c/code-network
c/code-nodeadmin
c/code-peerselection
c/code-storage
c/contrib
c/dev-infrastructure
c/docs
c/operational
c/packaging
c/unknown
c/website
kw:2pc
kw:410
kw:9p
kw:ActivePerl
kw:AttributeError
kw:DataUnavailable
kw:DeadReferenceError
kw:DoS
kw:FileZilla
kw:GetLastError
kw:IFinishableConsumer
kw:K
kw:LeastAuthority
kw:Makefile
kw:RIStorageServer
kw:StringIO
kw:UncoordinatedWriteError
kw:about
kw:access
kw:access-control
kw:accessibility
kw:accounting
kw:accounting-crawler
kw:add-only
kw:aes
kw:aesthetics
kw:alias
kw:aliases
kw:aliens
kw:allmydata
kw:amazon
kw:ambient
kw:annotations
kw:anonymity
kw:anonymous
kw:anti-censorship
kw:api_auth_token
kw:appearance
kw:appname
kw:apport
kw:archive
kw:archlinux
kw:argparse
kw:arm
kw:assertion
kw:attachment
kw:auth
kw:authentication
kw:automation
kw:avahi
kw:availability
kw:aws
kw:azure
kw:backend
kw:backoff
kw:backup
kw:backupdb
kw:backward-compatibility
kw:bandwidth
kw:basedir
kw:bayes
kw:bbfreeze
kw:beta
kw:binaries
kw:binutils
kw:bitcoin
kw:bitrot
kw:blacklist
kw:blocker
kw:blocks-cloud-deployment
kw:blocks-cloud-merge
kw:blocks-magic-folder-merge
kw:blocks-merge
kw:blocks-raic
kw:blocks-release
kw:blog
kw:bom
kw:bonjour
kw:branch
kw:branding
kw:breadcrumbs
kw:brians-opinion-needed
kw:browser
kw:bsd
kw:build
kw:build-helpers
kw:buildbot
kw:builders
kw:buildslave
kw:buildslaves
kw:cache
kw:cap
kw:capleak
kw:captcha
kw:cast
kw:centos
kw:cffi
kw:chacha
kw:charset
kw:check
kw:checker
kw:chroot
kw:ci
kw:clean
kw:cleanup
kw:cli
kw:cloud
kw:cloud-backend
kw:cmdline
kw:code
kw:code-checks
kw:coding-standards
kw:coding-tools
kw:coding_tools
kw:collection
kw:compatibility
kw:completion
kw:compression
kw:confidentiality
kw:config
kw:configuration
kw:configuration.txt
kw:conflict
kw:connection
kw:connectivity
kw:consistency
kw:content
kw:control
kw:control.furl
kw:convergence
kw:coordination
kw:copyright
kw:corruption
kw:cors
kw:cost
kw:coverage
kw:coveralls
kw:coveralls.io
kw:cpu-watcher
kw:cpyext
kw:crash
kw:crawler
kw:crawlers
kw:create-container
kw:cruft
kw:crypto
kw:cryptography
kw:cryptography-lib
kw:cryptopp
kw:csp
kw:curl
kw:cutoff-date
kw:cycle
kw:cygwin
kw:d3
kw:daemon
kw:darcs
kw:darcsver
kw:database
kw:dataloss
kw:db
kw:dead-code
kw:deb
kw:debian
kw:debug
kw:deep-check
kw:defaults
kw:deferred
kw:delete
kw:deletion
kw:denial-of-service
kw:dependency
kw:deployment
kw:deprecation
kw:desert-island
kw:desert-island-build
kw:design
kw:design-review-needed
kw:detection
kw:dev-infrastructure
kw:devpay
kw:directory
kw:directory-page
kw:dirnode
kw:dirnodes
kw:disconnect
kw:discovery
kw:disk
kw:disk-backend
kw:distribute
kw:distutils
kw:dns
kw:do_http
kw:doc-needed
kw:docker
kw:docs
kw:docs-needed
kw:dokan
kw:dos
kw:download
kw:downloader
kw:dragonfly
kw:drop-upload
kw:duplicity
kw:dusty
kw:earth-dragon
kw:easy
kw:ec2
kw:ecdsa
kw:ed25519
kw:egg-needed
kw:eggs
kw:eliot
kw:email
kw:empty
kw:encoding
kw:endpoint
kw:enterprise
kw:enum34
kw:environment
kw:erasure
kw:erasure-coding
kw:error
kw:escaping
kw:etag
kw:etch
kw:evangelism
kw:eventual
kw:example
kw:excess-authority
kw:exec
kw:exocet
kw:expiration
kw:extensibility
kw:extension
kw:failure
kw:fedora
kw:ffp
kw:fhs
kw:figleaf
kw:file
kw:file-descriptor
kw:filename
kw:filesystem
kw:fileutil
kw:fips
kw:firewall
kw:first
kw:floatingpoint
kw:flog
kw:foolscap
kw:forward-compatibility
kw:forward-secrecy
kw:forwarding
kw:free
kw:freebsd
kw:frontend
kw:fsevents
kw:ftp
kw:ftpd
kw:full
kw:furl
kw:fuse
kw:garbage
kw:garbage-collection
kw:gateway
kw:gatherer
kw:gc
kw:gcc
kw:gentoo
kw:get
kw:git
kw:git-annex
kw:github
kw:glacier
kw:globalcaps
kw:glossary
kw:google-cloud-storage
kw:google-drive-backend
kw:gossip
kw:governance
kw:grid
kw:grid-manager
kw:gridid
kw:gridsync
kw:grsec
kw:gsoc
kw:gvfs
kw:hackfest
kw:hacktahoe
kw:hang
kw:hardlink
kw:heartbleed
kw:heisenbug
kw:help
kw:helper
kw:hint
kw:hooks
kw:how
kw:how-to
kw:howto
kw:hp
kw:hp-cloud
kw:html
kw:http
kw:https
kw:i18n
kw:i2p
kw:i2p-collab
kw:illustration
kw:image
kw:immutable
kw:impressions
kw:incentives
kw:incident
kw:init
kw:inlineCallbacks
kw:inotify
kw:install
kw:installer
kw:integration
kw:integration-test
kw:integrity
kw:interactive
kw:interface
kw:interfaces
kw:interoperability
kw:interstellar-exploration
kw:introducer
kw:introduction
kw:iphone
kw:ipkg
kw:iputil
kw:ipv6
kw:irc
kw:jail
kw:javascript
kw:joke
kw:jquery
kw:json
kw:jsui
kw:junk
kw:key-value-store
kw:kfreebsd
kw:known-issue
kw:konqueror
kw:kpreid
kw:kvm
kw:l10n
kw:lae
kw:large
kw:latency
kw:leak
kw:leasedb
kw:leases
kw:libgmp
kw:license
kw:licenss
kw:linecount
kw:link
kw:linux
kw:lit
kw:localhost
kw:location
kw:locking
kw:logging
kw:logo
kw:loopback
kw:lucid
kw:mac
kw:macintosh
kw:magic-folder
kw:manhole
kw:manifest
kw:manual-test-needed
kw:map
kw:mapupdate
kw:max_space
kw:mdmf
kw:memcheck
kw:memory
kw:memory-leak
kw:mesh
kw:metadata
kw:meter
kw:migration
kw:mime
kw:mingw
kw:minimal
kw:misc
kw:miscapture
kw:mlp
kw:mock
kw:more-info-needed
kw:mountain-lion
kw:move
kw:multi-users
kw:multiple
kw:multiuser-gateway
kw:munin
kw:music
kw:mutability
kw:mutable
kw:mystery
kw:names
kw:naming
kw:nas
kw:navigation
kw:needs-review
kw:needs-spawn
kw:netbsd
kw:network
kw:nevow
kw:new-user
kw:newcaps
kw:news
kw:news-done
kw:news-needed
kw:newsletter
kw:newurls
kw:nfc
kw:nginx
kw:nixos
kw:no-clobber
kw:node
kw:node-url
kw:notification
kw:notifyOnDisconnect
kw:nsa310
kw:nsa320
kw:nsa325
kw:numpy
kw:objects
kw:old
kw:openbsd
kw:openitp-packaging
kw:openssl
kw:openstack
kw:opensuse
kw:operation-helpers
kw:operational
kw:operations
kw:ophandle
kw:ophandles
kw:ops
kw:optimization
kw:optional
kw:options
kw:organization
kw:os
kw:os.abort
kw:ostrom
kw:osx
kw:osxfuse
kw:otf-magic-folder-objective1
kw:otf-magic-folder-objective2
kw:otf-magic-folder-objective3
kw:otf-magic-folder-objective4
kw:otf-magic-folder-objective5
kw:otf-magic-folder-objective6
kw:p2p
kw:packaging
kw:partial
kw:password
kw:path
kw:paths
kw:pause
kw:peer-selection
kw:performance
kw:permalink
kw:permissions
kw:persistence
kw:phone
kw:pickle
kw:pip
kw:pipermail
kw:pkg_resources
kw:placement
kw:planning
kw:policy
kw:port
kw:portability
kw:portal
kw:posthook
kw:pratchett
kw:preformance
kw:preservation
kw:privacy
kw:process
kw:profile
kw:profiling
kw:progress
kw:proxy
kw:publish
kw:pyOpenSSL
kw:pyasn1
kw:pycparser
kw:pycrypto
kw:pycrypto-lib
kw:pycryptopp
kw:pyfilesystem
kw:pyflakes
kw:pylint
kw:pypi
kw:pypy
kw:pysqlite
kw:python
kw:python3
kw:pythonpath
kw:pyutil
kw:pywin32
kw:quickstart
kw:quiet
kw:quotas
kw:quoting
kw:raic
kw:rainhill
kw:random
kw:random-access
kw:range
kw:raspberry-pi
kw:reactor
kw:readonly
kw:rebalancing
kw:recovery
kw:recursive
kw:redhat
kw:redirect
kw:redressing
kw:refactor
kw:referer
kw:referrer
kw:regression
kw:rekey
kw:relay
kw:release
kw:release-blocker
kw:reliability
kw:relnotes
kw:remote
kw:removable
kw:removable-disk
kw:rename
kw:renew
kw:repair
kw:replace
kw:report
kw:repository
kw:research
kw:reserved_space
kw:response-needed
kw:response-time
kw:restore
kw:retrieve
kw:retry
kw:review
kw:review-needed
kw:reviewed
kw:revocation
kw:roadmap
kw:rollback
kw:rpm
kw:rsa
kw:rss
kw:rst
kw:rsync
kw:rusty
kw:s3
kw:s3-backend
kw:s3-frontend
kw:s4
kw:same-origin
kw:sandbox
kw:scalability
kw:scaling
kw:scheduling
kw:schema
kw:scheme
kw:scp
kw:scripts
kw:sdist
kw:sdmf
kw:security
kw:self-contained
kw:server
kw:servermap
kw:servers-of-happiness
kw:service
kw:setup
kw:setup.py
kw:setup_requires
kw:setuptools
kw:setuptools_darcs
kw:sftp
kw:shared
kw:shareset
kw:shell
kw:signals
kw:simultaneous
kw:six
kw:size
kw:slackware
kw:slashes
kw:smb
kw:sneakernet
kw:snowleopard
kw:socket
kw:solaris
kw:space
kw:space-efficiency
kw:spam
kw:spec
kw:speed
kw:sqlite
kw:ssh
kw:ssh-keygen
kw:sshfs
kw:ssl
kw:stability
kw:standards
kw:start
kw:startup
kw:static
kw:static-analysis
kw:statistics
kw:stats
kw:stats_gatherer
kw:status
kw:stdeb
kw:storage
kw:streaming
kw:strports
kw:style
kw:stylesheet
kw:subprocess
kw:sumo
kw:survey
kw:svg
kw:symlink
kw:synchronous
kw:tac
kw:tahoe-*
kw:tahoe-add-alias
kw:tahoe-admin
kw:tahoe-archive
kw:tahoe-backup
kw:tahoe-check
kw:tahoe-cp
kw:tahoe-create-alias
kw:tahoe-create-introducer
kw:tahoe-debug
kw:tahoe-deep-check
kw:tahoe-deepcheck
kw:tahoe-lafs-trac-stream
kw:tahoe-list-aliases
kw:tahoe-ls
kw:tahoe-magic-folder
kw:tahoe-manifest
kw:tahoe-mkdir
kw:tahoe-mount
kw:tahoe-mv
kw:tahoe-put
kw:tahoe-restart
kw:tahoe-rm
kw:tahoe-run
kw:tahoe-start
kw:tahoe-stats
kw:tahoe-unlink
kw:tahoe-webopen
kw:tahoe.css
kw:tahoe_files
kw:tahoewapi
kw:tarball
kw:tarballs
kw:tempfile
kw:templates
kw:terminology
kw:test
kw:test-and-set
kw:test-from-egg
kw:test-needed
kw:testgrid
kw:testing
kw:tests
kw:throttling
kw:ticket999-s3-backend
kw:tiddly
kw:time
kw:timeout
kw:timing
kw:to
kw:to-be-closed-on-2011-08-01
kw:tor
kw:tor-protocol
kw:torsocks
kw:tox
kw:trac
kw:transparency
kw:travis
kw:travis-ci
kw:trial
kw:trickle
kw:trivial
kw:truckee
kw:tub
kw:tub.location
kw:twine
kw:twistd
kw:twistd.log
kw:twisted
kw:twisted-14
kw:twisted-trial
kw:twitter
kw:twn
kw:txaws
kw:type
kw:typeerror
kw:ubuntu
kw:ucwe
kw:ueb
kw:ui
kw:unclean
kw:uncoordinated-writes
kw:undeletable
kw:unfinished-business
kw:unhandled-error
kw:unhappy
kw:unicode
kw:unit
kw:unix
kw:unlink
kw:update
kw:upgrade
kw:upload
kw:upload-helper
kw:uri
kw:url
kw:usability
kw:use-case
kw:utf-8
kw:util
kw:uwsgi
kw:ux
kw:validation
kw:variables
kw:vdrive
kw:verify
kw:verlib
kw:version
kw:versioning
kw:versions
kw:video
kw:virtualbox
kw:virtualenv
kw:vista
kw:visualization
kw:visualizer
kw:vm
kw:volunteergrid2
kw:volunteers
kw:vpn
kw:wapi
kw:warners-opinion-needed
kw:warning
kw:weapi
kw:web
kw:web.port
kw:webapi
kw:webdav
kw:webdrive
kw:webport
kw:websec
kw:website
kw:websocket
kw:welcome
kw:welcome-page
kw:welcomepage
kw:wiki
kw:win32
kw:win64
kw:windows
kw:windows-related
kw:winscp
kw:workaround
kw:world-domination
kw:wrapper
kw:write-enabler
kw:wui
kw:x86
kw:x86-64
kw:xhtml
kw:xml
kw:xss
kw:zbase32
kw:zetuptoolz
kw:zfec
kw:zookos-opinion-needed
kw:zope
kw:zope.interface
p/blocker
p/critical
p/major
p/minor
p/normal
p/supercritical
p/trivial
r/cannot reproduce
r/duplicate
r/fixed
r/invalid
r/somebody else's problem
r/was already fixed
r/wontfix
r/worksforme
t/defect
t/enhancement
t/task
v/0.2.0
v/0.3.0
v/0.4.0
v/0.5.0
v/0.5.1
v/0.6.0
v/0.6.1
v/0.7.0
v/0.8.0
v/0.9.0
v/1.0.0
v/1.1.0
v/1.10.0
v/1.10.1
v/1.10.2
v/1.10a2
v/1.11.0
v/1.12.0
v/1.12.1
v/1.13.0
v/1.14.0
v/1.15.0
v/1.15.1
v/1.2.0
v/1.3.0
v/1.4.1
v/1.5.0
v/1.6.0
v/1.6.1
v/1.7.0
v/1.7.1
v/1.7β
v/1.8.0
v/1.8.1
v/1.8.2
v/1.8.3
v/1.8β
v/1.9.0
v/1.9.0-s3branch
v/1.9.0a1
v/1.9.0a2
v/1.9.0b1
v/1.9.1
v/1.9.2
v/1.9.2a1
v/cloud-branch
v/unknown
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac#959
No description provided.