mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
Work in progress block separation
This commit is contained in:
@@ -693,7 +693,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
let root = self.block_root_at_slot(request_slot, skips)?;
|
||||
|
||||
if let Some(block_root) = root {
|
||||
Ok(self.store.get_blinded_block(&block_root)?)
|
||||
Ok(self
|
||||
.store
|
||||
.get_blinded_block(&block_root, Some(request_slot))?)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
@@ -919,7 +921,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
) -> Result<Option<SignedBeaconBlock<T::EthSpec>>, Error> {
|
||||
// Load block from database, returning immediately if we have the full block w payload
|
||||
// stored.
|
||||
let blinded_block = match self.store.try_get_full_block(block_root)? {
|
||||
let blinded_block = match self.store.try_get_full_block(block_root, None)? {
|
||||
Some(DatabaseBlock::Full(block)) => return Ok(Some(block)),
|
||||
Some(DatabaseBlock::Blinded(block)) => block,
|
||||
None => return Ok(None),
|
||||
@@ -975,7 +977,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
&self,
|
||||
block_root: &Hash256,
|
||||
) -> Result<Option<SignedBlindedBeaconBlock<T::EthSpec>>, Error> {
|
||||
Ok(self.store.get_blinded_block(block_root)?)
|
||||
Ok(self.store.get_blinded_block(block_root, None)?)
|
||||
}
|
||||
|
||||
/// Returns the state at the given root, if any.
|
||||
@@ -4629,7 +4631,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
|
||||
let beacon_block = self
|
||||
.store
|
||||
.get_blinded_block(&beacon_block_root)?
|
||||
.get_blinded_block(&beacon_block_root, None)?
|
||||
.ok_or_else(|| {
|
||||
Error::DBInconsistent(format!("Missing block {}", beacon_block_root))
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user