diff --git a/eth2/state_processing/src/common/get_attesting_indices.rs b/eth2/state_processing/src/common/get_attesting_indices.rs index a45eeb881..c627c366b 100644 --- a/eth2/state_processing/src/common/get_attesting_indices.rs +++ b/eth2/state_processing/src/common/get_attesting_indices.rs @@ -3,7 +3,7 @@ use types::*; /// Returns validator indices which participated in the attestation, sorted by increasing index. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn get_attesting_indices( state: &BeaconState, attestation_data: &AttestationData, @@ -18,7 +18,7 @@ pub fn get_attesting_indices( /// Returns validator indices which participated in the attestation, unsorted. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn get_attesting_indices_unsorted( state: &BeaconState, attestation_data: &AttestationData, diff --git a/eth2/state_processing/src/common/initiate_validator_exit.rs b/eth2/state_processing/src/common/initiate_validator_exit.rs index 996dcdb2a..40b3d80fa 100644 --- a/eth2/state_processing/src/common/initiate_validator_exit.rs +++ b/eth2/state_processing/src/common/initiate_validator_exit.rs @@ -3,7 +3,7 @@ use types::{BeaconStateError as Error, *}; /// Initiate the exit of the validator of the given `index`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn initiate_validator_exit( state: &mut BeaconState, index: usize, diff --git a/eth2/state_processing/src/common/slash_validator.rs b/eth2/state_processing/src/common/slash_validator.rs index 2a2db1a77..0908f4a39 100644 --- a/eth2/state_processing/src/common/slash_validator.rs +++ b/eth2/state_processing/src/common/slash_validator.rs @@ -3,7 +3,7 @@ use types::{BeaconStateError as Error, *}; /// Slash the validator with index ``index``. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn slash_validator( state: &mut BeaconState, slashed_index: usize, diff --git a/eth2/state_processing/src/common/verify_bitfield.rs b/eth2/state_processing/src/common/verify_bitfield.rs index 886269a54..0d4045c2e 100644 --- a/eth2/state_processing/src/common/verify_bitfield.rs +++ b/eth2/state_processing/src/common/verify_bitfield.rs @@ -4,7 +4,7 @@ use types::*; /// /// Is title `verify_bitfield` in spec. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_bitfield_length(bitfield: &Bitfield, committee_size: usize) -> bool { if bitfield.num_bytes() != ((committee_size + 7) / 8) { return false; diff --git a/eth2/state_processing/src/get_genesis_state.rs b/eth2/state_processing/src/get_genesis_state.rs index 18a1e7c35..5cb8648ee 100644 --- a/eth2/state_processing/src/get_genesis_state.rs +++ b/eth2/state_processing/src/get_genesis_state.rs @@ -9,7 +9,7 @@ pub enum GenesisError { /// Returns the genesis `BeaconState` /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn get_genesis_beacon_state( genesis_validator_deposits: &[Deposit], genesis_time: u64, diff --git a/eth2/state_processing/src/per_block_processing.rs b/eth2/state_processing/src/per_block_processing.rs index c65c6d17b..ab7e5a320 100644 --- a/eth2/state_processing/src/per_block_processing.rs +++ b/eth2/state_processing/src/per_block_processing.rs @@ -40,7 +40,7 @@ mod verify_transfer; /// Returns `Ok(())` if the block is valid and the state was successfully updated. Otherwise /// returns an error describing why the block was invalid or how the function failed to execute. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn per_block_processing( state: &mut BeaconState, block: &BeaconBlock, @@ -55,7 +55,7 @@ pub fn per_block_processing( /// Returns `Ok(())` if the block is valid and the state was successfully updated. Otherwise /// returns an error describing why the block was invalid or how the function failed to execute. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn per_block_processing_without_verifying_block_signature( state: &mut BeaconState, block: &BeaconBlock, @@ -70,7 +70,7 @@ pub fn per_block_processing_without_verifying_block_signature( /// Returns `Ok(())` if the block is valid and the state was successfully updated. Otherwise /// returns an error describing why the block was invalid or how the function failed to execute. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn per_block_processing_signature_optional( mut state: &mut BeaconState, block: &BeaconBlock, @@ -97,7 +97,7 @@ fn per_block_processing_signature_optional( /// Processes the block header. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_block_header( state: &mut BeaconState, block: &BeaconBlock, @@ -132,7 +132,7 @@ pub fn process_block_header( /// Verifies the signature of a block. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_block_signature( state: &BeaconState, block: &BeaconBlock, @@ -160,7 +160,7 @@ pub fn verify_block_signature( /// Verifies the `randao_reveal` against the block's proposer pubkey and updates /// `state.latest_randao_mixes`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_randao( state: &mut BeaconState, block: &BeaconBlock, @@ -191,7 +191,7 @@ pub fn process_randao( /// Update the `state.eth1_data_votes` based upon the `eth1_data` provided. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_eth1_data( state: &mut BeaconState, eth1_data: &Eth1Data, @@ -217,7 +217,7 @@ pub fn process_eth1_data( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_proposer_slashings( state: &mut BeaconState, proposer_slashings: &[ProposerSlashing], @@ -250,7 +250,7 @@ pub fn process_proposer_slashings( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_attester_slashings( state: &mut BeaconState, attester_slashings: &[AttesterSlashing], @@ -308,7 +308,7 @@ pub fn process_attester_slashings( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_attestations( state: &mut BeaconState, attestations: &[Attestation], @@ -357,7 +357,7 @@ pub fn process_attestations( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_deposits( state: &mut BeaconState, deposits: &[Deposit], @@ -434,7 +434,7 @@ pub fn process_deposits( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_exits( state: &mut BeaconState, voluntary_exits: &[VoluntaryExit], @@ -466,7 +466,7 @@ pub fn process_exits( /// Returns `Ok(())` if the validation and state updates completed successfully, otherwise returns /// an `Err` describing the invalid object or cause of failure. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_transfers( state: &mut BeaconState, transfers: &[Transfer], diff --git a/eth2/state_processing/src/per_block_processing/validate_attestation.rs b/eth2/state_processing/src/per_block_processing/validate_attestation.rs index 379b921f4..a2ee268bb 100644 --- a/eth2/state_processing/src/per_block_processing/validate_attestation.rs +++ b/eth2/state_processing/src/per_block_processing/validate_attestation.rs @@ -11,7 +11,7 @@ use types::*; /// /// Returns `Ok(())` if the `Attestation` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn validate_attestation( state: &BeaconState, attestation: &Attestation, @@ -34,7 +34,7 @@ pub fn validate_attestation_time_independent_only( /// /// Returns `Ok(())` if the `Attestation` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn validate_attestation_without_signature( state: &BeaconState, attestation: &Attestation, @@ -47,7 +47,7 @@ pub fn validate_attestation_without_signature( /// given state, optionally validating the aggregate signature. /// /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn validate_attestation_parametric( state: &BeaconState, attestation: &Attestation, @@ -99,7 +99,7 @@ fn validate_attestation_parametric( /// Check target epoch, source epoch, source root, and source crosslink. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_casper_ffg_vote( attestation: &Attestation, state: &BeaconState, diff --git a/eth2/state_processing/src/per_block_processing/verify_attester_slashing.rs b/eth2/state_processing/src/per_block_processing/verify_attester_slashing.rs index 7e1fa5e66..3ae32d72a 100644 --- a/eth2/state_processing/src/per_block_processing/verify_attester_slashing.rs +++ b/eth2/state_processing/src/per_block_processing/verify_attester_slashing.rs @@ -8,7 +8,7 @@ use types::*; /// /// Returns `Ok(())` if the `AttesterSlashing` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_attester_slashing( state: &BeaconState, attester_slashing: &AttesterSlashing, @@ -39,7 +39,7 @@ pub fn verify_attester_slashing( /// /// Returns Ok(indices) if `indices.len() > 0`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn get_slashable_indices( state: &BeaconState, attester_slashing: &AttesterSlashing, diff --git a/eth2/state_processing/src/per_block_processing/verify_deposit.rs b/eth2/state_processing/src/per_block_processing/verify_deposit.rs index da2353bb9..860e9cd26 100644 --- a/eth2/state_processing/src/per_block_processing/verify_deposit.rs +++ b/eth2/state_processing/src/per_block_processing/verify_deposit.rs @@ -5,7 +5,7 @@ use types::*; /// Verify `Deposit.pubkey` signed `Deposit.signature`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_deposit_signature( state: &BeaconState, deposit: &Deposit, @@ -25,7 +25,7 @@ pub fn verify_deposit_signature( /// Verify that the `Deposit` index is correct. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_deposit_index( state: &BeaconState, deposit: &Deposit, @@ -57,7 +57,7 @@ pub fn get_existing_validator_index( /// Verify that a deposit is included in the state's eth1 deposit root. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_deposit_merkle_proof( state: &BeaconState, deposit: &Deposit, diff --git a/eth2/state_processing/src/per_block_processing/verify_exit.rs b/eth2/state_processing/src/per_block_processing/verify_exit.rs index 2a3a29b3f..4bfad5f19 100644 --- a/eth2/state_processing/src/per_block_processing/verify_exit.rs +++ b/eth2/state_processing/src/per_block_processing/verify_exit.rs @@ -7,7 +7,7 @@ use types::*; /// /// Returns `Ok(())` if the `Exit` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_exit( state: &BeaconState, exit: &VoluntaryExit, @@ -18,7 +18,7 @@ pub fn verify_exit( /// Like `verify_exit` but doesn't run checks which may become true in future states. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_exit_time_independent_only( state: &BeaconState, exit: &VoluntaryExit, @@ -29,7 +29,7 @@ pub fn verify_exit_time_independent_only( /// Parametric version of `verify_exit` that skips some checks if `time_independent_only` is true. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_exit_parametric( state: &BeaconState, exit: &VoluntaryExit, diff --git a/eth2/state_processing/src/per_block_processing/verify_indexed_attestation.rs b/eth2/state_processing/src/per_block_processing/verify_indexed_attestation.rs index f06f1e900..4597082df 100644 --- a/eth2/state_processing/src/per_block_processing/verify_indexed_attestation.rs +++ b/eth2/state_processing/src/per_block_processing/verify_indexed_attestation.rs @@ -8,7 +8,7 @@ use types::*; /// Verify an `IndexedAttestation`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_indexed_attestation( state: &BeaconState, indexed_attestation: &IndexedAttestation, @@ -19,7 +19,7 @@ pub fn verify_indexed_attestation( /// Verify but don't check the signature. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_indexed_attestation_without_signature( state: &BeaconState, indexed_attestation: &IndexedAttestation, @@ -30,7 +30,7 @@ pub fn verify_indexed_attestation_without_signature( /// Optionally check the signature. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_indexed_attestation_parametric( state: &BeaconState, indexed_attestation: &IndexedAttestation, @@ -107,7 +107,7 @@ where /// Verify the signature of an IndexedAttestation. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_indexed_attestation_signature( state: &BeaconState, indexed_attestation: &IndexedAttestation, diff --git a/eth2/state_processing/src/per_block_processing/verify_proposer_slashing.rs b/eth2/state_processing/src/per_block_processing/verify_proposer_slashing.rs index 744427ad9..b2419a05b 100644 --- a/eth2/state_processing/src/per_block_processing/verify_proposer_slashing.rs +++ b/eth2/state_processing/src/per_block_processing/verify_proposer_slashing.rs @@ -7,7 +7,7 @@ use types::*; /// /// Returns `Ok(())` if the `ProposerSlashing` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_proposer_slashing( proposer_slashing: &ProposerSlashing, state: &BeaconState, @@ -65,7 +65,7 @@ pub fn verify_proposer_slashing( /// /// Returns `true` if the signature is valid. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_header_signature( header: &BeaconBlockHeader, pubkey: &PublicKey, diff --git a/eth2/state_processing/src/per_block_processing/verify_transfer.rs b/eth2/state_processing/src/per_block_processing/verify_transfer.rs index de4cef44f..e99ed6a9a 100644 --- a/eth2/state_processing/src/per_block_processing/verify_transfer.rs +++ b/eth2/state_processing/src/per_block_processing/verify_transfer.rs @@ -8,7 +8,7 @@ use types::*; /// /// Returns `Ok(())` if the `Transfer` is valid, otherwise indicates the reason for invalidity. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_transfer( state: &BeaconState, transfer: &Transfer, @@ -19,7 +19,7 @@ pub fn verify_transfer( /// Like `verify_transfer` but doesn't run checks which may become true in future states. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn verify_transfer_time_independent_only( state: &BeaconState, transfer: &Transfer, @@ -37,7 +37,7 @@ pub fn verify_transfer_time_independent_only( /// present or future. /// - Validator transfer eligibility (e.g., is withdrawable) /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn verify_transfer_parametric( state: &BeaconState, transfer: &Transfer, @@ -154,7 +154,7 @@ fn verify_transfer_parametric( /// /// Does not check that the transfer is valid, however checks for overflow in all actions. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn execute_transfer( state: &mut BeaconState, transfer: &Transfer, diff --git a/eth2/state_processing/src/per_epoch_processing.rs b/eth2/state_processing/src/per_epoch_processing.rs index 05ef7f658..26091d49e 100644 --- a/eth2/state_processing/src/per_epoch_processing.rs +++ b/eth2/state_processing/src/per_epoch_processing.rs @@ -26,7 +26,7 @@ pub type WinningRootHashSet = HashMap; /// Mutates the given `BeaconState`, returning early if an error is encountered. If an error is /// returned, a state might be "half-processed" and therefore in an invalid state. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn per_epoch_processing( state: &mut BeaconState, spec: &ChainSpec, @@ -80,7 +80,7 @@ pub fn per_epoch_processing( /// - `finalized_epoch` /// - `finalized_root` /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_justification_and_finalization( state: &mut BeaconState, total_balances: &TotalBalances, @@ -147,7 +147,7 @@ pub fn process_justification_and_finalization( /// /// Also returns a `WinningRootHashSet` for later use during epoch processing. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_crosslinks( state: &mut BeaconState, spec: &ChainSpec, @@ -183,7 +183,7 @@ pub fn process_crosslinks( /// Finish up an epoch update. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_final_updates( state: &mut BeaconState, spec: &ChainSpec, diff --git a/eth2/state_processing/src/per_epoch_processing/apply_rewards.rs b/eth2/state_processing/src/per_epoch_processing/apply_rewards.rs index 7ddba6f38..88b51aae8 100644 --- a/eth2/state_processing/src/per_epoch_processing/apply_rewards.rs +++ b/eth2/state_processing/src/per_epoch_processing/apply_rewards.rs @@ -32,7 +32,7 @@ impl std::ops::AddAssign for Delta { /// Apply attester and proposer rewards. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_rewards_and_penalties( state: &mut BeaconState, validator_statuses: &mut ValidatorStatuses, @@ -74,7 +74,7 @@ pub fn process_rewards_and_penalties( /// For each attesting validator, reward the proposer who was first to include their attestation. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_proposer_deltas( deltas: &mut Vec, state: &BeaconState, @@ -111,7 +111,7 @@ fn get_proposer_deltas( /// Apply rewards for participation in attestations during the previous epoch. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_attestation_deltas( deltas: &mut Vec, state: &BeaconState, @@ -144,7 +144,7 @@ fn get_attestation_deltas( /// Determine the delta for a single validator, sans proposer rewards. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_attestation_delta( validator: &ValidatorStatus, total_balances: &TotalBalances, @@ -224,7 +224,7 @@ fn get_attestation_delta( /// Calculate the deltas based upon the winning roots for attestations during the previous epoch. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_crosslink_deltas( deltas: &mut Vec, state: &BeaconState, @@ -258,7 +258,7 @@ fn get_crosslink_deltas( /// Returns the base reward for some validator. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_base_reward( state: &BeaconState, index: usize, diff --git a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs index 020534f80..3213b3230 100644 --- a/eth2/state_processing/src/per_epoch_processing/process_slashings.rs +++ b/eth2/state_processing/src/per_epoch_processing/process_slashings.rs @@ -2,7 +2,7 @@ use types::{BeaconStateError as Error, *}; /// Process slashings. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_slashings( state: &mut BeaconState, current_total_balance: u64, diff --git a/eth2/state_processing/src/per_epoch_processing/registry_updates.rs b/eth2/state_processing/src/per_epoch_processing/registry_updates.rs index 469a14fdd..f97841d72 100644 --- a/eth2/state_processing/src/per_epoch_processing/registry_updates.rs +++ b/eth2/state_processing/src/per_epoch_processing/registry_updates.rs @@ -5,7 +5,7 @@ use types::*; /// Peforms a validator registry update, if required. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn process_registry_updates( state: &mut BeaconState, spec: &ChainSpec, diff --git a/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs b/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs index 45ef3419b..ece9174ca 100644 --- a/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs +++ b/eth2/state_processing/src/per_epoch_processing/validator_statuses.rs @@ -162,7 +162,7 @@ impl ValidatorStatuses { /// - Active validators /// - Total balances for the current and previous epochs. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn new( state: &BeaconState, spec: &ChainSpec, @@ -202,7 +202,7 @@ impl ValidatorStatuses { /// Process some attestations from the given `state` updating the `statuses` and /// `total_balances` fields. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn process_attestations( &mut self, state: &BeaconState, @@ -289,7 +289,7 @@ impl ValidatorStatuses { /// Update the `statuses` for each validator based upon whether or not they attested to the /// "winning" shard block root for the previous epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn process_winning_roots( &mut self, state: &BeaconState, @@ -323,7 +323,7 @@ impl ValidatorStatuses { /// Returns `true` if some `PendingAttestation` is from the supplied `epoch`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn is_from_epoch(a: &PendingAttestation, epoch: Epoch) -> bool { a.data.target_epoch == epoch } @@ -331,7 +331,7 @@ fn is_from_epoch(a: &PendingAttestation, epoch: Epoch) -> bool { /// Returns `true` if the attestation's FFG target is equal to the hash of the `state`'s first /// beacon block in the given `epoch`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn target_matches_epoch_start_block( a: &PendingAttestation, state: &BeaconState, @@ -346,7 +346,7 @@ fn target_matches_epoch_start_block( /// Returns `true` if a `PendingAttestation` and `BeaconState` share the same beacon block hash for /// the current slot of the `PendingAttestation`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn has_common_beacon_block_root( a: &PendingAttestation, state: &BeaconState, diff --git a/eth2/state_processing/src/per_epoch_processing/winning_root.rs b/eth2/state_processing/src/per_epoch_processing/winning_root.rs index 62917a134..ab4381a3c 100644 --- a/eth2/state_processing/src/per_epoch_processing/winning_root.rs +++ b/eth2/state_processing/src/per_epoch_processing/winning_root.rs @@ -16,7 +16,7 @@ impl WinningRoot { /// A winning root is "better" than another if it has a higher `total_attesting_balance`. Ties /// are broken by favouring the higher `crosslink_data_root` value. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn is_better_than(&self, other: &Self) -> bool { ( self.total_attesting_balance, @@ -34,7 +34,7 @@ impl WinningRoot { /// The `WinningRoot` object also contains additional fields that are useful in later stages of /// per-epoch processing. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn winning_root( state: &BeaconState, shard: u64, diff --git a/eth2/state_processing/src/per_slot_processing.rs b/eth2/state_processing/src/per_slot_processing.rs index 8adfe988b..6abd0a075 100644 --- a/eth2/state_processing/src/per_slot_processing.rs +++ b/eth2/state_processing/src/per_slot_processing.rs @@ -9,7 +9,7 @@ pub enum Error { /// Advances a state forward by one slot, performing per-epoch processing if required. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn per_slot_processing( state: &mut BeaconState, spec: &ChainSpec, diff --git a/eth2/types/src/attestation.rs b/eth2/types/src/attestation.rs index 682716073..40f97119d 100644 --- a/eth2/types/src/attestation.rs +++ b/eth2/types/src/attestation.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// Details an attestation that can be slashable. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/attestation_data.rs b/eth2/types/src/attestation_data.rs index 3b0f529d6..e3e989baa 100644 --- a/eth2/types/src/attestation_data.rs +++ b/eth2/types/src/attestation_data.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// The data upon which an attestation is based. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/attestation_data_and_custody_bit.rs b/eth2/types/src/attestation_data_and_custody_bit.rs index e2d949ae8..601bc4041 100644 --- a/eth2/types/src/attestation_data_and_custody_bit.rs +++ b/eth2/types/src/attestation_data_and_custody_bit.rs @@ -7,7 +7,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Used for pairing an attestation with a proof-of-custody. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/attester_slashing.rs b/eth2/types/src/attester_slashing.rs index 2b6402fcc..85770d290 100644 --- a/eth2/types/src/attester_slashing.rs +++ b/eth2/types/src/attester_slashing.rs @@ -7,7 +7,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Two conflicting attestations. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, diff --git a/eth2/types/src/beacon_block.rs b/eth2/types/src/beacon_block.rs index 2a829fda2..f823f234e 100644 --- a/eth2/types/src/beacon_block.rs +++ b/eth2/types/src/beacon_block.rs @@ -10,7 +10,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// A block of the `BeaconChain`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, @@ -36,7 +36,7 @@ pub struct BeaconBlock { impl BeaconBlock { /// Returns an empty block to be used during genesis. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn empty(spec: &ChainSpec) -> BeaconBlock { BeaconBlock { slot: spec.genesis_slot, @@ -63,7 +63,7 @@ impl BeaconBlock { /// Returns the `tree_hash_root | update` of the block. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn canonical_root(&self) -> Hash256 { Hash256::from_slice(&self.tree_hash_root()[..]) } @@ -75,7 +75,7 @@ impl BeaconBlock { /// /// Note: performs a full tree-hash of `self.body`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn block_header(&self) -> BeaconBlockHeader { BeaconBlockHeader { slot: self.slot, @@ -88,7 +88,7 @@ impl BeaconBlock { /// Returns a "temporary" header, where the `state_root` is `spec.zero_hash`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn temporary_block_header(&self, spec: &ChainSpec) -> BeaconBlockHeader { BeaconBlockHeader { state_root: spec.zero_hash, diff --git a/eth2/types/src/beacon_block_body.rs b/eth2/types/src/beacon_block_body.rs index e3609d889..6b0eb1401 100644 --- a/eth2/types/src/beacon_block_body.rs +++ b/eth2/types/src/beacon_block_body.rs @@ -8,7 +8,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// The body of a `BeaconChain` block, containing operations. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, diff --git a/eth2/types/src/beacon_block_header.rs b/eth2/types/src/beacon_block_header.rs index f58803c20..829130222 100644 --- a/eth2/types/src/beacon_block_header.rs +++ b/eth2/types/src/beacon_block_header.rs @@ -10,7 +10,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// A header of a `BeaconBlock`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, @@ -36,14 +36,14 @@ pub struct BeaconBlockHeader { impl BeaconBlockHeader { /// Returns the `tree_hash_root` of the header. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn canonical_root(&self) -> Hash256 { Hash256::from_slice(&self.signed_root()[..]) } /// Given a `body`, consumes `self` and returns a complete `BeaconBlock`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn into_block(self, body: BeaconBlockBody) -> BeaconBlock { BeaconBlock { slot: self.slot, diff --git a/eth2/types/src/beacon_state.rs b/eth2/types/src/beacon_state.rs index ba70b21d3..f76676a2b 100644 --- a/eth2/types/src/beacon_state.rs +++ b/eth2/types/src/beacon_state.rs @@ -63,7 +63,7 @@ pub enum Error { /// The state of the `BeaconChain` at some slot. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, @@ -157,7 +157,7 @@ impl BeaconState { /// This does not fully build a genesis beacon state, it omits processing of initial validator /// deposits. To obtain a full genesis beacon state, use the `BeaconStateBuilder`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn genesis( genesis_time: u64, latest_eth1_data: Eth1Data, @@ -234,7 +234,7 @@ impl BeaconState { /// Returns the `tree_hash_root` of the state. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn canonical_root(&self) -> Hash256 { Hash256::from_slice(&self.tree_hash_root()[..]) } @@ -263,7 +263,7 @@ impl BeaconState { /// The epoch corresponding to `self.slot`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn current_epoch(&self) -> Epoch { self.slot.epoch(T::slots_per_epoch()) } @@ -272,7 +272,7 @@ impl BeaconState { /// /// If the current epoch is the genesis epoch, the genesis_epoch is returned. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn previous_epoch(&self) -> Epoch { let current_epoch = self.current_epoch(); if current_epoch > T::genesis_epoch() { @@ -284,7 +284,7 @@ impl BeaconState { /// The epoch following `self.current_epoch()`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn next_epoch(&self) -> Epoch { self.current_epoch() + 1 } @@ -313,7 +313,7 @@ impl BeaconState { /// /// Note: Utilizes the cache and will fail if the appropriate cache is not initialized. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_attestation_slot(&self, attestation_data: &AttestationData) -> Result { let target_relative_epoch = RelativeEpoch::from_epoch(self.current_epoch(), attestation_data.target_epoch)?; @@ -342,7 +342,7 @@ impl BeaconState { /// /// Does not utilize the cache, performs a full iteration over the validator registry. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_active_validator_indices(&self, epoch: Epoch) -> Vec { get_active_validator_indices(&self.validator_registry, epoch) } @@ -362,7 +362,7 @@ impl BeaconState { /// /// Note: Utilizes the cache and will fail if the appropriate cache is not initialized. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_crosslink_committees_at_slot( &self, slot: Slot, @@ -379,7 +379,7 @@ impl BeaconState { /// /// Note: Utilizes the cache and will fail if the appropriate cache is not initialized. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_crosslink_committee_for_shard( &self, shard: u64, @@ -396,7 +396,7 @@ impl BeaconState { /// Returns the beacon proposer index for the `slot` in the given `relative_epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 // NOTE: be sure to test this bad boy. pub fn get_beacon_proposer_index( &self, @@ -433,7 +433,7 @@ impl BeaconState { /// Safely obtains the index for latest block roots, given some `slot`. /// - /// Spec v0.5.1 + /// Spec v0.6.3 fn get_latest_block_roots_index(&self, slot: Slot) -> Result { if (slot < self.slot) && (self.slot <= slot + self.latest_block_roots.len() as u64) { Ok(slot.as_usize() % self.latest_block_roots.len()) @@ -444,7 +444,7 @@ impl BeaconState { /// Return the block root at a recent `slot`. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_block_root(&self, slot: Slot) -> Result<&Hash256, BeaconStateError> { let i = self.get_latest_block_roots_index(slot)?; Ok(&self.latest_block_roots[i]) @@ -452,7 +452,7 @@ impl BeaconState { /// Return the block root at a recent `epoch`. /// - /// Spec v0.6.0 + /// Spec v0.6.3 // NOTE: the spec calls this get_block_root pub fn get_block_root_at_epoch(&self, epoch: Epoch) -> Result<&Hash256, BeaconStateError> { self.get_block_root(epoch.start_slot(T::slots_per_epoch())) @@ -460,7 +460,7 @@ impl BeaconState { /// Sets the block root for some given slot. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn set_block_root( &mut self, slot: Slot, @@ -473,7 +473,7 @@ impl BeaconState { /// Safely obtains the index for `latest_randao_mixes` /// - /// Spec v0.5.1 + /// Spec v0.6.3 fn get_randao_mix_index(&self, epoch: Epoch) -> Result { let current_epoch = self.current_epoch(); let len = T::LatestRandaoMixesLength::to_u64(); @@ -491,7 +491,7 @@ impl BeaconState { /// /// See `Self::get_randao_mix`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn update_randao_mix(&mut self, epoch: Epoch, signature: &Signature) -> Result<(), Error> { let i = epoch.as_usize() % T::LatestRandaoMixesLength::to_usize(); @@ -504,7 +504,7 @@ impl BeaconState { /// Return the randao mix at a recent ``epoch``. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_randao_mix(&self, epoch: Epoch) -> Result<&Hash256, Error> { let i = self.get_randao_mix_index(epoch)?; Ok(&self.latest_randao_mixes[i]) @@ -512,7 +512,7 @@ impl BeaconState { /// Set the randao mix at a recent ``epoch``. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn set_randao_mix(&mut self, epoch: Epoch, mix: Hash256) -> Result<(), Error> { let i = self.get_randao_mix_index(epoch)?; self.latest_randao_mixes[i] = mix; @@ -521,7 +521,7 @@ impl BeaconState { /// Safely obtains the index for `latest_active_index_roots`, given some `epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn get_active_index_root_index(&self, epoch: Epoch, spec: &ChainSpec) -> Result { let current_epoch = self.current_epoch(); @@ -537,7 +537,7 @@ impl BeaconState { /// Return the `active_index_root` at a recent `epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_active_index_root(&self, epoch: Epoch, spec: &ChainSpec) -> Result { let i = self.get_active_index_root_index(epoch, spec)?; Ok(self.latest_active_index_roots[i]) @@ -545,7 +545,7 @@ impl BeaconState { /// Set the `active_index_root` at a recent `epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn set_active_index_root( &mut self, epoch: Epoch, @@ -559,7 +559,7 @@ impl BeaconState { /// Replace `active_index_roots` with clones of `index_root`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn fill_active_index_roots_with(&mut self, index_root: Hash256) { self.latest_active_index_roots = vec![index_root; self.latest_active_index_roots.len()].into() @@ -567,7 +567,7 @@ impl BeaconState { /// Safely obtains the index for latest state roots, given some `slot`. /// - /// Spec v0.5.1 + /// Spec v0.6.3 fn get_latest_state_roots_index(&self, slot: Slot) -> Result { if (slot < self.slot) && (self.slot <= slot + self.latest_state_roots.len() as u64) { Ok(slot.as_usize() % self.latest_state_roots.len()) @@ -578,7 +578,7 @@ impl BeaconState { /// Gets the state root for some slot. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_state_root(&mut self, slot: Slot) -> Result<&Hash256, Error> { let i = self.get_latest_state_roots_index(slot)?; Ok(&self.latest_state_roots[i]) @@ -586,7 +586,7 @@ impl BeaconState { /// Sets the latest state root for slot. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn set_state_root(&mut self, slot: Slot, state_root: Hash256) -> Result<(), Error> { let i = self.get_latest_state_roots_index(slot)?; self.latest_state_roots[i] = state_root; @@ -595,7 +595,7 @@ impl BeaconState { /// Safely obtains the index for `latest_slashed_balances`, given some `epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn get_slashed_balance_index(&self, epoch: Epoch) -> Result { let i = epoch.as_usize() % self.latest_slashed_balances.len(); @@ -610,7 +610,7 @@ impl BeaconState { /// Gets the total slashed balances for some epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_slashed_balance(&self, epoch: Epoch) -> Result { let i = self.get_slashed_balance_index(epoch)?; Ok(self.latest_slashed_balances[i]) @@ -618,7 +618,7 @@ impl BeaconState { /// Sets the total slashed balances for some epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn set_slashed_balance(&mut self, epoch: Epoch, balance: u64) -> Result<(), Error> { let i = self.get_slashed_balance_index(epoch)?; self.latest_slashed_balances[i] = balance; @@ -627,7 +627,7 @@ impl BeaconState { /// Get the attestations from the current or previous epoch. /// - /// Spec v0.6.0 + /// Spec v0.6.3 pub fn get_matching_source_attestations( &self, epoch: Epoch, @@ -643,7 +643,7 @@ impl BeaconState { /// Get the current crosslink for a shard. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_current_crosslink(&self, shard: u64) -> Result<&Crosslink, Error> { self.current_crosslinks .get(shard as usize) @@ -652,7 +652,7 @@ impl BeaconState { /// Get the previous crosslink for a shard. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_previous_crosslink(&self, shard: u64) -> Result<&Crosslink, Error> { self.previous_crosslinks .get(shard as usize) @@ -661,7 +661,7 @@ impl BeaconState { /// Transform an attestation into the crosslink that it reinforces. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_crosslink_from_attestation_data( &self, data: &AttestationData, @@ -680,7 +680,7 @@ impl BeaconState { /// Generate a seed for the given `epoch`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn generate_seed(&self, epoch: Epoch, spec: &ChainSpec) -> Result { // Bypass the safe getter for RANDAO so we can gracefully handle the scenario where `epoch // == 0`. @@ -701,7 +701,7 @@ impl BeaconState { /// Return the effective balance (also known as "balance at stake") for a validator with the given ``index``. /// - /// Spec v0.6.0 + /// Spec v0.6.3 pub fn get_effective_balance( &self, validator_index: usize, @@ -715,7 +715,7 @@ impl BeaconState { /// Return the epoch at which an activation or exit triggered in ``epoch`` takes effect. /// - /// Spec v0.5.1 + /// Spec v0.6.3 pub fn get_delayed_activation_exit_epoch(&self, epoch: Epoch, spec: &ChainSpec) -> Epoch { epoch + 1 + spec.activation_exit_delay } @@ -724,7 +724,7 @@ impl BeaconState { /// /// Uses the epoch cache, and will error if it isn't initialized. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_churn_limit(&self, spec: &ChainSpec) -> Result { Ok(std::cmp::max( spec.min_per_epoch_churn_limit, @@ -738,7 +738,7 @@ impl BeaconState { /// /// Note: Utilizes the cache and will fail if the appropriate cache is not initialized. /// - /// Spec v0.6.2 + /// Spec v0.6.3 pub fn get_attestation_duties( &self, validator_index: usize, @@ -751,7 +751,7 @@ impl BeaconState { /// Return the combined effective balance of an array of validators. /// - /// Spec v0.6.0 + /// Spec v0.6.3 pub fn get_total_balance( &self, validator_indices: &[usize], diff --git a/eth2/types/src/beacon_state/beacon_state_types.rs b/eth2/types/src/beacon_state/beacon_state_types.rs index 795cc734e..7e4a04258 100644 --- a/eth2/types/src/beacon_state/beacon_state_types.rs +++ b/eth2/types/src/beacon_state/beacon_state_types.rs @@ -22,7 +22,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq { /// Return the number of committees in one epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn get_epoch_committee_count( active_validator_count: usize, target_committee_size: usize, @@ -60,42 +60,42 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq { /// Returns the `SLOTS_PER_EPOCH` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn slots_per_epoch() -> u64 { Self::SlotsPerEpoch::to_u64() } /// Returns the `SHARD_COUNT` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn shard_count() -> usize { Self::ShardCount::to_usize() } /// Returns the `SLOTS_PER_HISTORICAL_ROOT` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn slots_per_historical_root() -> usize { Self::SlotsPerHistoricalRoot::to_usize() } /// Returns the `LATEST_RANDAO_MIXES_LENGTH` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn latest_randao_mixes_length() -> usize { Self::LatestRandaoMixesLength::to_usize() } /// Returns the `LATEST_ACTIVE_INDEX_ROOTS` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn latest_active_index_roots() -> usize { Self::LatestActiveIndexRootsLength::to_usize() } /// Returns the `LATEST_SLASHED_EXIT_LENGTH` constant for this specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn latest_slashed_exit_length() -> usize { Self::LatestSlashedExitLength::to_usize() } @@ -103,7 +103,7 @@ pub trait EthSpec: 'static + Default + Sync + Send + Clone + Debug + PartialEq { /// Ethereum Foundation specifications. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive(Clone, PartialEq, Debug, Default, Serialize, Deserialize)] pub struct MainnetEthSpec; diff --git a/eth2/types/src/beacon_state/committee_cache.rs b/eth2/types/src/beacon_state/committee_cache.rs index 418213a68..54564d95d 100644 --- a/eth2/types/src/beacon_state/committee_cache.rs +++ b/eth2/types/src/beacon_state/committee_cache.rs @@ -24,7 +24,7 @@ pub struct CommitteeCache { impl CommitteeCache { /// Return a new, fully initialized cache. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn initialized( state: &BeaconState, epoch: Epoch, @@ -128,7 +128,7 @@ impl CommitteeCache { /// /// Always returns `&[]` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn active_validator_indices(&self) -> &[usize] { &self.shuffling } @@ -137,7 +137,7 @@ impl CommitteeCache { /// /// Always returns `&[]` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn shuffling(&self) -> &[usize] { &self.shuffling } @@ -147,7 +147,7 @@ impl CommitteeCache { /// /// Always returns `None` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_crosslink_committee_for_shard(&self, shard: Shard) -> Option { if shard >= self.shard_count || self.initialized_epoch.is_none() { return None; @@ -201,7 +201,7 @@ impl CommitteeCache { /// /// Always returns `usize::default()` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn active_validator_count(&self) -> usize { self.shuffling.len() } @@ -210,7 +210,7 @@ impl CommitteeCache { /// /// Always returns `usize::default()` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn epoch_committee_count(&self) -> usize { self.committee_count } @@ -226,7 +226,7 @@ impl CommitteeCache { /// /// Returns `None` if `slot` is not in the initialized epoch, or if `Self` is not initialized. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_crosslink_committees_for_slot(&self, slot: Slot) -> Option> { let position = self .initialized_epoch? @@ -258,7 +258,7 @@ impl CommitteeCache { /// /// Always returns `None` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn first_committee_at_slot(&self, slot: Slot) -> Option<&[usize]> { self.get_crosslink_committees_for_slot(slot)? .first() @@ -267,7 +267,7 @@ impl CommitteeCache { /// Returns a slice of `self.shuffling` that represents the `index`'th committee in the epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn compute_committee(&self, index: usize) -> Option<&[usize]> { Some(&self.shuffling[self.compute_committee_range(index)?]) } @@ -276,7 +276,7 @@ impl CommitteeCache { /// /// To avoid a divide-by-zero, returns `None` if `self.committee_count` is zero. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn compute_committee_range(&self, index: usize) -> Option> { if self.committee_count == 0 { return None; @@ -295,7 +295,7 @@ impl CommitteeCache { /// /// Always returns `None` for a non-initialized epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 fn crosslink_slot_for_shard(&self, shard: u64) -> Option { let offset = (shard + self.shard_count - self.shuffling_start_shard) % self.shard_count; Some( @@ -317,7 +317,7 @@ impl CommitteeCache { /// Returns a list of all `validator_registry` indices where the validator is active at the given /// `epoch`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub fn get_active_validator_indices(validators: &[Validator], epoch: Epoch) -> Vec { let mut active = Vec::with_capacity(validators.len()); @@ -335,7 +335,7 @@ pub fn get_active_validator_indices(validators: &[Validator], epoch: Epoch) -> V /// Returns the count of all `validator_registry` indices where the validator is active at the given /// `epoch`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 fn get_active_validator_count(validators: &[Validator], epoch: Epoch) -> usize { validators.iter().filter(|v| v.is_active_at(epoch)).count() } diff --git a/eth2/types/src/chain_spec.rs b/eth2/types/src/chain_spec.rs index 16c3d30f3..74ce40671 100644 --- a/eth2/types/src/chain_spec.rs +++ b/eth2/types/src/chain_spec.rs @@ -5,7 +5,7 @@ use test_utils::{u8_from_hex_str, u8_to_hex_str}; /// Each of the BLS signature domains. /// -/// Spec v0.6.1 +/// Spec v0.6.3 pub enum Domain { BeaconProposer, Randao, @@ -17,7 +17,7 @@ pub enum Domain { /// Holds all the "constants" for a BeaconChain. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive(PartialEq, Debug, Clone, Serialize, Deserialize)] #[serde(default)] pub struct ChainSpec { @@ -115,7 +115,7 @@ pub struct ChainSpec { impl ChainSpec { /// Get the domain number that represents the fork meta and signature domain. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_domain(&self, epoch: Epoch, domain: Domain, fork: &Fork) -> u64 { let domain_constant = match domain { Domain::BeaconProposer => self.domain_beacon_proposer, @@ -137,7 +137,7 @@ impl ChainSpec { /// Returns a `ChainSpec` compatible with the Ethereum Foundation specification. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn mainnet() -> Self { Self { /* diff --git a/eth2/types/src/crosslink.rs b/eth2/types/src/crosslink.rs index 9a06ca8bf..d7d77ec4a 100644 --- a/eth2/types/src/crosslink.rs +++ b/eth2/types/src/crosslink.rs @@ -8,7 +8,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Specifies the block hash for a shard at an epoch. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/deposit.rs b/eth2/types/src/deposit.rs index 1b031b0d5..df814c297 100644 --- a/eth2/types/src/deposit.rs +++ b/eth2/types/src/deposit.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// A deposit to potentially become a beacon chain validator. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, diff --git a/eth2/types/src/deposit_data.rs b/eth2/types/src/deposit_data.rs index 274fa68a4..895e47e59 100644 --- a/eth2/types/src/deposit_data.rs +++ b/eth2/types/src/deposit_data.rs @@ -10,7 +10,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// The data supplied by the user to the deposit contract. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, @@ -35,7 +35,7 @@ pub struct DepositData { impl DepositData { /// Generate the signature for a given DepositData details. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn create_signature( &self, secret_key: &SecretKey, diff --git a/eth2/types/src/eth1_data.rs b/eth2/types/src/eth1_data.rs index 0a7043543..dedaf9f00 100644 --- a/eth2/types/src/eth1_data.rs +++ b/eth2/types/src/eth1_data.rs @@ -8,7 +8,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Contains data obtained from the Eth1 chain. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, diff --git a/eth2/types/src/fork.rs b/eth2/types/src/fork.rs index 47ff29916..4546fd5f7 100644 --- a/eth2/types/src/fork.rs +++ b/eth2/types/src/fork.rs @@ -10,7 +10,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Specifies a fork of the `BeaconChain`, to prevent replay attacks. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, @@ -35,7 +35,7 @@ pub struct Fork { impl Fork { /// Initialize the `Fork` from the genesis parameters in the `spec`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn genesis(genesis_epoch: Epoch) -> Self { Self { previous_version: [0; 4], @@ -46,7 +46,7 @@ impl Fork { /// Return the fork version of the given ``epoch``. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn get_fork_version(&self, epoch: Epoch) -> [u8; 4] { if epoch < self.epoch { return self.previous_version; diff --git a/eth2/types/src/historical_batch.rs b/eth2/types/src/historical_batch.rs index 0d8916216..30206ae63 100644 --- a/eth2/types/src/historical_batch.rs +++ b/eth2/types/src/historical_batch.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Historical block and state roots. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/indexed_attestation.rs b/eth2/types/src/indexed_attestation.rs index 14f6e470b..1758521e1 100644 --- a/eth2/types/src/indexed_attestation.rs +++ b/eth2/types/src/indexed_attestation.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// /// To be included in an `AttesterSlashing`. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, @@ -35,14 +35,14 @@ pub struct IndexedAttestation { impl IndexedAttestation { /// Check if ``attestation_data_1`` and ``attestation_data_2`` have the same target. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn is_double_vote(&self, other: &IndexedAttestation) -> bool { self.data.target_epoch == other.data.target_epoch && self.data != other.data } /// Check if ``attestation_data_1`` surrounds ``attestation_data_2``. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn is_surround_vote(&self, other: &IndexedAttestation) -> bool { self.data.source_epoch < other.data.source_epoch && other.data.target_epoch < self.data.target_epoch diff --git a/eth2/types/src/pending_attestation.rs b/eth2/types/src/pending_attestation.rs index 2c3b04a42..53e381a6f 100644 --- a/eth2/types/src/pending_attestation.rs +++ b/eth2/types/src/pending_attestation.rs @@ -8,7 +8,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// An attestation that has been included in the state but not yet fully processed. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/proposer_slashing.rs b/eth2/types/src/proposer_slashing.rs index b4d5ef0e5..591fdad49 100644 --- a/eth2/types/src/proposer_slashing.rs +++ b/eth2/types/src/proposer_slashing.rs @@ -8,7 +8,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Two conflicting proposals from the same proposer (validator). /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq, diff --git a/eth2/types/src/relative_epoch.rs b/eth2/types/src/relative_epoch.rs index 3178701e8..eeeca65f3 100644 --- a/eth2/types/src/relative_epoch.rs +++ b/eth2/types/src/relative_epoch.rs @@ -9,7 +9,7 @@ pub enum Error { /// Defines the epochs relative to some epoch. Most useful when referring to the committees prior /// to and following some epoch. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive(Debug, PartialEq, Clone, Copy)] pub enum RelativeEpoch { /// The prior epoch. @@ -23,7 +23,7 @@ pub enum RelativeEpoch { impl RelativeEpoch { /// Returns the `epoch` that `self` refers to, with respect to the `base` epoch. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn into_epoch(self, base: Epoch) -> Epoch { match self { // Due to saturating nature of epoch, check for current first. @@ -40,7 +40,7 @@ impl RelativeEpoch { /// - `EpochTooLow` when `other` is more than 1 prior to `base`. /// - `EpochTooHigh` when `other` is more than 1 after `base`. /// - /// Spec v0.6.1 + /// Spec v0.6.3 pub fn from_epoch(base: Epoch, other: Epoch) -> Result { // Due to saturating nature of epoch, check for current first. if other == base { diff --git a/eth2/types/src/transfer.rs b/eth2/types/src/transfer.rs index ffac85c7b..8a7850cfc 100644 --- a/eth2/types/src/transfer.rs +++ b/eth2/types/src/transfer.rs @@ -11,7 +11,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// The data submitted to the deposit contract. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/validator.rs b/eth2/types/src/validator.rs index f16225d7c..4337e164d 100644 --- a/eth2/types/src/validator.rs +++ b/eth2/types/src/validator.rs @@ -7,7 +7,7 @@ use tree_hash_derive::{CachedTreeHash, TreeHash}; /// Information about a `BeaconChain` validator. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, Clone, diff --git a/eth2/types/src/voluntary_exit.rs b/eth2/types/src/voluntary_exit.rs index 6754aa2c9..5630d4d4c 100644 --- a/eth2/types/src/voluntary_exit.rs +++ b/eth2/types/src/voluntary_exit.rs @@ -9,7 +9,7 @@ use tree_hash_derive::{CachedTreeHash, SignedRoot, TreeHash}; /// An exit voluntarily submitted a validator who wishes to withdraw. /// -/// Spec v0.6.1 +/// Spec v0.6.3 #[derive( Debug, PartialEq,