mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-21 14:58:31 +00:00
Updates to make crates publishable (#2472)
## Issue Addressed Related to: #2259 Made an attempt at all the necessary updates here to publish the crates to crates.io. I incremented the minor versions on all the crates that have been previously published. We still might run into some issues as we try to publish because I'm not able to test this out but I think it's a good starting point. ## Proposed Changes - Add description and license to `ssz_types` and `serde_util` - rename `serde_util` to `eth2_serde_util` - increment minor versions - remove path dependencies - remove patch dependencies ## Additional Info Crates published: - [x] `tree_hash` -- need to publish `tree_hash_derive` and `eth2_hashing` first - [x] `eth2_ssz_types` -- need to publish `eth2_serde_util` first - [x] `tree_hash_derive` - [x] `eth2_ssz` - [x] `eth2_ssz_derive` - [x] `eth2_serde_util` - [x] `eth2_hashing` Co-authored-by: realbigsean <seananderson33@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@ compare_fields = { path = "../../common/compare_fields" }
|
||||
compare_fields_derive = { path = "../../common/compare_fields_derive" }
|
||||
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
|
||||
ethereum-types = "0.11.0"
|
||||
eth2_hashing = "0.1.0"
|
||||
eth2_hashing = "0.2.0"
|
||||
hex = "0.4.2"
|
||||
int_to_bytes = { path = "../int_to_bytes" }
|
||||
log = "0.4.11"
|
||||
@@ -25,13 +25,13 @@ safe_arith = { path = "../safe_arith" }
|
||||
serde = {version = "1.0.116" , features = ["rc"] }
|
||||
serde_derive = "1.0.116"
|
||||
slog = "2.5.2"
|
||||
eth2_ssz = "0.1.2"
|
||||
eth2_ssz_derive = "0.1.0"
|
||||
eth2_ssz_types = { path = "../ssz_types" }
|
||||
eth2_ssz = "0.3.0"
|
||||
eth2_ssz_derive = "0.2.1"
|
||||
eth2_ssz_types = "0.2.0"
|
||||
swap_or_not_shuffle = { path = "../swap_or_not_shuffle" }
|
||||
test_random_derive = { path = "../../common/test_random_derive" }
|
||||
tree_hash = "0.1.1"
|
||||
tree_hash_derive = "0.2.0"
|
||||
tree_hash = "0.3.0"
|
||||
tree_hash_derive = "0.3.1"
|
||||
rand_xorshift = "0.2.0"
|
||||
cached_tree_hash = { path = "../cached_tree_hash" }
|
||||
serde_yaml = "0.8.13"
|
||||
@@ -39,7 +39,7 @@ tempfile = "3.1.0"
|
||||
derivative = "2.1.1"
|
||||
rusqlite = { version = "0.25.3", features = ["bundled"], optional = true }
|
||||
arbitrary = { version = "0.4.6", features = ["derive"], optional = true }
|
||||
serde_utils = { path = "../serde_utils" }
|
||||
eth2_serde_utils = "0.1.0"
|
||||
regex = "1.3.9"
|
||||
lazy_static = "1.4.0"
|
||||
parking_lot = "0.11.1"
|
||||
|
||||
@@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash;
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
pub struct AggregateAndProof<T: EthSpec> {
|
||||
/// The index of the validator that created the attestation.
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub aggregator_index: u64,
|
||||
/// The aggregate attestation.
|
||||
pub aggregate: Attestation<T>,
|
||||
|
||||
@@ -27,7 +27,7 @@ use tree_hash_derive::TreeHash;
|
||||
)]
|
||||
pub struct AttestationData {
|
||||
pub slot: Slot,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
|
||||
// LMD GHOST vote
|
||||
|
||||
@@ -13,6 +13,6 @@ pub struct AttestationDuty {
|
||||
/// The total number of attesters in the committee.
|
||||
pub committee_len: usize,
|
||||
/// The committee count at `attestation_slot`.
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committees_at_slot: u64,
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ pub struct BeaconBlock<T: EthSpec> {
|
||||
#[superstruct(getter(copy))]
|
||||
pub slot: Slot,
|
||||
#[superstruct(getter(copy))]
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proposer_index: u64,
|
||||
#[superstruct(getter(copy))]
|
||||
pub parent_root: Hash256,
|
||||
|
||||
@@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash;
|
||||
)]
|
||||
pub struct BeaconBlockHeader {
|
||||
pub slot: Slot,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proposer_index: u64,
|
||||
pub parent_root: Hash256,
|
||||
pub state_root: Hash256,
|
||||
|
||||
@@ -198,7 +198,7 @@ where
|
||||
{
|
||||
// Versioning
|
||||
#[superstruct(getter(copy))]
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub genesis_time: u64,
|
||||
#[superstruct(getter(copy))]
|
||||
pub genesis_validators_root: Hash256,
|
||||
@@ -219,7 +219,7 @@ where
|
||||
pub eth1_data: Eth1Data,
|
||||
pub eth1_data_votes: VariableList<Eth1Data, T::SlotsPerEth1VotingPeriod>,
|
||||
#[superstruct(getter(copy))]
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub eth1_deposit_index: u64,
|
||||
|
||||
// Registry
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::*;
|
||||
use eth2_serde_utils::quoted_u64::MaybeQuoted;
|
||||
use int_to_bytes::int_to_bytes4;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use serde_utils::quoted_u64::MaybeQuoted;
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
use tree_hash::TreeHash;
|
||||
@@ -533,44 +533,44 @@ pub struct Config {
|
||||
#[serde(default)]
|
||||
pub preset_base: String,
|
||||
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
min_genesis_active_validator_count: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
min_genesis_time: u64,
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
genesis_fork_version: [u8; 4],
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
genesis_delay: u64,
|
||||
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
altair_fork_version: [u8; 4],
|
||||
altair_fork_epoch: Option<MaybeQuoted<Epoch>>,
|
||||
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
seconds_per_slot: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
seconds_per_eth1_block: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
min_validator_withdrawability_delay: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
shard_committee_period: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
eth1_follow_distance: u64,
|
||||
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
inactivity_score_bias: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
inactivity_score_recovery_rate: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
ejection_balance: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
min_per_epoch_churn_limit: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
churn_limit_quotient: u64,
|
||||
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
deposit_chain_id: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
deposit_network_id: u64,
|
||||
deposit_contract_address: Address,
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash;
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
pub struct ContributionAndProof<T: EthSpec> {
|
||||
/// The index of the validator that created the sync contribution.
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub aggregator_index: u64,
|
||||
/// The aggregate contribution.
|
||||
pub contribution: SyncCommitteeContribution<T>,
|
||||
|
||||
@@ -15,7 +15,7 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct DepositData {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
pub withdrawal_credentials: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub amount: u64,
|
||||
pub signature: SignatureBytes,
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct DepositMessage {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
pub withdrawal_credentials: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub amount: u64,
|
||||
}
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ use tree_hash_derive::TreeHash;
|
||||
Debug, Clone, PartialEq, Default, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom,
|
||||
)]
|
||||
pub struct EnrForkId {
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub fork_digest: [u8; 4],
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub next_fork_version: [u8; 4],
|
||||
pub next_fork_epoch: Epoch,
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ use tree_hash_derive::TreeHash;
|
||||
)]
|
||||
pub struct Eth1Data {
|
||||
pub deposit_root: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub deposit_count: u64,
|
||||
pub block_hash: Hash256,
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ use tree_hash_derive::TreeHash;
|
||||
TestRandom,
|
||||
)]
|
||||
pub struct Fork {
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub previous_version: [u8; 4],
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub current_version: [u8; 4],
|
||||
pub epoch: Epoch,
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash;
|
||||
Debug, Clone, PartialEq, Default, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom,
|
||||
)]
|
||||
pub struct ForkData {
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub current_version: [u8; 4],
|
||||
pub genesis_validators_root: Hash256,
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@ use serde_derive::Serialize;
|
||||
pub struct FreeAttestation {
|
||||
pub data: AttestationData,
|
||||
pub signature: Signature,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ impl Graffiti {
|
||||
|
||||
impl fmt::Display for Graffiti {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", serde_utils::hex::encode(&self.0))
|
||||
write!(f, "{}", eth2_serde_utils::hex::encode(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ pub mod serde_graffiti {
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
serializer.serialize_str(&serde_utils::hex::encode(bytes))
|
||||
serializer.serialize_str(ð2_serde_utils::hex::encode(bytes))
|
||||
}
|
||||
|
||||
pub fn deserialize<'de, D>(deserializer: D) -> Result<[u8; GRAFFITI_BYTES_LEN], D::Error>
|
||||
@@ -105,7 +105,7 @@ pub mod serde_graffiti {
|
||||
{
|
||||
let s: String = Deserialize::deserialize(deserializer)?;
|
||||
|
||||
let bytes = serde_utils::hex::decode(&s).map_err(D::Error::custom)?;
|
||||
let bytes = eth2_serde_utils::hex::decode(&s).map_err(D::Error::custom)?;
|
||||
|
||||
if bytes.len() != GRAFFITI_BYTES_LEN {
|
||||
return Err(D::Error::custom(format!(
|
||||
|
||||
@@ -63,9 +63,9 @@ impl<T: EthSpec> Hash for IndexedAttestation<T> {
|
||||
mod quoted_variable_list_u64 {
|
||||
use super::*;
|
||||
use crate::Unsigned;
|
||||
use eth2_serde_utils::quoted_u64_vec::{QuotedIntVecVisitor, QuotedIntWrapper};
|
||||
use serde::ser::SerializeSeq;
|
||||
use serde::{Deserializer, Serializer};
|
||||
use serde_utils::quoted_u64_vec::{QuotedIntVecVisitor, QuotedIntWrapper};
|
||||
|
||||
pub fn serialize<S, T>(value: &VariableList<u64, T>, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
||||
@@ -13,9 +13,9 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct PendingAttestation<T: EthSpec> {
|
||||
pub aggregation_bits: BitList<T::MaxValidatorsPerCommittee>,
|
||||
pub data: AttestationData,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub inclusion_delay: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proposer_index: u64,
|
||||
}
|
||||
|
||||
|
||||
@@ -12,71 +12,71 @@ use serde_derive::{Deserialize, Serialize};
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
pub struct BasePreset {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_committees_per_slot: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub target_committee_size: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_validators_per_committee: u64,
|
||||
#[serde(with = "serde_utils::quoted_u8")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u8")]
|
||||
pub shuffle_round_count: u8,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub hysteresis_quotient: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub hysteresis_downward_multiplier: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub hysteresis_upward_multiplier: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub safe_slots_to_update_justified: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_deposit_amount: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_effective_balance: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub effective_balance_increment: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_attestation_inclusion_delay: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub slots_per_epoch: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_seed_lookahead: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_seed_lookahead: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub epochs_per_eth1_voting_period: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub slots_per_historical_root: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_epochs_to_inactivity_penalty: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub epochs_per_historical_vector: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub epochs_per_slashings_vector: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub historical_roots_limit: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_registry_limit: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub base_reward_factor: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub whistleblower_reward_quotient: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proposer_reward_quotient: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub inactivity_penalty_quotient: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_slashing_penalty_quotient: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proportional_slashing_multiplier: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_proposer_slashings: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_attester_slashings: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_attestations: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_deposits: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub max_voluntary_exits: u64,
|
||||
}
|
||||
|
||||
@@ -123,17 +123,17 @@ impl BasePreset {
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "UPPERCASE")]
|
||||
pub struct AltairPreset {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub inactivity_penalty_quotient_altair: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_slashing_penalty_quotient_altair: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub proportional_slashing_multiplier_altair: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub sync_committee_size: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub epochs_per_sync_committee_period: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub min_sync_committee_participants: u64,
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@ use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Rem, Sub, SubAssi
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct Slot(#[serde(with = "serde_utils::quoted_u64")] u64);
|
||||
pub struct Slot(#[serde(with = "eth2_serde_utils::quoted_u64")] u64);
|
||||
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct Epoch(#[serde(with = "serde_utils::quoted_u64")] u64);
|
||||
pub struct Epoch(#[serde(with = "eth2_serde_utils::quoted_u64")] u64);
|
||||
|
||||
impl_common!(Slot);
|
||||
impl_common!(Epoch);
|
||||
|
||||
@@ -20,7 +20,7 @@ lazy_static! {
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct SubnetId(#[serde(with = "serde_utils::quoted_u64")] u64);
|
||||
pub struct SubnetId(#[serde(with = "eth2_serde_utils::quoted_u64")] u64);
|
||||
|
||||
pub fn subnet_id_to_string(i: u64) -> &'static str {
|
||||
if i < MAX_SUBNET_ID as u64 {
|
||||
|
||||
@@ -21,7 +21,7 @@ pub enum Error {
|
||||
pub struct SyncCommitteeContribution<T: EthSpec> {
|
||||
pub slot: Slot,
|
||||
pub beacon_block_root: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub subcommittee_index: u64,
|
||||
pub aggregation_bits: BitVector<T::SyncSubcommitteeSize>,
|
||||
pub signature: AggregateSignature,
|
||||
|
||||
@@ -13,7 +13,7 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct SyncCommitteeMessage {
|
||||
pub slot: Slot,
|
||||
pub beacon_block_root: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
// Signature by the validator over `beacon_block_root`.
|
||||
pub signature: Signature,
|
||||
|
||||
@@ -7,9 +7,9 @@ use std::collections::HashSet;
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct SyncDuty {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64_vec")]
|
||||
pub validator_sync_committee_indices: Vec<u64>,
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ lazy_static! {
|
||||
#[cfg_attr(feature = "arbitrary-fuzz", derive(arbitrary::Arbitrary))]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct SyncSubnetId(#[serde(with = "serde_utils::quoted_u64")] u64);
|
||||
pub struct SyncSubnetId(#[serde(with = "eth2_serde_utils::quoted_u64")] u64);
|
||||
|
||||
pub fn sync_subnet_id_to_string(i: u64) -> &'static str {
|
||||
if i < SYNC_COMMITTEE_SUBNET_COUNT {
|
||||
|
||||
@@ -14,7 +14,7 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct Validator {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
pub withdrawal_credentials: Hash256,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub effective_balance: u64,
|
||||
pub slashed: bool,
|
||||
pub activation_eligibility_epoch: Epoch,
|
||||
|
||||
@@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash;
|
||||
pub struct VoluntaryExit {
|
||||
/// Earliest epoch when voluntary exit can be processed.
|
||||
pub epoch: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user