Skip to content

Commit 8232fed

Browse files
committed
fix: handle zero dencun fork slot
1 parent c46ef73 commit 8232fed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/indexer/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,15 @@ impl Indexer {
142142
}
143143

144144
let historical_sync_completed =
145-
matches!(current_lower_block_id, BlockId::Slot(slot) if slot < self.dencun_fork_slot);
145+
matches!(current_lower_block_id, BlockId::Slot(slot) if slot <= self.dencun_fork_slot);
146146

147147
if !self.disable_sync_historical && !historical_sync_completed {
148-
let historical_sync_final_block_id =
149-
end_block_id.unwrap_or(BlockId::Slot(self.dencun_fork_slot - 1));
148+
let target_slot = if self.dencun_fork_slot == 0 {
149+
self.dencun_fork_slot
150+
} else {
151+
self.dencun_fork_slot - 1
152+
};
153+
let historical_sync_final_block_id = end_block_id.unwrap_or(BlockId::Slot(target_slot));
150154

151155
self.start_historical_indexing_task(
152156
tx1,

0 commit comments

Comments
 (0)