Skip to content

Fetch certs in parallel#255

Merged
Threated merged 2 commits intodevelopfrom
push-zxrqmlkznrmp
Mar 30, 2026
Merged

Fetch certs in parallel#255
Threated merged 2 commits intodevelopfrom
push-zxrqmlkznrmp

Conversation

@Threated
Copy link
Copy Markdown
Member

@Threated Threated commented Mar 30, 2026

This should improve startup times significantly. In the future I think it would make sense to not fetch all certificates of the beam network at startup but only ever the ones that are needed for sending or receiving a message. This would come at some minor latency cost when the cache is cold but that seems like a good tradeoff.

Copy link
Copy Markdown
Member

@TKussel TKussel left a comment

Choose a reason for hiding this comment

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

I'm not sure I agree with the startup time -- first invocation time trade-off assessment. Let's discuss this further.

let mut new_count = 0;
//TODO Check for validity
for serial in new_certificate_serials {
let cert_getter = CERT_GETTER.get().unwrap();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this hold an exclusive lock? If yes, please introduce an additional scope. If not, all good.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It just gets a shared ref from the OnceCell which should be set at this point. No mutex involved as all methods on dyn GetCerts only need a shared ref.

@Threated Threated merged commit 5008108 into develop Mar 30, 2026
40 of 42 checks passed
@Threated Threated deleted the push-zxrqmlkznrmp branch March 30, 2026 12:00
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.

2 participants