Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable2407] Backport PoV-reclaim fixes (#5273, #5281) #5351

Merged
merged 2 commits into from
Aug 14, 2024

Conversation

skunert
Copy link
Contributor

@skunert skunert commented Aug 13, 2024

Backports #5273 & #5281

gui1117 and others added 2 commits August 13, 2024 22:33
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
#5229

@skunert
@s0me0ne-unkn0wn

(cherry picked from commit 862860e)
This PR adds an additional defensive check to the reclaim SE.

Since it can happen that we miss some storage accesses on other SEs
pre-dispatch, we should double check
that the bookkeeping of the runtime stays ahead of the node-side
pov-size.

If we discover a mismatch and the node-side pov-size is indeed higher,
we should set the runtime bookkeeping to the node-side value. In cases
such as #5229, we would stop including extrinsics and not run `on_idle`
at least.

cc @gui1117

---------

Co-authored-by: command-bot <>
(cherry picked from commit 055eb53)
@skunert skunert requested a review from a team as a code owner August 13, 2024 20:37
Copy link

This pull request is amending an existing release. Please proceed with extreme caution,
as to not impact downstream teams that rely on the stability of it. Some things to consider:

  • Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
  • Should be a legit fix for some bug, not adding tons of new features.
  • Must either be already audited or trivial (not sure audit).
Emergency Bypass

If you really need to bypass this check: add validate: false to each crate
in the Prdoc where a breaking change is introduced. This will release a new major
version of that crate and all its reverse dependencies and basically break the release.

@skunert skunert changed the title [stable2407] Backport PoV-reclaim fixes [stable2407] Backport PoV-reclaim fixes (#5273, #5281) Aug 13, 2024
@EgorPopelyaev EgorPopelyaev merged commit b754e0b into stable2407 Aug 14, 2024
149 of 163 checks passed
@EgorPopelyaev EgorPopelyaev deleted the skunert/stable2407-backport-reclaim branch August 14, 2024 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants