mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
requests block + blob always post eip4844
This commit is contained in:
@@ -103,6 +103,7 @@ use store::{
|
||||
use task_executor::{ShutdownReason, TaskExecutor};
|
||||
use tree_hash::TreeHash;
|
||||
use types::beacon_state::CloneConfig;
|
||||
use types::consts::eip4844::MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS;
|
||||
use types::signed_block_and_blobs::BlockWrapper;
|
||||
use types::*;
|
||||
|
||||
@@ -5421,9 +5422,24 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
|
||||
/// The epoch at which we require a data availability check in block processing.
|
||||
/// `None` if the `Eip4844` fork is disabled.
|
||||
pub fn data_availability_boundary(&self) -> Option<Epoch> {
|
||||
self.spec
|
||||
self.spec.eip4844_fork_epoch.map(|fork_epoch| {
|
||||
self.epoch().ok().map(|current_epoch|{
|
||||
std::cmp::max(
|
||||
fork_epoch,
|
||||
current_epoch - *MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS,
|
||||
)
|
||||
})
|
||||
}).flatten()
|
||||
}
|
||||
|
||||
/// Returns `true` if we are at or past the `Eip4844` fork. This will always return `false` if
|
||||
/// the `Eip4844` fork is disabled.
|
||||
pub fn is_data_availability_check_required(&self) -> Result<bool, Error> {
|
||||
let current_epoch = self.epoch()?;
|
||||
Ok(self.spec
|
||||
.eip4844_fork_epoch
|
||||
.map(|e| std::cmp::max(e, self.head().finalized_checkpoint().epoch))
|
||||
.map(|fork_epoch| fork_epoch <= current_epoch)
|
||||
.unwrap_or(false))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use slot_clock::SlotClock;
|
||||
|
||||
use crate::beacon_chain::{BeaconChain, BeaconChainTypes, MAXIMUM_GOSSIP_CLOCK_DISPARITY};
|
||||
use bls::PublicKey;
|
||||
use types::consts::eip4844::BLS_MODULUS;
|
||||
use crate::{kzg_utils, BeaconChainError};
|
||||
use bls::PublicKey;
|
||||
use state_processing::per_block_processing::eip4844::eip4844::verify_kzg_commitments_against_transactions;
|
||||
use types::consts::eip4844::BLS_MODULUS;
|
||||
use types::{BeaconStateError, BlobsSidecar, Hash256, KzgCommitment, Slot, Transactions};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user