mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
28463a12f0
When doing a cross contract call you can supply an optional Weight limit for that call. If one doesn't specify the limit (setting it to 0) the sub call will have all the remaining gas available. If one does specify the limit we subtract that amount eagerly from the Weight meter and fail fast if not enough `Weight` is available. This is quite annoying because setting a fixed limit will set the `gas_required` in the gas estimation according to the specified limit. Even if in that dry-run the actual call didn't consume that whole amount. It effectively discards the more precise measurement it should have from the dry-run. This PR changes the behaviour so that the supplied limit is an actual limit: We do the cross contract call even if the limit is higher than the remaining `Weight`. We then fail and roll back in the cub call in case there is not enough weight. This makes the weight estimation in the dry-run no longer dependent on the weight limit supplied when doing a cross contract call. --------- Co-authored-by: PG Herveou <pgherveou@gmail.com>
14 lines
531 B
Plaintext
14 lines
531 B
Plaintext
title: Don't fail fast if the weight limit of a cross contract call is too big
|
|
|
|
doc:
|
|
- audience: Runtime Dev
|
|
description: |
|
|
Cross contracts calls will now be executed even if the supplied weight
|
|
limit is bigger than the reamining weight. If the **actual** weight is too low
|
|
they will fail in the cross contract call and roll back. This is different from the
|
|
old behaviour where the limit for the cross contract call must be smaller than
|
|
the remaining weight.
|
|
|
|
crates:
|
|
- name: pallet-contracts
|