From 86e22b8addf1743864f3362ebb022a295c99d9cd Mon Sep 17 00:00:00 2001 From: Zooko O'Whielacronx Date: Thu, 9 Oct 2008 12:13:57 -0700 Subject: [PATCH] interfaces: loosen a few max-size constraints which would limit us to a mere 1.09 TB maximum file size These constraints were originally intended to protect against attacks on the storage server protocol layer which exhaust memory in the peer. However, defending against that sort of DoS is hard -- probably it isn't completely achieved -- and it costs development time to think about it, and it sometimes imposes limits on legitimate users which we don't necessarily want to impose. So, for now we forget about limiting the amount of RAM that a foolscap peer can cause you to start using. --- src/allmydata/interfaces.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index b508fb21..9d6ddd48 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -14,7 +14,7 @@ FURL = StringConstraint(1000) StorageIndex = StringConstraint(16) URI = StringConstraint(300) # kind of arbitrary -MAX_BUCKETS = 200 # per peer +MAX_BUCKETS = 256 # per peer -- zfec offers at most 256 shares per file ShareData = StringConstraint(None) URIExtensionData = StringConstraint(1000) @@ -236,23 +236,22 @@ class IStorageBucketWriter(Interface): @return: a Deferred that fires (with None) when the operation completes """ - def put_plaintext_hashes(hashes=ListOf(Hash, maxLength=2**20)): + def put_plaintext_hashes(hashes=ListOf(Hash)): """ @return: a Deferred that fires (with None) when the operation completes """ - def put_crypttext_hashes(hashes=ListOf(Hash, maxLength=2**20)): + def put_crypttext_hashes(hashes=ListOf(Hash)): """ @return: a Deferred that fires (with None) when the operation completes """ - def put_block_hashes(blockhashes=ListOf(Hash, maxLength=2**20)): + def put_block_hashes(blockhashes=ListOf(Hash)): """ @return: a Deferred that fires (with None) when the operation completes """ - def put_share_hashes(sharehashes=ListOf(TupleOf(int, Hash), - maxLength=2**20)): + def put_share_hashes(sharehashes=ListOf(TupleOf(int, Hash))): """ @return: a Deferred that fires (with None) when the operation completes """ @@ -293,22 +292,22 @@ class IStorageBucketReader(Interface): def get_plaintext_hashes(): """ - @return: ListOf(Hash, maxLength=2**20) + @return: ListOf(Hash) """ def get_crypttext_hashes(): """ - @return: ListOf(Hash, maxLength=2**20) + @return: ListOf(Hash) """ def get_block_hashes(): """ - @return: ListOf(Hash, maxLength=2**20) + @return: ListOf(Hash) """ def get_share_hashes(): """ - @return: ListOf(TupleOf(int, Hash), maxLength=2**20) + @return: ListOf(TupleOf(int, Hash)) """ def get_uri_extension(): -- 2.45.2