You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If the tree's checkpoint doesn't match the correctness checkpoint, something went wrong
239
266
// and we bail loudly.
240
267
if checkpoint != correctness_checkpoint.checkpoint{
241
-
let reorg_event = ReorgEvent::new(
268
+
Self::panic_with_reorg(
269
+
&self.reorg_reporter,
270
+
&self.reorg_period,
271
+
&self.checkpoint_syncer,
242
272
tree.root(),
243
-
correctness_checkpoint.root,
244
-
checkpoint.index,
245
-
chrono::Utc::now().timestamp()asu64,
246
-
self.reorg_period.clone(),
247
-
);
248
-
error!(
249
-
?checkpoint,
250
-
?correctness_checkpoint,
251
-
?reorg_event,
252
-
"Incorrect tree root. Most likely a reorg has occurred. Please reach out for help, this is a potentially serious error impacting signed messages. Do NOT forcefully resume operation of this validator. Keep it crashlooping or shut down until you receive support."
info!("Blockchain does not support block height, reporting with reorg period");
259
-
self.reorg_reporter
260
-
.report_with_reorg_period(&self.reorg_period)
261
-
.await;
262
-
}
263
-
264
-
letmut panic_message = "Incorrect tree root. Most likely a reorg has occurred. Please reach out for help, this is a potentially serious error impacting signed messages. Do NOT forcefully resume operation of this validator. Keep it crashlooping or shut down until you receive support.".to_owned();
265
-
ifletErr(e) = self
266
-
.checkpoint_syncer
267
-
.write_reorg_status(&reorg_event)
268
-
.await
269
-
{
270
-
panic_message.push_str(&format!(
271
-
" Reorg troubleshooting details couldn't be written to checkpoint storage: {}",
272
-
e
273
-
));
274
-
}
275
-
panic!("{panic_message}");
273
+
correctness_checkpoint,
274
+
&checkpoint,
275
+
)
276
+
.await;
276
277
}
277
278
278
279
tracing::info!(
@@ -296,6 +297,95 @@ impl ValidatorSubmitter {
296
297
}
297
298
}
298
299
300
+
/// Verify checkpoint is valid
301
+
asyncfnverify_checkpoint(
302
+
&self,
303
+
tree:&IncrementalMerkle,
304
+
latest_checkpoint:&CheckpointAtBlock,
305
+
latest_seen_checkpoint:&CheckpointInfo,
306
+
){
307
+
// if checkpoint has an index greater than last seen, then it is valid
308
+
if latest_seen_checkpoint.checkpoint_index < latest_checkpoint.index{
309
+
return;
310
+
}
311
+
312
+
let block_height = match latest_checkpoint.block_height{
313
+
Some(s) => s,
314
+
None => return,
315
+
};
316
+
// if checkpoint has a block height greater than last seen, then it is valid
317
+
if latest_seen_checkpoint.block_height < block_height {
318
+
return;
319
+
}
320
+
321
+
// otherwise, a reorg occurred when checkpoint has a lower index
322
+
// but has the same or higher block height
323
+
tracing::error!(
324
+
?latest_checkpoint,
325
+
?latest_seen_checkpoint,
326
+
"Latest checkpoint index is lower than previously seen, but has a block height equal or greater.");
"Incorrect tree root. Most likely a reorg has occurred. Please reach out for help, this is a potentially serious error impacting signed messages. Do NOT forcefully resume operation of this validator. Keep it crashlooping or shut down until you receive support."
letmut panic_message = "Incorrect tree root. Most likely a reorg has occurred. Please reach out for help, this is a potentially serious error impacting signed messages. Do NOT forcefully resume operation of this validator. Keep it crashlooping or shut down until you receive support.".to_owned();
0 commit comments