mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 12:11:59 +00:00
Add new fields to BeaconState to match v1.7.0-alpha.1.
This commit is contained in:
@@ -162,15 +162,6 @@ pub fn envelope_processing<E: EthSpec>(
|
||||
});
|
||||
};
|
||||
|
||||
// Verify the withdrawals root
|
||||
envelope_verify!(
|
||||
payload.withdrawals.tree_hash_root() == *state.latest_withdrawals_root()?,
|
||||
EnvelopeProcessingError::WithdrawalsRootMismatch {
|
||||
state: *state.latest_withdrawals_root()?,
|
||||
envelope: payload.withdrawals.tree_hash_root(),
|
||||
}
|
||||
);
|
||||
|
||||
// Verify the gas limit
|
||||
envelope_verify!(
|
||||
payload.gas_limit == committed_bid.gas_limit,
|
||||
|
||||
@@ -130,8 +130,6 @@ pub mod gloas {
|
||||
let (expected_withdrawals, builder_withdrawals_count, partial_withdrawals_count) =
|
||||
get_expected_withdrawals(state, spec)?;
|
||||
|
||||
*state.latest_withdrawals_root_mut()? = expected_withdrawals.tree_hash_root();
|
||||
|
||||
for withdrawal in expected_withdrawals.iter() {
|
||||
decrease_balance(
|
||||
state,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use bls::Hash256;
|
||||
use milhouse::{List, Vector};
|
||||
use ssz_types::BitVector;
|
||||
use std::mem;
|
||||
@@ -88,7 +87,10 @@ 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(),
|
||||
proposer_lookahead: mem::take(&mut pre.proposer_lookahead),
|
||||
// Gloas
|
||||
builders: List::default(),
|
||||
next_withdrawal_builder_index: 0,
|
||||
execution_payload_availability: BitVector::default(), // All bits set to false initially
|
||||
builder_pending_payments: Vector::new(vec![
|
||||
BuilderPendingPayment::default();
|
||||
@@ -96,7 +98,7 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
|
||||
])?,
|
||||
builder_pending_withdrawals: List::default(), // Empty list initially,
|
||||
latest_block_hash: pre.latest_execution_payload_header.block_hash,
|
||||
latest_withdrawals_root: Hash256::default(),
|
||||
payload_expected_withdrawals: List::default(),
|
||||
// Caches
|
||||
total_active_balance: pre.total_active_balance,
|
||||
progressive_balances_cache: mem::take(&mut pre.progressive_balances_cache),
|
||||
@@ -105,7 +107,6 @@ pub fn upgrade_state_to_gloas<E: EthSpec>(
|
||||
exit_cache: mem::take(&mut pre.exit_cache),
|
||||
slashings_cache: mem::take(&mut pre.slashings_cache),
|
||||
epoch_cache: mem::take(&mut pre.epoch_cache),
|
||||
proposer_lookahead: mem::take(&mut pre.proposer_lookahead),
|
||||
});
|
||||
Ok(post)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user