From adf1d9c533d51c908b8e3b7430ba7e2554a2ef45 Mon Sep 17 00:00:00 2001 From: Grant Wuerker Date: Tue, 9 Jul 2019 12:36:59 +0200 Subject: [PATCH] Processing attestation in fork choice --- beacon_node/beacon_chain/src/beacon_chain.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 2d82822701..ca4667e00e 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -480,6 +480,14 @@ impl BeaconChain { self.metrics.attestation_processing_requests.inc(); let timer = self.metrics.attestation_processing_times.start_timer(); + match self.store.exists::(&attestation.data.target_root) { + Ok(true) => { + per_block_processing::validate_attestation_time_independent_only(&*self.state.read(), &attestation, &self.spec)?; + self.fork_choice.process_attestation(&*self.state.read(), &attestation); + }, + _ => {} + }; + let result = self .op_pool .insert_attestation(attestation, &*self.state.read(), &self.spec);