-
Notifications
You must be signed in to change notification settings - Fork 185
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
bindings/go: make it work with upcoming go1.24. #247
Conversation
In an unexpected turn of events go1.24 reclassified import "C" non-local, which rendered C.blst_* type aliases defunct. The only working solution appears to be to wrap them into structs. Since all the C.blst_* types were opaque, the wrapping shouldn't affect applications. In the sense that the shell struct won't obstruct anything, because nothing was visible.
Thanks for the quick turnaround @dot-asm. I can confirm that with this change, I am able to successfully build my project using the blst Go bindings, whether I am still using go1.23, go1.24rc1, or with Go tip. |
This uses the supranational/blst package for an implementation of BLS signatures. We use the minimized signature form, hence the package name. The package includes a BLS-backed gcrypto.PubKey implementation and a CommonMessageSignatureProof implementation. There are likely some missing details in the BLS setup, at least in adding configurability for the signatures' salt. I think the domain separation tag is correct. I cannot find the whitepaper or technical document that introduced me to the concept, but the model of arranging the validators in a tree for key and signature aggregation is based on the concept that the leftmost validators are trustworthy and likely to be online, while the rightmost validators are the least expected to vote. See further documentation on the SignatureProof type. It has not been fully integrated yet, but we have tests around the usage of both of those types. Next up are some slight interface changes that will affect the ed25519 implementation too. And I think we may need some special handling such that the signature committed to chain is a "final aggregation" of keys that would not normally be aggregated together. For instance, if there are only four validators, then during consensus gossip, we would pair 0-1 and 2-3, but never 0-2 or 1-3. If the final votes were only from 0, 1, and 3 -- that is to say validator 2 was absent or perhaps voted nil -- then we would commit with the aggregated signaure 0-1-3, to minimize space used for signatures. This also removes the gmerkle package, which was left in for specifically this use case, but which turned out to be an incorrect fit. Note that with the introduction of this package, we have a dependency on supranational/blst, which is a C dependency; and there is currently the outstanding issue supranational/blst#245 which prevents building blst with Go 1.24. However, supranational/blst#247 is an open PR that fixes the build for Go 1.24 and Go tip.
It would be great to get this PR in as soon as possible, since our builds over at go-ethereum are currently borked by this |
This is also blocking Prysm upgrading to go 1.24 |
Just yesterday I tried to find the release date, but all schedule pages I viewed said "1.24rc3 is available" with no mention of the schedule for the final release :-( Maybe my browsing skills are inadequate... This is merged, a release will be cut shortly. |
1.24 was released today: https://go.dev/doc/go1.24 |
+1 here. our builds are still borked on 1.24 EDIT: ok release was cut. |
In an unexpected turn of events go1.24 reclassified import "C" non-local, which rendered C.blst_* type aliases defunct. The only working solution appears to be to wrap them into structs. Since all the C.blst_* types were opaque, the wrapping shouldn't affect applications. In the sense that the shell struct won't obstruct anything, because nothing was visible.