Fix underestimated proof-size accounting for precompile storage reads - #3753
Conversation
Elois/fix moon 3449
…-size Better delegator storage proof size calculation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR adds ChangesParachain Staking Proof-Size Refactoring
Conviction Voting Proof-Size Refactoring
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Coverage Report@@ Coverage Diff @@
## master elois/backport-hotfix +/- ##
=========================================================
+ Coverage 77.12% 77.13% +0.01%
Files 389 389
+ Lines 77272 77285 +13
=========================================================
+ Hits 59593 59611 +18
- Misses 17679 17674 -5
|
Goal
Fix underestimated proof-size accounting for precompile storage reads that return conviction-voting class locks and parachain-staking delegator state.
What reviewers need to know
precompiles/conviction-votingnow chargesclassLocksForusing the max encoded length of the fullClassLocksForbounded vector, including each lock balance, instead of only accounting for class IDs.precompiles/parachain-stakingnow computes the delegator-state read proof size from SCALE upper bounds for the key and max-sizedDelegatorvalue, replacing the previous fixed formula.pallets/parachain-stakingderivesMaxEncodedLenforBondandDelegatorStatusso the staking precompile can derive the upper bound from the actual encoded types.note: Silent label because the change was already deployed to production in release runtimes 4204 and 4303, so we should not mention it in the next regular changelog.
Need help on this PR? Tag
@codesmithwith what you need.