You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the research, we devised a temporary solution until we implement multi-dimensional resources.
Each byte should have an analog in the Gas units. All operations that increase the storage will be charged additionally according to this value(storage-related opcodes, witnesses, serialized transaction itself). This issue is intended to investigate what value it should be. The research report contains some ideas of how we can calculate this value.
The output of this issue is an updated gas_per_byte field of consensus parameters and the instruction on how to calculate this value in the future. If it depends on some other consensus parameters like block_gas_limit, it should be highlighted in the formula/instruction.
Potential problem
If, after finalization of the formula, the gas value for one byte is significantly less than 1(rounding it to 1 leads to a huge overcharge for the user), we need to update the code and consensus parameter to support fraction.
Note
Inserting a new K/V into a state or asset into balances also has Sparse Merkle Tree storage overhead. As a temporary solution, we may try to include this into gas_per_byte. We need to benchmark how the number of entries increases the size of the storage. Later, we can multiply the gas_per_byte by this value for some predefined number of entries.
It is an optional section, and later can be extracted into a separate issue, if we want to.
The text was updated successfully, but these errors were encountered:
Overview
Based on the research, we devised a temporary solution until we implement multi-dimensional resources.
Each byte should have an analog in the Gas units. All operations that increase the storage will be charged additionally according to this value(storage-related opcodes, witnesses, serialized transaction itself). This issue is intended to investigate what value it should be. The research report contains some ideas of how we can calculate this value.
The output of this issue is an updated
gas_per_byte
field of consensus parameters and the instruction on how to calculate this value in the future. If it depends on some other consensus parameters likeblock_gas_limit
, it should be highlighted in the formula/instruction.Potential problem
If, after finalization of the formula, the gas value for one byte is significantly less than
1
(rounding it to1
leads to a huge overcharge for the user), we need to update the code and consensus parameter to support fraction.Note
Inserting a new K/V into a state or asset into balances also has Sparse Merkle Tree storage overhead. As a temporary solution, we may try to include this into
gas_per_byte
. We need to benchmark how the number of entries increases the size of the storage. Later, we can multiply thegas_per_byte
by this value for some predefined number of entries.It is an optional section, and later can be extracted into a separate issue, if we want to.
The text was updated successfully, but these errors were encountered: