Skip to content

Change fetch_ohttp_keys to timeout more quickly #968

@DanGould

Description

@DanGould

Which crate is this issue for?

payjoin-cli

Motivation

In Bull Bitcoin mobile when bootstrapping the default reqwest proxy function we ship times out after 60 seconds. Users see nothing happenings, so if the first relay is down the whole payjoin session might fail. The same behavior happens in payjoin-cli.

Possible solution

Consider timing out the proxy() request (or whichever is the first request) after ~5-10 seconds to try another relay instead for a more reliable user experience. This would require either a default timeout in our functions or adding the ability to specify a timeout in our io module as well as demonstrating the proper reference.

Alternatively, the OhttpKeys for directories may be cached to avoid fetching every time. Ensure current behavior uses OhttpKeys from directly from the Bitcoin URI (bip21) instead of fetching as well.

Useful Skills

  • Rust chops, including async
  • Familarity with HTTP CONNECT semantics

Guidance for new contributors

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apigood first issueDoes NOT mean "an LLM can do this." Please discuss the constraints and intended approach.payjoin-cli

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions