Skip to content
Unverified Commit 862860ec authored by thiolliere's avatar thiolliere Committed by GitHub
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
parent b1a9ad4d
Pipeline #488581 waiting for manual action with stages
in 17 minutes and 32 seconds