Skip to content

Conversation

@tankyleo
Copy link
Contributor

As Matt notes in #56, fetch_jwt_token may be called on startup/wallet init and may be in the critical path for the first wallet UI paint, so its incredibly latency-sensitive.

As Matt notes in lightningdevkit#56,
`fetch_jwt_token` may be called on startup/wallet init and may be in
the critical path for the first wallet UI paint, so its incredibly
latency-sensitive.
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 30, 2026

👋 Thanks for assigning @tnull as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

let lnurl_request = bitreq::get(&self.url)
.with_headers(self.default_headers.clone())
.with_timeout(DEFAULT_TIMEOUT_SECS)
.with_max_body_size(Some(MAX_RESPONSE_BODY_SIZE));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we consider it that latency critical, we probably want to enable piplining for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitate mostly because the server might only want to issue a single JWT token over the course of say 24 hours for a particular public key. Is that reasonable ? So in the second round, the server might refuse to return the JWT on the second try.

There is also the fact that we could get different k1's back from the first call, so not quite idempotent, but this may be ok here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't matter because we have to wait for the first response before we can send the second request, so either way its serial.

@tankyleo tankyleo requested a review from tnull February 2, 2026 01:58
@tnull tnull merged commit ad63805 into lightningdevkit:main Feb 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants