target_attestations.rs

Overview

The target_attestations.rs file defines the BlockStatistics struct and its associated methods, which provide utilities related to block attestation statistics within a blockchain context. The primary purpose of this file is to offer functionality for calculating expected attestation counts based on block keepers and managing window sizes related to block statistics analysis.

Structs and Methods

BlockStatistics

A struct that encapsulates parameters required for analyzing block statistics. Currently, it maintains a single field:

Fields

Field

Type

Description

window_size

usize

The number of blocks in the observation window.

Methods

_next(self, _block_identifier: BlockIdentifier, _new_window_size: Option<usize>) -> Self
_expected_number_of_attestations_for_descendant_block(&self, total_number_of_block_keepers_for_descendant_block: usize) -> usize

Implementation Details and Algorithms

Interaction with Other Parts of the System

Structure Diagram

classDiagram
class BlockStatistics {
-window_size: usize
+_next()
+_expected_number_of_attestations_for_descendant_block()
}
BlockStatistics ..> BlockIdentifier : uses