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

Change validator key to BLS12-381 #103

Merged
merged 8 commits into from
Apr 25, 2024
Merged

Change validator key to BLS12-381 #103

merged 8 commits into from
Apr 25, 2024

Conversation

brunoffranca
Copy link
Member

What ❔

Changes the validator keys to use the BLS12-381 curve.

Why ❔

Now that we decided to separate validator and attester keys, we can use a more efficient curve for the validator keys.

@dnkolegov
Copy link
Contributor

@brunoffranca, does that mean that the bn254 curve will not be used at all?

@brunoffranca
Copy link
Member Author

It will be used to sign L1 batches. L2 blocks and all consensus messages will use BLS12-381.
After EIP-2537 gets merged, everything will use BLS12-381.

@brunoffranca brunoffranca marked this pull request as ready for review April 25, 2024 00:45
@brunoffranca brunoffranca self-assigned this Apr 25, 2024
@brunoffranca
Copy link
Member Author

brunoffranca commented Apr 25, 2024

@pompon0 I added two more commits removing MsgHash. Signature schemes already hash the message internally, it doesn't make sense to be hashing twice. See if you approve.

@pompon0
Copy link
Contributor

pompon0 commented Apr 25, 2024

@brunoffranca the point of having MsgHash was to avoid passing the whole message from place to place, and to avoid cloning as the messages can get quite large. I agree that so far we have underutilized those optimizations, but I can already see that you had to add a couple of extra clones in this PR already.

@brunoffranca
Copy link
Member Author

brunoffranca commented Apr 25, 2024

the point of having MsgHash was to avoid passing the whole message from place to place, and to avoid cloning

@pompon0 Do you believe that this extra cloning does make a performance difference? And that we will actually start utilizing this MsgHash construct more in the future? If yes, I can remove these two commits.

@pompon0
Copy link
Contributor

pompon0 commented Apr 25, 2024

Do you believe that this extra cloning does make a performance difference? And that we will actually start utilizing this MsgHash construct more in the future? If yes, I can remove these two commits.

It is hard for me to tell. We can reintroduce it later, once there is a need to do some serious profiling. Just please avoid introducing Clone requirements in generic functions.

Copy link
Contributor

@pompon0 pompon0 left a comment

Choose a reason for hiding this comment

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

added some comments

@pompon0
Copy link
Contributor

pompon0 commented Apr 25, 2024

also FYI, if we reintroduce it later it will be a breaking change to the protocol.

@brunoffranca
Copy link
Member Author

Ok, like I always say, tie break goes to the reviewer. So I'll remove these two commits.

@brunoffranca brunoffranca merged commit 5165fcd into main Apr 25, 2024
5 checks passed
@brunoffranca brunoffranca deleted the bf-change-keys branch April 25, 2024 23:40
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