Skip to content

Commit

Permalink
do not store stake table for e+1, e+2 in add_epoch_root()
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Mar 7, 2025
1 parent 95bb765 commit f06aa85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion hotshot-types/src/data/ns_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ pub fn parse_ns_table(payload_byte_len: usize, bytes: &[u8]) -> Vec<Range<usize>
!= bytes.len().saturating_sub(NUM_NSS_BYTE_LEN)
/ NS_ID_BYTE_LEN.saturating_add(NS_OFFSET_BYTE_LEN)
{
tracing::warn!("Failed to parse the metadata as namespace table. Use a single namespace table instead.");
return vec![(0..payload_byte_len)];
}
let mut l = 0;
Expand Down
9 changes: 2 additions & 7 deletions types/src/v0/impls/stake_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,9 @@ impl EpochCommittees {
};

self.state.insert(epoch, committee.clone());
self.state.insert(epoch + 1, committee.clone());
self.state.insert(epoch + 2, committee.clone());

self.randomized_committees
.insert(epoch, randomized_committee.clone());
self.randomized_committees
.insert(epoch + 1, randomized_committee.clone());
self.randomized_committees
.insert(epoch + 2, randomized_committee.clone());
}

// We need a constructor to match our concrete type.
Expand Down Expand Up @@ -306,7 +301,7 @@ impl EpochCommittees {

// TODO: remove this, workaround for hotshot asking for stake tables from epoch 1 and 2
let mut map = HashMap::new();
for epoch in Epoch::genesis().u64()..=50 {
for epoch in Epoch::genesis().u64()..=2 {
map.insert(Epoch::new(epoch), members.clone());
randomized_committees.insert(Epoch::new(epoch), randomized_committee.clone());
}
Expand Down

0 comments on commit f06aa85

Please sign in to comment.