Skip to content
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

Impossible to build due to type error in crypto/kzg4844 #29271

Closed
OkudenCyrilDever opened this issue Mar 15, 2024 · 9 comments
Closed

Impossible to build due to type error in crypto/kzg4844 #29271

OkudenCyrilDever opened this issue Mar 15, 2024 · 9 comments
Labels

Comments

@OkudenCyrilDever
Copy link

System information

Geth version: v1.13.14
OS & Version: OSX

Expected behaviour

Build normally from command line or Docker build.

Actual behaviour

Returns 4 errors such cannot use (gokzg4844.Blob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.BlobToKZGCommitment and fails.

Steps to reproduce the behaviour

go build using any library with go-ethereum@v1.13.14 latest dependency

Backtrace

# github.com/ethereum/go-ethereum/crypto/kzg4844
../../../../../go/pkg/mod/github.com/ethereum/go-ethereum@v1.13.14/crypto/kzg4844/kzg4844_gokzg.go:52:49: cannot use (gokzg4844.Blob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.BlobToKZGCommitment
../../../../../go/pkg/mod/github.com/ethereum/go-ethereum@v1.13.14/crypto/kzg4844/kzg4844_gokzg.go:64:47: cannot use (gokzg4844.Blob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.ComputeKZGProof
../../../../../go/pkg/mod/github.com/ethereum/go-ethereum@v1.13.14/crypto/kzg4844/kzg4844_gokzg.go:86:44: cannot use (gokzg4844.Blob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.ComputeBlobKZGProof
../../../../../go/pkg/mod/github.com/ethereum/go-ethereum@v1.13.14/crypto/kzg4844/kzg4844_gokzg.go:97:36: cannot use (gokzg4844.Blob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.VerifyBlobKZGProof
@cyrildever
Copy link

This is quite urgent because I'm stuck because of this error that didn't appear yesterday.

@namiloh
Copy link

namiloh commented Mar 15, 2024

Are you using latest by commit or v1.13.14?
Show relevant part of your go.mod please

@OkudenCyrilDever
Copy link
Author

With regard to go-ethereum, this is the go.mod:

github.com/ethereum/go-ethereum v1.13.14 // indirect

And this is the go.sum:

github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA=
github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0=
github.com/ethereum/go-ethereum v1.10.26/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/ethereum/go-ethereum v1.13.2/go.mod h1:gkQ5Ygi64ZBh9M/4iXY1R8WqoNCx1Ey0CkYn2BD4/fw=
github.com/ethereum/go-ethereum v1.13.5/go.mod h1:yMTu38GSuyxaYzQMViqNmQ1s3cE84abZexQmTgenWk0=
github.com/ethereum/go-ethereum v1.13.11/go.mod h1:gFtlVORuUcT+UUIcJ/veCNjkuOSujCi338uSHJrYAew=
github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ=
github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=

@OkudenCyrilDever
Copy link
Author

And my local Go client on my machine is 1.22.1 and when I'm building with Docker I use the golang:latest image.

@namiloh
Copy link

namiloh commented Mar 15, 2024

I think you need to either

  • use the latest geth, so upgrade the dependency to be by hash
  • or downgrade the c-kzg dependency, to 0.4.0 again.

Upgrading geth might be tricky, if it is an indirect dependency. Mind sharing more details about the project?

@OkudenCyrilDever
Copy link
Author

I'm actually using a cascade of custom libraries that starts using go-ethereum for its crypto features. One of the sub-project is helping redact documents with a custom Feistel cipher implementation. The project I use was working perfectly well yesterday night, and I didn't do anything but building it this morning to run a Docker instance. Hence my surprise...
Could you elaborate on which hash I should use / what should I put in my upper lib in this cascade of libraries? I have no trouble updating them all if need be, but as it's time-consuming I wouldn't want to make it before I'm sure it works.

By the way, the use of the 0.4.0 version in c-kzg seems to be the thing, because my original library is indeed using. What I don't understand is why the v1.0.0 appears downstream?

@holiman
Copy link
Contributor

holiman commented Mar 15, 2024

go-ethereum after commit d5bacfa, which merged #29050 uses c-kzg 1.0.0. This is a breaking change.

As for why you suddenly started using 1.0.0, I have no idea. The dependency ought to remain on 0.4.0. Unless some other dependency pulls in 1.0.0. I'm not sure.

@OkudenCyrilDever
Copy link
Author

I've checked all my dependencies and, as I couldn't figure out why 1.0.0 was popping up in my downstream lib, I totally rebuilt it step-by-step, making sure the 0.4.0 stays. It worked out well, so my problem is solved. Nonetheless, the errors I got remains a bit worrying to me in the eventuality I'd want to move go-ethereum version up.
Thanks to you all for your precious help.

@namiloh
Copy link

namiloh commented Mar 15, 2024

Next release will be 1.14.0, it will use c-kzg 1.0.0 and should be no problem with the dependencies.

"should" :)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants