@@ -24,11 +24,11 @@ export async function syncTaggedLogs(
2424 capsuleDataProvider : CapsuleDataProvider ,
2525) : Promise < void > {
2626 // # Explanation of how the algorithm works
27- // When we perform the sync we will look at logs that correspond to the tagging index range (LI, ..., FI, ..., NI]
27+ // When we perform the sync we will look at logs that correspond to the tagging index range (LI, NI]
2828 //
2929 // LI is the highest index that was used in a tx that is included in a block at least 24 hours ago.
30- // FI is the highest index that was used in a tx that has been included in a finalized block.
31- // NI is the index that is WINDOW_LEN ahead of FI .
30+ // NI is the index that is WINDOW_LEN ahead of the highest index that was used in a tx that is included in
31+ // a finalized block .
3232 //
3333 // "(" denotes an open end of the range - the index is not included in the range.
3434 // "]" denotes a closed end of the range - the index is included in the range.
@@ -49,6 +49,12 @@ export async function syncTaggedLogs(
4949 //
5050 // Therefore, once we see that index I has been used in a block that is at least 24 hours old, we can safely stop
5151 // syncing logs for all indexes <= I and set LI = I.
52+ //
53+ // ## Explanation of NI
54+ //
55+ // When a sender chooses a tagging index, they will select an index that is at most WINDOW_LEN greater than
56+ // the highest finalized index. If that index was already used, they will throw an error. For this reason we have
57+ // don't have to look further than NI.
5258}
5359
5460async function storePendingTaggedLogs (
0 commit comments