Re: Review of draft-toomim-httpbis-versions-00
Michael Toomim <toomim@gmail.com> Thu, 10 October 2024 23:38 UTC
Received: by ietfa.amsl.com (Postfix) id 56895C151061; Thu, 10 Oct 2024 16:38:57 -0700 (PDT)
Delivered-To: ietfarch-httpbisa-archive-bis2juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 55CF1C14F6BB for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 10 Oct 2024 16:38:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.857
X-Spam-Level:
X-Spam-Status: No, score=-2.857 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=w3.org header.b="CcToaC7D"; dkim=pass (2048-bit key) header.d=w3.org header.b="mL8i9Oem"; dkim=pass (2048-bit key) header.d=gmail.com header.b="MLTzz+3C"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E52HLla7aJ3B for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 10 Oct 2024 16:38:53 -0700 (PDT)
Received: from mab.w3.org (mab.w3.org [IPv6:2600:1f18:7d7a:2700:d091:4b25:8566:8113]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E1B22C14F6B5 for <httpbisa-archive-bis2Juki@ietf.org>; Thu, 10 Oct 2024 16:38:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Subject:In-Reply-To:From:References:Cc:To:MIME-Version:Date: Message-ID:Content-Type:Reply-To; bh=tEX0Wn6ys32a95cCVyFW4QdekyNw9Cjysgws7GqIsLk=; b=CcToaC7D4UdtJwyfY1Eeqww3vX Q5D0sGBaX1wHm6OJyp1I2cTpHM2pPhfu51yP8mSn/eIqKPx5GzbzvRhS6OEUH/JP0ZTf9nwQtKn2y ZKqMR82mKuBDggasfoTsVRNmEN8Bvba48Die6IJoZcazVggxkpCVXlVErCIGI41jLhKEV59zayna+ WBJfIlVsDHhOd0sGeQ4QoqdhqGe+E/X7JeW1ptyTKjgVJ/ylQbA3tWIXQFwObqctWs4Qgu/HQsPPb K06CW4EUUQgjCxuhTmviCXL+NNkvnilt0Qi/Mtd5ix83bBuHjavv81c6Aevqldkodn74kiEm5YLQZ pYK7bsHA==;
Received: from lists by mab.w3.org with local (Exim 4.96) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1sz2jF-00Gb5u-2I for ietf-http-wg-dist@listhub.w3.org; Thu, 10 Oct 2024 23:37:57 +0000
Resent-Date: Thu, 10 Oct 2024 23:37:57 +0000
Resent-Message-Id: <E1sz2jF-00Gb5u-2I@mab.w3.org>
Received: from ip-10-0-0-144.ec2.internal ([10.0.0.144] helo=pan.w3.org) by mab.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <toomim@gmail.com>) id 1sz2jD-00Gb4y-0S for ietf-http-wg@listhub.w3.internal; Thu, 10 Oct 2024 23:37:55 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Content-Type:Reply-To; bh=tEX0Wn6ys32a95cCVyFW4QdekyNw9Cjysgws7GqIsLk=; t=1728603475; x=1729467475; b=mL8i9OempDQxlHMIimRdO3DjIhch3nGh6pS0obVzeds/7QRal+MnpKJ28x73zqpDaCbaaBPT0pP QGuKkjc2Rng4E57Hi6fFaDPXfGX62oEc1/q5CJQGYPlctHLsUADhsjS+X6H5xaOeXELKXiVcfcHFG WPDkSMzwlwMeIgHYbhm020I/XSVA9o+3YUQvvoMeW1E1fmMUUVPpv4uqrSrbXVGWVHf8OIeNUjuIY 1Th3lSq58I7hzIsUC8IifQQETI6NcoMl8UxD6xqkDl2fB6CDylxeiWtH+5kAU/vcz8G6EcdNgusuA zp/NoRdT45R+9/e2FDCcgQeb1+eRMwQpSh8w==;
Received-SPF: pass (pan.w3.org: domain of gmail.com designates 2607:f8b0:4864:20::62d as permitted sender) client-ip=2607:f8b0:4864:20::62d; envelope-from=toomim@gmail.com; helo=mail-pl1-x62d.google.com;
Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by pan.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from <toomim@gmail.com>) id 1sz2jC-006soN-0L for ietf-http-wg@w3.org; Thu, 10 Oct 2024 23:37:55 +0000
Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-208cf673b8dso15565205ad.3 for <ietf-http-wg@w3.org>; Thu, 10 Oct 2024 16:37:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728603470; x=1729208270; darn=w3.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tEX0Wn6ys32a95cCVyFW4QdekyNw9Cjysgws7GqIsLk=; b=MLTzz+3CxTYjkheghS5PAdVzwbI9DUb7CfAg1jp3pdXcTIFq6eQsXQxSh7PRoVPfEd 6yDokHipX+NaGnr2MlstPDH5yEMAjzoxSBPRw41PDw82rRjeMC6Wq+9Ludat2Fr0mr5e VqfkQKsnh7JYU99jRcAeYKVP6AoqD7NWBs9zxcxWDyTqvWGN/kt2QSUiHwn64mihdbxX OUWM0h6jWfhxJM9IXy/OUAuGSTKXxwp0g29OM64o4ziMZr/tYKlCpB6r/cPO3RsAE643 JNfyzUL6ER3aK/uxxy1/wZ2+Osfv1f9w2BmlbXr99dlNeO6YiOtzvMl20ByY8Wb35fpS 9ToA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728603470; x=1729208270; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tEX0Wn6ys32a95cCVyFW4QdekyNw9Cjysgws7GqIsLk=; b=FQ1hZ8eiw2PVP42JI2S4HYM+Bzuj4SAbwJoXZ9ZDCg+U1yDTJPhYs3cY4ZSak9XILI hzxJ6OO9Ka4LKXGupjGQ2wWfJZEdsDDgHf4jIfI8LSJJi/gDRaTyei30GL79Kp58jXFM IXiDSaK3eBk7PcPnZJDCpyk7Stw1LyXTc3jf6q8qEEkne92d5IPZ8uwuVt+2PgIC8zj/ wrWRc+FINlbJXDtx1MeSMrlB7enc27CLw/NWv57zKLRwKllD7mxW8Gp9sxwanps43KLO ttb5BRxxsavMndjef4A4AQXlqyOEniz2v/JotVVlqmrdVnslpba2hehlbeaLcxU40D6+ dgLw==
X-Gm-Message-State: AOJu0YykzNciqmvC8M4IGZau9eBvaFERV2d7xqp6dEFTqOIsRPRsMb60 1kH3LPuNB8qBtO6AZ8ypAmm3nkeXnt+cwUBKL4Z3GOgvH7TFbkfq
X-Google-Smtp-Source: AGHT+IGYXwDZGMZIaJ/UJhFBrTBgHfQb7YaZ6RfnJ+tuBm070Tb4vuJxkpNTro9sv072kXe7vqW34A==
X-Received: by 2002:a17:902:e845:b0:20c:7409:bd00 with SMTP id d9443c01a7336-20ca1429a4cmr9090925ad.5.1728603469877; Thu, 10 Oct 2024 16:37:49 -0700 (PDT)
Received: from [192.168.10.52] (c-73-241-198-96.hsd1.ca.comcast.net. [73.241.198.96]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7ea53eaf5dcsm109632a12.73.2024.10.10.16.37.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Oct 2024 16:37:48 -0700 (PDT)
Content-Type: multipart/alternative; boundary="------------dZ3dU1nlXumHThVVq6w71jY0"
Message-ID: <a6ce578c-a08a-4abd-8c9a-f0e000bbe3d0@gmail.com>
Date: Thu, 10 Oct 2024 16:37:47 -0700
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Martin Kleppmann <martin@kleppmann.com>
Cc: HTTP Working Group <ietf-http-wg@w3.org>, Braid <braid-http@googlegroups.com>, Peter van Hardenberg <pvh@pvh.ca>
References: <172046173132.445281.15041630415895010148@dt-datatracker-5f88556585-j5r2h> <ff54cd4f-c30e-4447-8744-3297e53b74be@gmail.com> <16912382-c530-4508-b457-4397d06acd46@gmail.com> <0a25c83e-6941-464e-9252-8ca98960226a@gmail.com> <ba9bd07d-b648-4afc-8c78-4ec05d2e1797@gmail.com> <f04e6822-e49a-430f-a605-6547f20b96d6@gmail.com> <DA7B545D-A9FF-4263-8B0B-342D8D4DF08D@kleppmann.com>
Content-Language: en-US
From: Michael Toomim <toomim@gmail.com>
In-Reply-To: <DA7B545D-A9FF-4263-8B0B-342D8D4DF08D@kleppmann.com>
X-W3C-Hub-DKIM-Status: validation passed: (address=toomim@gmail.com domain=gmail.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-5.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, DMARC_PASS=-0.001, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, W3C_AA=-1, W3C_DB=-1, W3C_WL=-1
X-W3C-Scan-Sig: pan.w3.org 1sz2jC-006soN-0L fcdea4315f090eadffd24d0739c1bfd3
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Review of draft-toomim-httpbis-versions-00
Archived-At: <https://www.w3.org/mid/a6ce578c-a08a-4abd-8c9a-f0e000bbe3d0@gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/52383
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/email/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>
Martin, thank you for engaging! It's valuable getting input on data synchronization from the author of Designing Data-Intensive Applications <https://medium.com/javarevisited/review-is-designing-data-intensive-applications-by-martin-kleppman-worth-it-b3b7dfa17a5c>. I believe we are addressing complementary aspects of the state synchronization problem, rather than "different approaches." Specifically: you're focusing on how peers reconcile and route an E2EE history of blobs; whereas I'm working on the structure within those blobs. Our work could integrate as follows: Envelope 1: Your work (routing protocol) Routing Headers Message Type Message 2: My work (message structure) Headers Version 3: This versioning spec Parents 3: This versioning spec Range Body New Value An Envelope is a structured container within a protocol that encapsulates opaque data across multiple hops. It's a feature of SMTP, for instance, that allows mail to go through relays, while GPG-encrypting the contents, and is also how BCC works. In my understanding, you are working on a routing & reconciliation protocol for envelopes that maintain content opacity. In my view, your work could be expressed in an extension to HTTP that allows HTTP messages to route through multiple peers. Some HTTP extensions already implement this concept implicitly. For example, OHAI (Oblivious HTTP) uses an encapsulated request that functions like an envelope — it includes routing information (gateway and target URLs), encrypts contents, and has authenticity elements (like a nonce). This enables OHAI to separate client identity from request content, facilitating privacy-preserving routing. The versioning spec discussed in this thread, on the other hand, addresses part 3 of the above diagram: event Versioning, which falls within part 2: Messages. Our efforts complement each other. Any synchronization protocol requires both message routing and message contents. However, I've noticed you use "synchronization protocol" to refer to just the reconciliation part: > I prefer to think about the sync protocol as a reconciliation between two sets of blobs, where the two peers are figuring out which blobs they need to send to each other so that, at the end, they both have all the blobs. I propose using "synchronization" to encompass the entire problem, including the CRDT bits. CRDTs are crucial to synchronization as they define how peers merge parallel edits in synchrony. I hope we can discuss both aspects. I would love to hear your thoughts on the versioning proposal, and I will now address your broader questions about P2P routing of HTTP messages: Martin Kleppmann wrote: > - If you want to atomically update multiple objects, would your > approach require multiple PUTs? Is there a risk of some of them being > applied and some being dropped if the network drops at an inopportune > moment? In our approach we simply encode multiple updates into a > single blob. An example for wanting atomicity: say you want to attach > a comment as an annotation to a span of text. In Automerge you would > do that by attaching a comment ID as a mark to a range of characters, > and then in a separate object you would map the comment ID to a JSON > object with the details of the comment (author, text, timestamp, reply > thread, etc). Yes, we want to support atomic mutations (e.g. "transactions") across objects. I'd like to pick a more difficult example, though, because annotations to spans of text do not intrinsically require two atomic writes to create. The annotation's "attachment" can just be a single field that points to a span of text at a version ID, such as {version: ["x72h"], range: "text 44:70"}. Then you don't need an intermediate object, don't mutate the text CRDT, and end up with just one object to mutate. Perhaps a stronger example is a Bank Account transfer. Suppose Bob wants to send $10 to Alice. We will debit -$100 from Bob's account, and credit +$100 to Alice's. Bob and Alice sign their mutations from different computers, and send them over the network: PUT /bob Version: "transaction-9bx38" Content-Range: json .account.balance Content-Length: 3 110 PUT /alice Version: "transaction-9bx38" Content-Range: json .account.balance Content-Length: 2 90 You propose enforcing atomicity by encoding both PUT messages within the same opaque envelope, which would eliminate scenarios where some peers have one message, but not the other. Unfortunately, this requires both mutations to be created atomically on the same computer. If Alice and Bob sign and send their transactions from separate peers, they will have separate envelopes, and we still have an atomicity problem to contend with. A more general way to address atomicity is via Versioning + Validation. Atomicity is about time, Versioning specifies time, and Validation can mark a version invalid until all parts of the transaction are available. In our case, Bob and Alice: * Choose a single Version ID (e.g. "transaction-9bx38") for both PUTs, to say that they happened atomically, at the same time. * Implement a validation rule (aka "precondition" in CRDT parlance) that says the mutation is not valid/enabled until both sides of the transaction have been received, and are signed by the appropriate parties. I believe Validated Versioning provides a more expressive framework for atomicity than Multi-Message Envelopes. We can do this with PUTs, if we extend them with a versioning spec (e.g. in this thread) and a validation spec (TBD). > - How would the HTTP-style requests map to a p2p setting? The PUT … > syntax seems to suggest an asymmetric, client-server style > relationship between the communicating nodes. I know you said that > Braid was p2p-compatible, but maybe the HTTP-style syntax just puts me > so much in a client-server mindset that it's not obvious to me how it > translates to communication between peers. This might be easier to understand visually, so I just recorded this video: https://braid.org/protocol/visualizing-http2p I hope that's helpful. It was my first time trying that. I'm happy to clarify anything that I hand-waved. The resources I used are here: 1. https://braid.org/antimatter#viz2 2. https://braid.org/antimatter#messages-summary > Why prescribe the HTTP-style message format and not just let each CRDT > implementation define its own serialisation format that is optimised > for its features? The goal is interoperability. You cannot get decentralization without interoperability. If you build a decentralized protocol that doesn't interoperate, you just create a new walled garden on top of your "p2p" protocol. Look at IPFS. My work makes CRDTs and OT interoperable. We now have a common protocol that any CRDT and OT algorithm can use, while independently optimizing their own features. (Yes, this is the Time Machine architecture that unifies OT and CRDT, which I am writing up, and your new paper cites a draft of.) Part of this is a general representation of time, specified in terms of Events and Versions, with a "version-type" that enables optimizations, without coupling implementations to each other's data structures. This versioning idea is in the spec for this thread, and is awaiting peer-review from experts like you. This common protocol for any CRDT or OT algorithm has many benefits. (1) It allows us to build CRDT algorithms that support multiple merge-types. (See Seph's reference-crdts work.) (2) It allows implementations to implement optimizations independently, while still guaranteeing consistency. (Consider EG-Walker. Each peer can implement a walker and its internal format differently.) (3) It allows implementations to summarize or prune some ranges of history independently, while still guaranteeing full consistency for merges through other ranges of time (like with antimatter), and (4) to request various ranges of history from one another in a standard way if they have dropped information that they want back. (5) It allows these operations to be implemented by generic infrastructure, such as CDNs, caches, and backup devices, without requiring them to implement any specific CRDT or OT algorithm. (6) We can also build debugging and programming tools that are able to inspect and support this history without knowing about a particular CRDT or OT algorithm. See the braid-chrome <https://github.com/braid-org/braid-chrome> devtools panel as an example. The goal is interoperability. It results in better performance, tools, and infrastructure; along with more widespread usage. This gets even better when we interoperate with HTTP. > I guess one thing that your approach supports is that when in > unencrypted mode, the server could generate a snapshot of the document > rather than serving a log of the edit history. However, our blob > approach allows that too: a server that is able to interpret the > contents of the blobs can also compress them into a snapshot and serve > it when required (we sometimes call this a "shallow clone" by analogy > to the similar concept in Git). But that is an optional extension to > the protocol; the core protocol can still work on uninterpreted blobs. Yes, there are important use-cases for both needs. However, one man's "core" is another man's "optional." May I propose the neutral principle of *separation of concerns*? The serialization/envelope/routing/reconciliation can be a separate concern from the message formatting. We don't need to agree on which concern is more "core." It's up to implementations to choose which specs they want to implement. Thank you, again. This discussion has been quite valuable to me. I hope you find value in it, as well! Michael
- Fwd: New Version Notification for draft-toomim-ht… Michael Toomim
- Re: New Version Notification for draft-toomim-htt… Rory Hewitt
- Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: New Version Notification for draft-toomim-htt… Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: [braid] Re: New Version Notification for draf… Rory Hewitt
- Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Marius Kleidl
- Re: New Version Notification for draft-toomim-htt… Julian Reschke
- Re: New Version Notification for draft-toomim-htt… Michael Toomim
- Re: [braid] Re: New Version Notification for draf… Michael Toomim
- Re: [braid] Re: New Version Notification for draf… Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Fwd: New Version Notification for draft-toomi… Julian Reschke
- Re: Fwd: New Version Notification for draft-toomi… Josh Cohen
- Re: Fwd: New Version Notification for draft-toomi… Lisa Dusseault
- Re: Fwd: New Version Notification for draft-toomi… Michael Toomim
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim
- Re: Fwd: New Version Notification for draft-toomi… Josh Cohen
- Re: Review of draft-toomim-httpbis-versions-00 Ben Schwartz
- Re: Review of draft-toomim-httpbis-versions-00 Michael Toomim