Skip to content

Commit

Permalink
Change unpacked_config_tuple, fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
SpyCheese committed Jan 26, 2024
1 parent 959cdfe commit 2db69f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions crypto/block/mc-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2028,9 +2028,7 @@ td::Ref<vm::Tuple> Config::get_unpacked_config_tuple(ton::UnixTime now) const {
tuple.push_back(get_param(21)); // config_gas_prices
tuple.push_back(get_param(24)); // config_mc_fwd_prices
tuple.push_back(get_param(25)); // config_fwd_prices
tuple.push_back(get_param(31)); // fundamental_smc_addr
tuple.push_back(get_param(43)); // size_limits_config
tuple.push_back({}); // null, reserved
return td::make_cnt_ref<std::vector<vm::StackEntry>>(std::move(tuple));
}

Expand Down
4 changes: 2 additions & 2 deletions crypto/vm/tonops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static const StackEntry& get_param(VmState* st, unsigned idx) {
return tuple_index(t1, idx);
}

// ConfigParams: 18 (only one entry), 19, 20, 21, 24, 25, 31, 43
// ConfigParams: 18 (only one entry), 19, 20, 21, 24, 25, 43
static td::Ref<CellSlice> get_unpacked_config_param(VmState* st, unsigned idx) {
auto tuple = st->get_c7();
auto t1 = tuple_index(tuple, 0).as_tuple_range(255);
Expand Down Expand Up @@ -1723,7 +1723,7 @@ int exec_send_message(VmState* st) {
// bits in the root cell of a message are not included in msg.bits (lump_price pays for them)
td::uint64 max_cells;
if (st->get_global_version() >= 6) {
auto r_size_limits_config = block::Config::do_get_size_limits_config(get_unpacked_config_param(st, 7));
auto r_size_limits_config = block::Config::do_get_size_limits_config(get_unpacked_config_param(st, 6));
if (r_size_limits_config.is_error()) {
throw VmError{Excno::cell_und, PSTRING() << "cannot parse config: " << r_size_limits_config.error().message()};
}
Expand Down
8 changes: 3 additions & 5 deletions doc/GlobalVersions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ If the parameter is absent from the config, the value is null.
* **3**: `ConfigParam 21` (gas prices).
* **4**: `ConfigParam 24` (mc fwd fees).
* **5**: `ConfigParam 25` (fwd fees).
* **6**: `ConfigParam 31` (fundamental smc addresses).
* **7**: `ConfigParam 43` (size limits).
* **8**: `null` (reserved).
* **6**: `ConfigParam 43` (size limits).

### New TVM instructions
* `GETEXECUTIONPRICE` (`gas_used is_mc - price`) - calculates gas fee.
* `GETSTORAGEPRICE` (`cells bits is_mc - price`) - calculates storage fees (only current StoragePrices entry is used).
* `GETFORWARDPRICE` (`cells bits time_delta is_mc - price`) - calculates forward 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`.

Expand Down

0 comments on commit 2db69f3

Please sign in to comment.