You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(accountsdb): cast block size and block count to u64 before comput… (#341)
…ing db size
<!-- greptile_comment -->
## Greptile Summary
This change refines the database size calculation in the storage module
to prevent overflow issues when handling large sizes.
- In `/magicblock-accounts-db/src/storage.rs`, both `meta.total_blocks`
and `meta.block_size` are now cast to `u64` before multiplication.
- The addition of `METADATA_STORAGE_SIZE` is safely handled to ensure
accurate sizing.
- These casts protect against overflow when using near-maximum `u32`
values for block metadata.
- Overall, the fix enhances the integrity of the database size
computation for large account databases.
<!-- /greptile_comment -->
0 commit comments