Remove dumb artificial delay

This commit is contained in:
Eitan Seri- Levi
2026-03-03 20:22:30 -08:00
parent 16e7bb5f1d
commit e8d83ef57f
5 changed files with 21 additions and 25 deletions

View File

@@ -115,7 +115,6 @@ use state_processing::{
per_slot_processing,
state_advance::{complete_state_advance, partial_state_advance},
};
use types::consts::gloas::PAYLOAD_STATUS_FULL;
use std::borrow::Cow;
use std::cmp::Ordering;
use std::collections::HashMap;
@@ -133,6 +132,7 @@ use task_executor::{RayonPoolType, ShutdownReason, TaskExecutor};
use tokio_stream::Stream;
use tracing::{Span, debug, debug_span, error, info, info_span, instrument, trace, warn};
use tree_hash::TreeHash;
use types::consts::gloas::PAYLOAD_STATUS_FULL;
use types::data::{ColumnIndex, FixedBlobSidecarList};
use types::execution::BlockProductionVersion;
use types::*;
@@ -2089,7 +2089,8 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
});
}
if proto_block.slot < request_slot && proto_block.payload_status == PAYLOAD_STATUS_FULL {
if proto_block.slot < request_slot && proto_block.payload_status == PAYLOAD_STATUS_FULL
{
1
} else {
0
@@ -2148,7 +2149,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
&self.spec,
)?;
if self.spec.fork_name_at_slot::<T::EthSpec>(request_slot).gloas_enabled() {
if self
.spec
.fork_name_at_slot::<T::EthSpec>(request_slot)
.gloas_enabled()
{
attestation.data_mut().index = payload_status
}

View File

@@ -98,8 +98,8 @@ use task_executor::JoinHandle;
use tracing::{Instrument, Span, debug, debug_span, error, info_span, instrument, warn};
use types::{
BeaconBlockRef, BeaconState, BeaconStateError, BlobsList, ChainSpec, DataColumnSidecarList,
Epoch, EthSpec, FullPayload, Hash256, InconsistentFork, KzgProofs,
RelativeEpoch, SignedBeaconBlock, SignedBeaconBlockHeader, Slot, StatePayloadStatus,
Epoch, EthSpec, FullPayload, Hash256, InconsistentFork, KzgProofs, RelativeEpoch,
SignedBeaconBlock, SignedBeaconBlockHeader, Slot, StatePayloadStatus,
data::DataColumnSidecarError,
};
@@ -1948,23 +1948,13 @@ fn load_parent<T: BeaconChainTypes, B: AsBlock<T::EthSpec>>(
&& let Ok(parent_bid_block_hash) = parent_block.payload_bid_block_hash()
{
if block.as_block().is_parent_block_full(parent_bid_block_hash) {
// TODO(gloas): loading the envelope here is not very efficient.
// The envelope may not have arrived yet, so we retry after a short delay.
let envelope = match chain.store.get_payload_envelope(&root)? {
Some(envelope) => envelope,
None => {
warn!(
parent_block_root = ?root,
"Parent block envelope not yet available, waiting 1s for arrival"
);
std::thread::sleep(std::time::Duration::from_secs(1));
chain.store.get_payload_envelope(&root)?.ok_or_else(|| {
BeaconChainError::DBInconsistent(format!(
"Missing envelope for parent block {root:?}",
))
})?
}
};
// The parent block's envelope must have been imported for us to load the
// full state. If it hasn't arrived yet, return an unknown parent error so
// the block gets sent to the reprocess queue.
let envelope = chain
.store
.get_payload_envelope(&root)?
.ok_or(BlockError::ParentUnknown { parent_root: root })?;
(StatePayloadStatus::Full, envelope.message.state_root)
} else {
(StatePayloadStatus::Pending, parent_block.state_root())

View File

@@ -273,7 +273,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
return Err(EnvelopeError::BlockRootUnknown { block_root });
}
// TODO(gloas) no fork choice logic yet
// Take an exclusive write-lock on fork choice. It's very important to prevent deadlocks by
// avoiding taking other locks whilst holding this lock.

View File

@@ -49,10 +49,12 @@ use rayon::prelude::*;
use sensitive_url::SensitiveUrl;
use slot_clock::{SlotClock, TestingSlotClock};
use ssz_types::{RuntimeVariableList, VariableList};
use state_processing::{BlockSignatureStrategy, ConsensusContext, VerifyBlockRoot, per_block_processing};
use state_processing::per_block_processing::compute_timestamp_at_slot;
use state_processing::per_block_processing::deneb::kzg_commitment_to_versioned_hash;
use state_processing::state_advance::complete_state_advance;
use state_processing::{
BlockSignatureStrategy, ConsensusContext, VerifyBlockRoot, per_block_processing,
};
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::fmt;

View File

@@ -134,7 +134,7 @@ pub async fn publish_execution_payload_envelope<T: BeaconChainTypes>(
warn!(%slot, %beacon_block_root, "Execution payload envelope rejected");
return Err(warp_utils::reject::custom_bad_request(format!(
"execution payload envelope rejected, gossip verification"
)))
)));
};
// Import the envelope locally (runs state transition and notifies the EL).