Fix some low-hanging FIXMEs

This commit is contained in:
Michael Sproul
2022-10-24 15:02:43 +11:00
parent 84ae7b2976
commit 59c1972df7
6 changed files with 12 additions and 14 deletions

View File

@@ -197,7 +197,6 @@ where
};
let finalized_checkpoint = justified_checkpoint;
// FIXME(sproul): avoid `to_vec` perf penalty
Self {
store,
balances_cache: <_>::default(),

View File

@@ -626,7 +626,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.get_full_block(&new_view.head_block_root, None)?
.ok_or(Error::MissingBeaconBlock(new_view.head_block_root))?;
// FIXME(sproul): use advanced state?
let beacon_state_root = beacon_block.state_root();
let beacon_state: BeaconState<T::EthSpec> = self
.get_state(&beacon_state_root, Some(beacon_block.slot()))?
@@ -1288,8 +1287,7 @@ fn observe_head_block_delays<E: EthSpec, S: SlotClock>(
// If the block was enshrined as head too late for attestations to be created for it,
// log a debug warning and increment a metric.
if late_head {
// FIXME(sproul): restore this metric, idk where it went
// metrics::inc_counter(&metrics::BEACON_BLOCK_HEAD_SLOT_START_DELAY_EXCEEDED_TOTAL);
metrics::inc_counter(&metrics::BEACON_BLOCK_HEAD_SLOT_START_DELAY_EXCEEDED_TOTAL);
debug!(
log,
"Delayed head block";

View File

@@ -72,7 +72,6 @@ pub use store;
pub use timeout_rw_lock::TimeoutRwLock;
pub use types;
// FIXME(sproul): compatibility shim
pub mod validator_pubkey_cache {
use crate::BeaconChainTypes;

View File

@@ -813,6 +813,11 @@ lazy_static! {
// [0.1, 0.2, 0.5, 1, 2, 5, 10, 20, 50]
decimal_buckets(-1,2)
);
pub static ref BEACON_BLOCK_HEAD_SLOT_START_DELAY_EXCEEDED_TOTAL: Result<IntCounter> = try_create_int_counter(
"beacon_block_head_slot_start_delay_exceeded_total",
"Triggered when the duration between the start of the block's slot and the current time \
will result in failed attestations.",
);
pub static ref BEACON_BLOCK_HEAD_MISSED_ATT_DEADLINE_LATE: Result<IntCounter> = try_create_int_counter(
"beacon_block_head_missed_att_deadline_late",
"Total number of delayed head blocks that arrived late"