Skip to content

Introduce timing information on verification + add component tests #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2025

Conversation

AkshatM
Copy link
Contributor

@AkshatM AkshatM commented May 28, 2025

Users attempting to profile the time it takes to verify currently
need to measure both time to generating a signature base, as well
as time to actually perform message verification using the underlying algorithm.

This change augments the return signature of `verify()` to return
benchmarks of both operations, so that drill-down views into overhead are possible.

I've also revisited some of the `component` library changes to add a
more expansive suite of tests. The tests revealed a few typos scattered
here and there that led to invalid semantics, as well as validated the
`sfv` library as correctly handling duplicate parameters.

@thibmeu thibmeu self-requested a review May 28, 2025 20:01
Copy link
Collaborator

@thibmeu thibmeu left a comment

Choose a reason for hiding this comment

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

Overall ok.
Can you add a description to the PR as well with a bit more details.

I'd be great to have tests as well.

@@ -589,7 +599,9 @@ impl MessageVerifier {
.and_then(|key| keyring.get(key)),
})
.ok_or(ImplementationError::NoSuchKey)?;
let generation = Instant::now();
Copy link
Collaborator

Choose a reason for hiding this comment

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

i recall instant::now() not working well with wasm32. Did you test? Might be a test target we add so Cloudflare workers are supported

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 added a build target for wasm32 in GitHub Actions, I would need to install a test runner for WASM to actually run the tests themselves. I think this should be sufficient?

@AkshatM AkshatM marked this pull request as draft May 28, 2025 20:24
@AkshatM AkshatM force-pushed the main branch 4 times, most recently from 69b8bb2 to 6033f52 Compare May 30, 2025 15:49
@AkshatM AkshatM changed the title Introduce timing information on verification Introduce timing information on verification + add component tests May 30, 2025
Users attempting to profile the time it takes to verify currently
need to measure both time to generating a signature base, as well
as time to actually perform message verification using the underlying algorithm.

This change augments the return signature of `verify()` to return
benchmarks of both operations, so that drill-down views into overhead are possible.

I've also revisited some of the `component` library changes to add a
more expansive suite of tests. The tests revealed a few typos scattered
here and there that led to invalid semantics, as well as validated the
`sfv` library as correctly handling duplicate parameters.
@AkshatM
Copy link
Contributor Author

AkshatM commented May 30, 2025

Overall ok. Can you add a description to the PR as well with a bit more details.

Description added. I also included a new patch to fix some typos in the core code.

I'd be great to have tests as well.

Tests added!

@AkshatM AkshatM marked this pull request as ready for review May 30, 2025 16:16
Copy link
Contributor

@armfazh armfazh left a comment

Choose a reason for hiding this comment

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

lgtm, the comment below can be solved later.

@AkshatM AkshatM merged commit 73ec4ca into cloudflare:main May 30, 2025
2 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.

3 participants