nspcc-dev / neofs-contract

NeoFS smart-contract
GNU General Public License v3.0
10 stars 17 forks source link

Data size constraint of the container contract #313

Open AnnaShaleva opened 1 year ago

AnnaShaleva commented 1 year ago

The size of Container struct stored in the container contract by https://github.com/nspcc-dev/neofs-contract/blob/dc89137484cd042e79378d4745558cc560b6368a/container/container_contract.go#L731 is restricted by the stackitem.MaxSize constraint (1MB).

The struct in the serialized representation takes has the following fields:

We need to estimate the maximum size of the serialized container representation to ensure it fits the limits.

The same thing should be done for eACL (estimate the maximum size of serialized eACL representation).

Ref. #304.

roman-khimov commented 1 year ago

I think it's more limited by limits.MaxStorageValueLen. Probably this is not a big problem (maybe more relevant for EACLs).

AnnaShaleva commented 1 year ago

I think it's more limited by limits.MaxStorageValueLen

Oh, that's definitely the case, I probably forgot to update my notes before the publishing, because I've also considered this case.