Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZKAPAuthorizer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Administrator
ZKAPAuthorizer
Commits
3f5a9183
Commit
3f5a9183
authored
5 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
doc improvements
parent
121656b1
No related branches found
Branches containing commit
No related tags found
1 merge request
!49
Correct pass count for mutable writes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/_zkapauthorizer/_storage_server.py
+5
-4
5 additions, 4 deletions
src/_zkapauthorizer/_storage_server.py
src/_zkapauthorizer/tests/test_storage_server.py
+17
-2
17 additions, 2 deletions
src/_zkapauthorizer/tests/test_storage_server.py
with
22 additions
and
6 deletions
src/_zkapauthorizer/_storage_server.py
+
5
−
4
View file @
3f5a9183
...
...
@@ -426,10 +426,11 @@ def get_slot_share_size(storage_server, storage_index, sharenums):
else
:
# Compared to calculating how much *user* data we're
# storing, the on-disk file is larger by at *least*
# SLOT_HEADER_SIZE* where various bookkeeping is kept.
# There is also a variable sized trailer which is harder
# to compute. Fortunately it's generally also a lot
# smaller so I'm just going to ignore it for now.
# SLOT_HEADER_SIZE. There is also a variable sized
# trailer which is harder to compute but which is at least
# LEASE_TRAILER_SIZE. Fortunately it's often exactly
# LEASE_TRAILER_SIZE so I'm just going to ignore it for
# now.
#
# By measuring that the slots are larger than the data the
# user is storing we'll overestimate how many passes are
...
...
This diff is collapsed.
Click to expand it.
src/_zkapauthorizer/tests/test_storage_server.py
+
17
−
2
View file @
3f5a9183
...
...
@@ -203,8 +203,23 @@ class PassValidationTests(TestCase):
self
.
fail
(
"
expected MorePassesRequired, got {}
"
.
format
(
result
))
def
_test_extend_mutable_fails_without_passes
(
self
,
storage_index
,
secrets
,
test_and_write_vectors_for_shares
,
make_data_vector
):
# Hypothesis causes our storage server to be used many times. Clean
def
_test_extend_mutable_fails_without_passes
(
self
,
storage_index
,
secrets
,
test_and_write_vectors_for_shares
,
make_data_vector
,
):
"""
Verify that increasing the storage requirements of a slot without
supplying more passes fails.
:param make_data_vector: A one-argument callable. It will be called
with the current length of a slot share. It should return a write
vector which will increase the storage requirements of that slot
share by at least BYTES_PER_PASS.
"""
# hypothesis causes our storage server to be used many times. Clean
# up between iterations.
cleanup_storage_server
(
self
.
anonymous_storage_server
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment