mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +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:
@@ -36,7 +36,7 @@ pub fn parse_pubkey(secret: &str) -> Result<PublicKey, Error> {
|
||||
&secret[SECRET_PREFIX.len()..]
|
||||
};
|
||||
|
||||
serde_utils::hex::decode(secret)
|
||||
eth2_serde_utils::hex::decode(secret)
|
||||
.map_err(|e| Error::InvalidSecret(format!("invalid hex: {:?}", e)))
|
||||
.and_then(|bytes| {
|
||||
if bytes.len() != PK_LEN {
|
||||
@@ -101,7 +101,7 @@ impl ValidatorClientHttpClient {
|
||||
let message =
|
||||
Message::parse_slice(digest(&SHA256, &body).as_ref()).expect("sha256 is 32 bytes");
|
||||
|
||||
serde_utils::hex::decode(&sig)
|
||||
eth2_serde_utils::hex::decode(&sig)
|
||||
.ok()
|
||||
.and_then(|bytes| {
|
||||
let sig = Signature::parse_der(&bytes).ok()?;
|
||||
|
||||
@@ -21,14 +21,14 @@ pub struct ValidatorRequest {
|
||||
#[serde(default)]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub graffiti: Option<GraffitiString>,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub deposit_gwei: u64,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CreateValidatorsMnemonicRequest {
|
||||
pub mnemonic: ZeroizeString,
|
||||
#[serde(with = "serde_utils::quoted_u32")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u32")]
|
||||
pub key_derivation_path_offset: u32,
|
||||
pub validators: Vec<ValidatorRequest>,
|
||||
}
|
||||
@@ -42,7 +42,7 @@ pub struct CreatedValidator {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub graffiti: Option<GraffitiString>,
|
||||
pub eth1_deposit_tx_data: String,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub deposit_gwei: u64,
|
||||
}
|
||||
|
||||
|
||||
@@ -77,10 +77,10 @@ impl std::fmt::Display for EndpointVersion {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct GenesisData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub genesis_time: u64,
|
||||
pub genesis_validators_root: Hash256,
|
||||
#[serde(with = "serde_utils::bytes_4_hex")]
|
||||
#[serde(with = "eth2_serde_utils::bytes_4_hex")]
|
||||
pub genesis_fork_version: [u8; 4],
|
||||
}
|
||||
|
||||
@@ -270,9 +270,9 @@ impl fmt::Display for ValidatorId {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidatorData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub balance: u64,
|
||||
pub status: ValidatorStatus,
|
||||
pub validator: Validator,
|
||||
@@ -280,9 +280,9 @@ pub struct ValidatorData {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidatorBalanceData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub balance: u64,
|
||||
}
|
||||
|
||||
@@ -437,16 +437,16 @@ pub struct ValidatorsQuery {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CommitteeData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
pub slot: Slot,
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64_vec")]
|
||||
pub validators: Vec<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct SyncCommitteeByValidatorIndices {
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64_vec")]
|
||||
pub validators: Vec<u64>,
|
||||
pub validator_aggregates: Vec<SyncSubcommittee>,
|
||||
}
|
||||
@@ -454,7 +454,7 @@ pub struct SyncCommitteeByValidatorIndices {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct SyncSubcommittee {
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64_vec")]
|
||||
pub indices: Vec<u64>,
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ pub struct BlockHeaderData {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct DepositContractData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub chain_id: u64,
|
||||
pub address: Address,
|
||||
}
|
||||
@@ -501,7 +501,7 @@ pub struct IdentityData {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct MetaData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub seq_number: u64,
|
||||
pub attnets: String,
|
||||
pub syncnets: String,
|
||||
@@ -546,20 +546,20 @@ pub struct ValidatorBalancesQuery {
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct ValidatorIndexData(#[serde(with = "serde_utils::quoted_u64_vec")] pub Vec<u64>);
|
||||
pub struct ValidatorIndexData(#[serde(with = "eth2_serde_utils::quoted_u64_vec")] pub Vec<u64>);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct AttesterData {
|
||||
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")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committees_at_slot: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committee_index: CommitteeIndex,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committee_length: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_committee_index: u64,
|
||||
pub slot: Slot,
|
||||
}
|
||||
@@ -567,7 +567,7 @@ pub struct AttesterData {
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ProposerData {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
pub slot: Slot,
|
||||
}
|
||||
@@ -592,11 +592,11 @@ pub struct ValidatorAggregateAttestationQuery {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BeaconCommitteeSubscription {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub validator_index: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committee_index: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub committees_at_slot: u64,
|
||||
pub slot: Slot,
|
||||
pub is_aggregator: bool,
|
||||
@@ -714,13 +714,13 @@ impl fmt::Display for PeerDirection {
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PeerCount {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub connected: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub connecting: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub disconnected: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub disconnecting: u64,
|
||||
}
|
||||
|
||||
@@ -752,7 +752,7 @@ pub struct SseHead {
|
||||
#[derive(PartialEq, Debug, Serialize, Deserialize, Clone)]
|
||||
pub struct SseChainReorg {
|
||||
pub slot: Slot,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub depth: u64,
|
||||
pub old_head_block: Hash256,
|
||||
pub old_head_state: Hash256,
|
||||
@@ -910,13 +910,13 @@ impl FromStr for Accept {
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct LivenessRequestData {
|
||||
pub epoch: Epoch,
|
||||
#[serde(with = "serde_utils::quoted_u64_vec")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64_vec")]
|
||||
pub indices: Vec<u64>,
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Debug, Serialize, Deserialize)]
|
||||
pub struct LivenessResponseData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
#[serde(with = "eth2_serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
pub epoch: Epoch,
|
||||
pub is_live: bool,
|
||||
|
||||
Reference in New Issue
Block a user