From 6789754d94568d804d7863031de9c2c0b3987c32 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 17 Nov 2021 21:46:42 -0500
Subject: [PATCH] some more words about this one weird trick

---
 src/_zkapauthorizer/_storage_server.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/_zkapauthorizer/_storage_server.py b/src/_zkapauthorizer/_storage_server.py
index 5352d0a..d0ec81e 100644
--- a/src/_zkapauthorizer/_storage_server.py
+++ b/src/_zkapauthorizer/_storage_server.py
@@ -783,6 +783,20 @@ def get_writev_price(storage_server, pass_value, storage_index, tw_vectors, now)
             # written.  If they have an unexpired lease then we can apply some
             # or all of the remainder of the value of that lease towards this
             # operation.
+            #
+            # For example, if there are 5 0.5 MB shares already present then 5
+            # ZKAPs (assuming a ZKAP value of 1 MB-month) have been spent to
+            # store them while only 2.5 MB of storage has been allocated.
+            # This means we could accept another 2.5 MB of data for storage at
+            # no cost to the client while still having been completely paid
+            # for the storage committed.
+            #
+            # This is sort of a weird trick to try to reduce the impact of
+            # ZKAP value lost to the rounding scheme in use.  There's a good
+            # chance there are better solutions waiting to be discovered that
+            # would obsolete this logic.  Note that whatever the logic here,
+            # it must agree with the client-side logic so that both server and
+            # client come to the same conclusion regarding price.
             sharenums=None,
         ),
     )
-- 
GitLab