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

CHIA-595: bump chia_rs to 0.8.0 and update G1Element handling #18037

Merged
merged 2 commits into from
May 21, 2024

Conversation

arvidn
Copy link
Contributor

@arvidn arvidn commented May 17, 2024

Purpose:

bump the chia_rs dependency to use the latest version.

The new version returns G1Elements in Spend and SpendBundleConditions as parameters to the AGG_SIG_* conditions. This has two consequences in chia-blockchain:

  1. We no longer need to convert the bytes48 objects into G1Elements when we get them back from block validation.
  2. The public keys are now more strictly validated on the rust side. Converting 48 bytes into a G1Element (public key) may fail, if the bytes are not a valid serialization of a valid key.

So, some tests that used garbage bytes in place of a public key had to be updated to use valid keys.

Also, the BLS cache no longer needs to take the keys in byte-form, but can take them as G1Elements directly.

Current Behavior:

The BLS cache takes keys as plain bytes.
The KeyTool (test utility) uses serialized public keys as index.
The pkm_pairs() function returns public keys as bytes48.

New Behavior:

The BLS cache takes keys as G1Elements
The KeyTool uses G1Element as index.
The pkm_pairs() function returns public keys as G1Element.

@arvidn arvidn added the Changed Required label for PR that categorizes merge commit message as "Changed" for changelog label May 17, 2024
@arvidn arvidn closed this May 17, 2024
@arvidn arvidn reopened this May 17, 2024
@arvidn arvidn marked this pull request as ready for review May 17, 2024 15:18
@arvidn arvidn requested a review from a team as a code owner May 17, 2024 15:18
@arvidn arvidn requested a review from matt-o-how May 17, 2024 15:18
matt-o-how
matt-o-how previously approved these changes May 20, 2024
Copy link
Contributor

File Coverage Missing Lines
chia/_tests/util/key_tool.py 80.0% lines 25
Total Missing Coverage
132 lines Unknown 99%

@cmmarslender cmmarslender merged commit a4c1143 into main May 21, 2024
359 of 360 checks passed
@cmmarslender cmmarslender deleted the chia-rs-0.8.0 branch May 21, 2024 18:42
@arvidn arvidn changed the title bump chia_rs to 0.8.0 and update G1Element handling CHIA-595: bump chia_rs to 0.8.0 and update G1Element handling May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changed Required label for PR that categorizes merge commit message as "Changed" for changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants