mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Merge branch 'electra-engine-api' of https://github.com/sigp/lighthouse into beacon-api-electra
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,
|
||||
@@ -1702,11 +1717,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`.
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user