Migrate derivative to educe (#8125)

Fixes #7001.


  Mostly mechanical replacement of `derivative` attributes with `educe` ones.

### **Attribute Syntax Changes**

```rust
// Bounds: = "..." → (...)
#[derivative(Hash(bound = "E: EthSpec"))]
#[educe(Hash(bound(E: EthSpec)))]

// Ignore: = "ignore" → (ignore)
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]

// Default values: value = "..." → expression = ...
#[derivative(Default(value = "ForkName::Base"))]
#[educe(Default(expression = ForkName::Base))]

// Methods: format_with/compare_with = "..." → method(...)
#[derivative(Debug(format_with = "fmt_peer_set_as_len"))]
#[educe(Debug(method(fmt_peer_set_as_len)))]

// Empty bounds: removed entirely, educe can infer appropriate bounds
#[derivative(Default(bound = ""))]
#[educe(Default)]

// Transparent debug: manual implementation (educe doesn't support it)
#[derivative(Debug = "transparent")]
// Replaced with manual Debug impl that delegates to inner field
```

**Note**: Some bounds use strings (`bound("E: EthSpec")`) for superstruct compatibility (`expected ','` errors).


Co-Authored-By: Javier Chávarri <javier.chavarri@gmail.com>

Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Javier Chávarri
2025-11-06 15:13:57 +01:00
committed by GitHub
parent 0090b35ee0
commit 2c1f1c1605
56 changed files with 277 additions and 287 deletions

22
Cargo.lock generated
View File

@@ -862,7 +862,7 @@ dependencies = [
"bitvec 1.0.1",
"bls",
"criterion",
"derivative",
"educe",
"eth2",
"eth2_network_config",
"ethereum_hashing",
@@ -2543,7 +2543,7 @@ dependencies = [
"bls",
"compare_fields",
"context_deserialize",
"derivative",
"educe",
"eth2_network_config",
"ethereum_ssz",
"ethereum_ssz_derive",
@@ -2862,7 +2862,7 @@ dependencies = [
name = "eth2"
version = "0.1.0"
dependencies = [
"derivative",
"educe",
"eip_3076",
"either",
"enr",
@@ -5014,7 +5014,7 @@ dependencies = [
"arbitrary",
"c-kzg",
"criterion",
"derivative",
"educe",
"ethereum_hashing",
"ethereum_serde_utils",
"ethereum_ssz",
@@ -6309,7 +6309,7 @@ dependencies = [
"beacon_processor",
"bls",
"delay_map",
"derivative",
"educe",
"eth2",
"eth2_network_config",
"ethereum_ssz",
@@ -6745,7 +6745,7 @@ version = "0.2.0"
dependencies = [
"beacon_chain",
"bitvec 1.0.1",
"derivative",
"educe",
"ethereum_ssz",
"ethereum_ssz_derive",
"itertools 0.10.5",
@@ -8748,7 +8748,7 @@ version = "0.1.0"
dependencies = [
"bincode",
"byteorder",
"derivative",
"educe",
"ethereum_ssz",
"ethereum_ssz_derive",
"filesystem",
@@ -8917,7 +8917,7 @@ dependencies = [
"arbitrary",
"beacon_chain",
"bls",
"derivative",
"educe",
"ethereum_hashing",
"ethereum_ssz",
"ethereum_ssz_derive",
@@ -9855,7 +9855,7 @@ dependencies = [
"compare_fields",
"context_deserialize",
"criterion",
"derivative",
"educe",
"eth2_interop_keypairs",
"ethereum_hashing",
"ethereum_serde_utils",
@@ -10099,7 +10099,7 @@ version = "0.1.0"
dependencies = [
"bls",
"deposit_contract",
"derivative",
"educe",
"eth2_keystore",
"filesystem",
"hex",
@@ -10187,7 +10187,7 @@ dependencies = [
"beacon_chain",
"clap",
"clap_utils",
"derivative",
"educe",
"environment",
"eth2",
"eth2_network_config",

View File

@@ -128,11 +128,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"
eip_3076 = { path = "common/eip_3076" }
either = "1.9"
environment = { path = "lighthouse/environment" }

View File

@@ -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 }

View File

@@ -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;
@@ -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,

View File

@@ -1,4 +1,4 @@
use derivative::Derivative;
use educe::Educe;
use slot_clock::SlotClock;
use std::marker::PhantomData;
use std::sync::Arc;
@@ -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>>,

View File

@@ -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};
@@ -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,

View File

@@ -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};
@@ -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>,
@@ -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>>),

View File

@@ -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;
@@ -296,8 +296,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>>,
@@ -353,8 +353,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>>,
@@ -383,8 +383,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>>,

View File

@@ -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;
@@ -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,

View File

@@ -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;
@@ -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,

View File

@@ -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;
@@ -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`.
///
@@ -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)>,
}

View File

@@ -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};
@@ -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>,

View File

@@ -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 }

View File

@@ -1,5 +1,5 @@
use beacon_chain::block_verification_types::RpcBlock;
use derivative::Derivative;
use educe::Educe;
use lighthouse_network::PeerId;
use lighthouse_network::rpc::methods::BlocksByRangeRequest;
use lighthouse_network::rpc::methods::DataColumnsByRangeRequest;
@@ -78,8 +78,8 @@ pub enum BatchProcessingResult {
NonFaultyFailure,
}
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
/// A segment of a chain.
pub struct BatchInfo<E: EthSpec, B: BatchConfig, D: Hash> {
/// Start slot of the batch.
@@ -97,7 +97,7 @@ pub struct BatchInfo<E: EthSpec, B: BatchConfig, D: Hash> {
/// Whether this batch contains all blocks or all blocks and blobs.
batch_type: ByRangeRequestType,
/// Pin the generic
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
marker: std::marker::PhantomData<(E, B)>,
}

View File

@@ -5,7 +5,7 @@ use crate::sync::network_context::{
SyncNetworkContext,
};
use beacon_chain::{BeaconChainTypes, BlockProcessStatus};
use derivative::Derivative;
use educe::Educe;
use lighthouse_network::service::api_types::Id;
use lighthouse_tracing::SPAN_SINGLE_BLOCK_LOOKUP;
use parking_lot::RwLock;
@@ -57,8 +57,8 @@ pub enum LookupRequestError {
},
}
#[derive(Derivative)]
#[derivative(Debug(bound = "T: BeaconChainTypes"))]
#[derive(Educe)]
#[educe(Debug(bound(T: BeaconChainTypes)))]
pub struct SingleBlockLookup<T: BeaconChainTypes> {
pub id: Id,
pub block_request_state: BlockRequestState<T::EthSpec>,
@@ -67,7 +67,7 @@ pub struct SingleBlockLookup<T: BeaconChainTypes> {
/// the custody request to have an updated view of the peers that claim to have imported the
/// block associated with this lookup. The peer set of a lookup can change rapidly, and faster
/// than the lifetime of a custody request.
#[derivative(Debug(format_with = "fmt_peer_set_as_len"))]
#[educe(Debug(method(fmt_peer_set_as_len)))]
peers: Arc<RwLock<HashSet<PeerId>>>,
block_root: Hash256,
awaiting_parent: Option<Hash256>,
@@ -369,10 +369,10 @@ impl<T: BeaconChainTypes> SingleBlockLookup<T> {
}
/// The state of the blob request component of a `SingleBlockLookup`.
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
pub struct BlobRequestState<E: EthSpec> {
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
pub block_root: Hash256,
pub state: SingleLookupRequestState<FixedBlobSidecarList<E>>,
}
@@ -387,10 +387,10 @@ impl<E: EthSpec> BlobRequestState<E> {
}
/// The state of the custody request component of a `SingleBlockLookup`.
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
pub struct CustodyRequestState<E: EthSpec> {
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
pub block_root: Hash256,
pub state: SingleLookupRequestState<DataColumnSidecarList<E>>,
}
@@ -405,10 +405,10 @@ impl<E: EthSpec> CustodyRequestState<E> {
}
/// The state of the block request component of a `SingleBlockLookup`.
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
pub struct BlockRequestState<E: EthSpec> {
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
pub requested_block_root: Hash256,
pub state: SingleLookupRequestState<Arc<SignedBeaconBlock<E>>>,
}

View File

@@ -9,7 +9,7 @@ portable = ["beacon_chain/portable"]
[dependencies]
bitvec = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
itertools = { workspace = true }

View File

@@ -3,7 +3,7 @@ use crate::OperationPool;
use crate::attestation_storage::AttestationMap;
use crate::bls_to_execution_changes::{BlsToExecutionChanges, ReceivedPreCapella};
use crate::sync_aggregate_id::SyncAggregateId;
use derivative::Derivative;
use educe::Educe;
use parking_lot::RwLock;
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
@@ -22,10 +22,7 @@ type PersistedSyncContributions<E> = Vec<(SyncAggregateId, Vec<SyncCommitteeCont
/// of this type (or its encoded form) for equality. Convert back to an `OperationPool` first.
#[superstruct(
variants(V15, V20),
variant_attributes(
derive(Derivative, PartialEq, Debug, Encode, Decode),
derivative(Clone),
),
variant_attributes(derive(Educe, PartialEq, Debug, Encode, Decode), educe(Clone),),
partial_getter_error(ty = "OpPoolError", expr = "OpPoolError::IncorrectOpPoolVariant")
)]
#[derive(PartialEq, Debug, Encode)]

View File

@@ -9,7 +9,7 @@ default = ["lighthouse"]
lighthouse = []
[dependencies]
derivative = { workspace = true }
educe = { workspace = true }
eip_3076 = { workspace = true }
either = { workspace = true }
enr = { version = "0.13.0", features = ["ed25519"] }

View File

@@ -19,7 +19,7 @@ pub use self::error::{Error, ok_or_error, success_or_error};
use self::mixin::{RequestAccept, ResponseOptional};
use self::types::*;
use ::types::beacon_response::ExecutionOptimisticFinalizedBeaconResponse;
use derivative::Derivative;
use educe::Educe;
use futures::Stream;
use futures_util::StreamExt;
use libp2p_identity::PeerId;
@@ -135,10 +135,10 @@ impl Timeouts {
/// A wrapper around `reqwest::Client` which provides convenience methods for interfacing with a
/// Lighthouse Beacon Node HTTP server (`http_api`).
#[derive(Clone, Debug, Derivative)]
#[derivative(PartialEq)]
#[derive(Clone, Debug, Educe)]
#[educe(PartialEq)]
pub struct BeaconNodeHttpClient {
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]
client: reqwest::Client,
server: SensitiveUrl,
timeouts: Timeouts,

View File

@@ -11,7 +11,7 @@ insecure_keys = []
[dependencies]
bls = { workspace = true }
deposit_contract = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
eth2_keystore = { workspace = true }
filesystem = { workspace = true }
hex = { workspace = true }

View File

@@ -3,7 +3,7 @@ use crate::builder::{
WITHDRAWAL_KEYSTORE_FILE, keystore_password_path,
};
use deposit_contract::decode_eth1_tx_data;
use derivative::Derivative;
use educe::Educe;
use eth2_keystore::{Error as KeystoreError, Keystore, PlainText};
use lockfile::{Lockfile, LockfileError};
use std::fs::{File, read, write};
@@ -56,11 +56,11 @@ pub struct Eth1DepositData {
///
/// Holds a lockfile in `self.dir` to attempt to prevent concurrent access from multiple
/// processes.
#[derive(Debug, Derivative)]
#[derivative(PartialEq)]
#[derive(Debug, Educe)]
#[educe(PartialEq)]
pub struct ValidatorDir {
dir: PathBuf,
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]
_lockfile: Lockfile,
}

View File

@@ -20,7 +20,7 @@ portable = ["bls/supranational-portable"]
[dependencies]
arbitrary = { workspace = true }
bls = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
ethereum_hashing = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }

View File

@@ -8,7 +8,7 @@ use crate::per_block_processing::{
verify_proposer_slashing,
};
use arbitrary::Arbitrary;
use derivative::Derivative;
use educe::Educe;
use smallvec::{SmallVec, smallvec};
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
@@ -39,11 +39,11 @@ pub trait TransformPersist {
///
/// The inner `op` field is private, meaning instances of this type can only be constructed
/// by calling `validate`.
#[derive(Derivative, Debug, Clone, Arbitrary)]
#[derivative(
#[derive(Educe, Debug, Clone, Arbitrary)]
#[educe(
PartialEq,
Eq,
Hash(bound = "T: TransformPersist + std::hash::Hash, E: EthSpec")
Hash(bound(T: TransformPersist + std::hash::Hash, E: EthSpec))
)]
#[arbitrary(bound = "T: TransformPersist + Arbitrary<'arbitrary>, E: EthSpec")]
pub struct SigVerifiedOp<T: TransformPersist, E: EthSpec> {

View File

@@ -30,7 +30,7 @@ arbitrary = { workspace = true, features = ["derive"], optional = true }
bls = { workspace = true }
compare_fields = { workspace = true }
context_deserialize = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
ethereum_hashing = { workspace = true }
ethereum_serde_utils = { workspace = true }

View File

@@ -8,7 +8,7 @@ use crate::{
};
use crate::{Hash256, Slot, test_utils::TestRandom};
use crate::{IndexedAttestation, context_deserialize};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz_derive::{Decode, Encode};
use ssz_types::BitVector;
@@ -45,11 +45,11 @@ impl From<ssz_types::Error> for Error {
Decode,
Encode,
TestRandom,
Derivative,
Educe,
TreeHash,
),
context_deserialize(ForkName),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -66,7 +66,8 @@ impl From<ssz_types::Error> for Error {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, TreeHash, Encode, Derivative, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, TreeHash, Encode, Educe, Deserialize)]
#[educe(PartialEq)]
#[serde(untagged)]
#[tree_hash(enum_behaviour = "transparent")]
#[ssz(enum_behaviour = "transparent")]
@@ -599,18 +600,7 @@ impl<'de, E: EthSpec> ContextDeserialize<'de, ForkName> for Vec<Attestation<E>>
*/
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(
Debug,
Clone,
Serialize,
Deserialize,
Decode,
Encode,
TestRandom,
Derivative,
TreeHash,
PartialEq,
)]
#[derive(Debug, Clone, Serialize, Deserialize, Decode, Encode, TestRandom, TreeHash, PartialEq)]
#[context_deserialize(ForkName)]
pub struct SingleAttestation {
#[serde(with = "serde_utils::quoted_u64")]

View File

@@ -4,7 +4,7 @@ use crate::indexed_attestation::{
};
use crate::{ContextDeserialize, ForkName};
use crate::{EthSpec, test_utils::TestRandom};
use derivative::Derivative;
use educe::Educe;
use rand::{Rng, RngCore};
use serde::{Deserialize, Deserializer, Serialize};
use ssz_derive::{Decode, Encode};
@@ -16,7 +16,7 @@ use tree_hash_derive::TreeHash;
variants(Base, Electra),
variant_attributes(
derive(
Derivative,
Educe,
Debug,
Clone,
Serialize,
@@ -27,7 +27,7 @@ use tree_hash_derive::TreeHash;
TestRandom,
),
context_deserialize(ForkName),
derivative(PartialEq, Eq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Eq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec"),
cfg_attr(
feature = "arbitrary",
@@ -42,8 +42,8 @@ use tree_hash_derive::TreeHash;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Derivative)]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Encode, Deserialize, TreeHash, Educe)]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec", untagged)]
#[ssz(enum_behaviour = "transparent")]
#[tree_hash(enum_behaviour = "transparent")]
@@ -57,8 +57,8 @@ pub struct AttesterSlashing<E: EthSpec> {
/// This is a copy of the `AttesterSlashing` enum but with `Encode` and `Decode` derived
/// using the `union` behavior for the purposes of persistence on disk. We use a separate
/// type so that we don't accidentally use this non-spec encoding in consensus objects.
#[derive(Debug, Clone, Encode, Decode, Derivative)]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Encode, Decode, Educe)]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
#[ssz(enum_behaviour = "union")]
pub enum AttesterSlashingOnDisk<E: EthSpec> {
Base(AttesterSlashingBase<E>),

View File

@@ -1,7 +1,7 @@
use crate::attestation::AttestationBase;
use crate::test_utils::TestRandom;
use crate::*;
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, DecodeError};
use ssz_derive::{Decode, Encode};
@@ -27,9 +27,9 @@ use self::indexed_attestation::IndexedAttestationBase;
Decode,
TreeHash,
TestRandom,
Derivative,
Educe,
),
derivative(PartialEq, Hash(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")),
educe(PartialEq, Hash(bound(E: EthSpec, Payload: AbstractExecPayload<E>))),
serde(
bound = "E: EthSpec, Payload: AbstractExecPayload<E>",
deny_unknown_fields
@@ -52,8 +52,8 @@ use self::indexed_attestation::IndexedAttestationBase;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(untagged)]
#[serde(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")]
#[tree_hash(enum_behaviour = "transparent")]

View File

@@ -1,6 +1,6 @@
use crate::test_utils::TestRandom;
use crate::*;
use derivative::Derivative;
use educe::Educe;
use merkle_proof::{MerkleTree, MerkleTreeError};
use metastruct::metastruct;
use serde::{Deserialize, Deserializer, Serialize};
@@ -39,9 +39,9 @@ pub const BLOB_KZG_COMMITMENTS_INDEX: usize = 11;
Decode,
TreeHash,
TestRandom,
Derivative,
Educe,
),
derivative(PartialEq, Hash(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")),
educe(PartialEq, Hash(bound(E: EthSpec, Payload: AbstractExecPayload<E>))),
serde(
bound = "E: EthSpec, Payload: AbstractExecPayload<E>",
deny_unknown_fields
@@ -71,8 +71,8 @@ pub const BLOB_KZG_COMMITMENTS_INDEX: usize = 11;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")
)]
#[derive(Debug, Clone, Serialize, Deserialize, Derivative, TreeHash)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Educe, TreeHash)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(untagged)]
#[serde(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")]
#[tree_hash(enum_behaviour = "transparent")]

View File

@@ -5,7 +5,7 @@ use crate::historical_summary::HistoricalSummary;
use crate::test_utils::TestRandom;
use crate::*;
use compare_fields::CompareFields;
use derivative::Derivative;
use educe::Educe;
use ethereum_hashing::hash;
use int_to_bytes::{int_to_bytes4, int_to_bytes8};
use metastruct::{NumFields, metastruct};
@@ -245,7 +245,7 @@ impl From<BeaconStateHash> for Hash256 {
variants(Base, Altair, Bellatrix, Capella, Deneb, Electra, Fulu, Gloas),
variant_attributes(
derive(
Derivative,
Educe,
Debug,
PartialEq,
Serialize,
@@ -262,7 +262,7 @@ impl From<BeaconStateHash> for Hash256 {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
),
derivative(Clone),
educe(Clone),
),
specific_variant_attributes(
Base(metastruct(

View File

@@ -2,7 +2,7 @@
use crate::*;
use core::num::NonZeroUsize;
use derivative::Derivative;
use educe::Educe;
use safe_arith::SafeArith;
use serde::{Deserialize, Serialize};
use ssz::{Decode, DecodeError, Encode, four_byte_option_impl};
@@ -20,13 +20,13 @@ four_byte_option_impl!(four_byte_option_non_zero_usize, NonZeroUsize);
/// Computes and stores the shuffling for an epoch. Provides various getters to allow callers to
/// read the committees for the given epoch.
#[derive(Derivative, Debug, Default, Clone, Serialize, Deserialize, Encode, Decode)]
#[derivative(PartialEq)]
#[derive(Educe, Debug, Default, Clone, Serialize, Deserialize, Encode, Decode)]
#[educe(PartialEq)]
pub struct CommitteeCache {
#[ssz(with = "four_byte_option_epoch")]
initialized_epoch: Option<Epoch>,
shuffling: Vec<usize>,
#[derivative(PartialEq(compare_with = "compare_shuffling_positions"))]
#[educe(PartialEq(method(compare_shuffling_positions)))]
shuffling_positions: Vec<NonZeroUsizeOption>,
committees_per_slot: u64,
slots_per_epoch: u64,

View File

@@ -7,7 +7,7 @@ use crate::{
beacon_block_body::BLOB_KZG_COMMITMENTS_INDEX,
};
use bls::Signature;
use derivative::Derivative;
use educe::Educe;
use kzg::{BYTES_PER_BLOB, BYTES_PER_FIELD_ELEMENT, Blob as KzgBlob, Kzg, KzgCommitment, KzgProof};
use merkle_proof::{MerkleTreeError, merkle_root_from_branch, verify_merkle_proof};
use rand::Rng;
@@ -49,12 +49,10 @@ impl Ord for BlobIdentifier {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(
Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Derivative,
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Educe)]
#[context_deserialize(ForkName)]
#[serde(bound = "E: EthSpec")]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
pub struct BlobSidecar<E: EthSpec> {
#[serde(with = "serde_utils::quoted_u64")]
pub index: u64,

View File

@@ -2,7 +2,7 @@ use crate::application_domain::{APPLICATION_DOMAIN_BUILDER, ApplicationDomain};
use crate::blob_sidecar::BlobIdentifier;
use crate::data_column_sidecar::DataColumnsByRootIdentifier;
use crate::*;
use derivative::Derivative;
use educe::Educe;
use ethereum_hashing::hash;
use int_to_bytes::int_to_bytes4;
use safe_arith::{ArithError, SafeArith};
@@ -1566,15 +1566,15 @@ pub struct BlobParameters {
// A wrapper around a vector of BlobParameters to ensure that the vector is reverse
// sorted by epoch.
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Debug, Derivative, Clone)]
#[derivative(PartialEq)]
#[derive(Debug, Educe, Clone)]
#[educe(PartialEq)]
pub struct BlobSchedule {
schedule: Vec<BlobParameters>,
// This is a hack to prevent the blob schedule being serialized on the /eth/v1/config/spec
// endpoint prior to the Fulu fork being scheduled.
//
// We can remove this once Fulu is live on mainnet.
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]
skip_serializing: bool,
}

View File

@@ -6,7 +6,7 @@ use crate::{
SignedBeaconBlockHeader, Slot,
};
use bls::Signature;
use derivative::Derivative;
use educe::Educe;
use kzg::Error as KzgError;
use kzg::{KzgCommitment, KzgProof};
use merkle_proof::verify_merkle_proof;
@@ -40,11 +40,9 @@ pub type DataColumnSidecarList<E> = Vec<Arc<DataColumnSidecar<E>>>;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(
Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Derivative,
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Educe)]
#[serde(bound = "E: EthSpec")]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
#[context_deserialize(ForkName)]
pub struct DataColumnSidecar<E: EthSpec> {
#[serde(with = "serde_utils::quoted_u64")]

View File

@@ -1,18 +1,22 @@
//! Identifies each data column subnet by an integer identifier.
use crate::ChainSpec;
use crate::data_column_sidecar::ColumnIndex;
use derivative::Derivative;
use safe_arith::{ArithError, SafeArith};
use serde::{Deserialize, Serialize};
use std::fmt::{self, Display};
use std::ops::{Deref, DerefMut};
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, Derivative, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[derivative(Debug = "transparent")]
#[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(transparent)]
pub struct DataColumnSubnetId(#[serde(with = "serde_utils::quoted_u64")] u64);
impl fmt::Debug for DataColumnSubnetId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
std::fmt::Debug::fmt(&self.0, f)
}
}
impl DataColumnSubnetId {
pub fn new(id: u64) -> Self {
id.into()

View File

@@ -1,18 +1,22 @@
use crate::FixedBytesExtended;
use crate::Hash256;
use crate::test_utils::TestRandom;
use derivative::Derivative;
use rand::RngCore;
use serde::{Deserialize, Serialize};
use ssz::{Decode, DecodeError, Encode};
use std::fmt;
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Default, Clone, Copy, Serialize, Deserialize, Eq, PartialEq, Hash, Derivative)]
#[derivative(Debug = "transparent")]
#[derive(Default, Clone, Copy, Serialize, Deserialize, Eq, PartialEq, Hash)]
#[serde(transparent)]
pub struct ExecutionBlockHash(#[serde(with = "serde_utils::b256_hex")] pub Hash256);
impl fmt::Debug for ExecutionBlockHash {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
std::fmt::Debug::fmt(&self.0, f)
}
}
impl ExecutionBlockHash {
pub fn zero() -> Self {
Self(Hash256::zero())

View File

@@ -1,5 +1,5 @@
use crate::{test_utils::TestRandom, *};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
@@ -27,10 +27,10 @@ pub type Withdrawals<E> = VariableList<Withdrawal, <E as EthSpec>::MaxWithdrawal
Decode,
TreeHash,
TestRandom,
Derivative,
Educe,
),
context_deserialize(ForkName),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -48,8 +48,8 @@ pub type Withdrawals<E> = VariableList<Withdrawal, <E as EthSpec>::MaxWithdrawal
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec", untagged)]
#[ssz(enum_behaviour = "transparent")]
#[tree_hash(enum_behaviour = "transparent")]

View File

@@ -1,5 +1,5 @@
use crate::{test_utils::TestRandom, *};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
@@ -20,9 +20,9 @@ use tree_hash_derive::TreeHash;
Decode,
TreeHash,
TestRandom,
Derivative,
Educe,
),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -44,8 +44,8 @@ use tree_hash_derive::TreeHash;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec", untagged)]
#[tree_hash(enum_behaviour = "transparent")]
#[ssz(enum_behaviour = "transparent")]

View File

@@ -2,7 +2,7 @@ use crate::context_deserialize;
use crate::test_utils::TestRandom;
use crate::{ConsolidationRequest, DepositRequest, EthSpec, ForkName, Hash256, WithdrawalRequest};
use alloy_primitives::Bytes;
use derivative::Derivative;
use educe::Educe;
use ethereum_hashing::{DynamicContext, Sha256Context};
use serde::{Deserialize, Serialize};
use ssz::Encode;
@@ -24,10 +24,10 @@ pub type ConsolidationRequests<E> =
arbitrary(bound = "E: EthSpec")
)]
#[derive(
Debug, Derivative, Default, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom,
Debug, Educe, Default, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom,
)]
#[serde(bound = "E: EthSpec")]
#[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))]
#[educe(PartialEq, Eq, Hash(bound(E: EthSpec)))]
#[context_deserialize(ForkName)]
pub struct ExecutionRequests<E: EthSpec> {
pub deposits: DepositRequests<E>,

View File

@@ -3,7 +3,7 @@ use crate::{
AggregateSignature, AttestationData, EthSpec, ForkName, VariableList, test_utils::TestRandom,
};
use core::slice::Iter;
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Serialize};
use ssz::Encode;
use ssz_derive::{Decode, Encode};
@@ -28,11 +28,11 @@ use tree_hash_derive::TreeHash;
Decode,
Encode,
TestRandom,
Derivative,
Educe,
TreeHash,
),
context_deserialize(ForkName),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -46,7 +46,8 @@ use tree_hash_derive::TreeHash;
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, TreeHash, Encode, Derivative, Deserialize, PartialEq)]
#[derive(Debug, Clone, Serialize, TreeHash, Encode, Educe, Deserialize)]
#[educe(PartialEq)]
#[serde(untagged)]
#[tree_hash(enum_behaviour = "transparent")]
#[ssz(enum_behaviour = "transparent")]

View File

@@ -5,7 +5,7 @@ use crate::{
LightClientHeaderElectra, LightClientHeaderFulu, LightClientHeaderGloas,
SignedBlindedBeaconBlock, Slot, SyncCommittee, light_client_update::*, test_utils::TestRandom,
};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, Encode};
use ssz_derive::{Decode, Encode};
@@ -22,15 +22,15 @@ use tree_hash_derive::TreeHash;
derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
Derivative,
Educe,
Decode,
Encode,
TestRandom,
TreeHash,
),
educe(PartialEq),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",

View File

@@ -7,7 +7,7 @@ use crate::{
LightClientHeaderGloas, SignedBlindedBeaconBlock, light_client_update::*,
test_utils::TestRandom,
};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, Encode};
use ssz_derive::Decode;
@@ -22,15 +22,15 @@ use tree_hash_derive::TreeHash;
derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
Derivative,
Educe,
Decode,
Encode,
TestRandom,
TreeHash,
),
educe(PartialEq),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",

View File

@@ -8,7 +8,7 @@ use crate::{
ExecutionPayloadHeaderElectra, ExecutionPayloadHeaderFulu, ExecutionPayloadHeaderGloas,
FixedVector, Hash256, SignedBlindedBeaconBlock, test_utils::TestRandom,
};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::Decode;
use ssz_derive::{Decode, Encode};
@@ -23,15 +23,15 @@ use tree_hash_derive::TreeHash;
derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
Derivative,
Educe,
Decode,
Encode,
TestRandom,
TreeHash,
),
educe(PartialEq),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",

View File

@@ -6,7 +6,7 @@ use crate::{
LightClientHeaderElectra, LightClientHeaderFulu, LightClientHeaderGloas,
SignedBlindedBeaconBlock, light_client_update::*,
};
use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::{Decode, Encode};
use ssz_derive::Decode;
@@ -24,15 +24,15 @@ use tree_hash_derive::TreeHash;
derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
Derivative,
Educe,
Decode,
Encode,
TestRandom,
TreeHash,
),
educe(PartialEq),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",

View File

@@ -7,7 +7,7 @@ use crate::{
LightClientHeaderCapella, LightClientHeaderDeneb, LightClientHeaderFulu,
LightClientHeaderGloas, SignedBlindedBeaconBlock, beacon_state, test_utils::TestRandom,
};
use derivative::Derivative;
use educe::Educe;
use safe_arith::ArithError;
use safe_arith::SafeArith;
use serde::{Deserialize, Deserializer, Serialize};
@@ -105,15 +105,15 @@ impl From<milhouse::Error> for Error {
derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
Derivative,
Educe,
Decode,
Encode,
TestRandom,
TreeHash,
),
educe(PartialEq),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",

View File

@@ -1,5 +1,5 @@
use crate::{test_utils::TestRandom, *};
use derivative::Derivative;
use educe::Educe;
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use ssz::{Decode, Encode};
@@ -161,9 +161,9 @@ pub trait AbstractExecPayload<E: EthSpec>:
Decode,
TestRandom,
TreeHash,
Derivative,
Educe,
),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -173,8 +173,8 @@ pub trait AbstractExecPayload<E: EthSpec>:
ssz(struct_behaviour = "transparent"),
),
ref_attributes(
derive(Debug, Derivative, TreeHash),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
derive(Debug, Educe, TreeHash),
educe(PartialEq, Hash(bound(E: EthSpec))),
tree_hash(enum_behaviour = "transparent"),
),
map_into(ExecutionPayload),
@@ -187,8 +187,8 @@ pub trait AbstractExecPayload<E: EthSpec>:
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, Deserialize, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec")]
#[tree_hash(enum_behaviour = "transparent")]
pub struct FullPayload<E: EthSpec> {
@@ -531,9 +531,9 @@ impl<E: EthSpec> TryFrom<ExecutionPayloadHeader<E>> for FullPayload<E> {
Decode,
TestRandom,
TreeHash,
Derivative,
Educe,
),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec", deny_unknown_fields),
cfg_attr(
feature = "arbitrary",
@@ -543,8 +543,8 @@ impl<E: EthSpec> TryFrom<ExecutionPayloadHeader<E>> for FullPayload<E> {
ssz(struct_behaviour = "transparent"),
),
ref_attributes(
derive(Debug, Derivative, TreeHash),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
derive(Debug, Educe, TreeHash),
educe(PartialEq, Hash(bound(E: EthSpec))),
tree_hash(enum_behaviour = "transparent"),
),
map_into(ExecutionPayloadHeader),
@@ -556,8 +556,8 @@ impl<E: EthSpec> TryFrom<ExecutionPayloadHeader<E>> for FullPayload<E> {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(Debug, Clone, Serialize, Deserialize, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec")]
#[tree_hash(enum_behaviour = "transparent")]
pub struct BlindedPayload<E: EthSpec> {

View File

@@ -1,5 +1,5 @@
use crate::ContextDeserialize;
use derivative::Derivative;
use educe::Educe;
use serde::de::Error as DeError;
use serde::{Deserialize, Deserializer, Serialize};
use ssz::Decode;
@@ -44,8 +44,8 @@ use tree_hash::{Hash256, MerkleHasher, PackedEncoding, TreeHash, TreeHashType};
/// assert!(long.push(6).is_err());
///
/// ```
#[derive(Clone, Serialize, Deserialize, Derivative)]
#[derivative(PartialEq, Eq, Hash(bound = "T: std::hash::Hash"))]
#[derive(Clone, Serialize, Deserialize, Educe)]
#[educe(PartialEq, Eq, Hash(bound(T: std::hash::Hash)))]
#[serde(transparent)]
pub struct RuntimeVariableList<T> {
vec: Vec<T>,

View File

@@ -1,7 +1,7 @@
use crate::beacon_block_body::{BLOB_KZG_COMMITMENTS_INDEX, format_kzg_commitments};
use crate::test_utils::TestRandom;
use crate::*;
use derivative::Derivative;
use educe::Educe;
use merkle_proof::MerkleTree;
use serde::{Deserialize, Deserializer, Serialize};
use ssz_derive::{Decode, Encode};
@@ -51,10 +51,10 @@ impl From<SignedBeaconBlockHash> for Hash256 {
Encode,
Decode,
TreeHash,
Derivative,
Educe,
TestRandom
),
derivative(PartialEq, Hash(bound = "E: EthSpec")),
educe(PartialEq, Hash(bound(E: EthSpec))),
serde(bound = "E: EthSpec, Payload: AbstractExecPayload<E>"),
cfg_attr(
feature = "arbitrary",
@@ -71,8 +71,8 @@ impl From<SignedBeaconBlockHash> for Hash256 {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")
)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(untagged)]
#[serde(bound = "E: EthSpec, Payload: AbstractExecPayload<E>")]
#[tree_hash(enum_behaviour = "transparent")]

View File

@@ -2,7 +2,7 @@ use crate::consts::altair::SYNC_COMMITTEE_SUBNET_COUNT;
use crate::context_deserialize;
use crate::test_utils::TestRandom;
use crate::{AggregateSignature, BitVector, EthSpec, ForkName, SyncCommitteeContribution};
use derivative::Derivative;
use educe::Educe;
use safe_arith::{ArithError, SafeArith};
use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
@@ -26,10 +26,8 @@ impl From<ArithError> for Error {
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[derive(
Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Derivative,
)]
#[derivative(PartialEq, Hash(bound = "E: EthSpec"))]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom, Educe)]
#[educe(PartialEq, Hash(bound(E: EthSpec)))]
#[serde(bound = "E: EthSpec")]
#[context_deserialize(ForkName)]
pub struct SyncAggregate<E: EthSpec> {

View File

@@ -8,7 +8,7 @@ edition = "2021"
[dependencies]
arbitrary = { workspace = true }
c-kzg = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
ethereum_hashing = { workspace = true }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }

View File

@@ -1,5 +1,5 @@
use c_kzg::BYTES_PER_COMMITMENT;
use derivative::Derivative;
use educe::Educe;
use ethereum_hashing::hash_fixed;
use serde::de::{Deserialize, Deserializer};
use serde::ser::{Serialize, Serializer};
@@ -11,8 +11,8 @@ use tree_hash::{Hash256, PackedEncoding, TreeHash};
pub const VERSIONED_HASH_VERSION_KZG: u8 = 0x01;
#[derive(Derivative, Clone, Copy, Encode, Decode)]
#[derivative(PartialEq, Eq, Hash)]
#[derive(Educe, Clone, Copy, Encode, Decode)]
#[educe(PartialEq, Eq, Hash)]
#[ssz(struct_behaviour = "transparent")]
pub struct KzgCommitment(pub [u8; c_kzg::BYTES_PER_COMMITMENT]);

View File

@@ -14,7 +14,7 @@ portable = ["types/portable"]
[dependencies]
bincode = { workspace = true }
byteorder = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }
filesystem = { workspace = true }

View File

@@ -7,7 +7,7 @@ use crate::{
*,
},
};
use derivative::Derivative;
use educe::Educe;
use redb::{ReadableTable, TableDefinition};
use std::{borrow::Cow, path::PathBuf};
@@ -23,18 +23,18 @@ pub struct Database<'env> {
_phantom: PhantomData<&'env ()>,
}
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
pub struct RwTransaction<'env> {
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
txn: redb::WriteTransaction,
_phantom: PhantomData<&'env ()>,
}
#[derive(Derivative)]
#[derivative(Debug)]
#[derive(Educe)]
#[educe(Debug)]
pub struct Cursor<'env> {
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
txn: &'env redb::WriteTransaction,
db: &'env Database<'env>,
current_key: Option<Cow<'env, [u8]>>,

View File

@@ -17,7 +17,7 @@ beacon_chain = { workspace = true }
bls = { workspace = true }
compare_fields = { workspace = true }
context_deserialize = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
eth2_network_config = { workspace = true }
ethereum_ssz = { workspace = true }
ethereum_ssz_derive = { workspace = true }

View File

@@ -2,7 +2,7 @@ use crate::cases::{self, Case, Cases, EpochTransition, LoadCase, Operation};
use crate::type_name::TypeName;
use crate::{FeatureName, type_name};
use context_deserialize::ContextDeserialize;
use derivative::Derivative;
use educe::Educe;
use std::fs::{self, DirEntry};
use std::marker::PhantomData;
use std::path::PathBuf;
@@ -154,8 +154,8 @@ pub trait Handler {
macro_rules! bls_eth_handler {
($runner_name: ident, $case_name:ident, $handler_name:expr) => {
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct $runner_name;
impl Handler for $runner_name {
@@ -174,8 +174,8 @@ macro_rules! bls_eth_handler {
macro_rules! bls_handler {
($runner_name: ident, $case_name:ident, $handler_name:expr) => {
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct $runner_name;
impl Handler for $runner_name {
@@ -335,8 +335,8 @@ impl<T, E> SszStaticHandler<T, E> {
}
/// Handler for SSZ types that implement `CachedTreeHash`.
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct SszStaticTHCHandler<T, E>(PhantomData<(T, E)>);
/// Handler for SSZ types that don't implement `ssz::Decode`.
@@ -436,8 +436,8 @@ where
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct ShufflingHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for ShufflingHandler<E> {
@@ -460,8 +460,8 @@ impl<E: EthSpec + TypeName> Handler for ShufflingHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct SanityBlocksHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for SanityBlocksHandler<E> {
@@ -486,8 +486,8 @@ impl<E: EthSpec + TypeName> Handler for SanityBlocksHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct SanitySlotsHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for SanitySlotsHandler<E> {
@@ -511,8 +511,8 @@ impl<E: EthSpec + TypeName> Handler for SanitySlotsHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct RandomHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for RandomHandler<E> {
@@ -531,8 +531,8 @@ impl<E: EthSpec + TypeName> Handler for RandomHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct EpochProcessingHandler<E, T>(PhantomData<(E, T)>);
impl<E: EthSpec + TypeName, T: EpochTransition<E>> Handler for EpochProcessingHandler<E, T> {
@@ -581,8 +581,8 @@ impl<E: EthSpec + TypeName> Handler for RewardsHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct ForkHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for ForkHandler<E> {
@@ -601,8 +601,8 @@ impl<E: EthSpec + TypeName> Handler for ForkHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct TransitionHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for TransitionHandler<E> {
@@ -621,8 +621,8 @@ impl<E: EthSpec + TypeName> Handler for TransitionHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct FinalityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for FinalityHandler<E> {
@@ -705,8 +705,8 @@ impl<E: EthSpec + TypeName> Handler for ForkChoiceHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct OptimisticSyncHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for OptimisticSyncHandler<E> {
@@ -734,8 +734,8 @@ impl<E: EthSpec + TypeName> Handler for OptimisticSyncHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct GenesisValidityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for GenesisValidityHandler<E> {
@@ -754,8 +754,8 @@ impl<E: EthSpec + TypeName> Handler for GenesisValidityHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct GenesisInitializationHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for GenesisInitializationHandler<E> {
@@ -774,8 +774,8 @@ impl<E: EthSpec + TypeName> Handler for GenesisInitializationHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGBlobToKZGCommitmentHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGBlobToKZGCommitmentHandler<E> {
@@ -794,8 +794,8 @@ impl<E: EthSpec> Handler for KZGBlobToKZGCommitmentHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGComputeBlobKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeBlobKZGProofHandler<E> {
@@ -814,8 +814,8 @@ impl<E: EthSpec> Handler for KZGComputeBlobKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGComputeKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeKZGProofHandler<E> {
@@ -834,8 +834,8 @@ impl<E: EthSpec> Handler for KZGComputeKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGVerifyBlobKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofHandler<E> {
@@ -854,8 +854,8 @@ impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGVerifyBlobKZGProofBatchHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofBatchHandler<E> {
@@ -874,8 +874,8 @@ impl<E: EthSpec> Handler for KZGVerifyBlobKZGProofBatchHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGVerifyKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyKZGProofHandler<E> {
@@ -894,8 +894,8 @@ impl<E: EthSpec> Handler for KZGVerifyKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct GetCustodyGroupsHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for GetCustodyGroupsHandler<E> {
@@ -914,8 +914,8 @@ impl<E: EthSpec + TypeName> Handler for GetCustodyGroupsHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct ComputeColumnsForCustodyGroupHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for ComputeColumnsForCustodyGroupHandler<E> {
@@ -934,8 +934,8 @@ impl<E: EthSpec + TypeName> Handler for ComputeColumnsForCustodyGroupHandler<E>
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGComputeCellsHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeCellsHandler<E> {
@@ -954,8 +954,8 @@ impl<E: EthSpec> Handler for KZGComputeCellsHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGComputeCellsAndKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGComputeCellsAndKZGProofHandler<E> {
@@ -974,8 +974,8 @@ impl<E: EthSpec> Handler for KZGComputeCellsAndKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGVerifyCellKZGProofBatchHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGVerifyCellKZGProofBatchHandler<E> {
@@ -994,8 +994,8 @@ impl<E: EthSpec> Handler for KZGVerifyCellKZGProofBatchHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KZGRecoverCellsAndKZGProofHandler<E>(PhantomData<E>);
impl<E: EthSpec> Handler for KZGRecoverCellsAndKZGProofHandler<E> {
@@ -1014,8 +1014,8 @@ impl<E: EthSpec> Handler for KZGRecoverCellsAndKZGProofHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct KzgInclusionMerkleProofValidityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for KzgInclusionMerkleProofValidityHandler<E> {
@@ -1038,8 +1038,8 @@ impl<E: EthSpec + TypeName> Handler for KzgInclusionMerkleProofValidityHandler<E
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct MerkleProofValidityHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for MerkleProofValidityHandler<E> {
@@ -1062,8 +1062,8 @@ impl<E: EthSpec + TypeName> Handler for MerkleProofValidityHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct LightClientUpdateHandler<E>(PhantomData<E>);
impl<E: EthSpec + TypeName> Handler for LightClientUpdateHandler<E> {
@@ -1087,8 +1087,8 @@ impl<E: EthSpec + TypeName> Handler for LightClientUpdateHandler<E> {
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct OperationsHandler<E, O>(PhantomData<(E, O)>);
impl<E: EthSpec + TypeName, O: Operation<E>> Handler for OperationsHandler<E, O> {
@@ -1107,8 +1107,8 @@ impl<E: EthSpec + TypeName, O: Operation<E>> Handler for OperationsHandler<E, O>
}
}
#[derive(Derivative)]
#[derivative(Default(bound = ""))]
#[derive(Educe)]
#[educe(Default)]
pub struct SszGenericHandler<H>(PhantomData<H>);
impl<H: TypeName> Handler for SszGenericHandler<H> {

View File

@@ -8,7 +8,7 @@ edition = { workspace = true }
account_utils = { workspace = true }
clap = { workspace = true }
clap_utils = { workspace = true }
derivative = { workspace = true }
educe = { workspace = true }
environment = { workspace = true }
eth2 = { workspace = true }
eth2_network_config = { workspace = true }

View File

@@ -3,7 +3,7 @@ use crate::DumpConfig;
use account_utils::eth2_keystore::Keystore;
use clap::{Arg, ArgAction, ArgMatches, Command};
use clap_utils::FLAG_HEADER;
use derivative::Derivative;
use educe::Educe;
use eth2::lighthouse_vc::types::KeystoreJsonStr;
use eth2::{SensitiveUrl, lighthouse_vc::std_types::ImportKeystoreStatus};
use serde::{Deserialize, Serialize};
@@ -159,15 +159,15 @@ pub fn cli_app() -> Command {
)
}
#[derive(Clone, PartialEq, Serialize, Deserialize, Derivative)]
#[derivative(Debug)]
#[derive(Clone, PartialEq, Serialize, Deserialize, Educe)]
#[educe(Debug)]
pub struct ImportConfig {
pub validators_file_path: Option<PathBuf>,
pub keystore_file_path: Option<PathBuf>,
pub vc_url: SensitiveUrl,
pub vc_token_path: PathBuf,
pub ignore_duplicates: bool,
#[derivative(Debug = "ignore")]
#[educe(Debug(ignore))]
pub password: Option<Zeroizing<String>>,
pub fee_recipient: Option<Address>,
pub gas_limit: Option<u64>,