mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 05:48:31 +00:00
Merge branch 'unstable' into vc-fallback
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn::{parse_macro_input, DeriveInput};
|
||||
|
||||
@@ -96,7 +96,7 @@ mod tests {
|
||||
let mut deposit_data = DepositData {
|
||||
pubkey: keypair.pk.into(),
|
||||
withdrawal_credentials: Hash256::from_slice(&[42; 32]),
|
||||
amount: u64::max_value(),
|
||||
amount: u64::MAX,
|
||||
signature: Signature::empty().into(),
|
||||
};
|
||||
deposit_data.signature = deposit_data.create_signature(&keypair.sk, spec);
|
||||
|
||||
@@ -716,6 +716,21 @@ pub struct AttesterData {
|
||||
pub slot: Slot,
|
||||
}
|
||||
|
||||
impl AttesterData {
|
||||
pub fn match_attestation_data<E: EthSpec>(
|
||||
&self,
|
||||
attestation_data: &AttestationData,
|
||||
spec: &ChainSpec,
|
||||
) -> bool {
|
||||
if spec.fork_name_at_slot::<E>(attestation_data.slot) < ForkName::Electra {
|
||||
self.slot == attestation_data.slot && self.committee_index == attestation_data.index
|
||||
} else {
|
||||
// After electra `attestation_data.index` is set to 0 and does not match the duties
|
||||
self.slot == attestation_data.slot
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ProposerData {
|
||||
pub pubkey: PublicKeyBytes,
|
||||
@@ -1700,11 +1715,11 @@ impl<E: EthSpec> ForkVersionDeserialize for FullBlockContents<E> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Into<BeaconBlock<E>> for FullBlockContents<E> {
|
||||
fn into(self) -> BeaconBlock<E> {
|
||||
match self {
|
||||
Self::BlockContents(block_and_sidecars) => block_and_sidecars.block,
|
||||
Self::Block(block) => block,
|
||||
impl<E: EthSpec> From<FullBlockContents<E>> for BeaconBlock<E> {
|
||||
fn from(from: FullBlockContents<E>) -> BeaconBlock<E> {
|
||||
match from {
|
||||
FullBlockContents::<E>::BlockContents(block_and_sidecars) => block_and_sidecars.block,
|
||||
FullBlockContents::<E>::Block(block) => block,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,11 +16,9 @@
|
||||
//!
|
||||
//! This implementation passes the [reference implementation
|
||||
//! tests](https://github.com/ethereum/eth2.0-pm/blob/6e41fcf383ebeb5125938850d8e9b4e9888389b4/interop/mocked_start/keygen_test_vector.yaml).
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
use bls::{Keypair, PublicKey, SecretKey};
|
||||
use ethereum_hashing::hash;
|
||||
use lazy_static::lazy_static;
|
||||
use num_bigint::BigUint;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fs::File;
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
//! ## Example
|
||||
//!
|
||||
//! ```rust
|
||||
//! #[macro_use]
|
||||
//! extern crate lazy_static;
|
||||
//! use lazy_static::lazy_static;
|
||||
//! use lighthouse_metrics::*;
|
||||
//!
|
||||
//! // These metrics are "magically" linked to the global registry defined in `lighthouse_metrics`.
|
||||
|
||||
@@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!(
|
||||
// NOTE: using --match instead of --exclude for compatibility with old Git
|
||||
"--match=thiswillnevermatchlol"
|
||||
],
|
||||
prefix = "Lighthouse/v5.1.3-",
|
||||
fallback = "Lighthouse/v5.1.3"
|
||||
prefix = "Lighthouse/v5.2.0-",
|
||||
fallback = "Lighthouse/v5.2.0"
|
||||
);
|
||||
|
||||
/// Returns the first eight characters of the latest commit hash for this build.
|
||||
|
||||
@@ -123,12 +123,10 @@ impl Serializer for ToSendSerializer {
|
||||
take(&mut self.kv, |kv| Box::new((kv, SingleKV(key, val))));
|
||||
Ok(())
|
||||
}
|
||||
#[cfg(integer128)]
|
||||
fn emit_u128(&mut self, key: Key, val: u128) -> slog::Result {
|
||||
take(&mut self.kv, |kv| Box::new((kv, SingleKV(key, val))));
|
||||
Ok(())
|
||||
}
|
||||
#[cfg(integer128)]
|
||||
fn emit_i128(&mut self, key: Key, val: i128) -> slog::Result {
|
||||
take(&mut self.kv, |kv| Box::new((kv, SingleKV(key, val))));
|
||||
Ok(())
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use lighthouse_metrics::{
|
||||
inc_counter, try_create_int_counter, IntCounter, Result as MetricsResult,
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Exposes [`MetricsLayer`]: A tracing layer that registers metrics of logging events.
|
||||
|
||||
use lazy_static::lazy_static;
|
||||
use lighthouse_metrics as metrics;
|
||||
use tracing_log::NormalizeEvent;
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
|
||||
mod manual_slot_clock;
|
||||
mod metrics;
|
||||
mod system_time_slot_clock;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use crate::SlotClock;
|
||||
use lazy_static::lazy_static;
|
||||
pub use lighthouse_metrics::*;
|
||||
use types::{EthSpec, Slot};
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
use crate::proc_macro::TokenStream;
|
||||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn::{parse_macro_input, DeriveInput};
|
||||
|
||||
|
||||
@@ -39,8 +39,6 @@ pub enum Error {
|
||||
/// generally caused by supplying an `amount` at deposit-time that is different to the one used
|
||||
/// at generation-time.
|
||||
Eth1DepositRootMismatch,
|
||||
#[cfg(feature = "unencrypted_keys")]
|
||||
SszKeypairError(String),
|
||||
}
|
||||
|
||||
/// Information required to submit a deposit to the Eth1 deposit contract.
|
||||
|
||||
Reference in New Issue
Block a user