pub struct EthereumState {
pub last_signed_block_slot: Option<u64>,
pub block_signing_roots: BTreeMap<u64, [u8; 32]>,
pub highest_source_epoch: u64,
pub highest_target_epoch: u64,
pub attestation_history: AttestationHistory,
}Expand description
Ethereum-specific validator state
This is the existing ValidatorState fields extracted for multi-chain support.
Fields§
§last_signed_block_slot: Option<u64>Highest slot for which a block was signed
block_signing_roots: BTreeMap<u64, [u8; 32]>Map of slot -> signing_root for block proposals Used to allow idempotent re-signing of the same block
highest_source_epoch: u64Highest source epoch in any signed attestation
highest_target_epoch: u64Highest target epoch in any signed attestation
attestation_history: AttestationHistoryAttestation history for surround vote detection
Implementations§
Source§impl EthereumState
impl EthereumState
Sourcepub fn get_block_signing_root(&self, slot: u64) -> Option<&[u8; 32]>
pub fn get_block_signing_root(&self, slot: u64) -> Option<&[u8; 32]>
Get the signing root for a block at the given slot, if any
Sourcepub fn record_block_signing(&mut self, slot: u64, signing_root: [u8; 32])
pub fn record_block_signing(&mut self, slot: u64, signing_root: [u8; 32])
Record that a block was signed for the given slot
Sourcepub fn get_attestation_signing_root(
&self,
source_epoch: u64,
target_epoch: u64,
) -> Option<&[u8; 32]>
pub fn get_attestation_signing_root( &self, source_epoch: u64, target_epoch: u64, ) -> Option<&[u8; 32]>
Get the signing root for an attestation with the given source/target, if any
Trait Implementations§
Source§impl Clone for EthereumState
impl Clone for EthereumState
Source§fn clone(&self) -> EthereumState
fn clone(&self) -> EthereumState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EthereumState
impl Debug for EthereumState
Source§impl Default for EthereumState
impl Default for EthereumState
Source§impl<'de> Deserialize<'de> for EthereumState
impl<'de> Deserialize<'de> for EthereumState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EthereumState
impl RefUnwindSafe for EthereumState
impl Send for EthereumState
impl Sync for EthereumState
impl Unpin for EthereumState
impl UnwindSafe for EthereumState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more