Skip to content

Commit a71800d

Browse files
authored
log: add some additional logging in cert pool / local-cluster (#348)
1 parent f1d22e5 commit a71800d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

local-cluster/tests/local_cluster.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7073,7 +7073,7 @@ fn test_alpenglow_ensure_liveness_after_intertwined_notar_and_skip_fallbacks() {
70737073
/// - Node A (40% - ε stake) is taken offline, representing combined Byzantine and offline stake
70747074
/// - This leaves Node B (30% + ε) and Node C (30%) as the active validators
70757075
/// - Despite the significant offline stake, the remaining nodes can still achieve consensus
7076-
/// - Network continues to fast finalize blocks with the remaining 60% + ε stake
7076+
/// - Network continues to slow finalize blocks with the remaining 60% + ε stake
70777077
///
70787078
/// ## Phase 2: Network Partition Triggers NotarizeFallback
70797079
/// - Node C's turbine is disabled at slot 20, causing it to miss incoming blocks
@@ -7186,6 +7186,7 @@ fn test_alpenglow_ensure_liveness_after_second_notar_fallback_condition() {
71867186

71877187
// Phase 1: Take Node A offline to simulate Byzantine + offline stake
71887188
// This represents 40% - ε of total stake going offline
7189+
info!("Phase 1: Exiting Node A");
71897190
cluster.exit_node(&validator_keys[0].pubkey());
71907191

71917192
// Vote listener state management

votor/src/certificate_pool.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl From<AlpenglowCommitmentError> for AddVoteError {
8989

9090
#[derive(Default)]
9191
pub struct CertificatePool {
92+
my_pubkey: Pubkey,
9293
// Vote pools to do bean counting for votes.
9394
vote_pools: BTreeMap<PoolId, VotePoolType>,
9495
/// Completed certificates
@@ -131,6 +132,7 @@ impl CertificatePool {
131132
let parent_ready_tracker = ParentReadyTracker::new(my_pubkey, root_block);
132133

133134
let mut pool = Self {
135+
my_pubkey,
134136
vote_pools: BTreeMap::new(),
135137
completed_certificates: BTreeMap::new(),
136138
highest_notarized_fallback: None,
@@ -322,6 +324,7 @@ impl CertificatePool {
322324
cert: Arc<CertificateMessage>,
323325
events: &mut Vec<VotorEvent>,
324326
) {
327+
trace!("{}: Inserting certificate {:?}", self.my_pubkey, cert_id);
325328
self.completed_certificates.insert(cert_id, cert);
326329
match cert_id {
327330
Certificate::NotarizeFallback(slot, block_id) => {
@@ -686,6 +689,7 @@ impl CertificatePool {
686689
/// This avoids the need to recreate the entire certificate pool since it's
687690
/// not distinguished by the pubkey.
688691
pub fn update_pubkey(&mut self, new_pubkey: Pubkey) {
692+
self.my_pubkey = new_pubkey;
689693
self.parent_ready_tracker.update_pubkey(new_pubkey);
690694
}
691695

@@ -696,8 +700,9 @@ impl CertificatePool {
696700
pub fn get_certs_for_standstill(&self) -> Vec<Arc<CertificateMessage>> {
697701
self.completed_certificates
698702
.iter()
699-
.filter_map(|(_, cert)| {
703+
.filter_map(|(cert_id, cert)| {
700704
if Some(cert.certificate.slot()) >= self.highest_finalized_with_notarize {
705+
trace!("{}: Refreshing certificate {:?}", self.my_pubkey, cert_id);
701706
Some(cert.clone())
702707
} else {
703708
None

0 commit comments

Comments
 (0)