Serialize constant-width integers #41

Closed
opened 2023-10-03 19:31:07 +00:00 by fyrchik · 2 comments
Owner

Lets introduce util helpers to serialize integers using constant amount of bytes.
container.DeletionInfo struct uses epoch and is serialized using variable number of bytes. The problem is when this number changes between test invocation and persist. It can happen only 7 times throughout the network lifetime, so not is that big a deal. But it seems easy to support and also backward compatible (native serialization just strips leading zeroes).

I believe we also have 2-bytes sequences somewhere.

Lets introduce util helpers to serialize integers using constant amount of bytes. `container.DeletionInfo` struct uses epoch and is serialized using variable number of bytes. The problem is when this number changes between test invocation and persist. It can happen only 7 times throughout the network lifetime, so not is that big a deal. But it seems easy to support and also backward compatible (native serialization just strips leading zeroes). I believe we also have 2-bytes sequences somewhere.
fyrchik added the
discussion
label 2023-10-03 19:31:18 +00:00
Owner

As alternative, client can increase fee on container.Delete and similar operations (fee difference shouldn't be quite large for 1 bit value and 128 bit value, I suppose). But proposed solution is cleaner to me.

As alternative, client can increase fee on `container.Delete` and similar operations (fee difference shouldn't be quite large for 1 bit value and 128 bit value, I suppose). But proposed solution is cleaner to me.
Member

@fyrchik do we have other functions similar container.delete depend on the epoch?

@fyrchik do we have other functions similar `container.delete` depend on the epoch?
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-contract#41
No description provided.