Skip to content
Unverified Commit 4984effe authored by thiolliere's avatar thiolliere Committed by Sebastian Kunert
Browse files

StorageWeightReclaim: Fix issue when underestimating refund. (#5273)

The code do reduce or increase the weight by comparing
`benchmarked_weight` and `consumed_weight`.

But `benchmarked_weight` is the pre dispatch weight. not the post
dispatch weight that is actually written into the block weight by
`CheckWeight`.

So in case the consumed weight was: `pre dispatch weight > consumed
weight > post dispatch weight` then the reclaim code was reducing the
block weight instead of increasing it.

Might explain this issue even better
https://github.com/paritytech/polkadot-sdk/issues/5229

@skunert
@s0me0ne-unkn0wn

(cherry picked from commit 862860ec)
parent 131d56ed
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment