Force go bindings to use portable blst#292
Conversation
|
Isn't the portable version of blst slower than the normal one? Are we okay with that? |
For systems that support optimized instructions, yes.
I'm not sure. Something we should all discuss. From a reputation perspective, it may be better to have a slower library that supports everything than a faster library that doesn't support older CPUs and causes headaches for client devs. |
|
For documentation purpose, we compile |
|
For clarification, is |
| #include <stdint.h> | ||
| #include <stdio.h> | ||
|
|
||
| /* |
There was a problem hiding this comment.
Can you mark it as a TODO so that we don't forget it later?
haxxpop
left a comment
There was a problem hiding this comment.
LGTM after all. Mark it as approved for now just in case you want to merge it ASAP.
Unfortunately, it is required in the |
|
Thanks for the review @ppopth 😄 I'm going to mark this is a draft so it doesn't get merged. This is only a potential solution and has drawbacks. I'd like to discuss it with the team for a while before merging. Also, it will require another PR that converts blst to a subtree (or something like that). |
|
Closing. I don't think this is necessary anymore. |
This PR changes how blst is built and forces it to always use the portable version. Because we use the
supranational/blstGo package, which is compiled before the C-KZG Go bindings, we are unable to force it to be portable from within the bindings. Right now, the only way to do this is with an environment variable (CGO_CFLAGS).supranational/blstas an import/dependency.blst.Sfile which includesassembly.Sfrom blst so that it's assembled via CGO.main.go.header.hfile that defines types & everything.main.gofile but this is cleaner IMO.blst.hinc_kzg_4844.hif it's the Go bindings.server.c, this would cause problems.blst_headerssince we don't need them anymore.Additionally, we would need to convert the
blstsubmodule to a subtree, meaning that all ofblstsource files will become tracked files in this repo. Not really a fan of this idea, but it would be necessary. When theethereum/c-kzg-4844package is imported withgo getit does not do a recursive clone, so none of the blst source files would be available. If we decide to go down this route, we should do this in a separate PR.