@@ -77,6 +77,7 @@ use ssz_types::{
7777 serde_utils:: { quoted_u64_fixed_vec, quoted_u64_var_list} ,
7878 typenum:: { U4 , U32 , U64 , U2048 , U8192 , U65536 , U262144 , U16777216 , U134217728 } ,
7979} ;
80+ use tracing:: info;
8081use tree_hash:: TreeHash ;
8182use tree_hash_derive:: TreeHash ;
8283
@@ -1937,6 +1938,18 @@ impl BeaconState {
19371938 let total_active_balance = self . get_total_active_balance ( ) ;
19381939 let previous_target_balance = self . get_total_balance ( previous_indices) ;
19391940 let current_target_balance = self . get_total_balance ( current_indices) ;
1941+ info ! (
1942+ state_slot = self . slot,
1943+ current_epoch = self . get_current_epoch( ) ,
1944+ previous_epoch = self . get_previous_epoch( ) ,
1945+ total_active_balance,
1946+ previous_target_balance,
1947+ current_target_balance,
1948+ current_justified_epoch = self . current_justified_checkpoint. epoch,
1949+ previous_justified_epoch = self . previous_justified_checkpoint. epoch,
1950+ finalized_epoch = self . finalized_checkpoint. epoch,
1951+ "beacon_e2e_trace: weighing justification balances"
1952+ ) ;
19401953
19411954 self . weigh_justification_and_finalization (
19421955 total_active_balance,
@@ -2024,6 +2037,21 @@ impl BeaconState {
20242037 {
20252038 self . finalized_checkpoint = old_current_justified_checkpoint;
20262039 }
2040+ info ! (
2041+ state_slot = self . slot,
2042+ current_epoch,
2043+ previous_epoch,
2044+ previous_epoch_target_balance,
2045+ current_epoch_target_balance,
2046+ total_active_balance,
2047+ justification_bits = ?bits,
2048+ old_previous_justified_epoch = old_previous_justified_checkpoint. epoch,
2049+ old_current_justified_epoch = old_current_justified_checkpoint. epoch,
2050+ previous_justified_epoch = self . previous_justified_checkpoint. epoch,
2051+ current_justified_epoch = self . current_justified_checkpoint. epoch,
2052+ finalized_epoch = self . finalized_checkpoint. epoch,
2053+ "beacon_e2e_trace: weighed justification result"
2054+ ) ;
20272055
20282056 Ok ( ( ) )
20292057 }
@@ -2158,6 +2186,19 @@ impl BeaconState {
21582186 // Participation flag indices
21592187 let participation_flag_indices =
21602188 self . get_attestation_participation_flag_indices ( data, self . slot - data. slot ) ?;
2189+ let attesting_indices = self . get_attesting_indices ( attestation) ?;
2190+ info ! (
2191+ state_slot = self . slot,
2192+ attestation_slot = data. slot,
2193+ source_epoch = data. source. epoch,
2194+ target_epoch = data. target. epoch,
2195+ beacon_block_root = %data. beacon_block_root,
2196+ target_root = %data. target. root,
2197+ inclusion_delay = self . slot - data. slot,
2198+ participation_flag_indices = ?participation_flag_indices,
2199+ attesting_indices = ?attesting_indices,
2200+ "beacon_e2e_trace: state attestation participation"
2201+ ) ;
21612202 // Verify signature
21622203 ensure ! (
21632204 self . is_valid_indexed_attestation( & self . get_indexed_attestation( attestation) ?) ?,
@@ -2166,7 +2207,7 @@ impl BeaconState {
21662207
21672208 let base_reward_per_increment = self . get_base_reward_per_increment ( ) ;
21682209 let mut proposer_reward_numerator = 0 ;
2169- for index in self . get_attesting_indices ( attestation ) ? {
2210+ for index in attesting_indices {
21702211 let index = index as usize ;
21712212 for ( flag_index, & weight) in PARTICIPATION_FLAG_WEIGHTS . iter ( ) . enumerate ( ) {
21722213 let flag_index = flag_index as u8 ;
0 commit comments