Added/modified types and constants according to specs

This commit is contained in:
Kirk Baird 2019-01-16 10:39:02 +11:00
parent 0b47b81a6c
commit 8dec3c1dc7
No known key found for this signature in database
GPG Key ID: BF864B7ED0BEA33F
9 changed files with 160 additions and 48 deletions

View File

@ -1,17 +1,15 @@
use bls::{Signature, BLS_AGG_SIG_BYTE_SIZE};
use spec::ChainSpec; use spec::ChainSpec;
use ssz::{encode::encode_length, Decodable, LENGTH_BYTES};
use types::{BeaconBlock, BeaconBlockBody, Hash256}; use types::{BeaconBlock, BeaconBlockBody, Hash256};
/// Generate a genesis BeaconBlock. /// Generate a genesis BeaconBlock.
pub fn genesis_beacon_block(state_root: Hash256, spec: &ChainSpec) -> BeaconBlock { pub fn genesis_beacon_block(state_root: Hash256, spec: &ChainSpec) -> BeaconBlock {
BeaconBlock { BeaconBlock {
slot: spec.initial_slot_number, slot: spec.genesis_slot_number,
parent_root: spec.zero_hash, parent_root: spec.zero_hash,
state_root, state_root,
randao_reveal: spec.zero_hash, randao_reveal: spec.zero_hash,
candidate_pow_receipt_root: spec.zero_hash, candidate_pow_receipt_root: spec.zero_hash,
signature: genesis_signature(), signature: spec.empty_signature.clone(),
body: BeaconBlockBody { body: BeaconBlockBody {
proposer_slashings: vec![], proposer_slashings: vec![],
casper_slashings: vec![], casper_slashings: vec![],
@ -25,19 +23,11 @@ pub fn genesis_beacon_block(state_root: Hash256, spec: &ChainSpec) -> BeaconBloc
} }
} }
fn genesis_signature() -> Signature {
let mut bytes = encode_length(BLS_AGG_SIG_BYTE_SIZE, LENGTH_BYTES);
bytes.append(&mut vec![0; BLS_AGG_SIG_BYTE_SIZE]);
let (signature, _) = match Signature::ssz_decode(&bytes, 0) {
Ok(sig) => sig,
Err(_) => unreachable!(),
};
signature
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use bls::{Signature};
#[test] #[test]
fn test_genesis() { fn test_genesis() {
@ -101,5 +91,6 @@ mod tests {
for item in raw_sig_bytes.iter() { for item in raw_sig_bytes.iter() {
assert!(*item == 0); assert!(*item == 0);
} }
assert_eq!(genesis_block.signature, Signature::empty_sig());
} }
} }

View File

@ -21,7 +21,7 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
}; };
let initial_crosslink = CrosslinkRecord { let initial_crosslink = CrosslinkRecord {
slot: spec.initial_slot_number, slot: spec.genesis_slot_number,
shard_block_root: spec.zero_hash, shard_block_root: spec.zero_hash,
}; };
@ -29,19 +29,19 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
/* /*
* Misc * Misc
*/ */
slot: spec.initial_slot_number, slot: spec.genesis_slot_number,
genesis_time: spec.genesis_time, genesis_time: spec.genesis_time,
fork_data: ForkData { fork_data: ForkData {
pre_fork_version: spec.initial_fork_version, pre_fork_version: spec.genesis_fork_version,
post_fork_version: spec.initial_fork_version, post_fork_version: spec.genesis_fork_version,
fork_slot: spec.initial_slot_number, fork_slot: spec.genesis_slot_number,
}, },
/* /*
* Validator registry * Validator registry
*/ */
validator_registry: spec.initial_validators.clone(), validator_registry: spec.initial_validators.clone(),
validator_balances: spec.initial_balances.clone(), validator_balances: spec.initial_balances.clone(),
validator_registry_latest_change_slot: spec.initial_slot_number, validator_registry_latest_change_slot: spec.genesis_slot_number,
validator_registry_exit_count: 0, validator_registry_exit_count: 0,
validator_registry_delta_chain_tip: spec.zero_hash, validator_registry_delta_chain_tip: spec.zero_hash,
/* /*
@ -52,7 +52,12 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
spec.zero_hash; spec.zero_hash;
(spec.latest_randao_mixes_length / spec.epoch_length) as usize (spec.latest_randao_mixes_length / spec.epoch_length) as usize
], ],
shard_committees_at_slots: vec![], previous_epoch_start_shard: spec.genesis_start_shard,
current_epoch_start_shard: spec.genesis_start_shard,
previous_epoch_calculation_slot: spec.genesis_slot_number,
current_epoch_calculation_slot: spec.genesis_slot_number,
previous_epoch_randao_mix: spec.zero_hash,
current_epoch_randao_mix: spec.zero_hash,
/* /*
* Custody challenges * Custody challenges
*/ */
@ -60,10 +65,10 @@ pub fn genesis_beacon_state(spec: &ChainSpec) -> Result<BeaconState, Error> {
/* /*
* Finality * Finality
*/ */
previous_justified_slot: spec.initial_slot_number, previous_justified_slot: spec.genesis_slot_number,
justified_slot: spec.initial_slot_number, justified_slot: spec.genesis_slot_number,
justification_bitfield: 0, justification_bitfield: 0,
finalized_slot: spec.initial_slot_number, finalized_slot: spec.genesis_slot_number,
/* /*
* Recent state * Recent state
*/ */

View File

@ -1,5 +1,5 @@
use super::ChainSpec; use super::ChainSpec;
use bls::{Keypair, PublicKey, SecretKey}; use bls::{Keypair, PublicKey, SecretKey, Signature};
use types::{Address, Hash256, ValidatorRecord}; use types::{Address, Hash256, ValidatorRecord};
@ -17,12 +17,11 @@ impl ChainSpec {
* Misc * Misc
*/ */
shard_count: 1_024, shard_count: 1_024,
target_committee_size: 256, target_committee_size: 128,
ejection_balance: 16, ejection_balance: 16,
max_balance_churn_quotient: 32, max_balance_churn_quotient: 32,
gwei_per_eth: u64::pow(10, 9), gwei_per_eth: u64::pow(10, 9),
beacon_chain_shard_number: u64::max_value(), beacon_chain_shard_number: u64::max_value(),
bls_withdrawal_prefix_byte: 0x00,
max_casper_votes: 1_024, max_casper_votes: 1_024,
latest_block_roots_length: 8_192, latest_block_roots_length: 8_192,
latest_randao_mixes_length: 8_192, latest_randao_mixes_length: 8_192,
@ -38,35 +37,58 @@ impl ChainSpec {
/* /*
* Initial Values * Initial Values
*/ */
initial_fork_version: 0, genesis_fork_version: 0,
initial_slot_number: 0, genesis_slot_number: 0,
genesis_start_shard: 0,
far_future_slot: u64::max_value(),
zero_hash: Hash256::zero(), zero_hash: Hash256::zero(),
empty_signature: Signature::empty_sig(),
bls_withdrawal_prefix_byte: 0x00,
/* /*
* Time parameters * Time parameters
*/ */
slot_duration: 6, slot_duration: 6,
min_attestation_inclusion_delay: 4, min_attestation_inclusion_delay: 4,
epoch_length: 64, epoch_length: 64,
seed_lookahead: 64,
min_validator_registry_change_interval: 256, min_validator_registry_change_interval: 256,
pow_receipt_root_voting_period: 1_024, pow_receipt_root_voting_period: 1_024,
shard_persistent_committee_change_period: u64::pow(2, 17), min_validator_withdrawal_time: u64::pow(2, 14),
collective_penalty_calculation_period: u64::pow(2, 20), shard_persistent_committee_change_period: u64::pow(2, 17), // old
zero_balance_validator_ttl: u64::pow(2, 22), collective_penalty_calculation_period: u64::pow(2, 20), // old
zero_balance_validator_ttl: u64::pow(2, 22), // old
/* /*
* Reward and penalty quotients * Reward and penalty quotients
*/ */
base_reward_quotient: 2_048, base_reward_quotient: 1_024,
whistleblower_reward_quotient: 512, whistleblower_reward_quotient: 512,
includer_reward_quotient: 8, includer_reward_quotient: 8,
inactivity_penalty_quotient: u64::pow(2, 34), inactivity_penalty_quotient: u64::pow(2, 24),
/*
* Status flags
*/
initiated_exit: 1,
withdrawable: 2,
/* /*
* Max operations per block * Max operations per block
*/ */
max_proposer_slashings: 16, max_proposer_slashings: 16,
max_casper_slashings: 15, max_casper_slashings: 16,
max_attestations: 128, max_attestations: 128,
max_deposits: 16, max_deposits: 16,
max_exits: 16, max_exits: 16,
/*
* Validator registry delta flags
*/
activation: 0,
exit: 1,
/*
* Signature domains
*/
domain_deposit: 0,
domain_attestation: 1,
domain_proposal: 2,
domain_exit: 3,
/* /*
* Intialization parameters * Intialization parameters
*/ */
@ -107,6 +129,10 @@ fn initial_validators_for_testing() -> Vec<ValidatorRecord> {
withdrawal_credentials: Hash256::zero(), withdrawal_credentials: Hash256::zero(),
randao_commitment: Hash256::zero(), randao_commitment: Hash256::zero(),
randao_layers: 0, randao_layers: 0,
activation_slot: u64::max_value(),
exit_slot: u64::max_value(),
withdrawal_slot: u64::max_value(),
penalized_slot: u64::max_value(),
status: From::from(0), status: From::from(0),
latest_status_change_slot: 0, latest_status_change_slot: 0,
exit_count: 0, exit_count: 0,

View File

@ -3,6 +3,7 @@ extern crate types;
mod foundation; mod foundation;
use bls::Signature;
use types::{Address, Hash256, ValidatorRecord}; use types::{Address, Hash256, ValidatorRecord};
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug)]
@ -16,7 +17,6 @@ pub struct ChainSpec {
pub max_balance_churn_quotient: u64, pub max_balance_churn_quotient: u64,
pub gwei_per_eth: u64, pub gwei_per_eth: u64,
pub beacon_chain_shard_number: u64, pub beacon_chain_shard_number: u64,
pub bls_withdrawal_prefix_byte: u8,
pub max_casper_votes: u64, pub max_casper_votes: u64,
pub latest_block_roots_length: u64, pub latest_block_roots_length: u64,
pub latest_randao_mixes_length: u64, pub latest_randao_mixes_length: u64,
@ -32,20 +32,26 @@ pub struct ChainSpec {
/* /*
* Initial Values * Initial Values
*/ */
pub initial_fork_version: u64, pub genesis_fork_version: u64,
pub initial_slot_number: u64, pub genesis_slot_number: u64,
pub genesis_start_shard: u64,
pub far_future_slot: u64,
pub zero_hash: Hash256, pub zero_hash: Hash256,
pub empty_signature: Signature,
pub bls_withdrawal_prefix_byte: u8,
/* /*
* Time parameters * Time parameters
*/ */
pub slot_duration: u64, pub slot_duration: u64,
pub min_attestation_inclusion_delay: u64, pub min_attestation_inclusion_delay: u64,
pub epoch_length: u64, pub epoch_length: u64,
pub min_validator_registry_change_interval: u64, pub seed_lookahead: u64,
pub pow_receipt_root_voting_period: u64, pub min_validator_registry_change_interval: u64, // a.k.a. entry_exit_delay
pub shard_persistent_committee_change_period: u64, pub pow_receipt_root_voting_period: u64, // a.k. deposit_root_voting_period
pub collective_penalty_calculation_period: u64, pub min_validator_withdrawal_time: u64,
pub zero_balance_validator_ttl: u64, pub shard_persistent_committee_change_period: u64, //old
pub collective_penalty_calculation_period: u64, // old
pub zero_balance_validator_ttl: u64, // old
/* /*
* Reward and penalty quotients * Reward and penalty quotients
*/ */
@ -53,6 +59,11 @@ pub struct ChainSpec {
pub whistleblower_reward_quotient: u64, pub whistleblower_reward_quotient: u64,
pub includer_reward_quotient: u64, pub includer_reward_quotient: u64,
pub inactivity_penalty_quotient: u64, pub inactivity_penalty_quotient: u64,
/*
* Status flags
*/
pub initiated_exit: u64,
pub withdrawable: u64,
/* /*
* Max operations per block * Max operations per block
*/ */
@ -61,6 +72,18 @@ pub struct ChainSpec {
pub max_attestations: u64, pub max_attestations: u64,
pub max_deposits: u64, pub max_deposits: u64,
pub max_exits: u64, pub max_exits: u64,
/*
* Validator registry delta flags
*/
pub activation: u64,
pub exit: u64,
/*
* Signature domains
*/
pub domain_deposit: u64,
pub domain_attestation: u64,
pub domain_proposal: u64,
pub domain_exit: u64,
/* /*
* Intialization parameters * Intialization parameters
*/ */

View File

@ -2,7 +2,6 @@ use super::candidate_pow_receipt_root_record::CandidatePoWReceiptRootRecord;
use super::crosslink_record::CrosslinkRecord; use super::crosslink_record::CrosslinkRecord;
use super::fork_data::ForkData; use super::fork_data::ForkData;
use super::pending_attestation_record::PendingAttestationRecord; use super::pending_attestation_record::PendingAttestationRecord;
use super::shard_committee::ShardCommittee;
use super::validator_record::ValidatorRecord; use super::validator_record::ValidatorRecord;
use super::Hash256; use super::Hash256;
use crate::test_utils::TestRandom; use crate::test_utils::TestRandom;
@ -30,7 +29,12 @@ pub struct BeaconState {
// Randomness and committees // Randomness and committees
pub latest_randao_mixes: Vec<Hash256>, pub latest_randao_mixes: Vec<Hash256>,
pub latest_vdf_outputs: Vec<Hash256>, pub latest_vdf_outputs: Vec<Hash256>,
pub shard_committees_at_slots: Vec<Vec<ShardCommittee>>, pub previous_epoch_start_shard: u64,
pub current_epoch_start_shard: u64,
pub previous_epoch_calculation_slot: u64,
pub current_epoch_calculation_slot: u64,
pub previous_epoch_randao_mix: Hash256,
pub current_epoch_randao_mix: Hash256,
// Custody challenges // Custody challenges
pub custody_challenges: Vec<CustodyChallenge>, pub custody_challenges: Vec<CustodyChallenge>,
@ -73,7 +77,12 @@ impl Encodable for BeaconState {
s.append(&self.validator_registry_delta_chain_tip); s.append(&self.validator_registry_delta_chain_tip);
s.append(&self.latest_randao_mixes); s.append(&self.latest_randao_mixes);
s.append(&self.latest_vdf_outputs); s.append(&self.latest_vdf_outputs);
s.append(&self.shard_committees_at_slots); s.append(&self.previous_epoch_start_shard);
s.append(&self.current_epoch_start_shard);
s.append(&self.previous_epoch_calculation_slot);
s.append(&self.current_epoch_calculation_slot);
s.append(&self.previous_epoch_randao_mix);
s.append(&self.current_epoch_randao_mix);
s.append(&self.custody_challenges); s.append(&self.custody_challenges);
s.append(&self.previous_justified_slot); s.append(&self.previous_justified_slot);
s.append(&self.justified_slot); s.append(&self.justified_slot);
@ -101,7 +110,12 @@ impl Decodable for BeaconState {
let (validator_registry_delta_chain_tip, i) = <_>::ssz_decode(bytes, i)?; let (validator_registry_delta_chain_tip, i) = <_>::ssz_decode(bytes, i)?;
let (latest_randao_mixes, i) = <_>::ssz_decode(bytes, i)?; let (latest_randao_mixes, i) = <_>::ssz_decode(bytes, i)?;
let (latest_vdf_outputs, i) = <_>::ssz_decode(bytes, i)?; let (latest_vdf_outputs, i) = <_>::ssz_decode(bytes, i)?;
let (shard_committees_at_slots, i) = <_>::ssz_decode(bytes, i)?; let (previous_epoch_start_shard, i) = <_>::ssz_decode(bytes, i)?;
let (current_epoch_start_shard, i) = <_>::ssz_decode(bytes, i)?;
let (previous_epoch_calculation_slot, i) = <_>::ssz_decode(bytes, i)?;
let (current_epoch_calculation_slot, i) = <_>::ssz_decode(bytes, i)?;
let (previous_epoch_randao_mix, i) = <_>::ssz_decode(bytes, i)?;
let (current_epoch_randao_mix, i) = <_>::ssz_decode(bytes, i)?;
let (custody_challenges, i) = <_>::ssz_decode(bytes, i)?; let (custody_challenges, i) = <_>::ssz_decode(bytes, i)?;
let (previous_justified_slot, i) = <_>::ssz_decode(bytes, i)?; let (previous_justified_slot, i) = <_>::ssz_decode(bytes, i)?;
let (justified_slot, i) = <_>::ssz_decode(bytes, i)?; let (justified_slot, i) = <_>::ssz_decode(bytes, i)?;
@ -127,7 +141,12 @@ impl Decodable for BeaconState {
validator_registry_delta_chain_tip, validator_registry_delta_chain_tip,
latest_randao_mixes, latest_randao_mixes,
latest_vdf_outputs, latest_vdf_outputs,
shard_committees_at_slots, previous_epoch_start_shard,
current_epoch_start_shard,
previous_epoch_calculation_slot,
current_epoch_calculation_slot,
previous_epoch_randao_mix,
current_epoch_randao_mix,
custody_challenges, custody_challenges,
previous_justified_slot, previous_justified_slot,
justified_slot, justified_slot,
@ -159,7 +178,12 @@ impl<T: RngCore> TestRandom<T> for BeaconState {
validator_registry_delta_chain_tip: <_>::random_for_test(rng), validator_registry_delta_chain_tip: <_>::random_for_test(rng),
latest_randao_mixes: <_>::random_for_test(rng), latest_randao_mixes: <_>::random_for_test(rng),
latest_vdf_outputs: <_>::random_for_test(rng), latest_vdf_outputs: <_>::random_for_test(rng),
shard_committees_at_slots: <_>::random_for_test(rng), previous_epoch_start_shard: <_>::random_for_test(rng),
current_epoch_start_shard: <_>::random_for_test(rng),
previous_epoch_calculation_slot: <_>::random_for_test(rng),
current_epoch_calculation_slot: <_>::random_for_test(rng),
previous_epoch_randao_mix: <_>::random_for_test(rng),
current_epoch_randao_mix: <_>::random_for_test(rng),
custody_challenges: <_>::random_for_test(rng), custody_challenges: <_>::random_for_test(rng),
previous_justified_slot: <_>::random_for_test(rng), previous_justified_slot: <_>::random_for_test(rng),
justified_slot: <_>::random_for_test(rng), justified_slot: <_>::random_for_test(rng),

View File

@ -3,6 +3,7 @@ use super::Hash256;
use crate::test_utils::TestRandom; use crate::test_utils::TestRandom;
use rand::RngCore; use rand::RngCore;
// Note: this is refer to as DepositRootVote in specs
#[derive(Debug, PartialEq, Clone)] #[derive(Debug, PartialEq, Clone)]
pub struct CandidatePoWReceiptRootRecord { pub struct CandidatePoWReceiptRootRecord {
pub candidate_pow_receipt_root: Hash256, pub candidate_pow_receipt_root: Hash256,

View File

@ -35,6 +35,10 @@ pub struct ValidatorRecord {
pub withdrawal_credentials: Hash256, pub withdrawal_credentials: Hash256,
pub randao_commitment: Hash256, pub randao_commitment: Hash256,
pub randao_layers: u64, pub randao_layers: u64,
pub activation_slot: u64,
pub exit_slot: u64,
pub withdrawal_slot: u64,
pub penalized_slot: u64,
pub status: ValidatorStatus, pub status: ValidatorStatus,
pub latest_status_change_slot: u64, pub latest_status_change_slot: u64,
pub exit_count: u64, pub exit_count: u64,
@ -99,6 +103,10 @@ impl Encodable for ValidatorRecord {
s.append(&self.withdrawal_credentials); s.append(&self.withdrawal_credentials);
s.append(&self.randao_commitment); s.append(&self.randao_commitment);
s.append(&self.randao_layers); s.append(&self.randao_layers);
s.append(&self.activation_slot);
s.append(&self.exit_slot);
s.append(&self.withdrawal_slot);
s.append(&self.penalized_slot);
s.append(&self.status); s.append(&self.status);
s.append(&self.latest_status_change_slot); s.append(&self.latest_status_change_slot);
s.append(&self.exit_count); s.append(&self.exit_count);
@ -114,6 +122,10 @@ impl Decodable for ValidatorRecord {
let (withdrawal_credentials, i) = <_>::ssz_decode(bytes, i)?; let (withdrawal_credentials, i) = <_>::ssz_decode(bytes, i)?;
let (randao_commitment, i) = <_>::ssz_decode(bytes, i)?; let (randao_commitment, i) = <_>::ssz_decode(bytes, i)?;
let (randao_layers, i) = <_>::ssz_decode(bytes, i)?; let (randao_layers, i) = <_>::ssz_decode(bytes, i)?;
let (activation_slot, i) = <_>::ssz_decode(bytes, i)?;
let (exit_slot, i) = <_>::ssz_decode(bytes, i)?;
let (withdrawal_slot, i) = <_>::ssz_decode(bytes, i)?;
let (penalized_slot, i) = <_>::ssz_decode(bytes, i)?;
let (status, i) = <_>::ssz_decode(bytes, i)?; let (status, i) = <_>::ssz_decode(bytes, i)?;
let (latest_status_change_slot, i) = <_>::ssz_decode(bytes, i)?; let (latest_status_change_slot, i) = <_>::ssz_decode(bytes, i)?;
let (exit_count, i) = <_>::ssz_decode(bytes, i)?; let (exit_count, i) = <_>::ssz_decode(bytes, i)?;
@ -127,6 +139,10 @@ impl Decodable for ValidatorRecord {
withdrawal_credentials, withdrawal_credentials,
randao_commitment, randao_commitment,
randao_layers, randao_layers,
activation_slot,
exit_slot,
withdrawal_slot,
penalized_slot,
status, status,
latest_status_change_slot, latest_status_change_slot,
exit_count, exit_count,
@ -146,6 +162,10 @@ impl<T: RngCore> TestRandom<T> for ValidatorRecord {
withdrawal_credentials: <_>::random_for_test(rng), withdrawal_credentials: <_>::random_for_test(rng),
randao_commitment: <_>::random_for_test(rng), randao_commitment: <_>::random_for_test(rng),
randao_layers: <_>::random_for_test(rng), randao_layers: <_>::random_for_test(rng),
activation_slot: <_>::random_for_test(rng),
exit_slot: <_>::random_for_test(rng),
withdrawal_slot: <_>::random_for_test(rng),
penalized_slot: <_>::random_for_test(rng),
status: <_>::random_for_test(rng), status: <_>::random_for_test(rng),
latest_status_change_slot: <_>::random_for_test(rng), latest_status_change_slot: <_>::random_for_test(rng),
exit_count: <_>::random_for_test(rng), exit_count: <_>::random_for_test(rng),

View File

@ -35,6 +35,12 @@ impl Signature {
pub fn as_raw(&self) -> &RawSignature { pub fn as_raw(&self) -> &RawSignature {
&self.0 &self.0
} }
/// Returns a new empty signature.
pub fn empty_sig() -> Self {
let empty: Vec<u8> = vec![0; 97];
Signature(RawSignature::from_bytes(&empty).unwrap())
}
} }
impl Encodable for Signature { impl Encodable for Signature {
@ -68,4 +74,16 @@ mod tests {
assert_eq!(original, decoded); assert_eq!(original, decoded);
} }
#[test]
pub fn test_empty_sig() {
let sig = Signature::empty_sig();
let sig_as_bytes: Vec<u8> = sig.as_raw().as_bytes();
assert_eq!(sig_as_bytes.len(), 97);
for one_byte in sig_as_bytes.iter() {
assert_eq!(*one_byte, 0);
}
}
} }

View File

@ -44,6 +44,10 @@ pub fn process_deposit(
withdrawal_credentials: deposit_input.withdrawal_credentials, withdrawal_credentials: deposit_input.withdrawal_credentials,
randao_commitment: deposit_input.randao_commitment, randao_commitment: deposit_input.randao_commitment,
randao_layers: 0, randao_layers: 0,
activation_slot: spec.far_future_slot,
exit_slot: spec.far_future_slot,
withdrawal_slot: spec.far_future_slot,
penalized_slot: spec.far_future_slot,
status: ValidatorStatus::PendingActivation, status: ValidatorStatus::PendingActivation,
latest_status_change_slot: state.validator_registry_latest_change_slot, latest_status_change_slot: state.validator_registry_latest_change_slot,
exit_count: 0, exit_count: 0,