Include rent_epoch and executable into account hash (#7415)

* Clean a bit

* Add rent_epoch and executable into account hashing

* Remove comment and instead create an issue
This commit is contained in:
Ryo Onodera
2019-12-12 13:03:33 +09:00
committed by GitHub
parent 1d0ba0d1f2
commit a1ab81a896
2 changed files with 87 additions and 6 deletions

View File

@@ -22,6 +22,8 @@ macro_rules! align_up {
}
/// Meta contains enough context to recover the index from storage itself
/// This struct will be backed by mmaped and snapshotted data files.
/// So the data layout must be stable and consistent across the entire cluster!
#[derive(Clone, PartialEq, Debug)]
pub struct StoredMeta {
/// global write version
@@ -31,6 +33,8 @@ pub struct StoredMeta {
pub data_len: u64,
}
/// This struct will be backed by mmaped and snapshotted data files.
/// So the data layout must be stable and consistent across the entire cluster!
#[derive(Serialize, Deserialize, Clone, Debug, Default, Eq, PartialEq)]
pub struct AccountMeta {
/// lamports in the account
@@ -187,9 +191,7 @@ impl AppendVec {
}
fn get_slice(&self, offset: usize, size: usize) -> Option<(&[u8], usize)> {
let len = self.len();
if len < offset + size {
if offset + size > self.len() {
return None;
}
let data = &self.map[offset..offset + size];