@@ -308,6 +308,7 @@ impl Node {
308
308
"epoch" => %config. epoch
309
309
) ;
310
310
ctx. update_persistent_state ( |ps| ps. commits . insert ( config. epoch ) ) ;
311
+ return ;
311
312
}
312
313
313
314
// Do we have the configuration in our persistent state? If not save it.
@@ -347,6 +348,7 @@ impl Node {
347
348
"received_epoch" => %config. epoch
348
349
) ;
349
350
self . coordinator_state = None ;
351
+ // Intentionally fall through
350
352
} else if coordinating_epoch == config. epoch {
351
353
info ! (
352
354
self . log,
@@ -402,7 +404,8 @@ impl Node {
402
404
}
403
405
}
404
406
405
- // We either were collectiong shares for an old epoch or haven't started yet.
407
+ // We either were collectiong shares for an old epoch or haven't started
408
+ // yet.
406
409
self . key_share_computer =
407
410
Some ( KeyShareComputer :: new ( & self . log , ctx, config) ) ;
408
411
}
@@ -417,6 +420,18 @@ impl Node {
417
420
ctx. persistent_state ( ) . latest_committed_configuration ( )
418
421
{
419
422
if latest_committed_config. epoch > epoch {
423
+ if !latest_committed_config. members . contains_key ( & from) {
424
+ info ! (
425
+ self . log,
426
+ "Received a GetShare message from expunged node" ;
427
+ "from" => %from,
428
+ "latest_committed_epoch" =>
429
+ %latest_committed_config. epoch,
430
+ "requested_epoch" => %epoch
431
+ ) ;
432
+ // TODO: Send an expunged message
433
+ return ;
434
+ }
420
435
info ! (
421
436
self . log,
422
437
concat!(
@@ -435,6 +450,20 @@ impl Node {
435
450
}
436
451
}
437
452
453
+ // Do we have the configuration? Is the requesting peer a member?
454
+ if let Some ( config) = ctx. persistent_state ( ) . configuration ( epoch) {
455
+ if !config. members . contains_key ( & from) {
456
+ info ! (
457
+ self . log,
458
+ "Received a GetShare message from expunged node" ;
459
+ "from" => %from,
460
+ "epoch" => %epoch
461
+ ) ;
462
+ // TODO: Send an expunged message
463
+ return ;
464
+ }
465
+ }
466
+
438
467
// If we have the share for the requested epoch, we always return it. We
439
468
// know that it is at least as new as the last committed epoch. We might
440
469
// not have learned about the configuration being committed yet, but
0 commit comments