diff --git a/beacon_chain/types/src/beacon_state.rs b/beacon_chain/types/src/beacon_state.rs index 2f5581d57..03f2c93aa 100644 --- a/beacon_chain/types/src/beacon_state.rs +++ b/beacon_chain/types/src/beacon_state.rs @@ -2,33 +2,44 @@ use super::candidate_pow_receipt_root_record::CandidatePoWReceiptRootRecord; use super::crosslink_record::CrosslinkRecord; use super::fork_data::ForkData; use super::pending_attestation_record::PendingAttestationRecord; -use super::shard_and_committee::ShardAndCommittee; +use super::shard_committee::ShardCommittee; use super::shard_reassignment_record::ShardReassignmentRecord; use super::validator_record::ValidatorRecord; use super::Hash256; #[derive(Debug, PartialEq)] pub struct BeaconState { + // Misc + pub slot: u64, + pub genesis_time: u64, + pub fork_data: ForkData, + + // Validator registry pub validator_registry: Vec, pub validator_registry_latest_change_slot: u64, pub validator_registry_exit_count: u64, pub validator_registry_delta_chain_tip: Hash256, + + // Randomness and committees pub randao_mix: Hash256, pub next_seed: Hash256, - pub shard_and_committee_for_slots: Vec>, + pub shard_committees_at_slots: Vec>, pub persistent_committees: Vec>, pub persistent_committee_reassignments: Vec, + + // Finality pub previous_justified_slot: u64, pub justified_slot: u64, - pub justified_slot_bitfield: u64, + pub justification_bitfield: u64, pub finalized_slot: u64, + + // Recent state pub latest_crosslinks: Vec, - pub latest_state_recalculation_slot: u64, - pub latest_block_hashes: Vec, + pub latest_block_roots: Vec, pub latest_penalized_exit_balances: Vec, pub latest_attestations: Vec, + + // PoW receipt root pub processed_pow_receipt_root: Hash256, pub candidate_pow_receipt_roots: Vec, - pub genesis_time: u64, - pub fork_data: ForkData, } diff --git a/beacon_chain/types/src/lib.rs b/beacon_chain/types/src/lib.rs index f86d5f024..65299d5d1 100644 --- a/beacon_chain/types/src/lib.rs +++ b/beacon_chain/types/src/lib.rs @@ -14,7 +14,7 @@ pub mod crosslink_record; pub mod crystallized_state; pub mod fork_data; pub mod pending_attestation_record; -pub mod shard_and_committee; +pub mod shard_committee; pub mod shard_reassignment_record; pub mod special_record; pub mod validator_record; @@ -33,7 +33,7 @@ pub use crosslink_record::CrosslinkRecord; pub use crystallized_state::CrystallizedState; pub use fork_data::ForkData; pub use pending_attestation_record::PendingAttestationRecord; -pub use shard_and_committee::ShardAndCommittee; +pub use shard_committee::ShardCommittee; pub use special_record::{SpecialRecord, SpecialRecordKind}; pub use validator_record::{ValidatorRecord, ValidatorStatus}; pub use validator_registration::ValidatorRegistration; diff --git a/beacon_chain/types/src/shard_and_committee.rs b/beacon_chain/types/src/shard_committee.rs similarity index 90% rename from beacon_chain/types/src/shard_and_committee.rs rename to beacon_chain/types/src/shard_committee.rs index 44c2e57ff..2dc0f6a75 100644 --- a/beacon_chain/types/src/shard_and_committee.rs +++ b/beacon_chain/types/src/shard_committee.rs @@ -1,10 +1,10 @@ #[derive(Clone, Debug, PartialEq)] -pub struct ShardAndCommittee { +pub struct ShardCommittee { pub shard: u16, pub committee: Vec, } -impl ShardAndCommittee { +impl ShardCommittee { /// Returns a new instance where the `shard_id` is zero and the /// committee is an empty vector. pub fn zero() -> Self {