Return uint_8 instead of bool from all ckzg functions #353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think we might have finally found the root cause of all our windows rust issues.
Thanks to @michaelsproul for helping find this 馃檹
blst.h has this redefinition of bool
https://github.com/supranational/blst/blob/78fee18b25e16975e27b2d0314f6a323a23e6e83/bindings/blst.h#L27-L31
Because we import
blst.h
Inc-kzg-4844.h
,bool
in the c source code is redefined as anint
on windows. So in the c interface for allverify_*
functions,bool *ok
is in factint *ok
.When generating the rust bindings, bindgen made the stupid mistake of assuming that a bool in C would be a bool in rust. So on calling the underlying C function, rust allocates 1 byte for the bool type where C required 4. This is probably what was causing the undefined behaviour all this time.
Making this PR just to run CI on the issue. There's probably a better way of fixing this in C.
Running this with lighthouse on devnet 8. No crashes so far 馃帀