Skip to content

Commit f5c17bb

Browse files
authored
Merge pull request #958 from openmina/fix/vrf-stats
Fix epoch number in BeginEpochEvaluation action
2 parents f60596b + 641418d commit f5c17bb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ pub enum BlockProducerVrfEvaluatorAction {
8686
next_epoch_first_slot: u32,
8787
},
8888
/// Starting epoch evaluation.
89-
#[action_event(level = info, fields(best_tip_epoch, best_tip_slot, best_tip_global_slot))]
89+
#[action_event(level = info, fields(evaluation_epoch, best_tip_epoch, best_tip_slot, best_tip_global_slot))]
9090
BeginEpochEvaluation {
9191
best_tip_slot: u32,
9292
best_tip_global_slot: u32,
9393
best_tip_epoch: u32,
94+
evaluation_epoch: u32,
9495
staking_epoch_data: EpochData,
9596
latest_evaluated_global_slot: u32,
9697
},

node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,15 @@ impl BlockProducerVrfEvaluatorState {
364364
});
365365
}
366366
BlockProducerVrfEvaluatorAction::BeginEpochEvaluation {
367-
best_tip_epoch,
367+
best_tip_epoch: _,
368+
evaluation_epoch,
368369
latest_evaluated_global_slot,
369370
staking_epoch_data,
370371
best_tip_slot: _,
371372
best_tip_global_slot: _,
372373
} => {
373374
let latest_evaluated_global_slot = *latest_evaluated_global_slot;
374-
let epoch_number = *best_tip_epoch;
375+
let epoch_number = *evaluation_epoch;
375376

376377
state.set_pending_evaluation(PendingEvaluation {
377378
epoch_number,
@@ -470,6 +471,7 @@ impl BlockProducerVrfEvaluatorState {
470471
best_tip_epoch: *best_tip_epoch,
471472
best_tip_global_slot: *current_best_tip_global_slot,
472473
best_tip_slot: *current_best_tip_slot,
474+
evaluation_epoch: epoch_number,
473475
staking_epoch_data: staking_epoch_data.clone(),
474476
latest_evaluated_global_slot: initial_slot,
475477
});

0 commit comments

Comments
 (0)