Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data size constraint of the container contract #313

Open
AnnaShaleva opened this issue Jan 27, 2023 · 2 comments
Open

Data size constraint of the container contract #313

AnnaShaleva opened this issue Jan 27, 2023 · 2 comments
Labels
container Container contract related issue I3 Minimal impact S3 Minimally significant U3 Regular
Milestone

Comments

@AnnaShaleva
Copy link
Member

AnnaShaleva commented Jan 27, 2023

The size of Container struct stored in the container contract by

func addContainer(ctx storage.Context, id, owner []byte, container Container) {
is restricted by the stackitem.MaxSize constraint (1MB).

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

  • value (ByteString, 1 byte for stackitem type + len(serialized container bytes))
  • sig (ByteString, 1 byte for stackitem type + 64 bytes of the signature)
  • pub (ByteString, 1 byte for the stackitem type + 33 bytes of the compressed key)
  • token (ByteString, 1 byte for the stackitem type + [0 or len(SessionToken bytes)])

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
Copy link
Member

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

@roman-khimov roman-khimov added the container Container contract related issue label Jan 27, 2023
@AnnaShaleva
Copy link
Member Author

AnnaShaleva commented Jan 30, 2023

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.

@roman-khimov roman-khimov added U3 Regular S3 Minimally significant I3 Minimal impact labels Dec 20, 2023
@roman-khimov roman-khimov added this to the v0.21.0 milestone Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
container Container contract related issue I3 Minimal impact S3 Minimally significant U3 Regular
Projects
None yet
Development

No branches or pull requests

2 participants