Skip to content
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

Re-enable signature health checks with a faster library #1820

Merged
merged 3 commits into from
Apr 1, 2019

Conversation

mythmon
Copy link
Contributor

@mythmon mythmon commented Mar 28, 2019

As a reminder, we disabled these checks because they were too slow. The library we were using to validate signatures is a pure Python library, and is not focused on speed. I added a new library that is more focused on speed, though it includes C dependencies, which might make our life harder.

The new library is significantly less friendly, as well. I had to jump through some more hoops to actually use it, and I actually still use the slow library to decode the signature into the format expected by the new one. I think that's probably fine for now, but I could work on removing it entirely if it's important.

To test the speed increase, I created 100 signed recipes, re-enabled the test, and timed the signature verification check before and after this change.

Before:

Checked signatures for 100 recipes in 0:00:20.166276 (4.96 checks/second)

After:

Checked signatures for 100 recipes in 0:00:00.913976 (109 checks/second)

I think an almost 22x speed up should make it ok to re-enable these checks. 😄

I haven't tested the Docker build yet. Given that the new library has a C component, I suspect it might fail to install on some systems. On my laptop, I had to install gmp-devel to build the library. I expect CI will catch this issue though, so I'm not worried.

@mythmon mythmon requested a review from rehandalal March 28, 2019 23:36
@mythmon
Copy link
Contributor Author

mythmon commented Mar 28, 2019

CC @milescrabill @jvehent @sunahsuh

@rehandalal
Copy link
Contributor

I expect CI will catch this issue though, so I'm not worried.

Yup!

@mythmon
Copy link
Contributor Author

mythmon commented Mar 29, 2019

It seems like these CI failures are from the tests introduced in #1804. I'm not really sure why I'm only seeing it here though. I'm going to try and isolate that problem.

@mythmon
Copy link
Contributor Author

mythmon commented Mar 29, 2019

@rehandalal I think this would work now, if you want to review it.

Copy link
Contributor

@rehandalal rehandalal left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot added a commit that referenced this pull request Apr 1, 2019
1820: Re-enable signature health checks with a faster library r=rehandalal a=mythmon

As a reminder, we disabled these checks because they were too slow. The [library](https://pypi.org/project/ecdsa/) we were using to validate signatures is a pure Python library, and is not focused on speed. I added [a new library](https://pypi.org/project/fastecdsa/) that is more focused on speed, though it includes C dependencies, which might make our life harder.

The new library is significantly less friendly, as well. I had to jump through some more hoops to actually use it, and I actually still use the slow library to decode the signature into the format expected by the new one. I think that's probably fine for now, but I could work on removing it entirely if it's important.

To test the speed increase, I created 100 signed recipes, re-enabled the test, and timed the signature verification check before and after this change.

Before:

```
Checked signatures for 100 recipes in 0:00:20.166276 (4.96 checks/second)
```

After:

```
Checked signatures for 100 recipes in 0:00:00.913976 (109 checks/second)
```

I think an almost 22x speed up should make it ok to re-enable these checks. :smile: 	

I haven't tested the Docker build yet. Given that the new library has a C component, I suspect it might fail to install on some systems. On my laptop, I had to install `gmp-devel` to build the library. I expect CI will catch this issue though, so I'm not worried.

Co-authored-by: Mike Cooper <mythmon@gmail.com>
Co-authored-by: Michael Cooper <mythmon@gmail.com>
@bors
Copy link
Contributor

bors bot commented Apr 1, 2019

Build succeeded

@bors bors bot merged commit c0776b8 into mozilla:master Apr 1, 2019
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