additional updates per pr review

This commit is contained in:
shane-moore
2025-08-18 12:21:21 -07:00
committed by Mark Mackey
parent 161bd2d1bf
commit a3563289c1
4 changed files with 18 additions and 24 deletions

View File

@@ -439,7 +439,7 @@ impl<E: EthSpec> MockBuilder<E> {
block: SignedBlindedBeaconBlock<E>,
) -> Result<FullPayloadContents<E>, String> {
let root = match &block {
SignedBlindedBeaconBlock::Base(_) | SignedBlindedBeaconBlock::Altair(_) => {
SignedBlindedBeaconBlock::Base(_) | types::SignedBeaconBlock::Altair(_) => {
return Err("invalid fork".to_string());
}
SignedBlindedBeaconBlock::Bellatrix(block) => {
@@ -846,10 +846,6 @@ impl<E: EthSpec> MockBuilder<E> {
// first to avoid polluting the execution block generator with invalid payload attributes
// NOTE: this was part of an effort to add payload attribute uniqueness checks,
// which was abandoned because it broke too many tests in subtle ways.
ForkName::Gloas => {
// TODO(EIP7732) Check if this is how we want to do error handling for gloas
return Err("invalid fork".to_string());
}
ForkName::Bellatrix | ForkName::Capella => PayloadAttributes::new(
timestamp,
*prev_randao,
@@ -857,11 +853,16 @@ impl<E: EthSpec> MockBuilder<E> {
expected_withdrawals,
None,
),
ForkName::Deneb
| ForkName::Electra
| ForkName::Fulu
| ForkName::Base
| ForkName::Altair => {
ForkName::Deneb | ForkName::Electra | ForkName::Fulu | ForkName::Gloas => {
PayloadAttributes::new(
timestamp,
*prev_randao,
fee_recipient,
expected_withdrawals,
Some(head_block_root),
)
}
ForkName::Base | ForkName::Altair => {
return Err("invalid fork".to_string());
}
};

View File

@@ -167,9 +167,6 @@ where
#[superstruct(only(Gloas))]
pub latest_block_hash: ExecutionBlockHash,
#[superstruct(only(Gloas))]
pub latest_full_slot: Slot,
#[superstruct(only(Gloas))]
pub latest_withdrawals_root: Hash256,
}
@@ -500,7 +497,6 @@ impl<E: EthSpec> TryInto<BeaconState<E>> for PartialBeaconState<E> {
builder_pending_payments,
builder_pending_withdrawals,
latest_block_hash,
latest_full_slot,
latest_withdrawals_root
],
[historical_summaries]

View File

@@ -1,8 +1,8 @@
use bls::Hash256;
use std::mem;
use types::{
BeaconState, BeaconStateError as Error, BeaconStateGloas, BitVector, ChainSpec, EthSpec,
ExecutionBid, Fork, List, Vector,
BeaconState, BeaconStateError as Error, BeaconStateGloas, BitVector, BuilderPendingPayment,
ChainSpec, EthSpec, ExecutionBid, Fork, List, Vector,
};
/// Transform a `Fulu` state into a `Gloas` state.
@@ -85,10 +85,12 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
pending_consolidations: pre.pending_consolidations.clone(),
// Gloas
execution_payload_availability: BitVector::default(), // All bits set to false initially
builder_pending_payments: Vector::default(), // Empty vector initially,
builder_pending_withdrawals: List::default(), // Empty list initially,
builder_pending_payments: Vector::new(vec![
BuilderPendingPayment::default();
2 * E::slots_per_epoch() as usize
])?,
builder_pending_withdrawals: List::default(), // Empty list initially,
latest_block_hash: pre.latest_execution_payload_header.block_hash,
latest_full_slot: pre.slot,
latest_withdrawals_root: Hash256::default(),
// Caches
total_active_balance: pre.total_active_balance,

View File

@@ -597,11 +597,6 @@ where
#[metastruct(exclude_from(tree_lists))]
pub latest_block_hash: ExecutionBlockHash,
#[test_random(default)]
#[superstruct(only(Gloas))]
#[metastruct(exclude_from(tree_lists))]
pub latest_full_slot: Slot,
#[test_random(default)]
#[superstruct(only(Gloas))]
#[metastruct(exclude_from(tree_lists))]