This commit is contained in:
realbigsean
2023-01-22 05:54:25 +01:00
parent a83fd1afb4
commit 75320ff8bc
8 changed files with 57 additions and 27 deletions

View File

@@ -18,6 +18,8 @@ pub struct ConsensusContext<T: EthSpec> {
/// Cache of indexed attestations constructed during block processing.
indexed_attestations:
HashMap<(AttestationData, BitList<T::MaxValidatorsPerCommittee>), IndexedAttestation<T>>,
/// Whether `verify_kzg_commitments_against_transactions` has successfully passed.
kzg_commitments_consistent: bool,
}
#[derive(Debug, PartialEq, Clone)]
@@ -40,6 +42,7 @@ impl<T: EthSpec> ConsensusContext<T> {
proposer_index: None,
current_block_root: None,
indexed_attestations: HashMap::new(),
kzg_commitments_consistent: false,
}
}
@@ -155,4 +158,13 @@ impl<T: EthSpec> ConsensusContext<T> {
pub fn num_cached_indexed_attestations(&self) -> usize {
self.indexed_attestations.len()
}
pub fn set_kzg_commitments_consistent(mut self, kzg_commitments_consistent: bool) -> Self {
self.kzg_commitments_consistent = kzg_commitments_consistent;
self
}
pub fn kzg_commitments_consistent(&self) -> bool {
self.kzg_commitments_consistent
}
}