Skip to content

Commit

Permalink
Don't pause between long polls (#436)
Browse files Browse the repository at this point in the history
For 1. simplicity of implementation, 2. consistency, and 3. UX responsiveness don't
pause between long polls.

This actually has negligible effect on privacy compared to what the change commit
suggests as Yuval Kogman <[email protected]> comments:

> For a given subdirectory ID, the amount of time in between requests that
> the directory sees before this change was 5 seconds + R_i, where R is the
> round trip latency to the relay and i indexes { Alice, Bob or Carol }.

> The directory will is able to measure R_i indirectly before this change, and
> almost directly after it, thereby potentially identifying who is the receiver and
> who is the sender, since those roles are distinguishable based on the latency
> patterns of a pair of potentially related (i.e. temporally close but satisfying
> the ordering constraints of the BIP 77 messaging patterns). In other words
> R_i is potentially identifying metadata that leaks for each subdirectory, and
> by correlating different subdirectories (for which differences in this noisy
> measurement are helpful), the directory could still heuristically identify the
> parties involved, or at least learn some information or constraints about them
> with the same difficulty both before and after this change.  In other words
> R_i is potentially identifying metadata that leaks for each subdirectory, and
> by correlating different subdirectories (for which differences in this noisy
> measurement are helpful), the directory could still heuristically identify the
> parties involved, or at least learn some information or constraints about them
> with the same difficulty both before and after this change.
  • Loading branch information
DanGould authored Dec 11, 2024
2 parents f5ca610 + 6bf3ee1 commit 0891a5b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions payjoin-cli/src/app/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ impl App {
Ok(Some(psbt)) => return Ok(psbt),
Ok(None) => {
println!("No response yet.");
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
}
Err(re) => {
println!("{}", re);
Expand Down Expand Up @@ -245,9 +244,8 @@ impl App {
.process_res(ohttp_response.bytes().await?.to_vec().as_slice(), context)
.map_err(|_| anyhow!("GET fallback failed"))?;
log::debug!("got response");
match proposal {
Some(proposal) => break Ok(proposal),
None => std::thread::sleep(std::time::Duration::from_secs(5)),
if let Some(proposal) = proposal {
break Ok(proposal);
}
}
}
Expand Down

0 comments on commit 0891a5b

Please sign in to comment.