Update dependencies to get rid of the yanked deps (#4994)

* Initial attempt to upgrade hashbrown to latest to get rid of the crate warnings.

* Replace `.expect()` usage with use of `const`.

* Update ahash 0.7 as well

* Remove unsafe code.

* Update `lru` to 0.12 and fix release test errors.

* Set non-blocking socket

* Bump testcontainers to 0.15.

* Fix lint

---------

Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Jimmy Chen
2023-12-15 18:31:59 +11:00
committed by GitHub
parent f1113540d8
commit b0c374c1ca
24 changed files with 290 additions and 136 deletions

View File

@@ -3,13 +3,13 @@ use eth2::lighthouse::{BlockReward, BlockRewardsQuery};
use lru::LruCache;
use slog::{debug, warn, Logger};
use state_processing::BlockReplayer;
use std::num::NonZeroUsize;
use std::sync::Arc;
use types::beacon_block::BlindedBeaconBlock;
use warp_utils::reject::{
beacon_chain_error, beacon_state_error, custom_bad_request, custom_server_error,
};
use types::non_zero_usize::new_non_zero_usize;
use warp_utils::reject::{beacon_chain_error, beacon_state_error, custom_bad_request};
const STATE_CACHE_SIZE: usize = 2;
const STATE_CACHE_SIZE: NonZeroUsize = new_non_zero_usize(2);
/// Fetch block rewards for blocks from the canonical chain.
pub fn get_block_rewards<T: BeaconChainTypes>(
@@ -164,11 +164,7 @@ pub fn compute_block_rewards<T: BeaconChainTypes>(
.build_all_committee_caches(&chain.spec)
.map_err(beacon_state_error)?;
state_cache
.get_or_insert((parent_root, block.slot()), || state)
.ok_or_else(|| {
custom_server_error("LRU cache insert should always succeed".into())
})?
state_cache.get_or_insert((parent_root, block.slot()), || state)
};
// Compute block reward.