ethereum-optimism / op-geth

GNU Lesser General Public License v3.0
255 stars 654 forks source link

Update outdated packages in `go.mod` to resolve conflicts in external packages using `go-ethereum` #340

Open rtunazzz opened 1 week ago

rtunazzz commented 1 week ago

Description

Running go get -u to update outdated packages & resolving any conflicts.

Tests

No tests have been added, since this is only a deps bump

Additional context

The go-ethereum library has updated their dependencies, causing package version conflicts in some repos when using the golang op-geth library.

For example, on any repos using latest op-geth as well as any library that uses latest go-ethereum (v1.14.5) will currently causes errors such as:

# github.com/ethereum/go-ethereum/crypto/kzg4844
../../../go/pkg/mod/github.com/ethereum-optimism/op-geth@v1.101315.2/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-optimism/op-geth@v1.101315.2/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-optimism/op-geth@v1.101315.2/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-optimism/op-geth@v1.101315.2/crypto/kzg4844/kzg4844_gokzg.go:97:36: cannot use (gokzg4844.Bl
ob)(blob) (value of type gokzg4844.Blob) as *gokzg4844.Blob value in argument to context.VerifyBlobKZGProof

This is due to go-ethereum using a newer version of github.com/crate-crypto/go-kzg-4844 v1.0.0 (link).

protolambda commented 6 days ago

We are looking into upgrading op-geth to include upstream geth changes as a whole, rather than changing just the dependencies. Dependencies can diverge otherwise, and we prefer consistency with upstream versions as much as possible for compatibility and testing confidence.

rtunazzz commented 3 days ago

We are looking into upgrading op-geth to include upstream geth changes as a whole, rather than changing just the dependencies. Dependencies can diverge otherwise, and we prefer consistency with upstream versions as much as possible for compatibility and testing confidence.

That sounds great @protolambda. Is there a plan for that? Any way I can help?

Turns out this MR doesn't actually fix my problem with deps anyway. Signatures of some functions in geth has changed since the fork which also causes conflicts in 3rd party geth libraries.

e.g. constructing a new block now uses in geth

func (b *Block) WithBody(body Body) *Block

where as op-geth still uses the old

func (b *Block) WithBody(transactions []*Transaction, uncles []*Header) *Block