pub fn add_to_naive_aggregation_pool(
        &self,
        unaggregated_attestation: VerifiedUnaggregatedAttestation<T>,
    ) -> Result<VerifiedUnaggregatedAttestation<T>, AttestationError> {
        let _timer = metrics::start_timer(&metrics::ATTESTATION_PROCESSING_APPLY_TO_AGG_POOL);

        let attestation = unaggregated_attestation.attestation();

        match self.naive_aggregation_pool.write().insert(attestation) {
            Ok(outcome) => trace!(
                self.log,
                "Stored unaggregated attestation";
                "outcome" => ?outcome,
                "index" => attestation.data.index,
                "slot" => attestation.data.slot.as_u64(),
            ),
            Err(NaiveAggregationError::SlotTooLow {
                slot,
                lowest_permissible_slot,
            }) => {
                trace!(
                    self.log,
                    "Refused to store unaggregated attestation";
                    "lowest_permissible_slot" => lowest_permissible_slot.as_u64(),
                    "slot" => slot.as_u64(),
                );
            }
            Err(e) => {
                error!(
                        self.log,
                        "Failed to store unaggregated attestation";
                        "error" => ?e,
                        "index" => attestation.data.index,
                        "slot" => attestation.data.slot.as_u64(),
                );
                return Err(Error::from(e).into());
            }
        };

        Ok(unaggregated_attestation)
    }
/// Accepts an `VerifiedUnaggregatedAttestation` and attempts to apply it to the "naive
/// aggregation pool".
///
/// The naive aggregation pool is used by local validators to produce
/// `SignedAggregateAndProof`.
///
/// If the attestation is too old (low slot) to be included in the pool it is simply dropped
/// and no error is returned.
Accepts an `VerifiedUnaggregatedAttestation` and attempts to apply it to the "naive
aggregation pool".

The naive aggregation pool is used by local validators to produce
`SignedAggregateAndProof`.

If the attestation is too old (low slot) to be included in the pool it is simply dropped
and no error is returned.
Accepts an ` VerifiedUnaggregatedAttestation ` and attempts to apply it to the " naive aggregation pool " . The naive aggregation pool is used by local validators to produce ` SignedAggregateAndProof ` . If the attestation is too old ( low slot ) to be included in the pool it is simply dropped and no error is returned .
pub fn add_to_naive_aggregation_pool(
        &self,
        unaggregated_attestation: VerifiedUnaggregatedAttestation<T>,
    ) -> Result<VerifiedUnaggregatedAttestation<T>, AttestationError> {
        let _timer = metrics::start_timer(&metrics::ATTESTATION_PROCESSING_APPLY_TO_AGG_POOL);
        let attestation = unaggregated_attestation.attestation();
        match self.naive_aggregation_pool.write().insert(attestation) {
            Ok(outcome) => trace!(
                self.log,
                "Stored unaggregated attestation";
                "outcome" => ?outcome,
                "index" => attestation.data.index,
                "slot" => attestation.data.slot.as_u64(),
            ),
            Err(NaiveAggregationError::SlotTooLow {
                slot,
                lowest_permissible_slot,
            }) => {
                trace!(
                    self.log,
                    "Refused to store unaggregated attestation";
                    "lowest_permissible_slot" => lowest_permissible_slot.as_u64(),
                    "slot" => slot.as_u64(),
                );
            }
            Err(e) => {
                error!(
                        self.log,
                        "Failed to store unaggregated attestation";
                        "error" => ?e,
                        "index" => attestation.data.index,
                        "slot" => attestation.data.slot.as_u64(),
                );
                return Err(Error::from(e).into());
            }
        };
        Ok(unaggregated_attestation)
    }
pub fn add_to_naive_aggregation_pool ( & self , unaggregated_attestation : VerifiedUnaggregatedAttestation < T > , ) -> Result < VerifiedUnaggregatedAttestation < T > , AttestationError > { let _timer = metrics :: start_timer ( & metrics :: ATTESTATION_PROCESSING_APPLY_TO_AGG_POOL ) ; let attestation = unaggregated_attestation . attestation ( ) ; match self . naive_aggregation_pool . write ( ) . insert ( attestation ) { Ok ( outcome ) => trace ! ( self log " " " " outcome " " attestation data index " " attestation data slot as_u64 ( ) ) , Err ( NaiveAggregationError :: SlotTooLow { slot , lowest_permissible_slot , } ) => { trace ! ( self log " " " " lowest_permissible_slot as_u64 ( ) " " slot as_u64 ( ) ) ; } Err ( e ) => { error ! ( self log " " " " e " " attestation data index " " attestation data slot as_u64 ( ) ) ; return Err ( Error :: from ( e ) . into ( ) ) ; } } ; Ok ( unaggregated_attestation ) }
Accepts an `VerifiedUnaggregatedAttestation` and attempts to apply it to the "naive
aggregation pool".
Accepts an ` VerifiedUnaggregatedAttestation ` and attempts to apply it to the " naive aggregation pool " .
&self
unaggregated_attestation
VerifiedUnaggregatedAttestation<T>