mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 00:37:57 +00:00
f3a6b6dcea
This PR is fixing a bug in the sync mechanism between wasmi and pallet-contracts. This bug leads to essentially double charging all the gas that was used during the execution of the host function. When the `call` host function is used for recursion this will lead to a quadratic amount of gas consumption with regard to the nesting depth.We also took the chance to refactor the code in question and improve the rust docs. The bug was caused by not updating `GasMeter::executor_consumed` (previously `engine_consumed`) when leaving the host function. This lead to the value being stale (too low) when entering another host function. --------- Co-authored-by: PG Herveou <pgherveou@gmail.com>
11 lines
262 B
Plaintext
11 lines
262 B
Plaintext
title: Fix double charge of host function weight
|
|
|
|
doc:
|
|
- audience: Runtime Dev
|
|
description: |
|
|
Fixed a double charge which can lead to quadratic gas consumption of
|
|
the `call` and `instantiate` host functions.
|
|
|
|
crates:
|
|
- name: pallet-contracts
|