pub trait DiffTarget {
Show 21 methods
// Required methods
fn get_fork(&self) -> ForkName;
fn scalar_header_mut(&mut self) -> &mut Vec<u8> ⓘ;
fn balances_mut(&mut self) -> &mut impl ListMutTarget<u64>;
fn validators_mut(&mut self) -> &mut impl ValidatorMutTarget;
fn block_roots_mut(&mut self) -> &mut [[u8; 32]];
fn state_roots_mut(&mut self) -> &mut [[u8; 32]];
fn randao_mixes_mut(&mut self) -> &mut [[u8; 32]];
fn slashings_mut(&mut self) -> &mut [u64];
fn eth1_data_votes_mut(&mut self) -> &mut Vec<u8> ⓘ;
fn historical_roots_mut(&mut self) -> Option<&mut Vec<u8>>;
fn previous_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>;
fn current_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>;
fn previous_participation_mut(
&mut self,
) -> Option<&mut impl ListMutTarget<u8>>;
fn current_participation_mut(
&mut self,
) -> Option<&mut impl ListMutTarget<u8>>;
fn inactivity_scores_mut(&mut self) -> Option<&mut Vec<u64>>;
fn current_sync_committee_mut(&mut self) -> Option<&mut Vec<u8>>;
fn next_sync_committee_mut(&mut self) -> Option<&mut Vec<u8>>;
fn historical_summaries_mut(&mut self) -> Option<&mut Vec<u8>>;
fn pending_deposits_mut(&mut self) -> Option<&mut Vec<u8>>;
fn pending_partial_withdrawals_mut(&mut self) -> Option<&mut Vec<u8>>;
fn pending_consolidations_mut(&mut self) -> Option<&mut Vec<u8>>;
}Expand description
Mutable state interface used by apply.
Implement this trait for a beacon-state representation to allow an archived
BeaconStateDelta to be applied directly to the client’s native state.
The trait deliberately exposes only the mutable views required by the delta algorithms. It does not require the underlying state to use the same memory layout as Ethereum’s SSZ representation.
§Fork requirements
get_fork must return the fork of the state being
modified. apply rejects the operation if it differs from the fork stored
in the delta.
Fork-specific accessors should return None when the corresponding field
does not exist in the state representation.
§Mutation
Implementations must return references to the actual state storage.
apply mutates these collections in place.
If an implementation returns a view backed by temporary storage rather than the actual state, the reconstructed values will not be persisted to the beacon state.
Required Methods§
Sourcefn get_fork(&self) -> ForkName
fn get_fork(&self) -> ForkName
Returns the fork of the state being modified.
This value must match BeaconStateDelta::fork for apply to
proceed.
Sourcefn scalar_header_mut(&mut self) -> &mut Vec<u8> ⓘ
fn scalar_header_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns mutable storage for the scalar state header.
The returned buffer is replaced with the scalar bytes stored in the delta.
fn balances_mut(&mut self) -> &mut impl ListMutTarget<u64>
fn validators_mut(&mut self) -> &mut impl ValidatorMutTarget
fn block_roots_mut(&mut self) -> &mut [[u8; 32]]
fn state_roots_mut(&mut self) -> &mut [[u8; 32]]
fn randao_mixes_mut(&mut self) -> &mut [[u8; 32]]
fn slashings_mut(&mut self) -> &mut [u64]
fn eth1_data_votes_mut(&mut self) -> &mut Vec<u8> ⓘ
fn historical_roots_mut(&mut self) -> Option<&mut Vec<u8>>
Sourcefn previous_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>
fn previous_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>
Returns mutable access to previous_epoch_attestations.
Returns None for forks where this field does not exist.
Sourcefn current_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>
fn current_epoch_attestations_mut(&mut self) -> Option<&mut Vec<u8>>
Returns mutable access to previous_epoch_attestations.
Returns None for forks where this field does not exist.
fn previous_participation_mut(&mut self) -> Option<&mut impl ListMutTarget<u8>>
fn current_participation_mut(&mut self) -> Option<&mut impl ListMutTarget<u8>>
fn inactivity_scores_mut(&mut self) -> Option<&mut Vec<u64>>
fn current_sync_committee_mut(&mut self) -> Option<&mut Vec<u8>>
fn next_sync_committee_mut(&mut self) -> Option<&mut Vec<u8>>
fn historical_summaries_mut(&mut self) -> Option<&mut Vec<u8>>
fn pending_deposits_mut(&mut self) -> Option<&mut Vec<u8>>
fn pending_partial_withdrawals_mut(&mut self) -> Option<&mut Vec<u8>>
fn pending_consolidations_mut(&mut self) -> Option<&mut Vec<u8>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".