Skip to content

Commit

Permalink
Renames process proposal cache
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco committed Jul 4, 2024
1 parent c5b9147 commit 8674109
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Shell {

self.state
.in_mem_mut()
.process_proposal_cache
.block_proposals_cache
.put(block_hash, result);
}
Ok(Response::ProcessProposal(response))
Expand Down Expand Up @@ -219,7 +219,7 @@ impl Shell {
let process_proposal_result = match self
.state
.in_mem_mut()
.process_proposal_cache
.block_proposals_cache
.get(&finalize_req.block_hash)
{
// We already have the result of process proposal for this block
Expand Down Expand Up @@ -250,7 +250,7 @@ impl Shell {
}

// Clear the cache of proposed blocks' results
self.state.in_mem_mut().process_proposal_cache.clear();
self.state.in_mem_mut().block_proposals_cache.clear();

Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions crates/node/src/shims/abcipp_shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ impl AbcippShim {
.service
.state
.in_mem_mut()
.process_proposal_cache
.block_proposals_cache
.get(&block_hash)
{
// We already have the result of process proposal for
Expand Down Expand Up @@ -215,7 +215,7 @@ impl AbcippShim {
self.service
.state
.in_mem_mut()
.process_proposal_cache
.block_proposals_cache
.put(block_hash.to_owned(), result.clone());

result
Expand Down
4 changes: 2 additions & 2 deletions crates/state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ where
/// to avoid running process proposal more than once internally because of
/// the shim or the recheck option (comet only calls it at most once
/// for a given height/round)
pub process_proposal_cache: CLruCache<Hash, ProcessProposalCachedResult>,
pub block_proposals_cache: CLruCache<Hash, ProcessProposalCachedResult>,
}

/// Last committed block
Expand Down Expand Up @@ -165,7 +165,7 @@ where
eth_events_queue: EthEventsQueue::default(),
storage_read_past_height_limit,
commit_only_data: CommitOnlyData::default(),
process_proposal_cache: CLruCache::new(
block_proposals_cache: CLruCache::new(
NonZeroUsize::new(10).unwrap(),
),
}
Expand Down
2 changes: 1 addition & 1 deletion crates/state/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ pub mod testing {
eth_events_queue: EthEventsQueue::default(),
storage_read_past_height_limit: Some(1000),
commit_only_data: CommitOnlyData::default(),
process_proposal_cache: CLruCache::new(
block_proposals_cache: CLruCache::new(
NonZeroUsize::new(10).unwrap(),
),
}
Expand Down

0 comments on commit 8674109

Please sign in to comment.