mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-01 03:33:47 +00:00
Check data availability boundary in rpc request
This commit is contained in:
@@ -195,7 +195,7 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> SignedBeaconBlock<E, Payload>
|
||||
}
|
||||
|
||||
let domain = spec.get_domain(
|
||||
self.slot().epoch(E::slots_per_epoch()),
|
||||
self.epoch(),
|
||||
Domain::BeaconProposer,
|
||||
fork,
|
||||
genesis_validators_root,
|
||||
@@ -227,6 +227,11 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> SignedBeaconBlock<E, Payload>
|
||||
self.message().slot()
|
||||
}
|
||||
|
||||
/// Convenience accessor for the block's epoch.
|
||||
pub fn epoch(&self) -> Epoch {
|
||||
self.message().slot().epoch(E::slots_per_epoch())
|
||||
}
|
||||
|
||||
/// Convenience accessor for the block's parent root.
|
||||
pub fn parent_root(&self) -> Hash256 {
|
||||
self.message().parent_root()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use crate::signed_beacon_block::BlobReconstructionError;
|
||||
use crate::{BlobsSidecar, EthSpec, Hash256, SignedBeaconBlock, SignedBeaconBlockEip4844, Slot};
|
||||
use crate::{
|
||||
BlobsSidecar, Epoch, EthSpec, Hash256, SignedBeaconBlock, SignedBeaconBlockEip4844, Slot,
|
||||
};
|
||||
use derivative::Derivative;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use ssz::{Decode, DecodeError};
|
||||
@@ -74,6 +76,14 @@ impl<T: EthSpec> BlockWrapper<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn epoch(&self) -> Epoch {
|
||||
match &self.0 {
|
||||
BlockWrapperInner::Block(block) => block.epoch(),
|
||||
BlockWrapperInner::BlockAndBlob(block_sidecar_pair) => {
|
||||
block_sidecar_pair.beacon_block.epoch()
|
||||
}
|
||||
}
|
||||
}
|
||||
pub fn block(&self) -> &SignedBeaconBlock<T> {
|
||||
match &self.0 {
|
||||
BlockWrapperInner::Block(block) => &block,
|
||||
|
||||
Reference in New Issue
Block a user