Closed czarcas7ic closed 6 months ago
The changes involve introducing a mechanism to handle deprecated missed block bit arrays in the slashing module, aiming to improve performance and maintainability. A global variable sets a pruning limit per block, and a new function facilitates the deletion of deprecated entries. The migration script updates key prefixes and ensures backward compatibility without causing chain downtime during upgrades. These modifications signify an effort to optimize data storage and access patterns within the blockchain framework.
Files | Change Summaries |
---|---|
x/slashing/abci.go |
- Introduced deprecatedBitArrayPruneLimitPerBlock .- Added deletion logic for deprecated bit arrays in BeginBlocker . |
x/slashing/keeper/keeper.go |
- Added v4 import.- Added DeleteDeprecatedValidatorMissedBlockBitArray function. |
x/slashing/migrations/v4/keys.go x/slashing/migrations/v4/migrate.go x/slashing/migrations/v4/migrate_test.go |
- Updated and introduced key prefixes. - Adjusted migration logic for deprecated bit arrays, including handling of empty slices and pruning indicators. - Modified test logic to align with the new key usage and simplified checks for missed blocks. |
x/slashing/types/keys.go |
- Modified and updated key prefixes. - Introduced IsPruningKey and TrueByteValue . |
πβ¨
In the blockchain's heart, where bits arrayed,
A rabbit hopped, pruning paths it made.
With keys and codes, it danced and swayed,
Through deprecated fields, a new trail laid.
"To optimize!" it cheerfully brayed,
Leaving bytes lighter, in the shade.
πΏπ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Description
Closes: #XXXX
Updates slashing migration logic to:
Testing
I did a broad test with the in-place-testnet and all seemed well. When we do a more thorough upgrade test with multiple validators, we should bring a validator down and ensure the counter incs as expected.
Just b/c it took me a little to figure this out let me write it here:
You get the validator address like:
osmosisd tendermint show-validator
And then get signing info like:
osmosisd q slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"kY2Q8mLJkMgK9aFfZlvfllUiiP0D+h7HC+3hH87Qosk="}'
Summary by CodeRabbit