Skip to content

Commit ffd82a6

Browse files
committed
fix(heartbeats): Allow a difference of one slot for produced block times to account for the diff with heartbeat creation time
1 parent 060c549 commit ffd82a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/heartbeats-processor/src/local_db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,9 @@ pub async fn process_heartbeats(
431431
}
432432

433433
// Verify that the block slot matches the expected one for the current time
434-
// TODO: maybe we can be a bit more lenient here?
434+
// Allow a difference of 1 in either direction
435435
let expected_slot = global_slot_at_time(entry.create_time);
436-
if block_info.global_slot != expected_slot {
436+
if (block_info.global_slot as i64 - expected_slot as i64).abs() > 1 {
437437
println!(
438438
"WARNING: Invalid block slot: {} (height: {}, producer: {}, expected slot: {}, actual slot: {})",
439439
block_info.hash, block_info.height, entry.submitter, expected_slot, block_info.global_slot

0 commit comments

Comments
 (0)