Add bal support, remove epbs stuff

This commit is contained in:
Pawan Dhananjay
2026-01-16 12:40:57 -08:00
parent d099ad56fb
commit 47094d592c
15 changed files with 336 additions and 208 deletions

View File

@@ -456,6 +456,12 @@ pub fn process_execution_payload<E: EthSpec, Payload: AbstractExecPayload<E>>(
_ => return Err(BlockProcessingError::IncorrectStateType),
}
}
ExecutionPayloadHeaderRefMut::Gloas(header_mut) => {
match payload.to_execution_payload_header() {
ExecutionPayloadHeader::Gloas(header) => *header_mut = header,
_ => return Err(BlockProcessingError::IncorrectStateType),
}
}
}
Ok(())

View File

@@ -1,11 +1,5 @@
use bls::Hash256;
use milhouse::{List, Vector};
use ssz_types::BitVector;
use std::mem;
use types::{
BeaconState, BeaconStateError as Error, BeaconStateGloas, BuilderPendingPayment, ChainSpec,
EthSpec, ExecutionPayloadBid, Fork,
};
use types::{BeaconState, BeaconStateError as Error, BeaconStateGloas, ChainSpec, EthSpec, Fork};
/// Transform a `Fulu` state into a `Gloas` state.
pub fn upgrade_to_gloas<E: EthSpec>(
@@ -69,11 +63,8 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
// Sync committees
current_sync_committee: pre.current_sync_committee.clone(),
next_sync_committee: pre.next_sync_committee.clone(),
// Execution Bid
latest_execution_payload_bid: ExecutionPayloadBid {
block_hash: pre.latest_execution_payload_header.block_hash,
..Default::default()
},
// Execution - upgrade header from Fulu to Gloas
latest_execution_payload_header: pre.latest_execution_payload_header.upgrade_to_gloas(),
// Capella
next_withdrawal_index: pre.next_withdrawal_index,
next_withdrawal_validator_index: pre.next_withdrawal_validator_index,
@@ -88,15 +79,6 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
pending_deposits: pre.pending_deposits.clone(),
pending_partial_withdrawals: pre.pending_partial_withdrawals.clone(),
pending_consolidations: pre.pending_consolidations.clone(),
// Gloas
execution_payload_availability: BitVector::default(), // All bits set to false initially
builder_pending_payments: Vector::new(vec![
BuilderPendingPayment::default();
E::builder_pending_payments_limit()
])?,
builder_pending_withdrawals: List::default(), // Empty list initially,
latest_block_hash: pre.latest_execution_payload_header.block_hash,
latest_withdrawals_root: Hash256::default(),
// Caches
total_active_balance: pre.total_active_balance,
progressive_balances_cache: mem::take(&mut pre.progressive_balances_cache),