mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add TVM instructions for working with nonzero-level cells (#880)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
64b04e46d7
commit
51d30e2f2b
6 changed files with 156 additions and 1 deletions
|
@ -69,12 +69,26 @@ If the parameter is absent from the config, the value is null.
|
|||
* **6**: `ConfigParam 43` (size limits).
|
||||
|
||||
### New TVM instructions
|
||||
|
||||
#### Fee calculation
|
||||
* `GETEXECUTIONPRICE` (`gas_used is_mc - price`) - calculates gas fee.
|
||||
* `GETSTORAGEPRICE` (`cells bits seconds is_mc - price`) - calculates storage fees (only current StoragePrices entry is used).
|
||||
* `GETFORWARDPRICE` (`cells bits is_mc - price`) - calculates forward fee.
|
||||
* `GETPRECOMPILEDGAS` (`- null`) - reserved, currently returns `null`.
|
||||
|
||||
`gas_used`, `cells`, `bits`, `time_delta` are integers in range `0..2^63-1`.
|
||||
|
||||
#### Cell operations
|
||||
Operations for working with Merkle proofs, where cells can have non-zero level and multiple hashes.
|
||||
* `CLEVEL` (`cell - level`) - returns level of the cell.
|
||||
* `CLEVELMASK` (`cell - level_mask`) - returns level mask of the cell.
|
||||
* `i CHASHI` (`cell - hash`) - returns `i`th hash of the cell.
|
||||
* `i CDEPTHI` (`cell - depth`) - returns `i`th depth of the cell.
|
||||
* `CHASHIX` (`cell i - hash`) - returns `i`th hash of the cell.
|
||||
* `CDEPTHIX` (`cell i - depth`) - returns `i`th depth of the cell.
|
||||
|
||||
`i` is in range `0..3`.
|
||||
|
||||
### Other changes
|
||||
* `GLOBALID` gets `ConfigParam 19` from the tuple, not from the config dict. This decreases gas usage.
|
||||
* `SENDMSG` gets `ConfigParam 24/25` (message prices) from the tuple, not from the config dict, and also uses `ConfigParam 43` to get max_msg_cells.
|
Loading…
Add table
Add a link
Reference in a new issue