Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ context_deserialize_derive = { path = "consensus/context_deserialize/context_des
criterion = "0.5"
delay_map = "0.4"
deposit_contract = { path = "common/deposit_contract" }
derivative = "2"
directory = { path = "common/directory" }
dirs = "3"
discv5 = { version = "0.10", features = ["libp2p"] }
doppelganger_service = { path = "validator_client/doppelganger_service" }
educe = "0.6"
either = "1.9"
environment = { path = "lighthouse/environment" }
eth2 = { path = "common/eth2" }
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test_backfill = []
alloy-primitives = { workspace = true }
bitvec = { workspace = true }
bls = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
eth2 = { workspace = true }
eth2_network_config = { workspace = true }
ethereum_hashing = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions beacon_node/beacon_chain/src/beacon_fork_choice_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! reads when fork choice requires the validator balances of the justified state.

use crate::{BeaconSnapshot, metrics};
use derivative::Derivative;
use educe::Educe;
use fork_choice::ForkChoiceStore;
use proto_array::JustifiedBalances;
use safe_arith::ArithError;
Expand Down Expand Up @@ -127,10 +127,10 @@ impl BalancesCache {

/// Implements `fork_choice::ForkChoiceStore` in order to provide a persistent backing to the
/// `fork_choice::ForkChoice` struct.
#[derive(Debug, Derivative)]
#[derivative(PartialEq(bound = "E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>"))]
#[derive(Debug, Educe)]
#[educe(PartialEq(bound(E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>)))]
pub struct BeaconForkChoiceStore<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> {
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]
store: Arc<HotColdDB<E, Hot, Cold>>,
balances_cache: BalancesCache,
time: Slot,
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/blob_verification.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use derivative::Derivative;
use educe::Educe;
use slot_clock::SlotClock;
use std::marker::PhantomData;
use std::sync::Arc;
Expand Down Expand Up @@ -245,8 +245,8 @@ impl<T: BeaconChainTypes, O: ObservationStrategy> GossipVerifiedBlob<T, O> {

/// Wrapper over a `BlobSidecar` for which we have completed kzg verification.
/// i.e. `verify_blob_kzg_proof(blob, commitment, proof) == true`.
#[derive(Debug, Derivative, Clone, Encode, Decode)]
#[derivative(PartialEq, Eq)]
#[derive(Debug, Educe, Clone, Encode, Decode)]
#[educe(PartialEq, Eq)]
#[ssz(struct_behaviour = "transparent")]
pub struct KzgVerifiedBlob<E: EthSpec> {
blob: Arc<BlobSidecar<E>>,
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use crate::{
beacon_chain::{BeaconForkChoice, ForkChoiceError},
metrics,
};
use derivative::Derivative;
use educe::Educe;
use eth2::types::{BlockGossip, EventKind};
use execution_layer::PayloadStatus;
pub use fork_choice::{AttestationFromBlock, PayloadVerificationStatus};
Expand Down Expand Up @@ -689,8 +689,8 @@ pub fn signature_verify_chain_segment<T: BeaconChainTypes>(

/// A wrapper around a `SignedBeaconBlock` that indicates it has been approved for re-gossiping on
/// the p2p network.
#[derive(Derivative)]
#[derivative(Debug(bound = "T: BeaconChainTypes"))]
#[derive(Educe)]
#[educe(Debug(bound(T: BeaconChainTypes)))]
pub struct GossipVerifiedBlock<T: BeaconChainTypes> {
pub block: Arc<SignedBeaconBlock<T::EthSpec>>,
pub block_root: Hash256,
Expand Down
10 changes: 5 additions & 5 deletions beacon_node/beacon_chain/src/block_verification_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::data_availability_checker::AvailabilityCheckError;
pub use crate::data_availability_checker::{AvailableBlock, MaybeAvailableBlock};
use crate::data_column_verification::{CustodyDataColumn, CustodyDataColumnList};
use crate::{PayloadVerificationOutcome, get_block_root};
use derivative::Derivative;
use educe::Educe;
use ssz_types::VariableList;
use state_processing::ConsensusContext;
use std::fmt::{Debug, Formatter};
Expand All @@ -26,8 +26,8 @@ use types::{
/// Note: We make a distinction over blocks received over gossip because
/// in a post-deneb world, the blobs corresponding to a given block that are received
/// over rpc do not contain the proposer signature for dos resistance.
#[derive(Clone, Derivative)]
#[derivative(Hash(bound = "E: EthSpec"))]
#[derive(Clone, Educe)]
#[educe(Hash(bound(E: EthSpec)))]
pub struct RpcBlock<E: EthSpec> {
block_root: Hash256,
block: RpcBlockInner<E>,
Expand Down Expand Up @@ -80,8 +80,8 @@ impl<E: EthSpec> RpcBlock<E> {
/// Note: This variant is intentionally private because we want to safely construct the
/// internal variants after applying consistency checks to ensure that the block and blobs
/// are consistent with respect to each other.
#[derive(Debug, Clone, Derivative)]
#[derivative(Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Educe)]
#[educe(Hash(bound(E: EthSpec)))]
enum RpcBlockInner<E: EthSpec> {
/// Single block lookup response. This should potentially hit the data availability cache.
Block(Arc<SignedBeaconBlock<E>>),
Expand Down
14 changes: 7 additions & 7 deletions beacon_node/beacon_chain/src/data_column_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::block_verification::{
use crate::kzg_utils::{reconstruct_data_columns, validate_data_columns};
use crate::observed_data_sidecars::{ObservationStrategy, Observe};
use crate::{BeaconChain, BeaconChainError, BeaconChainTypes, metrics};
use derivative::Derivative;
use educe::Educe;
use fork_choice::ProtoBlock;
use kzg::{Error as KzgError, Kzg};
use proto_array::Block;
Expand Down Expand Up @@ -287,8 +287,8 @@ impl<T: BeaconChainTypes, O: ObservationStrategy> GossipVerifiedDataColumn<T, O>
}

/// Wrapper over a `DataColumnSidecar` for which we have completed kzg verification.
#[derive(Debug, Derivative, Clone, Encode, Decode)]
#[derivative(PartialEq, Eq)]
#[derive(Debug, Educe, Clone, Encode, Decode)]
#[educe(PartialEq, Eq)]
#[ssz(struct_behaviour = "transparent")]
pub struct KzgVerifiedDataColumn<E: EthSpec> {
data: Arc<DataColumnSidecar<E>>,
Expand Down Expand Up @@ -344,8 +344,8 @@ pub type CustodyDataColumnList<E> =
VariableList<CustodyDataColumn<E>, <E as EthSpec>::NumberOfColumns>;

/// Data column that we must custody
#[derive(Debug, Derivative, Clone, Encode, Decode)]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Educe, Clone, Encode, Decode)]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
#[ssz(struct_behaviour = "transparent")]
pub struct CustodyDataColumn<E: EthSpec> {
data: Arc<DataColumnSidecar<E>>,
Expand Down Expand Up @@ -374,8 +374,8 @@ impl<E: EthSpec> CustodyDataColumn<E> {
}

/// Data column that we must custody and has completed kzg verification
#[derive(Debug, Derivative, Clone, Encode, Decode)]
#[derivative(PartialEq, Eq)]
#[derive(Debug, Educe, Clone, Encode, Decode)]
#[educe(PartialEq, Eq)]
#[ssz(struct_behaviour = "transparent")]
pub struct KzgVerifiedCustodyDataColumn<E: EthSpec> {
data: Arc<DataColumnSidecar<E>>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{BeaconChain, BeaconChainTypes};
use derivative::Derivative;
use educe::Educe;
use slot_clock::SlotClock;
use std::time::Duration;
use strum::AsRefStr;
Expand Down Expand Up @@ -55,8 +55,8 @@ pub enum Error {
}

/// Wraps a `LightClientFinalityUpdate` that has been verified for propagation on the gossip network.
#[derive(Derivative)]
#[derivative(Clone(bound = "T: BeaconChainTypes"))]
#[derive(Educe)]
#[educe(Clone(bound(T: BeaconChainTypes)))]
pub struct VerifiedLightClientFinalityUpdate<T: BeaconChainTypes> {
light_client_finality_update: LightClientFinalityUpdate<T::EthSpec>,
seen_timestamp: Duration,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::{BeaconChain, BeaconChainTypes};
use derivative::Derivative;
use educe::Educe;
use eth2::types::Hash256;
use slot_clock::SlotClock;
use std::time::Duration;
Expand Down Expand Up @@ -49,8 +49,8 @@ pub enum Error {
}

/// Wraps a `LightClientOptimisticUpdate` that has been verified for propagation on the gossip network.
#[derive(Derivative)]
#[derivative(Clone(bound = "T: BeaconChainTypes"))]
#[derive(Educe)]
#[educe(Clone(bound(T: BeaconChainTypes)))]
pub struct VerifiedLightClientOptimisticUpdate<T: BeaconChainTypes> {
light_client_optimistic_update: LightClientOptimisticUpdate<T::EthSpec>,
pub parent_root: Hash256,
Expand Down
8 changes: 4 additions & 4 deletions beacon_node/beacon_chain/src/observed_operations.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use derivative::Derivative;
use educe::Educe;
use smallvec::{SmallVec, smallvec};
use state_processing::{SigVerifiedOp, TransformPersist, VerifyOperation, VerifyOperationAt};
use std::collections::HashSet;
Expand All @@ -14,8 +14,8 @@ pub const SMALL_VEC_SIZE: usize = 8;
/// Stateful tracker for exit/slashing operations seen on the network.
///
/// Implements the conditions for gossip verification of exits and slashings from the P2P spec.
#[derive(Debug, Derivative)]
#[derivative(Default(bound = "T: ObservableOperation<E>, E: EthSpec"))]
#[derive(Debug, Educe)]
#[educe(Default(bound(T: ObservableOperation<E>, E: EthSpec)))]
pub struct ObservedOperations<T: ObservableOperation<E>, E: EthSpec> {
/// Indices of validators for whom we have already seen an instance of an operation `T`.
///
Expand All @@ -26,7 +26,7 @@ pub struct ObservedOperations<T: ObservableOperation<E>, E: EthSpec> {
/// `attestation_1.attester_indices` and `attestation_2.attester_indices`.
observed_validator_indices: HashSet<u64>,
/// The name of the current fork. The default will be overwritten on first use.
#[derivative(Default(value = "ForkName::Base"))]
#[educe(Default(expression = ForkName::Base))]
current_fork: ForkName,
_phantom: PhantomData<(T, E)>,
}
Expand Down
6 changes: 3 additions & 3 deletions beacon_node/beacon_chain/src/sync_committee_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::{
BeaconChain, BeaconChainError, BeaconChainTypes, metrics, observed_aggregates::ObserveOutcome,
};
use bls::{PublicKeyBytes, verify_signature_sets};
use derivative::Derivative;
use educe::Educe;
use safe_arith::ArithError;
use slot_clock::SlotClock;
use ssz_derive::{Decode, Encode};
Expand Down Expand Up @@ -261,8 +261,8 @@ impl From<ContributionError> for Error {
}

/// Wraps a `SignedContributionAndProof` that has been verified for propagation on the gossip network.\
#[derive(Derivative)]
#[derivative(Clone(bound = "T: BeaconChainTypes"))]
#[derive(Educe)]
#[educe(Clone(bound(T: BeaconChainTypes)))]
pub struct VerifiedSyncContribution<T: BeaconChainTypes> {
signed_aggregate: SignedContributionAndProof<T::EthSpec>,
participant_pubkeys: Vec<PublicKeyBytes>,
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async-channel = { workspace = true }
beacon_chain = { workspace = true }
beacon_processor = { workspace = true }
delay_map = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
ethereum_ssz = { workspace = true }
execution_layer = { workspace = true }
fnv = { workspace = true }
Expand Down
Loading
Loading