Skip to content

Commit

Permalink
Limit archiving a bit more. Add explanatory comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
moodyjon committed Dec 9, 2023
1 parent 9c9a10d commit b7b4fb9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion rust/protocol/fuzz/fuzz_targets/interaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,15 @@ fuzz_target!(|data: (u64, &[u8])| {
};
match action >> 1 {
0 => {
if me.archive_count + them.archive_count < 40 {
let mut estimated_prev_states = 0;
// The set of previous session states grows in two ways:
// 1) The current session state of "me" is archived explicitly.
estimated_prev_states += me.archive_count;
// 2) A pre-key message is received from "them" and displaces the
// current session state. They may send one pre-key message initially.
// Additional pre-key messages from "them" follow explicit archiving.
estimated_prev_states += 1 + them.archive_count;
if estimated_prev_states < 40 {
// Only archive if it can't result in old sessions getting expired.
// We're not testing that.
me.archive_session(&them.address).await
Expand Down

0 comments on commit b7b4fb9

Please sign in to comment.