Make container.Delete() GAS cost more predictable #42

Merged
fyrchik merged 1 commit from fyrchik/frostfs-contract:fixed-marshal into support/v0.18 2024-09-04 19:51:17 +00:00

1 commit

Author SHA1 Message Date
6212b5bf72 [#42] container: Make GAS costs more predictable in Delete()
Some checks failed
/ DCO (pull_request) Failing after 3s
/ Tests (1.19) (pull_request) Successful in 5m10s
/ Tests (1.20) (pull_request) Successful in 53s
Persisting a transaction is done in 2 stages:
1. TestInvoke
2. Sign and send to the network.
3. At some point the tx is persisted.
Some time passes between 1 and 3, this could lead to different GAS
costs. It is a known issue for container delete: different epoch can
have different size in bytes and thus different cost to store.
Here we introduce fixed-length encoding for integers, so that the
problem can be avoided.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-10-05 15:49:06 +03:00