v2.2: Fixes storage alive size with secondary indexes (backport of #5778)#5793
v2.2: Fixes storage alive size with secondary indexes (backport of #5778)#5793brooksprumo merged 2 commits intov2.2from
Conversation
(cherry picked from commit 679ad80) # Conflicts: # accounts-db/src/accounts_db.rs
|
Cherry-pick of 679ad80 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
|
this won't have much bake time on testnet before 2.2 hits mb. we're confident? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2.2 #5793 +/- ##
=======================================
Coverage 83.4% 83.4%
=======================================
Files 806 806
Lines 373256 373276 +20
=======================================
+ Hits 311314 311381 +67
+ Misses 61942 61895 -47 🚀 New features to boost your workflow:
|
I feel good, yes. I also spun up a v2.2 node with secondary indexes to confirm. There's three sections in this graph: Left, Middle, and Right.
We can see the percentage alive in the storages is wrong (200%) in the middle with secondary indexes, and then correct again with this PR. |
|
@mergify rebase |
❌ Unable to rebase: user
|
|
@mircea-c Why the rebase? |
|
@brooksprumo don't mind me. Just getting the hang of this. I thought it needed a rebase based on the github message, but it has no conflicts so can just be merged. |
Gotcha. Yeah, please avoid rebasing PRs. I think it's best to let the owner/assignee be responsible for any rebasing; so as to avoid going through a long CI cycle unnecessarily. |

Problem
When generating the index with secondary indexes, the AccountStorageEntry's alive bytes is incorrectly set (approximately double). This likely causes issues later, e.g. not shrinking when they should.
Summary of Changes
Fix it.
Justification to Backport
The alive bytes is used to determine which storages to shrink, and when. Having the wrong value is a bug and makes debugging/reasoning about behavior harder.
This is an automatic backport of pull request #5778 done by [Mergify](https://mergify.com).