diff --git a/consensus/types/src/aggregate_and_proof.rs b/consensus/types/src/aggregate_and_proof.rs index 6edd8d3892..735ac0d299 100644 --- a/consensus/types/src/aggregate_and_proof.rs +++ b/consensus/types/src/aggregate_and_proof.rs @@ -144,6 +144,3 @@ impl AggregateAndProof { self.selection_proof().verify(validator_pubkey, message) } } - -impl SignedRoot for AggregateAndProof {} -impl SignedRoot for AggregateAndProofRef<'_, E> {} diff --git a/consensus/types/src/attestation_data.rs b/consensus/types/src/attestation_data.rs index 7578981f51..da85b5e018 100644 --- a/consensus/types/src/attestation_data.rs +++ b/consensus/types/src/attestation_data.rs @@ -1,5 +1,5 @@ use crate::test_utils::TestRandom; -use crate::{Checkpoint, Hash256, SignedRoot, Slot}; +use crate::{Checkpoint, Hash256, Slot}; use crate::slot_data::SlotData; use serde::{Deserialize, Serialize}; @@ -38,8 +38,6 @@ pub struct AttestationData { pub target: Checkpoint, } -impl SignedRoot for AttestationData {} - impl SlotData for AttestationData { fn get_slot(&self) -> Slot { self.slot diff --git a/consensus/types/src/beacon_block.rs b/consensus/types/src/beacon_block.rs index 6ea897cf1a..a9dfc8b0ec 100644 --- a/consensus/types/src/beacon_block.rs +++ b/consensus/types/src/beacon_block.rs @@ -81,9 +81,6 @@ pub struct BeaconBlock = FullPayload pub type BlindedBeaconBlock = BeaconBlock>; -impl> SignedRoot for BeaconBlock {} -impl> SignedRoot for BeaconBlockRef<'_, E, Payload> {} - /// Empty block trait for each block variant to implement. pub trait EmptyBlock { /// Returns an empty block to be used during genesis. diff --git a/consensus/types/src/beacon_block_header.rs b/consensus/types/src/beacon_block_header.rs index b382359313..b7bf1abafa 100644 --- a/consensus/types/src/beacon_block_header.rs +++ b/consensus/types/src/beacon_block_header.rs @@ -33,8 +33,6 @@ pub struct BeaconBlockHeader { pub body_root: Hash256, } -impl SignedRoot for BeaconBlockHeader {} - impl BeaconBlockHeader { /// Returns the `tree_hash_root` of the header. /// diff --git a/consensus/types/src/bls_to_execution_change.rs b/consensus/types/src/bls_to_execution_change.rs index 07d71b360f..6116802a61 100644 --- a/consensus/types/src/bls_to_execution_change.rs +++ b/consensus/types/src/bls_to_execution_change.rs @@ -27,8 +27,6 @@ pub struct BlsToExecutionChange { pub to_execution_address: Address, } -impl SignedRoot for BlsToExecutionChange {} - impl BlsToExecutionChange { pub fn sign( self, diff --git a/consensus/types/src/builder_bid.rs b/consensus/types/src/builder_bid.rs index 49911c3909..6ca22045e0 100644 --- a/consensus/types/src/builder_bid.rs +++ b/consensus/types/src/builder_bid.rs @@ -98,8 +98,6 @@ impl ForkVersionDecode for BuilderBid { } } -impl SignedRoot for BuilderBid {} - /// Validator registration, for use in interacting with servers implementing the builder API. #[derive(PartialEq, Debug, Encode, Serialize, Deserialize, Clone)] #[serde(bound = "E: EthSpec")] diff --git a/consensus/types/src/consolidation_request.rs b/consensus/types/src/consolidation_request.rs index e2df0bb972..d2fbd1ba60 100644 --- a/consensus/types/src/consolidation_request.rs +++ b/consensus/types/src/consolidation_request.rs @@ -1,4 +1,4 @@ -use crate::{test_utils::TestRandom, Address, PublicKeyBytes, SignedRoot}; +use crate::{test_utils::TestRandom, Address, PublicKeyBytes}; use serde::{Deserialize, Serialize}; use ssz::Encode; use ssz_derive::{Decode, Encode}; @@ -37,8 +37,6 @@ impl ConsolidationRequest { } } -impl SignedRoot for ConsolidationRequest {} - #[cfg(test)] mod tests { use super::*; diff --git a/consensus/types/src/contribution_and_proof.rs b/consensus/types/src/contribution_and_proof.rs index 321c12d220..a803df3b49 100644 --- a/consensus/types/src/contribution_and_proof.rs +++ b/consensus/types/src/contribution_and_proof.rs @@ -1,5 +1,5 @@ use super::{ - ChainSpec, EthSpec, Fork, Hash256, SecretKey, Signature, SignedRoot, SyncCommitteeContribution, + ChainSpec, EthSpec, Fork, Hash256, SecretKey, Signature, SyncCommitteeContribution, SyncSelectionProof, }; use crate::test_utils::TestRandom; @@ -68,5 +68,3 @@ impl ContributionAndProof { } } } - -impl SignedRoot for ContributionAndProof {} diff --git a/consensus/types/src/deposit_message.rs b/consensus/types/src/deposit_message.rs index 6184d0aeb3..fc9f9f9cb7 100644 --- a/consensus/types/src/deposit_message.rs +++ b/consensus/types/src/deposit_message.rs @@ -28,8 +28,6 @@ pub struct DepositMessage { pub amount: u64, } -impl SignedRoot for DepositMessage {} - #[cfg(test)] mod tests { use super::*; diff --git a/consensus/types/src/fork_data.rs b/consensus/types/src/fork_data.rs index 52ce57a2a9..077f8c5bbf 100644 --- a/consensus/types/src/fork_data.rs +++ b/consensus/types/src/fork_data.rs @@ -1,5 +1,5 @@ use crate::test_utils::TestRandom; -use crate::{Hash256, SignedRoot}; +use crate::Hash256; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -28,8 +28,6 @@ pub struct ForkData { pub genesis_validators_root: Hash256, } -impl SignedRoot for ForkData {} - #[cfg(test)] mod tests { use super::*; diff --git a/consensus/types/src/signing_data.rs b/consensus/types/src/signing_data.rs index f30d5fdfcb..37e6986505 100644 --- a/consensus/types/src/signing_data.rs +++ b/consensus/types/src/signing_data.rs @@ -33,3 +33,5 @@ pub trait SignedRoot: TreeHash { .tree_hash_root() } } + +impl SignedRoot for T {} diff --git a/consensus/types/src/slot_epoch.rs b/consensus/types/src/slot_epoch.rs index 0391756047..601f2b1133 100644 --- a/consensus/types/src/slot_epoch.rs +++ b/consensus/types/src/slot_epoch.rs @@ -11,7 +11,7 @@ //! may lead to programming errors which are not detected by the compiler. use crate::test_utils::TestRandom; -use crate::{ChainSpec, SignedRoot}; +use crate::ChainSpec; use rand::RngCore; use safe_arith::{ArithError, SafeArith}; diff --git a/consensus/types/src/slot_epoch_macros.rs b/consensus/types/src/slot_epoch_macros.rs index eee267355a..87c7222b37 100644 --- a/consensus/types/src/slot_epoch_macros.rs +++ b/consensus/types/src/slot_epoch_macros.rs @@ -292,8 +292,6 @@ macro_rules! impl_ssz { } } - impl SignedRoot for $type {} - impl TestRandom for $type { fn random_for_test(rng: &mut impl RngCore) -> Self { $type::from(u64::random_for_test(rng)) diff --git a/consensus/types/src/sync_aggregator_selection_data.rs b/consensus/types/src/sync_aggregator_selection_data.rs index 3da130bb06..cd5ca82db9 100644 --- a/consensus/types/src/sync_aggregator_selection_data.rs +++ b/consensus/types/src/sync_aggregator_selection_data.rs @@ -1,5 +1,5 @@ use crate::test_utils::TestRandom; -use crate::{SignedRoot, Slot}; +use crate::Slot; use serde::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; @@ -25,8 +25,6 @@ pub struct SyncAggregatorSelectionData { pub subcommittee_index: u64, } -impl SignedRoot for SyncAggregatorSelectionData {} - #[cfg(test)] mod tests { use super::*; diff --git a/consensus/types/src/sync_committee_contribution.rs b/consensus/types/src/sync_committee_contribution.rs index e160332f45..d09746e725 100644 --- a/consensus/types/src/sync_committee_contribution.rs +++ b/consensus/types/src/sync_committee_contribution.rs @@ -1,4 +1,4 @@ -use super::{AggregateSignature, EthSpec, SignedRoot}; +use super::{AggregateSignature, EthSpec}; use crate::slot_data::SlotData; use crate::{test_utils::TestRandom, BitVector, Hash256, Slot, SyncCommitteeMessage}; use serde::{Deserialize, Serialize}; @@ -75,8 +75,6 @@ impl SyncCommitteeContribution { } } -impl SignedRoot for Hash256 {} - /// This is not in the spec, but useful for determining uniqueness of sync committee contributions #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom)] pub struct SyncContributionData { diff --git a/consensus/types/src/validator_registration_data.rs b/consensus/types/src/validator_registration_data.rs index 345771074c..8620a7f88e 100644 --- a/consensus/types/src/validator_registration_data.rs +++ b/consensus/types/src/validator_registration_data.rs @@ -21,8 +21,6 @@ pub struct ValidatorRegistrationData { pub pubkey: PublicKeyBytes, } -impl SignedRoot for ValidatorRegistrationData {} - impl SignedValidatorRegistrationData { pub fn verify_signature(&self, spec: &ChainSpec) -> bool { self.message diff --git a/consensus/types/src/voluntary_exit.rs b/consensus/types/src/voluntary_exit.rs index 153506f47a..408d274c34 100644 --- a/consensus/types/src/voluntary_exit.rs +++ b/consensus/types/src/voluntary_exit.rs @@ -31,8 +31,6 @@ pub struct VoluntaryExit { pub validator_index: u64, } -impl SignedRoot for VoluntaryExit {} - impl VoluntaryExit { pub fn sign( self,