BeaconState field renamed

This commit is contained in:
Mark Mackey 2022-11-10 11:49:55 -06:00
parent 2191242341
commit 756e48f5dc
5 changed files with 8 additions and 10 deletions

View File

@ -110,7 +110,7 @@ where
pub next_withdrawal_index: u64, pub next_withdrawal_index: u64,
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
#[superstruct(only(Capella, Eip4844))] #[superstruct(only(Capella, Eip4844))]
pub latest_withdrawal_validator_index: u64, pub next_withdrawal_validator_index: u64,
} }
/// Implement the conversion function from BeaconState -> PartialBeaconState. /// Implement the conversion function from BeaconState -> PartialBeaconState.
@ -213,7 +213,7 @@ impl<T: EthSpec> PartialBeaconState<T> {
inactivity_scores, inactivity_scores,
latest_execution_payload_header, latest_execution_payload_header,
next_withdrawal_index, next_withdrawal_index,
latest_withdrawal_validator_index next_withdrawal_validator_index
] ]
), ),
#[cfg(not(feature = "withdrawals"))] #[cfg(not(feature = "withdrawals"))]
@ -245,7 +245,7 @@ impl<T: EthSpec> PartialBeaconState<T> {
inactivity_scores, inactivity_scores,
latest_execution_payload_header, latest_execution_payload_header,
next_withdrawal_index, next_withdrawal_index,
latest_withdrawal_validator_index next_withdrawal_validator_index
] ]
), ),
#[cfg(not(feature = "withdrawals"))] #[cfg(not(feature = "withdrawals"))]
@ -463,7 +463,7 @@ impl<E: EthSpec> TryInto<BeaconState<E>> for PartialBeaconState<E> {
inactivity_scores, inactivity_scores,
latest_execution_payload_header, latest_execution_payload_header,
next_withdrawal_index, next_withdrawal_index,
latest_withdrawal_validator_index next_withdrawal_validator_index
] ]
), ),
#[cfg(not(feature = "withdrawals"))] #[cfg(not(feature = "withdrawals"))]
@ -493,7 +493,7 @@ impl<E: EthSpec> TryInto<BeaconState<E>> for PartialBeaconState<E> {
inactivity_scores, inactivity_scores,
latest_execution_payload_header, latest_execution_payload_header,
next_withdrawal_index, next_withdrawal_index,
latest_withdrawal_validator_index next_withdrawal_validator_index
] ]
), ),
#[cfg(not(feature = "withdrawals"))] #[cfg(not(feature = "withdrawals"))]

View File

@ -286,8 +286,6 @@ pub fn process_exits<T: EthSpec>(
/// ///
/// Returns `Ok(())` if the validation and state updates completed successfully. Otherwise returs /// Returns `Ok(())` if the validation and state updates completed successfully. Otherwise returs
/// an `Err` describing the invalid object or cause of failure. /// an `Err` describing the invalid object or cause of failure.
///
/// https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#new-process_bls_to_execution_change
#[cfg(all(feature = "withdrawals", feature = "withdrawals-processing"))] #[cfg(all(feature = "withdrawals", feature = "withdrawals-processing"))]
pub fn process_bls_to_execution_changes<'a, T: EthSpec, Payload: AbstractExecPayload<T>>( pub fn process_bls_to_execution_changes<'a, T: EthSpec, Payload: AbstractExecPayload<T>>(
state: &mut BeaconState<T>, state: &mut BeaconState<T>,

View File

@ -60,7 +60,7 @@ pub fn upgrade_to_capella<E: EthSpec>(
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
next_withdrawal_index: 0, next_withdrawal_index: 0,
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
latest_withdrawal_validator_index: 0, next_withdrawal_validator_index: 0,
// Caches // Caches
total_active_balance: pre.total_active_balance, total_active_balance: pre.total_active_balance,
committee_caches: mem::take(&mut pre.committee_caches), committee_caches: mem::take(&mut pre.committee_caches),

View File

@ -67,7 +67,7 @@ pub fn upgrade_to_eip4844<E: EthSpec>(
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
next_withdrawal_index: pre.next_withdrawal_index, next_withdrawal_index: pre.next_withdrawal_index,
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
latest_withdrawal_validator_index: 0, next_withdrawal_validator_index: 0,
// Caches // Caches
total_active_balance: pre.total_active_balance, total_active_balance: pre.total_active_balance,
committee_caches: mem::take(&mut pre.committee_caches), committee_caches: mem::take(&mut pre.committee_caches),

View File

@ -300,7 +300,7 @@ where
pub next_withdrawal_index: u64, pub next_withdrawal_index: u64,
#[cfg(feature = "withdrawals")] #[cfg(feature = "withdrawals")]
#[superstruct(only(Capella, Eip4844))] #[superstruct(only(Capella, Eip4844))]
pub latest_withdrawal_validator_index: u64, pub next_withdrawal_validator_index: u64,
// Caching (not in the spec) // Caching (not in the spec)
#[serde(skip_serializing, skip_deserializing)] #[serde(skip_serializing, skip_deserializing)]