Skip to content

Commit 4db2da2

Browse files
Remove sequence state clearing on block rewind
1 parent 718f407 commit 4db2da2

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

src/ingester/fetchers/poller.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,11 @@ pub fn get_block_poller_stream(
7272
log::error!("Rewinding block stream to {}: {}", to_slot, reason);
7373
// Clear cached blocks
7474
block_cache.clear();
75-
// Clear sequence state to re-learn from rewound point
76-
crate::ingester::gap::clear_sequence_state();
7775
// Reset positions
7876
last_indexed_slot = to_slot - 1;
7977
current_start_slot = to_slot;
8078
rewind_occurred = true;
81-
log::info!("Cleared cache and sequence state, restarting from slot {}", current_start_slot);
79+
log::info!("Cleared cache, restarting from slot {}", current_start_slot);
8280
break;
8381
}
8482
}

src/ingester/gap/sequences.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,19 @@ impl StateUpdateSequences {
119119
}
120120
}
121121

122-
// Extract out_account leaf indexes
122+
// Extract out_account sequences
123123
for account_with_context in &state_update.out_accounts {
124124
let tree_pubkey = account_with_context.account.tree.0;
125-
let leaf_index = account_with_context.account.leaf_index.0;
126-
self.out_account_leaf_indexes
127-
.entry(tree_pubkey)
128-
.or_insert_with(Vec::new)
129-
.push(SequenceEntry {
130-
sequence: leaf_index,
131-
slot,
132-
signature: signature.to_string(),
133-
});
125+
if let Some(seq_value) = account_with_context.account.seq {
126+
self.out_account_leaf_indexes
127+
.entry(tree_pubkey)
128+
.or_insert_with(Vec::new)
129+
.push(SequenceEntry {
130+
sequence: seq_value.0,
131+
slot,
132+
signature: signature.to_string(),
133+
});
134+
}
134135
}
135136
}
136137

0 commit comments

Comments
 (0)