@@ -145,13 +145,30 @@ async fn import_gossip_attestation(
145145 . insert_attestation ( attestation. clone ( ) , single_attestation. committee_index ) ;
146146
147147 let current_slot = store. get_current_slot ( ) ?;
148+ info ! (
149+ current_slot,
150+ attestation_slot = single_attestation. data. slot,
151+ committee_index = single_attestation. committee_index,
152+ attester_index = single_attestation. attester_index,
153+ beacon_block_root = %single_attestation. data. beacon_block_root,
154+ target_epoch = single_attestation. data. target. epoch,
155+ target_root = %single_attestation. data. target. root,
156+ "beacon_e2e_trace: gossip attestation inserted"
157+ ) ;
148158 (
149159 attestation,
150160 current_slot >= single_attestation. data . slot + MIN_ATTESTATION_INCLUSION_DELAY ,
151161 )
152162 } ;
153163
154164 if should_process_attestation {
165+ info ! (
166+ attestation_slot = attestation. data. slot,
167+ beacon_block_root = %attestation. data. beacon_block_root,
168+ target_epoch = attestation. data. target. epoch,
169+ target_root = %attestation. data. target. root,
170+ "beacon_e2e_trace: gossip attestation processing fork choice"
171+ ) ;
155172 beacon_chain. process_attestation ( attestation, false ) . await ?;
156173 }
157174
@@ -175,10 +192,18 @@ pub async fn handle_gossipsub_message(
175192 match GossipsubMessage :: decode ( & message. topic , & message. data ) {
176193 Ok ( gossip_message) => match gossip_message {
177194 GossipsubMessage :: BeaconBlock ( signed_block) => {
195+ let slot = signed_block. message . slot ;
196+ let root = signed_block. message . block_root ( ) ;
197+ let parent_root = signed_block. message . parent_root ;
198+ let proposer_index = signed_block. message . proposer_index ;
199+ let attestation_count = signed_block. message . body . attestations . len ( ) ;
178200 info ! (
179- "Beacon block received over gossipsub: slot: {}, root: {}" ,
180- signed_block. message. slot,
181- signed_block. message. block_root( )
201+ slot,
202+ %root,
203+ %parent_root,
204+ proposer_index,
205+ attestation_count,
206+ "beacon_e2e_trace: gossip block received"
182207 ) ;
183208
184209 let tick_time = {
@@ -208,17 +233,55 @@ pub async fn handle_gossipsub_message(
208233
209234 match validation_result {
210235 ValidationResult :: Accept => {
236+ info ! (
237+ slot,
238+ %root,
239+ %parent_root,
240+ proposer_index,
241+ attestation_count,
242+ "beacon_e2e_trace: gossip block accepted"
243+ ) ;
211244 let signed_block_bytes = signed_block. as_ssz_bytes ( ) ;
212245 if let Err ( err) = beacon_chain. process_block ( * signed_block) . await {
213- error ! ( "Failed to process gossipsub beacon block: {err}" ) ;
246+ error ! (
247+ slot,
248+ %root,
249+ %parent_root,
250+ "beacon_e2e_trace: gossip block import failed: {err}"
251+ ) ;
252+ } else {
253+ info ! (
254+ slot,
255+ %root,
256+ %parent_root,
257+ "beacon_e2e_trace: gossip block imported"
258+ ) ;
214259 }
215260 forward_gossip_message ( & message, p2p_sender, signed_block_bytes) ;
261+ info ! (
262+ slot,
263+ %root,
264+ %parent_root,
265+ "beacon_e2e_trace: gossip block forwarded"
266+ ) ;
216267 }
217268 ValidationResult :: Ignore ( reason) => {
218- warn ! ( "Ignoring gossipsub beacon block: {reason}" ) ;
269+ warn ! (
270+ slot,
271+ %root,
272+ %parent_root,
273+ reason,
274+ "beacon_e2e_trace: gossip block ignored"
275+ ) ;
219276 }
220277 ValidationResult :: Reject ( reason) => {
221- warn ! ( "Rejecting gossipsub beacon block: {reason}" ) ;
278+ warn ! (
279+ slot,
280+ %root,
281+ %parent_root,
282+ reason,
283+ "beacon_e2e_trace: gossip block rejected"
284+ ) ;
222285 }
223286 }
224287 }
0 commit comments