@@ -111,9 +111,6 @@ pub struct SyncingChain<T: BeaconChainTypes> {
111
111
/// The current processing batch, if any.
112
112
current_processing_batch : Option < BatchId > ,
113
113
114
- /// Batches validated by this chain.
115
- validated_batches : u64 ,
116
-
117
114
/// The chain's log.
118
115
log : slog:: Logger ,
119
116
}
@@ -161,7 +158,6 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
161
158
attempted_optimistic_starts : HashSet :: default ( ) ,
162
159
state : ChainSyncingState :: Stopped ,
163
160
current_processing_batch : None ,
164
- validated_batches : 0 ,
165
161
log : log. new ( o ! ( "chain" => id) ) ,
166
162
}
167
163
}
@@ -182,8 +178,10 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
182
178
}
183
179
184
180
/// Progress in epochs made by the chain
185
- pub fn validated_epochs ( & self ) -> u64 {
186
- self . validated_batches * EPOCHS_PER_BATCH
181
+ pub fn processed_epochs ( & self ) -> u64 {
182
+ self . processing_target
183
+ . saturating_sub ( self . start_epoch )
184
+ . into ( )
187
185
}
188
186
189
187
/// Returns the total count of pending blocks in all the batches of this chain
@@ -655,7 +653,6 @@ impl<T: BeaconChainTypes> SyncingChain<T> {
655
653
let removed_batches = std:: mem:: replace ( & mut self . batches , remaining_batches) ;
656
654
657
655
for ( id, batch) in removed_batches. into_iter ( ) {
658
- self . validated_batches = self . validated_batches . saturating_add ( 1 ) ;
659
656
// only for batches awaiting validation can we be sure the last attempt is
660
657
// right, and thus, that any different attempt is wrong
661
658
match batch. state ( ) {
@@ -1212,7 +1209,6 @@ impl<T: BeaconChainTypes> slog::KV for SyncingChain<T> {
1212
1209
) ?;
1213
1210
serializer. emit_usize ( "batches" , self . batches . len ( ) ) ?;
1214
1211
serializer. emit_usize ( "peers" , self . peers . len ( ) ) ?;
1215
- serializer. emit_u64 ( "validated_batches" , self . validated_batches ) ?;
1216
1212
serializer. emit_arguments ( "state" , & format_args ! ( "{:?}" , self . state) ) ?;
1217
1213
slog:: Result :: Ok ( ( ) )
1218
1214
}
0 commit comments