mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 20:57:10 +00:00
Cell Dissemination (Partial messages) (#8314)
- https://github.com/ethereum/consensus-specs/pull/4558 - https://eips.ethereum.org/EIPS/eip-8136 Co-Authored-By: Daniel Knopik <daniel@dknopik.de> Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
This commit is contained in:
@@ -6,7 +6,9 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::marker::PhantomData;
|
||||
use std::sync::Arc;
|
||||
use types::{BlobSidecar, ChainSpec, DataColumnSidecar, EthSpec, Hash256, SignedBeaconBlock, Slot};
|
||||
use types::{
|
||||
BlobSidecar, ChainSpec, DataColumnSidecar, EthSpec, Hash256, PartialDataColumnHeader, Slot,
|
||||
};
|
||||
|
||||
type ValidatorIndex = u64;
|
||||
type BeaconBlockRoot = Hash256;
|
||||
@@ -102,17 +104,17 @@ impl ObservationKey {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_block<E: EthSpec>(
|
||||
block: &SignedBeaconBlock<E>,
|
||||
pub fn from_partial_column_header<E: EthSpec>(
|
||||
header: &PartialDataColumnHeader<E>,
|
||||
block_root: Hash256,
|
||||
spec: &ChainSpec,
|
||||
) -> Self {
|
||||
let slot = block.slot();
|
||||
let slot = header.slot();
|
||||
|
||||
if spec.fork_name_at_slot::<E>(slot).gloas_enabled() {
|
||||
Self::new_block_root_key(block_root, slot)
|
||||
} else {
|
||||
Self::new_proposer_key(block.message().proposer_index(), slot)
|
||||
Self::new_proposer_key(header.signed_block_header.message.proposer_index, slot)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user