Open subnix opened 4 months ago
CGO and especially go-ethereum/crypto/secp256k1 adds significant overhead to build time/size. Also it doesn't allow us to build on some platforms at all. go-ethereum has a cgo-safe wrapper for secp256k1.RecoverPubkey - crypto.Ecrecover. So we can use it to fix the problem. https://github.com/ethereum/go-ethereum/blob/6bb13e8e2be3aa8c41460eb11837baba514e19be/crypto/signature_cgo.go#L31-L34 https://github.com/ethereum/go-ethereum/blob/6bb13e8e2be3aa8c41460eb11837baba514e19be/crypto/signature_nocgo.go#L32-L40
go-ethereum/crypto/secp256k1
secp256k1.RecoverPubkey
crypto.Ecrecover
Fixes #111, Fixes #125, Fixes #103
P.S. Looks like it should resolve windows building issues, but I can't check it.
@fbsobreira could you take a look, please? It's a really small change that will significantly improve building and portability.
look good for me
CGO and especially
go-ethereum/crypto/secp256k1
adds significant overhead to build time/size. Also it doesn't allow us to build on some platforms at all. go-ethereum has a cgo-safe wrapper forsecp256k1.RecoverPubkey
-crypto.Ecrecover
. So we can use it to fix the problem. https://github.com/ethereum/go-ethereum/blob/6bb13e8e2be3aa8c41460eb11837baba514e19be/crypto/signature_cgo.go#L31-L34 https://github.com/ethereum/go-ethereum/blob/6bb13e8e2be3aa8c41460eb11837baba514e19be/crypto/signature_nocgo.go#L32-L40Fixes #111, Fixes #125, Fixes #103
P.S. Looks like it should resolve windows building issues, but I can't check it.