linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Create a data structure replacing `ReentrantCollectionView<C, AccountOwner, PendingBlobsView<C>>`

Open MathieuDutSik opened this issue 6 months ago • 3 comments

This structure has multiple issues:

  • The PendingBlobsView has a MapView for the BlobId as if different AccountOwner can have the same BlobId and separation is important. Actually, yes, in principle they can, but no repetition does not hurt, since if two users create the same blob, no problem occurs.
  • It is very inefficient if one wants to access a blob if one does not know the owner of the blob created. See the code in maybe_get_required_blobs about this.

MathieuDutSik avatar Oct 14 '25 12:10 MathieuDutSik

I don't understand the description of the first issue.

ma2bd avatar Nov 09 '25 18:11 ma2bd

We have a structure by AccountOwner, which makes the access to data slow. Why can't we have a

MapView<C, BlobId, BlobContent>

MathieuDutSik avatar Nov 11 '25 17:11 MathieuDutSik

We need to limit the amount of pending blobs we keep in the chain state view. If we have a limit for all chain owners, then a malicious owner can keep the other owners from making successful proposals by spamming the validators with unnecessary blobs.

So instead we impose a limit per owner.

But you're right, there's no reason why we shouldn't still store the actual blobs separately. We just need to do the bookkeeping about which blob belongs to which owners' proposals.

afck avatar Nov 11 '25 17:11 afck