Updated ChainSpec serialization and added some comments about potentially missing components.

This commit is contained in:
Luke Anderson 2019-09-05 00:40:23 +10:00
parent 4339e372c7
commit 50fca17308
No known key found for this signature in database
GPG Key ID: 44408169EC61E228

View File

@ -24,11 +24,13 @@ pub struct ChainSpec {
/* /*
* Constants * Constants
*/ */
#[serde(skip_serializing)] // skipped because Serde TOML has trouble with u64::max
pub far_future_epoch: Epoch, pub far_future_epoch: Epoch,
// The above may need to be skipped because Serde TOML has trouble with u64::max.
// Use: #[serde(skip_serializing)]
pub base_rewards_per_epoch: u64, pub base_rewards_per_epoch: u64,
pub deposit_contract_tree_depth: u64, pub deposit_contract_tree_depth: u64,
pub seconds_per_day: u64, pub seconds_per_day: u64,
//TODO missing JUSTIFICATION_BITS_LENGTH and ENDIANNESS
/* /*
* Misc * Misc
@ -52,6 +54,7 @@ pub struct ChainSpec {
* Initial Values * Initial Values
*/ */
pub genesis_slot: Slot, pub genesis_slot: Slot,
//TODO Missing genesis_epoch
#[serde(deserialize_with = "u8_from_hex_str", serialize_with = "u8_to_hex_str")] #[serde(deserialize_with = "u8_from_hex_str", serialize_with = "u8_to_hex_str")]
pub bls_withdrawal_prefix_byte: u8, pub bls_withdrawal_prefix_byte: u8,
@ -59,6 +62,7 @@ pub struct ChainSpec {
* Time parameters * Time parameters
*/ */
pub milliseconds_per_slot: u64, pub milliseconds_per_slot: u64,
//TODO should we also have SECONDS_PER_SLOT?
pub min_attestation_inclusion_delay: u64, pub min_attestation_inclusion_delay: u64,
pub min_seed_lookahead: Epoch, pub min_seed_lookahead: Epoch,
pub activation_exit_delay: u64, pub activation_exit_delay: u64,