mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Fix on-disk consensus context format
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
use crate::common::get_indexed_attestation;
|
||||
use crate::per_block_processing::errors::{AttestationInvalid, BlockOperationError};
|
||||
use crate::EpochCacheError;
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use std::collections::{hash_map::Entry, HashMap};
|
||||
use tree_hash::TreeHash;
|
||||
use types::{
|
||||
@@ -9,22 +8,20 @@ use types::{
|
||||
ChainSpec, Epoch, EthSpec, Hash256, IndexedAttestation, SignedBeaconBlock, Slot,
|
||||
};
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Encode, Decode)]
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
pub struct ConsensusContext<E: EthSpec> {
|
||||
/// Slot to act as an identifier/safeguard
|
||||
slot: Slot,
|
||||
pub slot: Slot,
|
||||
/// Previous epoch of the `slot` precomputed for optimization purpose.
|
||||
pub(crate) previous_epoch: Epoch,
|
||||
pub previous_epoch: Epoch,
|
||||
/// Current epoch of the `slot` precomputed for optimization purpose.
|
||||
pub(crate) current_epoch: Epoch,
|
||||
pub current_epoch: Epoch,
|
||||
/// Proposer index of the block at `slot`.
|
||||
proposer_index: Option<u64>,
|
||||
pub proposer_index: Option<u64>,
|
||||
/// Block root of the block at `slot`.
|
||||
current_block_root: Option<Hash256>,
|
||||
pub current_block_root: Option<Hash256>,
|
||||
/// Cache of indexed attestations constructed during block processing.
|
||||
/// We can skip serializing / deserializing this as the cache will just be rebuilt
|
||||
#[ssz(skip_serializing, skip_deserializing)]
|
||||
indexed_attestations:
|
||||
pub indexed_attestations:
|
||||
HashMap<(AttestationData, BitList<E::MaxValidatorsPerCommittee>), IndexedAttestation<E>>,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user