You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Mac builds in CI have been failing tests and after debugging we are getting a segmentation fault when we try to memcpy the CRS.
The function that calls the memcpy barretenberg::srs::IO<curve::BN254>::read_affine_elements_from_buffer( points.data(), (char*)data.data(), num_points * 64); assumes that data.size() is more than num_points * 64.
This should be the case if we enter the if branch size >= num_points. However, the size parameter is saved independently of the number of points that are downloaded. This means that its possible to have a size parameter of 10Million, but only download 5 million points, due to a bad internet connection or if we want a CRS size which is larger than the number of points stored in transcript00.dat.
Solution
Short term: we can use the minimum of data.size() and num_points * 64.
Long term: There is another bug in this, if we want CRS's of large sizes then this will only ever download the first transcript, so ideally we figure out how many points each transcript holds, we then check the max circuit size and download as many transcripts as needed.
The text was updated successfully, but these errors were encountered:
Will push a PR for the short term fix so that it unblocks donwstream and then push another fix to download the transcript properly and ensure that size is equal to the .dat file that gets downloaded
#1862)
related to #1861
# Checklist:
Remove the checklist to signal you've completed it. Enable auto-merge if
the PR is ready to merge.
- [ ] If the pull request requires a cryptography review (e.g.
cryptographic algorithm implementations) I have added the 'crypto' tag.
- [ ] I have reviewed my diff in github, line by line and removed
unexpected formatting changes, testing logs, or commented-out code.
- [ ] Every change is related to the PR description.
- [ ] I have
[linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
this pull request to relevant issues (if any exist).
Problem
Our Mac builds in CI have been failing tests and after debugging we are getting a segmentation fault when we try to memcpy the CRS.
The function that calls the memcpy
barretenberg::srs::IO<curve::BN254>::read_affine_elements_from_buffer( points.data(), (char*)data.data(), num_points * 64);
assumes thatdata.size()
is more thannum_points * 64
.This should be the case if we enter the if branch
size >= num_points
. However, the size parameter is saved independently of the number of points that are downloaded. This means that its possible to have a size parameter of 10Million, but only download 5 million points, due to a bad internet connection or if we want a CRS size which is larger than the number of points stored in transcript00.dat.Solution
Short term: we can use the minimum of data.size() and num_points * 64.
Long term: There is another bug in this, if we want CRS's of large sizes then this will only ever download the first transcript, so ideally we figure out how many points each transcript holds, we then check the max circuit size and download as many transcripts as needed.
The text was updated successfully, but these errors were encountered: