Resolve merge confklicts

This commit is contained in:
Eitan Seri-Levi
2026-05-18 23:12:53 +03:00
58 changed files with 2570 additions and 922 deletions

View File

@@ -1548,6 +1548,14 @@ where
}
}
/// Returns whether the execution payload for a block has been received.
///
/// Returns `false` for unknown blocks and pre-Gloas nodes.
pub fn is_payload_received(&self, block_root: &Hash256) -> bool {
self.proto_array.is_payload_received(block_root)
&& self.is_finalized_checkpoint_or_descendant(*block_root)
}
/// Returns whether the proposer should extend the execution payload chain of the given block.
pub fn should_extend_payload(&self, block_root: &Hash256) -> Result<bool, Error<T::Error>> {
let proposer_boost_root = self.fc_store.proposer_boost_root();

View File

@@ -12,7 +12,6 @@ use crate::{
};
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
use bls::{AggregateSignature, Keypair, PublicKeyBytes, Signature, SignatureBytes};
use fixed_bytes::FixedBytesExtended;
use ssz_types::Bitfield;
use ssz_types::VariableList;
use std::sync::{Arc, LazyLock};
@@ -52,7 +51,6 @@ async fn get_harness<E: EthSpec>(
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
(1..last_slot_of_epoch.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -2,7 +2,6 @@
use crate::per_epoch_processing::process_epoch;
use beacon_chain::test_utils::BeaconChainHarness;
use beacon_chain::types::{EthSpec, MinimalEthSpec};
use bls::{FixedBytesExtended, Hash256};
use types::Slot;
#[tokio::test]
@@ -22,7 +21,6 @@ async fn runs_without_error() {
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
(1..target_slot.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -356,6 +356,12 @@ impl<E: EthSpec, Payload: AbstractExecPayload<E>> SignedBeaconBlock<E, Payload>
self.message()
.body()
.blob_kzg_commitments()
.or_else(|_| {
self.message()
.body()
.signed_execution_payload_bid()
.map(|bid| bid.message().blob_kzg_commitments())
})
.map(|c| c.len())
.unwrap_or(0)
}

View File

@@ -1,6 +1,6 @@
use crate::execution::{ExecutionPayloadBidGloas, ExecutionPayloadBidHeze, ExecutionPayloadBidRef};
use crate::state::BeaconStateError;
use crate::{EthSpec, ForkName};
use crate::{Epoch, EthSpec, ForkName};
use bls::Signature;
use context_deserialize::{ContextDeserialize, context_deserialize};
use educe::Educe;
@@ -65,6 +65,10 @@ impl<E: EthSpec> SignedExecutionPayloadBid<E> {
}
}
pub fn epoch(&self) -> Epoch {
self.message().slot().epoch(E::slots_per_epoch())
}
pub fn empty_gloas() -> Self {
Self::Gloas(SignedExecutionPayloadBidGloas {
message: ExecutionPayloadBidGloas::default(),
@@ -88,6 +92,17 @@ impl<'a, E: EthSpec> SignedExecutionPayloadBidRef<'a, E> {
|inner, cons| { cons(&inner.message) }
)
}
pub fn epoch(&self) -> Epoch {
self.message().slot().epoch(E::slots_per_epoch())
}
pub fn to_owned(&self) -> SignedExecutionPayloadBid<E> {
match self {
Self::Gloas(inner) => SignedExecutionPayloadBid::Gloas((*inner).clone()),
Self::Heze(inner) => SignedExecutionPayloadBid::Heze((*inner).clone()),
}
}
}
impl<E: EthSpec> SignedExecutionPayloadBidGloas<E> {

View File

@@ -47,7 +47,6 @@ async fn new_state<E: EthSpec>(validator_count: usize, slot: Slot) -> BeaconStat
harness
.add_attested_blocks_at_slots(
head_state,
Hash256::zero(),
(1..=slot.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -39,7 +39,6 @@ async fn get_harness<E: EthSpec>(
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
slots.as_slice(),
(0..validator_count).collect::<Vec<_>>().as_slice(),
)