Skip to content

Commit cb69f82

Browse files
committed
Add score update logic
1 parent ec11407 commit cb69f82

File tree

1 file changed

+8
-0
lines changed
  • crates/iota-core/src/checkpoints

1 file changed

+8
-0
lines changed

crates/iota-core/src/checkpoints/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,14 @@ impl CheckpointBuilder {
16151615
}
16161616
}
16171617

1618+
// We update the validator scores based on the information contained in the
1619+
// Scorer. We choose this point in time to do so because we must guarantee that
1620+
// scores are up to date right before the epoch changes. It also provides a good
1621+
// update periodicity: updating scores each time a report is received could be
1622+
// too frequent and not needed, since scores are not used during the epoch
1623+
// (except for monitoring purposes, which does not need to be 100% exact)
1624+
self.epoch_store.scorer.update_scores();
1625+
16181626
let (mut effects, mut signatures): (Vec<_>, Vec<_>) = transactions.into_iter().unzip();
16191627
let epoch_rolling_gas_cost_summary =
16201628
self.get_epoch_total_gas_cost(last_checkpoint.as_ref().map(|(_, c)| c), &effects);

0 commit comments

Comments
 (0)