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

[1.14] Backport PoV-reclaim fixes (#5273, #5281) #5371

Merged

Commits on Aug 15, 2024

  1. 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
    #5229
    
    @skunert
    @s0me0ne-unkn0wn
    
    (cherry picked from commit 862860e)
    gui1117 authored and skunert committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    8b1d35f View commit details
    Browse the repository at this point in the history
  2. StorageWeightReclaim: set to node pov size if higher (#5281)

    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 committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    fa32f16 View commit details
    Browse the repository at this point in the history