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

ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules #1839

Closed
shrimalmadhur opened this issue Apr 5, 2022 · 51 comments

Comments

@shrimalmadhur
Copy link

Hello,

I am using the beta version (btcd@v0.22.0-beta) and recently I got this error while building

github.com/btcsuite/btcd/btcec tested by
github.com/btcsuite/btcd/btcec.test imports
github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
github.com/btcsuite/btcd v0.22.0-beta (/Users/madhurshrimal/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/Users/madhurshrimal/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

It didn't use to come before and suddenly it popped up. Any idea how I can solve this?

@sarvalabs-sai
Copy link

You may try deleting go.mod ,go.sum and do go clean --modcache before doing go mod init

@shrimalmadhur
Copy link
Author

@sarvalabs-sai I did that I still get the same result.
For more context, it is happening in this repository - https://github.com/coinbase/rosetta-sdk-go during running make format command.

@chappjc
Copy link
Contributor

chappjc commented Apr 5, 2022

@shrimalmadhur I believe the issue is that your make format target does go run golang.org/x/tools/cmd/goimports with no version suffix and from the module folder. From the go help run output for both go 1.17 and 1.18 (the only two Go versions that are not EOL):

If the package argument has a version suffix (like @latest or @v1.0.0),
"go run" builds the program in module-aware mode, ignoring the go.mod file in
the current directory or any parent directory, if there is one. This is useful
for running programs without affecting the dependencies of the main module.

If the package argument doesn't have a version suffix, "go run" may run in
module-aware mode or GOPATH mode, depending on the GO111MODULE environment
variable and the presence of a go.mod file. See 'go help modules' for details.
If module-aware mode is enabled, "go run" runs in the context of the main
module.

You want go run to leave your module's go.mod alone. So, you can try to append @latest:

go run golang.org/x/tools/cmd/goimports@latest -w .

Or you can just install goimports like you do with golines and goveralls. You'll have to do that if you still want to use go 1.16 or earlier. Since that feature of go run was introduced in 1.17, and there seems to be better handling with ambiguous imports with 1.17.

@erwanor
Copy link

erwanor commented Apr 6, 2022

I was having the same issue building a downstream script that uses ethclient (four or five layers removed from btcsuite/btcd/chaincfg/chainhash).

github.com/myrepo/myrepo imports
        github.com/ethereum/go-ethereum/accounts/abi/bind imports
        github.com/ethereum/go-ethereum/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.20.1-beta (/home/user/go/pkg/mod/github.com/btcsuite/btcd@v0.20.1-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/home/user/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

I solved it by forcing go.mod to resolve the package to the latest version (v1.0.0), by appending:

require github.com/btcd/chaincfg/chainhash v1.0.0 in my go.mod

@richardbertozzo
Copy link

The same here, what worked for me was forcing the version of btcd and go-ethereum at go.mod

module example

go 1.16

require (
	github.com/btcsuite/btcd v0.22.0-beta
	github.com/ethereum/go-ethereum v1.10.16	
)

@shrimalmadhur
Copy link
Author

@richardbertozzo yea seems like it happens when I upgrade go-ethereum to v1.10.17 keeping the btcd version constant. I want to update to the newer version due to a security update https://github.com/coinbase/rosetta-sdk-go/security/dependabot/1

@erwanor adding that line to go.mod is still not helping my case.

@chappjc
Copy link
Contributor

chappjc commented Apr 7, 2022

@shrimalmadhur Is it erroring on go build for you or just that go run command of the goimports tool? What Go version are you using?
One user of go-ethereum and btcd suggested the following, presumably for this import ambiguity issue, although I don't know what Go versions have trouble without it: ethereum/go-ethereum@f9ea1f1

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 7, 2022

@chappjc I am using go1.16. So when I followed your suggestion to do the way I am doing golines - I could run the make format command but still some of the other commands (running make gen, that doesn't really install any dependency, we use it for codegen) are having the same issue.

Just saw your updated comment. let me try that.

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 7, 2022

@chappjc even that other change doesn't help either

I just realized, one of our script is doing

./imports.sh;
go: downloading github.com/incu6us/goimports-reviser v0.1.6
go: downloading github.com/incu6us/goimports-reviser/v2 v2.5.1
go: downloading golang.org/x/mod v0.5.1
go: downloading golang.org/x/tools v0.1.8
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2-0.20220316175102-8d5c75c28923
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading github.com/google/go-cmp v0.5.4
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/leanovate/gopter v0.2.9
go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/kr/text v0.2.0
github.com/coinbase/rosetta-sdk-go/keys imports
	github.com/btcsuite/btcd/btcec tested by
	github.com/btcsuite/btcd/btcec.test imports
	github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
	github.com/btcsuite/btcd v0.22.0-beta (/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
	github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2-0.20220316175102-8d5c75c28923 (/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.2-0.20220316175102-8d5c75c28923)
make: *** [gen] Error 1

Specifically it's downloading - go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2-0.20220316175102-8d5c75c28923

Maybe that's the problem.

Update: The above is because I added the suggestion mentioned in go-ethereum. removing that it downloads go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 so doesn't look like that's the issue

@chappjc
Copy link
Contributor

chappjc commented Apr 7, 2022

That imports.sh issue is also related to changes in the go tooling. Namely, doing go get is trying to modify the current module, but you're really trying to install that goimports-reviser. go help get:

Building and installing packages with get is deprecated. In a future release,
the -d flag will be enabled by default, and 'go get' will be only be used to
adjust dependencies of the current module. To install a package using
dependencies from the current module, use 'go install'. To install a package
ignoring the current module, use 'go install' with an @version suffix like
"@latest" after each argument.

I just tested with Go 1.16, you can do go install github.com/incu6us/goimports-reviser/v2@latest and it will leave the go.mod alone.

@chappjc
Copy link
Contributor

chappjc commented Apr 7, 2022

Also, I'm not really sure about your deps target (which codegen.sh runs) given what I noted about go get above:

deps:
	go get ./...

I think you just want go build ./... or go install ./... there.

Earlier versions of go worked very differently with go get. Now go get is aimed primarily at modifying the current module's go.{mod,sum} files, not for building or installing anything.

If at all possible, you should update to Go 1.17 or 1.18. Go 1.16 is EOL and you're not going to get any security updates, such as the one announced for release today: https://groups.google.com/g/golang-announce/c/vtbMjE04kPk/m/xE-FGxCXCAAJ?utm_medium=email&utm_source=footer

@shrimalmadhur
Copy link
Author

@chappjc that makes sense. I think I am going to update Go first as 1.16 is EOL. for import issue I already updated the import.sh script to use go install. Let me update Go first and also change make deps. Thanks for the detail explanation. I will post an update once I've some done all those things.

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 7, 2022

@chappjc Hmm. so I updated to go1.17 - It adjusted go.mod and go.sum quite a bit but I still see same issue when I put go-ethereum v1.10.17

./imports.sh;
go: downloading github.com/incu6us/goimports-reviser/v2 v2.5.1
go: downloading github.com/incu6us/goimports-reviser v0.1.6
go: downloading golang.org/x/mod v0.5.1
go: downloading golang.org/x/tools v0.1.8
go: finding module for package golang.org/x/xerrors
go: finding module for package golang.org/x/sys/execabs
go: downloading golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: found golang.org/x/sys/execabs in golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12
go: found golang.org/x/xerrors in golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/google/go-cmp v0.5.4
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/leanovate/gopter v0.2.9
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading github.com/kr/pretty v0.2.1
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0
github.com/coinbase/rosetta-sdk-go/keys imports
	github.com/btcsuite/btcd/btcec tested by
	github.com/btcsuite/btcd/btcec.test imports
	github.com/btcsuite/btcd/chaincfg/chainhash loaded from github.com/btcsuite/btcd@v0.22.0-beta,
	but go 1.16 would fail to locate it:
	ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
	github.com/btcsuite/btcd v0.22.0-beta (/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
	github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

To proceed despite packages unresolved in go 1.16:
	go mod tidy -e
If reproducibility with go 1.16 is not needed:
	go mod tidy -compat=1.17
For other options, see:
	https://golang.org/doc/modules/pruning
make: *** [gen] Error 1

Not sure why it's still trying to resolve for go1.16 - but go 1.16 would fail to locate it:

@chappjc
Copy link
Contributor

chappjc commented Apr 7, 2022

Wow, that's irritating. go mod really trying to please go 1.16, which seems to have a disability here. :/

For a general solution, I don't know what to suggest for go 1.16 users, it may be impossible. For your module, I think you might be forced require 1.17 (go mod tidy -compat=1.17). Also don't forget the @latest when using go install in imports.sh and elsewhere so it doesn't touch the go.mod.

As an alternative, I would suggest switching the github.com/btcsuite/btcd require to github.com/btcsuite/btcd/btcec/v2 (an entirely separate module), since your project only seems to use btcd for the btcec package. The changes are trivial: update the import with a /v2 and omit the curve argument in two spots. However, github.com/Zilliqa/gozilliqa-sdk will be giving the same ambiguity issue as they're similarly requiring both btcd and go-ethereum.

@Roasbeef, if the btcec/v2 module did not require the ambiguous chaincfg/chainhash module in its test, these import issues for users still requiring the btcd v0.22.0-beta or older modules would vanish. Just another possible resolution since it's seems hard for users to resolve if they need to be importing the older btcd module too. EDIT: oh dang it's used in the regular schorr code too, not just tests

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 7, 2022

I already did go mod tidy -compat=1.17 when I updated to 1.17. Even after that it's showing me go1.16 failed to locate issue. Using @latest with go install now - thanks for the tip.

I tried your diff but as expected, it is now giving the same issue with github.com/Zilliqa/gozilliqa-sdk

github.com/coinbase/rosetta-sdk-go/keys imports
	github.com/Zilliqa/gozilliqa-sdk/schnorr imports
	github.com/btcsuite/btcd/btcec tested by
	github.com/btcsuite/btcd/btcec.test imports
	github.com/btcsuite/btcd/chaincfg/chainhash loaded from github.com/btcsuite/btcd@v0.21.0-beta.0.20201114000516-e9c7a5ac6401,
	but go 1.16 would fail to locate it:
	ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
	github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401 (/go/pkg/mod/github.com/btcsuite/btcd@v0.21.0-beta.0.20201114000516-e9c7a5ac6401/chaincfg/chainhash)
	github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

@chappjc
Copy link
Contributor

chappjc commented Apr 7, 2022

Yeah, looks like every go mod tidy command would have to have that switch until the ambiguity is ultimately eliminated... somehow. :( ugh. The go mod tidy in the docker command in codegen.sh namely. The imports script at least runs fine for me if it uses @latest in the command.
I'm not sure why the suggestion from @erwanor doesn't work on your module. I'm guessing that zilliqua mod breaks it for 1.16.

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 7, 2022

Oh wait a min. With you diff and adding go mod tidy -compat=1.17 in codegen.sh did not give me this error. I somehow was doing go mod tidy -compat=1.17 from my terminal and didn't realize the codegen.sh part. Maybe I was missing that and might not need the v2 change either? Let me try

Update: Ya I don't need that v2 change either. 🤦 - somehow I missed that go mod tidy in codegen.sh. But this does mean that it won't be compatible for go1.16 right?

Also can I still import this package in other repo which are using go1.16? Or they also need to be updated?

@chappjc
Copy link
Contributor

chappjc commented Apr 8, 2022

Don't know what go 1.16 users can expect, sorry.

Regardless, the btcec/v2 update in go-ethereum indirectly caused it to require the module version of the package github.com/btcsuite/btcd/chaincfg/chainhash and not just the chainhash package from the older btcd module. We can see this if we try to instruct it not to use the module version of chainhash:

$  go get -d github.com/ethereum/go-ethereum@v1.10.17
go: upgraded github.com/ethereum/go-ethereum v1.10.16 => v1.10.17

$  go get -d github.com/btcsuite/btcd/chaincfg/chainhash@none  # explicitly remove the module requirement
go: removed github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0
go: downgraded github.com/ethereum/go-ethereum v1.10.17 => v1.10.16

The go tooling can only resolve that by downgrading go-ethereum. It's not clear why go 1.16 and earlier aren't ok with an explicit require github.com/btcd/chaincfg/chainhash v1.0.0 to disambiguate.

In general, it's probably good for most btcd consumers like gozilliqa-sdk to start consuming only the new sub-modules that stick to SIV. In the meantime, looks like some pain.

EDIT: Ooooof, apparently there was a screwy procedure to "carve out" a new submodule: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository (second case) Seems to be too late for that now. Yuk, go modules are really a nightmare sometimes.

@shrimalmadhur
Copy link
Author

I see. seems like it might work with existing go1.16 though. I will try that.

@Dmdv
Copy link

Dmdv commented Apr 15, 2022

Keeps reproducing in all dependencies from 1.17

@Dmdv
Copy link

Dmdv commented Apr 15, 2022

I've tried everything.
And go mod tidy -compat=1.17 didn't help

require (
	github.com/ethereum/go-ethereum v1.10.17
	github.com/pkg/errors v0.9.1
	github.com/status-im/keycard-go v0.0.0-20210911161356-c8058144cee8
	github.com/stretchr/testify v1.7.1
	go.uber.org/zap v1.21.0
	golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
)

require (
	github.com/0chain/errors v1.0.3 // indirect
	github.com/0chain/gosdk v1.7.8 // indirect
	github.com/ReneKroon/ttlcache/v2 v2.11.0 // indirect
	github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
	github.com/deckarep/golang-set v1.8.0 // indirect
	github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
	github.com/didip/tollbooth v4.0.2+incompatible // indirect
	github.com/fsnotify/fsnotify v1.5.1 // indirect
	github.com/go-ole/go-ole v1.2.6 // indirect
	github.com/go-stack/stack v1.8.1 // indirect
	github.com/google/uuid v1.3.0 // indirect
	github.com/gorilla/websocket v1.5.0 // indirect
	github.com/hashicorp/hcl v1.0.0 // indirect
	github.com/herumi/bls-go-binary v1.0.1-0.20210830012634-a8e769d3b872 // indirect
	github.com/lithammer/shortuuid/v3 v3.0.7 // indirect
	github.com/magiconair/properties v1.8.6 // indirect
	github.com/mitchellh/mapstructure v1.4.3 // indirect
	github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
	github.com/pelletier/go-toml v1.9.4 // indirect
	github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
	github.com/rjeczalik/notify v0.9.2 // indirect
	github.com/shirou/gopsutil v3.21.11+incompatible // indirect
	github.com/spf13/afero v1.8.2 // indirect
	github.com/spf13/cast v1.4.1 // indirect
	github.com/spf13/jwalterweatherman v1.1.0 // indirect
	github.com/spf13/pflag v1.0.5 // indirect
	github.com/spf13/viper v1.11.0 // indirect
	github.com/subosito/gotenv v1.2.0 // indirect
	github.com/tklauser/go-sysconf v0.3.10 // indirect
	github.com/tklauser/numcpus v0.4.0 // indirect
	github.com/tyler-smith/go-bip39 v1.1.0 // indirect
	github.com/yusufpapurcu/wmi v1.2.2 // indirect
	go.uber.org/atomic v1.9.0 // indirect
	go.uber.org/multierr v1.8.0 // indirect
	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
	golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
	golang.org/x/text v0.3.7 // indirect
	golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
	gopkg.in/ini.v1 v1.66.4 // indirect
	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
	gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

go 1.17

The output:

ethereum/handler imports
        github.com/ethereum/go-ethereum/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.22.0-beta (/Users/dima/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/Users/dima/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

@Dmdv
Copy link

Dmdv commented Apr 15, 2022

Downgrade to go-ethereum 1.10.16 will not work for me either because I need 1.10.17

@Dmdv
Copy link

Dmdv commented Apr 15, 2022

I was having the same issue building a downstream script that uses ethclient (four or five layers removed from btcsuite/btcd/chaincfg/chainhash).

github.com/myrepo/myrepo imports
        github.com/ethereum/go-ethereum/accounts/abi/bind imports
        github.com/ethereum/go-ethereum/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.20.1-beta (/home/user/go/pkg/mod/github.com/btcsuite/btcd@v0.20.1-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 (/home/user/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.0)

I solved it by forcing go.mod to resolve the package to the latest version (v1.0.0), by appending:

require github.com/btcd/chaincfg/chainhash v1.0.0 in my go.mod

Not working

go: github.com/btcd/chaincfg/chainhash@v1.0.0: invalid version: git ls-remote -q origin in /Users/dima/go/pkg/mod/cache/vcs/8145d96c3e759b89ceeccb36491dc7d17a6d1b874f2973b498cd66993ae3ef2f: exit status 128:
	remote: Repository not found.
	fatal: repository 'https://github.com/btcd/chaincfg/' not found

@fjl
Copy link

fjl commented Apr 15, 2022

If we can fix it in go-ethereum by adding an explicit requirement of github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0 or any other version, I'm willing to apply this fix immediately.

I still don't understand what the issue is? Does it only happen with Go 1.16?

@chappjc
Copy link
Contributor

chappjc commented Apr 15, 2022

Not working

go: github.com/btcd/chaincfg/chainhash@v1.0.0: invalid version: git ls-remote -q origin in /Users/dima/go/pkg/mod/cache/vcs/8145d96c3e759b89ceeccb36491dc7d17a6d1b874f2973b498cd66993ae3ef2f: exit status 128:
	remote: Repository not found.
	fatal: repository 'https://github.com/btcd/chaincfg/' not found

@Dmdv you left out the "btcsuite" from that url

I still don't understand what the issue is? Does it only happen with Go 1.16?

@fjl Me neither. :/ Go modules at their worst here.

@davecgh
Copy link
Member

davecgh commented Apr 28, 2022

From looking into this a bit there are a few issues at play and the cleanest way to resolve them, basing on my experience with managing all of the dcrd modules for a few years now is that what @chappjc recapped is the best way to resolve the issue.

Namely, as can be seen in the module release workflow docs, versions without pre-release components are preferred over those with them. In other words, v0.22.0-beta is seen as before v0.18.1, so currently anyone just importing or doing a plain go get github.com/btcsuite/btcd is going to attempt to get v0.18.1 which is a broken version. Addressing that first issue implies that a new tag without a pre-release version on it is required.

Next, the latest pre-release tag v0.22.0-beta has chaincfg/chainhash as a package, but there is also now a separate module with the same path. This is 100% guaranteed to break consumers who try to use both v0.22.0-beta and anything that simultaneously uses the new module such as btcec/v2, which there are already consumers in the ecosystem that need to do that. Addressing that issue also requires a new tag that is seen as later than v0.18.1 in which the chaincfg/chainhash package has been removed.

Finally, since there are a lot of other breaking changes and changes that are not necessarily ready for a release, what is really needed is a new e.g. v0.23.0 tag that is code branched off of v0.22.0-beta with only the problematic package removed and the code updated to use the module instead.

That way v0.23.0 will be seen as the latest release module by consumers, it will not have the package that is causing conflicts in it, and it will not include a bunch of code that is not yet ready for release.

You could also opt for a v0.22.1, btw, since it will be seen as newer as well. The important parts are that:

  1. The new tag is not a pre-release version so that it is seen as the most recent proper release by the go tooling
  2. The new tag must use the new chaincfg/chainhash module and not contain the chaincfg/chainhash package
  3. The new tag does not contain code that is not ready to be released yet.

EDIT: Note that this approach will also fix the fact that https://pkg.go.dev/github.com/btcsuite/btcd is showing v0.14.6 and the incorrect README and all.

@davecgh
Copy link
Member

davecgh commented Apr 28, 2022

I opened #1851 which does what my comment and @chappjc suggested.

@Roasbeef
Copy link
Member

Pushed a new tag here after the merge of #1851: https://github.com/btcsuite/btcd/releases/tag/v0.22.1

All consumer now should be able update to that tag, and then freely use the new chainhash and btcec modules w/o the import ambiguity weirdness.

@davecgh
Copy link
Member

davecgh commented Apr 28, 2022

Confirmed the issues are now resolved:

$ go mod init foo; go get github.com/btcsuite/btcd; go get github.com/btcsuite/btcd/btcec/v2; go get github.com/ethereum/go-ethereum
go: creating new go.mod: module foo
go: added github.com/aead/siphash v1.0.1
go: added github.com/btcsuite/btcd v0.22.1
go: added github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
go: added github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
go: added github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
go: added github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd
go: added github.com/btcsuite/goleveldb v1.0.0
go: added github.com/btcsuite/snappy-go v1.0.0
go: added github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
go: added github.com/btcsuite/winsvc v1.0.0
go: added github.com/davecgh/go-spew v1.1.1
go: added github.com/decred/dcrd/lru v1.0.0
go: added github.com/jessevdk/go-flags v1.4.0
go: added github.com/jrick/logrotate v1.0.0
go: added github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23
go: added golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37
go: added github.com/btcsuite/btcd/btcec/v2 v2.1.3
go: added github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
go: added github.com/ethereum/go-ethereum v1.10.17
go: upgraded golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 => v0.0.0-20210322153248-0c34fe9e7dc2
go: upgraded golang.org/x/sys v0.0.0-20190412213103-97732733099d => v0.0.0-20210816183151-1e6c022a8912

Also the documentation is correct again as expected.

@shrimalmadhur
Copy link
Author

Thanks everybody!

@chappjc
Copy link
Contributor

chappjc commented Apr 29, 2022

Glad you got this resolved @shrimalmadhur! I'm not entirely sure your go get is needed or doing what's intended in your deps target given it's purposed change in recent Go versions to specifically updating the go.mod rather than building anything, but as long as you've got things building without hacks, I'm very pleased with the resolution.

@shrimalmadhur
Copy link
Author

shrimalmadhur commented Apr 29, 2022

Interesting - let me verify once. I am still using Go 1.16 ( which eventually I will move to newer versions). I do have a separate install and build target. I guess eventually deps target can be removed (deps is no being used in any CI ). But thanks for the tip @chappjc

dmarzzz pushed a commit to blocknative/go-ethereum that referenced this issue Jun 7, 2022
* params: begin v1.10.18 release cycle

* rlp: fix typo in comment (ethereum#24595)

Co-authored-by: Yong Yang <yangyong775654@163.com>

* core/state/snapshot: clean up the generation code (ethereum#24479)

* go.mod : upnp 1.0.3 stable version (ethereum#24573)

* internal/ethapi: add refund to StructLogRes (ethereum#24567)

* internal/ethapi: add refund to StructLogRes

* Update internal/ethapi/api.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth/tracers/logger: use omitempty to reduce log bloat  (ethereum#24547)

Makes the evm json output less verbose: omitting output of `memory` and `returndata` in case they are empty.

* common/compiler: add extra include paths to solidity compiler (ethereum#24541)

This PR adds a ExtraAllowedPath field to Solidity and exposes two APIs: CompileSource and CompileFiles, which were hidden inside CompileSolidityString and CompileSolidity before.

* core: verify genesis extradata for clique (ethereum#24470)

* Add extra-data checks for clique genesis

* Update genesis.go

* Update genesis.go

* core: simplify clique genesis check

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: change snapshot extension registration failure to warning instead of error (ethereum#24475)

* core: Change Snapshot extension registration failed to Debug

* Update eth/handler.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* trie, les, tests, core: implement trie tracer (ethereum#24403)

Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.

* core,eth: implement tx-level hooks for tracers (ethereum#24510)

* core,eth: add empty tx logger hooks

* core,eth: add initial and remaining gas to tx hooks

* store tx gasLimit in js tracer

* use gasLimit to compute intrinsic cost for js tracer

* re-use rules in transitiondb

* rm logs

* rm logs

* Mv some fields from Start to TxStart

* simplify sender lookup in prestate tracer

* mv env to TxStart

* Revert "mv env to TxStart"

This reverts commit 656939634b9aff19f55a1cd167345faf8b1ec310.

* Revert "simplify sender lookup in prestate tracer"

This reverts commit ab65bce48007cab99e68232e7aac2fe008338d50.

* Revert "Mv some fields from Start to TxStart"

This reverts commit aa50d3d9b2559addc80df966111ef5fb5d0c1b6b.

* fix intrinsic gas for prestate tracer

* add comments

* refactor

* fix test case

* simplify consumedGas calc in prestate tracer

* eth: clarify the error string on getlogs failure (ethereum#24617)

This PR makes the errors we spit out a bit more clear about what block is problematic.

* eth/downloader: retrieve pivot header from local chain if necessary (ethereum#24610)

* eth/downloader: retrieve pivot header from local chain if necessary

* eth/downloader: improve readability

* eth/downloader: update fix

* eth/downloader: add beacon sync tests

* eth/downloader: remove duplicated code

* README: update free space required (ethereum#24636)

* rpc: fixed a typo (ethereum#24642)

* eth/fetcher: if peers never respond, drop them

* eth/tracers: refactor traceTx to separate out struct logging (ethereum#24326)

* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core/state/snapshot: remove noop map item assignment

* cmd/geth: inspect snapshot dangling storage (ethereum#24643)

* cmd/geth: inspect snapshot dangling storage

* cmd/geth: make verify-state invoke verify-dangling

* accounts/abi: handle tuple arrays in ParseSelector (ethereum#24587)

Closes ethereum#24571

* all: use T.TempDir to create temporary test directories (ethereum#24633)

This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* les: fix panic in ultralight client sync (ethereum#24641)

* log: modify lock defer unlock order in sync handler (ethereum#24667)

This modifies the order of Lock() defer Unlock() to follow the more
typically used pattern.

* build/deb: update Debian control file to remove unencrypted git protocol (ethereum#24676)

* core/types: make "miner" optional in Header JSON (ethereum#24666)

"miner" is not set for pending block responses in some cases.

Fixes ethereum#24632

* cmd: set DefaultGasLimit to 30M (ethereum#24680)

* cmd: set DefaultGasLimit to 30M, rem deprec. Flag

* cmd: revert flag deprecation

* core: fix benchmark panic (ethereum#24657)

This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.

* abi/base: return error for pending call error (ethereum#24649)

If a pending contract call errors, return that error right away rather
than ignoring it to allow an error somewhere else. This is helpful for
callers to know if perhaps a call failed because of the context deadline
being expired. This change mirrors the behavior of non-pending contract
calls.

* build: add imports for go generate tools (ethereum#24682)

This adds a tools.go file to import all command packages used for
go:generate. Doing so makes it possible to execute go-based code
generators using 'go run', locking in the tool version using go.mod.

Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/tracers: make txhash blockhash accessible to native tracers (ethereum#24679)

* cmd/geth: support bigints for --override.terminaltotaldifficulty (ethereum#24646)


Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/downloader: remove stale beacon headers as backfilling progresses (ethereum#24670)

* eth/downloader: remove stale beacon headers as backfilling progresses

* eth/downloader: remove leftover from a previous design

* eth/downloader: do partial beacon cleanups if chain is large

* eth/downloader: linter != heart

* build: upgrade -dlgo version to Go 1.18.1 (ethereum#24689)

* build: upgrade -dlgo version to Go 1.18.1

* build: upgrade -dlgo version for macOS to Go 1.18.1

* eth/downloader: resolve local header by hash for beacon sync (ethereum#24691)

* eth/downlaoder: resolve local header by hash for beacon sync

* eth/downloader: fix error message

* eth/downloader: cap the reverse header resolving

* eth/downloader: re-enable tests

* eth/downloader: add warning logs

* go.mod: upgrade btcec and add 'chainhash' module requirement (ethereum#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.

* trie: remove unused makeHashNode (ethereum#24702)

* core/vm: fix typo (ethereum#24714)

Was just browsing the code and found this.

* eth/downloader: fix typo in downloader.go (ethereum#24704)

synchornization -> synchronization

* eth/tracers/logger: remove unnecessary comparisons in accessList.equal (ethereum#24663)

This change removes extraneous/unnecessary checks for equality
when comparing 2 accessList values A and B. Given that we validate that
their lengths of A and B are equal, if so and if every element in A is
in B, reflexively every element in B is already in A. If that weren't
the case and an element g existed in A but not in B, that would mean
that there is an extra element and hence a mathematical contradiction.

Fixes ethereum#24658

* README.md: update Go min required version to 1.16 (ethereum#24713)

* .github: update CODEOWNERS (ethereum#24743)

* internal/flags: fix godoc (ethereum#24734)

* cmd/faucet: fix genesis flag and improve documentation (ethereum#24735)

* cmd/evm: ensure input length is even (ethereum#24721)

* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix

Co-authored-by: Martin Holst Swende <martin@swende.se>

* fix typo (ethereum#24731)

* mobile: fix receipt encoding to json (ethereum#24701)

* p2p: fix type of DiscSubprotocolError (ethereum#24747)

It was 'int' accidentally, should be DiscReason instead.

* all: use 'embed' instead of go-bindata (ethereum#24744)

* cmd/geth, core/state/snapshot: fix flaw in dangling-storage check + inspect difflayers (ethereum#24677)

This PR fixes the flaw that @rjl493456442 found in https://github.com/ethereum/go-ethereum/pull/#issuecomment-1093817551 , namely, that the snapshot iterator uses the combined (disk + difflayers) 'view', wheres the raw iterator uses only the disk 'view'.

This PR instead splits up the work: one phase is iterating the disk layer data, another phase is loading the journalled difflayers and performing the same check there.

* cmd/*: refactor get flag value (ethereum#24761)

* consensus/ethash: fix typos in var names (ethereum#24745)

* internal/ethapi: add db operations to api (ethereum#24739)

Adds `debug_dbGet` method to rpc api

* core/types: fix unhandled errors in TestTransactionCoding (ethereum#24692)

* cmd/utils: utilize beacon wrapper in makechain (ethereum#24620)

* cmd/utils: utilize beacon wrapper in makechain

* cmd/utils: fix fake-pow to also be wrapped in beacon

* consensus/misc: correct error message

* all: use common.FileExist for checking file existence (ethereum#24748)

* ethclient/gethclient: return storage proofs in GetProof (ethereum#24697)

Storage proofs were being unmarshalled from the RPC form to the go struct, but were not being included in the final returned struct.

* eth/filters: remove unused struct fields (ethereum#24782)

* cmd/clef: fixups to the python clef poc (ethereum#24440)

This PR fixes up the example python clef wrapper. The poc is intended to demonstrate how to wite a UI for clef, and had severely bitrotted.
With these changes, it "works" in the sense that all the built-in tests triggers the intended python callbacks (no errors about method not found). It does not "work" in the sense that the wrapper can be used as an actual UI. It will auto-reject any signing requests, for example.

* cmd/evm: make evm t8n handle post-merge transitions (ethereum#24546)

This adds the ability to run --state.fork=Merged, and have post-merge rules apply. When doing so, it also requires the input env to contain currentRandom, and enforces the currentDifficulty to be omitted or zero.

* cmd: group network and db path flags together (ethereum#24698)

This PR groups all built-in network flags together and list them in the command as a whole.

And all database path flags(datadir, ancient) are also grouped, since usually these two are
used together.

* accounts: fix typo in comments (ethereum#24805)

* docker: speed up docker image build (ethereum#24796)

This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer

* cmd/utils: double limit on free-disk monitor (ethereum#24781)

This PR doubles the limit on which to trigger automatic shutdown, and also changes the timer to run once every 30s instead of 60s.

* build: fix formatted logs (ethereum#24807)

Changed `log.Fatal` to `log.Fatalf()` as it has a parameter...

* build: ppa build for jammy (ubuntu 22.04)

* graphql: add rawReceipt field to transaction type (ethereum#24738)

* graphql: add tx receiptsRLP field

* use MarshalBinary

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* update schema

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* rename to rawReceipt

* indent fix

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* eth/filters: fix code comment (ethereum#24799)

* cmd/geth: fix init genesis for dev (ethereum#24693)

* cmd/geth: fix init genesis for dev

* use ancient flag for init genesis cmd

* cmd, eth: fix required blocks regression

* core: fix WriteBlockAndSetHead documentation (ethereum#24818)

* core: recover state when beacon sets canonical head if it's missing (ethereum#24613)

* core: recover the state in SetChainHead if the head state is missing

* core: disable test logging

* core: address comment from martin

* core: improve log level in case state is recovered

* core, eth, les, light: rename SetChainHead to SetCanonical

* eth/protocols/eth: fix godoc comments (ethereum#24810)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/filters: remove explicit continue label in filterLogs (ethereum#24795)

The loop label can be removed because this 'continue' statement
is not in a nested loop.

* p2p/simulations: escape mockerType value from request (ethereum#24822)


Co-authored-by: Felix Lange <fjl@twurst.com>

* p2p/simulations: fix typo in network_test.go (ethereum#24824)

* miner: discard interrupted blocks (ethereum#24638)

During mining, when a new head arrives and interrupts the block building, the block being built should not be commited (but discarded). Committing the interrupted block introduces unnecessary delay, and possibly causes miner to mine on the previous head, which could result in higher uncle rate.

* core/rawdb: untie freezer and ancient chain data (ethereum#24684)

Previously freezer has only been used for storing ancient chain data, while obviously it can be used more. This PR unties the chain data and freezer, keep the minimal freezer structure and move all other logic (like incrementally freezing block data) into a separate structure called ChainFreezer.

This PR also extends the database interface by adding a new ancient store function AncientDatadir which can return the root directory of ancient store. The ancient root directory can be used when we want to open some other ancient-stores (e.g. reverse diff freezer).

* core/vm: implement EIP-3855: PUSH0 instruction (ethereum#24039)

* core/vm: Implement PUSH0

* Move PUSH0 to enable3855

* Add method doc

* eth/fetcher: avoid hang in tests (partial fix for ethereum#23331) (ethereum#23351)

* eth/fetcher: fix test to avoid hanging. Partial fix for ethereum#23331

* eth/filters: avoid dangling goroutines

* eth/fetcher: revert closing of proceed

* signer/fourbyte: import new signatures (ethereum#22865)

* abi: fix checks when all fields are indexed (ethereum#24792)

This PR fixes abi checks in the edge case where all arguments are indexed

* core/state/snapshot: fix race condition (ethereum#24685)

Fixes three race conditions found through fuzzing by David Theodore

* all: replace strings.Replace with string.ReplaceAll (ethereum#24835)

* internal: drop TestSignCliqueBlock (ethereum#24837)

* signer/fourbyte: remove offending signatures (ethereum#24842)

* core/vm: update benchmark to use Errorf instead of Sprintf (ethereum#24845)

* eth/protocols/snap: sort trienode heal requests by path (ethereum#24779)

* sort snap trienode heal requests

* eth/protocols/snap: remove debug code

* eth/protocols/snap: simplify sort, generate pathsets later

* eth/protocols/snap: review concern

* eth/protocols/snap: renamings

* eth/protocols/snap: add comments in Merge

* eth/protocols/snap: remove variable 'last' in Merge

* eth/protocols/snap: fix lint flaws in test

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/geth: print info banner for --dev mode (ethereum#24759)


Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: clean up some dead functions (ethereum#24851)

* core/vm: separate opcode group for 0x20 range (ethereum#24850)

* ethclient: add PeerCount method (ethereum#24849)

* adding peer count function

* Update ethclient.go

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: optimize Memory.Set32 (ethereum#24847)

* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32

* graphql: fix long literal passed in a variable (ethereum#24864)

* core/vm: for tracing, do not report post-op memory

* internal/ethapi: add debug_getRawReceipts RPC method (ethereum#24773)

Adds a method to retrieve all the binary encoded receipts from a block

* params: set ropsten TTD for TheMerge (ethereum#24876)

* cmd/utils: add deprecation warning for Rinkeby

* core/asm: use strings.Builder and fix godoc issues (ethereum#24861)

* all: replace uses of ioutil with io and os (ethereum#24869)

* cmd/geth: update vulnerabilities.json testdata (ethereum#24856)

* core/vm: reduce overhead in instructions-benchmark (ethereum#24860)

* core/vm: reduce footprint of OP benchmark

* core/vm: for opBenchmark, add code to detect inputs mutation

* Update core/vm/instructions_test.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: opBenchmark, stop timer before sanity-test code

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: fix flaky test, don't attach empty slots/proofs (ethereum#24885)

* eth/protocols/snap: don't include empty snapshot slot slice

This PR fixes the snapshot storage serving handler. In snap protocol
the response is capped by the response size. Server can cutdown the
response if the accumulated byte size exceeds the local hard limit.

It means we can meet a special scenario that there is no storage slot
included for a requested account, but we attach the proof for this
account by mistake.

So in the prover side, when it meets a empty storage response but with
a valid proof proves there are some more slots left in the trie, then
requestor will reject this response and disconnect with server.

In this PR, if there is no storage slot served for the requested account,
then no proof should be attached as well.

* eth/protocols/snap: loosen restrictions for flaky tests

* eth/catalyst: fix flaky test in catalyst

* graphql: add raw fields to block and tx (ethereum#24816)

* eth/catalyst: set the correct LatestValidHash (ethereum#24855)

* eth/catalyst: set the correct LatestValidHash

* eth/catalyst: core: return LVH during reorg, rework invalid teminal block

* eth/catalyst: nitpicks

* cmd/geth: add `db check-state-content` to verify integrity of trie nodes (ethereum#24840)

This PR adds db tooling (geth db check-state-content)  to verify the integrity of trie nodes. It iterates through the 32-byte key space in the database, which is expected to contain RLP-encoded trie nodes, addressed by hash.

* all: use strings.EqualFold for string comparison (ethereum#24890)

* all: replace non-trivial uses of package ioutil with os (ethereum#24886)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb/remotedb, cmd: add support for remote (readonly) databases (ethereum#24836)

* ethdb/remotedb, cmd: add support for remote (readonly) databases

* ethdb/remotedb: minor changes

* ethdb/remotedb: close the conn

* cmd, ethdb: add rpc accessor for ancient data

* internal/ethapi: license

* ethdb/remotedb: linter fixes

* core, eth, internal, rpc: implement final block (ethereum#24282)

* eth: core: implement finalized block

* eth/catalyst: fix final block

* eth/catalyst: update finalized head gauge

* internal/jsre/deps: updated web3.js to allow for finalized block

* eth/catalyst: make sure only one thread can call fcu

* eth/catalyst: nitpicks

* eth/catalyst: use plain mutex

* eth: nitpicks

* eth/catalyst, miner: build the execution payload async (ethereum#24866)

* eth/catalyst: build the execution payload async

* miner: added comment, added test case

* eth/catalyst: miner: move async block production to miner

* eth/catalyst, miner: support generate seal block async

* miner: rework GetSealingBlockAsync to use a passed channel

* miner: apply rjl's diff

* eth/catalyst: nitpicks

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/tracers/js: goja tracer (ethereum#23773)

This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.

Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.

We expect the performace of JS tracing to be at least as good or better with
this change.

* params: update goerli bootnodes (ethereum#24900)

* params: update goerli bootnodes

* params: use ip for enodes

* params: fix broken linter

* ethdb/remotedb: fix flawed check in Has/HasAncient

* core: fix the order of address in queue (ethereum#24907)

reverse the order of address in queue

* tests: update reference tests (ethereum#24899)

* tests: update reference tests

* tests: fix flaw in state test execution

* f

* eth/tracers/js: add memory.length method (ethereum#24887)

* eth/catalyst: update implementation to spec (ethereum#24802)

* eth/catalyst: return invalid payload attributes error

* eth/catalyst: implement LVH as specified, add tests

* eth/catalyst: return current block hash not header hash

* eth/catalyst: fix test

* eth/catalyst: bring error codes in line with spec

* core, eth, les, rpc: polish catalyst errors, add context

* build/bot: add mac build script (ethereum#24917)

* build/bot: remove xctool invocation in macos build script (ethereum#24918)

* build/bot: add ppa-build.sh (ethereum#24919)

* build/bot: avoid install of python-bzrlib, python-paramiko in PPA build (ethereum#24921)

* build/bot: create .ssh directory in ppa-build.sh (ethereum#24922)

* core/state/snapshot: detect and clean up dangling storage snapshot in generation (ethereum#24811)

* core/state/snapshot: check dangling storages when generating snapshot

* core/state/snapshot: polish

* core/state/snapshot: wipe the last part of the dangling storages

* core/state/snapshot: fix and add tests

* core/state/snapshot: fix comment

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core, cmd: expose dangling storage detector for wider usage

* core/state/snapshot: rename variable

* core, ethdb: use global iterators for snapshot generation

* core/state/snapshot: polish

* cmd, core/state/snapshot: polish

* core/state/snapshot: polish

* Update core/state/snapshot/generate.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb: extend db test suite and fix memorydb iterator

* ethdb/dbtest: rollback changes

* ethdb/memorydb: simplify iteration

* core/state/snapshot: update dangling counter

* core/state/snapshot: release iterators

* core/state/snapshot: update metrics

* core/state/snapshot: update time metrics

* metrics/influxdb: temp solution to present counter meaningfully, remove it

* add debug log, revert later

* core/state/snapshot: fix iterator panic

* all: customized snapshot iterator for backward iteration

* core, ethdb: polish

* core/state/snapshot: remove debug log

* core/state/snapshot: address comments from peter

* core/state/snapshot: reopen the iterator at the next position

* ethdb, core/state/snapshot: address comment from peter

* core/state/snapshot: reopen exhausted iterators

Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* accounts/abi: validate fieldnames, fixes ethereum#24930 (ethereum#24932)

* common/compiler, cmd/abigen: remove solc/vyper compiler integration

* eth/tracers/js: drop duktape engine (ethereum#24934)

ethereum#23773 added a JS tracer which uses Goja as its engine. In this PR I remove the previous tracer which used duktape as well as remove the dependencies.

This PR also comes with 2 fixes in the Goja tracer and one small behavioural change:

    I had handled errors in the native Go functions by panicing. My oversight was that Goja only handles panics with a Goja.Value as argument. The difference is panic(goja.Value) allows JS to catch the exception whereas Interrupt(error) doesn't.
    There was a race in how I handled Stop.
    Because of 1. some of the methods that simply return nil on error (like memory.slice) now throw an exception.

* signer/core: always pad clique header extra data with space for sealer's signature (ethereum#24941)

* signer/core: always pad clique header extra data with space for sealer's signature

* capitalize comment

* go.mod: upgrade to btcsuite/btcd/btcec v2.2.0 (ethereum#24939)

This should fully resolve dependency conflict issues in modules
that also depend on btcsuite/btcd v0.22.0.

* params: update CHTs for Geth 1.10.18

* all: update license headers and AUTHORS from git history (ethereum#24947)

* AUTHORS: remove one more duplicate entry (ethereum#24950)

* go.mod: upgrade to docker v1.6.2 (ethereum#24956)

This upgrade is necessary to silence a Dependabot warning.

* params: go-ethereum v1.10.18 stable

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: flowerofdream <775654398@qq.com>
Co-authored-by: Yong Yang <yangyong775654@163.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Nic Jansma <nic@nicj.net>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Tatsuya Shimoda <tacoo@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Tangui Clairet <tangui.clairet@gmail.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Vaibhaw <kvaibhaw99@gmail.com>
Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
Co-authored-by: Koosha K <koosha--@users.noreply.github.com>
Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Nikita Kozhemyakin <enginegl.ec@gmail.com>
Co-authored-by: henopied <13500516+henopied@users.noreply.github.com>
Co-authored-by: John Difool <johndifoolpi@gmail.com>
Co-authored-by: tia-99 <67107070+tia-99@users.noreply.github.com>
Co-authored-by: Joshua Gutow <jbgutow@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: nujabes403 <nujabes403@gmail.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Evgeny Kolyakov <freaker2k7@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: milesvant <milesvant@gmail.com>
Co-authored-by: ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
Co-authored-by: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Rachel Franks <nfranks@protonmail.com>
Co-authored-by: ||= nil <103940716+nedifi@users.noreply.github.com>
Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
Co-authored-by: Qian Bin <cola.tin.com@gmail.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: Austin Roberts <austin.roberts@rivet.cloud>
dmarzzz added a commit to blocknative/go-ethereum that referenced this issue Jun 27, 2022
* add workflow to build binaries on release

* Merge/v1.10.18 (#63)

* params: begin v1.10.18 release cycle

* rlp: fix typo in comment (ethereum#24595)

Co-authored-by: Yong Yang <yangyong775654@163.com>

* core/state/snapshot: clean up the generation code (ethereum#24479)

* go.mod : upnp 1.0.3 stable version (ethereum#24573)

* internal/ethapi: add refund to StructLogRes (ethereum#24567)

* internal/ethapi: add refund to StructLogRes

* Update internal/ethapi/api.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth/tracers/logger: use omitempty to reduce log bloat  (ethereum#24547)

Makes the evm json output less verbose: omitting output of `memory` and `returndata` in case they are empty.

* common/compiler: add extra include paths to solidity compiler (ethereum#24541)

This PR adds a ExtraAllowedPath field to Solidity and exposes two APIs: CompileSource and CompileFiles, which were hidden inside CompileSolidityString and CompileSolidity before.

* core: verify genesis extradata for clique (ethereum#24470)

* Add extra-data checks for clique genesis

* Update genesis.go

* Update genesis.go

* core: simplify clique genesis check

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: change snapshot extension registration failure to warning instead of error (ethereum#24475)

* core: Change Snapshot extension registration failed to Debug

* Update eth/handler.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* trie, les, tests, core: implement trie tracer (ethereum#24403)

Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.

* core,eth: implement tx-level hooks for tracers (ethereum#24510)

* core,eth: add empty tx logger hooks

* core,eth: add initial and remaining gas to tx hooks

* store tx gasLimit in js tracer

* use gasLimit to compute intrinsic cost for js tracer

* re-use rules in transitiondb

* rm logs

* rm logs

* Mv some fields from Start to TxStart

* simplify sender lookup in prestate tracer

* mv env to TxStart

* Revert "mv env to TxStart"

This reverts commit 656939634b9aff19f55a1cd167345faf8b1ec310.

* Revert "simplify sender lookup in prestate tracer"

This reverts commit ab65bce48007cab99e68232e7aac2fe008338d50.

* Revert "Mv some fields from Start to TxStart"

This reverts commit aa50d3d9b2559addc80df966111ef5fb5d0c1b6b.

* fix intrinsic gas for prestate tracer

* add comments

* refactor

* fix test case

* simplify consumedGas calc in prestate tracer

* eth: clarify the error string on getlogs failure (ethereum#24617)

This PR makes the errors we spit out a bit more clear about what block is problematic.

* eth/downloader: retrieve pivot header from local chain if necessary (ethereum#24610)

* eth/downloader: retrieve pivot header from local chain if necessary

* eth/downloader: improve readability

* eth/downloader: update fix

* eth/downloader: add beacon sync tests

* eth/downloader: remove duplicated code

* README: update free space required (ethereum#24636)

* rpc: fixed a typo (ethereum#24642)

* eth/fetcher: if peers never respond, drop them

* eth/tracers: refactor traceTx to separate out struct logging (ethereum#24326)

* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core/state/snapshot: remove noop map item assignment

* cmd/geth: inspect snapshot dangling storage (ethereum#24643)

* cmd/geth: inspect snapshot dangling storage

* cmd/geth: make verify-state invoke verify-dangling

* accounts/abi: handle tuple arrays in ParseSelector (ethereum#24587)

Closes ethereum#24571

* all: use T.TempDir to create temporary test directories (ethereum#24633)

This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* les: fix panic in ultralight client sync (ethereum#24641)

* log: modify lock defer unlock order in sync handler (ethereum#24667)

This modifies the order of Lock() defer Unlock() to follow the more
typically used pattern.

* build/deb: update Debian control file to remove unencrypted git protocol (ethereum#24676)

* core/types: make "miner" optional in Header JSON (ethereum#24666)

"miner" is not set for pending block responses in some cases.

Fixes ethereum#24632

* cmd: set DefaultGasLimit to 30M (ethereum#24680)

* cmd: set DefaultGasLimit to 30M, rem deprec. Flag

* cmd: revert flag deprecation

* core: fix benchmark panic (ethereum#24657)

This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.

* abi/base: return error for pending call error (ethereum#24649)

If a pending contract call errors, return that error right away rather
than ignoring it to allow an error somewhere else. This is helpful for
callers to know if perhaps a call failed because of the context deadline
being expired. This change mirrors the behavior of non-pending contract
calls.

* build: add imports for go generate tools (ethereum#24682)

This adds a tools.go file to import all command packages used for
go:generate. Doing so makes it possible to execute go-based code
generators using 'go run', locking in the tool version using go.mod.

Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/tracers: make txhash blockhash accessible to native tracers (ethereum#24679)

* cmd/geth: support bigints for --override.terminaltotaldifficulty (ethereum#24646)


Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/downloader: remove stale beacon headers as backfilling progresses (ethereum#24670)

* eth/downloader: remove stale beacon headers as backfilling progresses

* eth/downloader: remove leftover from a previous design

* eth/downloader: do partial beacon cleanups if chain is large

* eth/downloader: linter != heart

* build: upgrade -dlgo version to Go 1.18.1 (ethereum#24689)

* build: upgrade -dlgo version to Go 1.18.1

* build: upgrade -dlgo version for macOS to Go 1.18.1

* eth/downloader: resolve local header by hash for beacon sync (ethereum#24691)

* eth/downlaoder: resolve local header by hash for beacon sync

* eth/downloader: fix error message

* eth/downloader: cap the reverse header resolving

* eth/downloader: re-enable tests

* eth/downloader: add warning logs

* go.mod: upgrade btcec and add 'chainhash' module requirement (ethereum#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.

* trie: remove unused makeHashNode (ethereum#24702)

* core/vm: fix typo (ethereum#24714)

Was just browsing the code and found this.

* eth/downloader: fix typo in downloader.go (ethereum#24704)

synchornization -> synchronization

* eth/tracers/logger: remove unnecessary comparisons in accessList.equal (ethereum#24663)

This change removes extraneous/unnecessary checks for equality
when comparing 2 accessList values A and B. Given that we validate that
their lengths of A and B are equal, if so and if every element in A is
in B, reflexively every element in B is already in A. If that weren't
the case and an element g existed in A but not in B, that would mean
that there is an extra element and hence a mathematical contradiction.

Fixes ethereum#24658

* README.md: update Go min required version to 1.16 (ethereum#24713)

* .github: update CODEOWNERS (ethereum#24743)

* internal/flags: fix godoc (ethereum#24734)

* cmd/faucet: fix genesis flag and improve documentation (ethereum#24735)

* cmd/evm: ensure input length is even (ethereum#24721)

* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix

Co-authored-by: Martin Holst Swende <martin@swende.se>

* fix typo (ethereum#24731)

* mobile: fix receipt encoding to json (ethereum#24701)

* p2p: fix type of DiscSubprotocolError (ethereum#24747)

It was 'int' accidentally, should be DiscReason instead.

* all: use 'embed' instead of go-bindata (ethereum#24744)

* cmd/geth, core/state/snapshot: fix flaw in dangling-storage check + inspect difflayers (ethereum#24677)

This PR fixes the flaw that @rjl493456442 found in https://github.com/ethereum/go-ethereum/pull/#issuecomment-1093817551 , namely, that the snapshot iterator uses the combined (disk + difflayers) 'view', wheres the raw iterator uses only the disk 'view'.

This PR instead splits up the work: one phase is iterating the disk layer data, another phase is loading the journalled difflayers and performing the same check there.

* cmd/*: refactor get flag value (ethereum#24761)

* consensus/ethash: fix typos in var names (ethereum#24745)

* internal/ethapi: add db operations to api (ethereum#24739)

Adds `debug_dbGet` method to rpc api

* core/types: fix unhandled errors in TestTransactionCoding (ethereum#24692)

* cmd/utils: utilize beacon wrapper in makechain (ethereum#24620)

* cmd/utils: utilize beacon wrapper in makechain

* cmd/utils: fix fake-pow to also be wrapped in beacon

* consensus/misc: correct error message

* all: use common.FileExist for checking file existence (ethereum#24748)

* ethclient/gethclient: return storage proofs in GetProof (ethereum#24697)

Storage proofs were being unmarshalled from the RPC form to the go struct, but were not being included in the final returned struct.

* eth/filters: remove unused struct fields (ethereum#24782)

* cmd/clef: fixups to the python clef poc (ethereum#24440)

This PR fixes up the example python clef wrapper. The poc is intended to demonstrate how to wite a UI for clef, and had severely bitrotted.
With these changes, it "works" in the sense that all the built-in tests triggers the intended python callbacks (no errors about method not found). It does not "work" in the sense that the wrapper can be used as an actual UI. It will auto-reject any signing requests, for example.

* cmd/evm: make evm t8n handle post-merge transitions (ethereum#24546)

This adds the ability to run --state.fork=Merged, and have post-merge rules apply. When doing so, it also requires the input env to contain currentRandom, and enforces the currentDifficulty to be omitted or zero.

* cmd: group network and db path flags together (ethereum#24698)

This PR groups all built-in network flags together and list them in the command as a whole.

And all database path flags(datadir, ancient) are also grouped, since usually these two are
used together.

* accounts: fix typo in comments (ethereum#24805)

* docker: speed up docker image build (ethereum#24796)

This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer

* cmd/utils: double limit on free-disk monitor (ethereum#24781)

This PR doubles the limit on which to trigger automatic shutdown, and also changes the timer to run once every 30s instead of 60s.

* build: fix formatted logs (ethereum#24807)

Changed `log.Fatal` to `log.Fatalf()` as it has a parameter...

* build: ppa build for jammy (ubuntu 22.04)

* graphql: add rawReceipt field to transaction type (ethereum#24738)

* graphql: add tx receiptsRLP field

* use MarshalBinary

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* update schema

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* rename to rawReceipt

* indent fix

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* eth/filters: fix code comment (ethereum#24799)

* cmd/geth: fix init genesis for dev (ethereum#24693)

* cmd/geth: fix init genesis for dev

* use ancient flag for init genesis cmd

* cmd, eth: fix required blocks regression

* core: fix WriteBlockAndSetHead documentation (ethereum#24818)

* core: recover state when beacon sets canonical head if it's missing (ethereum#24613)

* core: recover the state in SetChainHead if the head state is missing

* core: disable test logging

* core: address comment from martin

* core: improve log level in case state is recovered

* core, eth, les, light: rename SetChainHead to SetCanonical

* eth/protocols/eth: fix godoc comments (ethereum#24810)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/filters: remove explicit continue label in filterLogs (ethereum#24795)

The loop label can be removed because this 'continue' statement
is not in a nested loop.

* p2p/simulations: escape mockerType value from request (ethereum#24822)


Co-authored-by: Felix Lange <fjl@twurst.com>

* p2p/simulations: fix typo in network_test.go (ethereum#24824)

* miner: discard interrupted blocks (ethereum#24638)

During mining, when a new head arrives and interrupts the block building, the block being built should not be commited (but discarded). Committing the interrupted block introduces unnecessary delay, and possibly causes miner to mine on the previous head, which could result in higher uncle rate.

* core/rawdb: untie freezer and ancient chain data (ethereum#24684)

Previously freezer has only been used for storing ancient chain data, while obviously it can be used more. This PR unties the chain data and freezer, keep the minimal freezer structure and move all other logic (like incrementally freezing block data) into a separate structure called ChainFreezer.

This PR also extends the database interface by adding a new ancient store function AncientDatadir which can return the root directory of ancient store. The ancient root directory can be used when we want to open some other ancient-stores (e.g. reverse diff freezer).

* core/vm: implement EIP-3855: PUSH0 instruction (ethereum#24039)

* core/vm: Implement PUSH0

* Move PUSH0 to enable3855

* Add method doc

* eth/fetcher: avoid hang in tests (partial fix for ethereum#23331) (ethereum#23351)

* eth/fetcher: fix test to avoid hanging. Partial fix for ethereum#23331

* eth/filters: avoid dangling goroutines

* eth/fetcher: revert closing of proceed

* signer/fourbyte: import new signatures (ethereum#22865)

* abi: fix checks when all fields are indexed (ethereum#24792)

This PR fixes abi checks in the edge case where all arguments are indexed

* core/state/snapshot: fix race condition (ethereum#24685)

Fixes three race conditions found through fuzzing by David Theodore

* all: replace strings.Replace with string.ReplaceAll (ethereum#24835)

* internal: drop TestSignCliqueBlock (ethereum#24837)

* signer/fourbyte: remove offending signatures (ethereum#24842)

* core/vm: update benchmark to use Errorf instead of Sprintf (ethereum#24845)

* eth/protocols/snap: sort trienode heal requests by path (ethereum#24779)

* sort snap trienode heal requests

* eth/protocols/snap: remove debug code

* eth/protocols/snap: simplify sort, generate pathsets later

* eth/protocols/snap: review concern

* eth/protocols/snap: renamings

* eth/protocols/snap: add comments in Merge

* eth/protocols/snap: remove variable 'last' in Merge

* eth/protocols/snap: fix lint flaws in test

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/geth: print info banner for --dev mode (ethereum#24759)


Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: clean up some dead functions (ethereum#24851)

* core/vm: separate opcode group for 0x20 range (ethereum#24850)

* ethclient: add PeerCount method (ethereum#24849)

* adding peer count function

* Update ethclient.go

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: optimize Memory.Set32 (ethereum#24847)

* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32

* graphql: fix long literal passed in a variable (ethereum#24864)

* core/vm: for tracing, do not report post-op memory

* internal/ethapi: add debug_getRawReceipts RPC method (ethereum#24773)

Adds a method to retrieve all the binary encoded receipts from a block

* params: set ropsten TTD for TheMerge (ethereum#24876)

* cmd/utils: add deprecation warning for Rinkeby

* core/asm: use strings.Builder and fix godoc issues (ethereum#24861)

* all: replace uses of ioutil with io and os (ethereum#24869)

* cmd/geth: update vulnerabilities.json testdata (ethereum#24856)

* core/vm: reduce overhead in instructions-benchmark (ethereum#24860)

* core/vm: reduce footprint of OP benchmark

* core/vm: for opBenchmark, add code to detect inputs mutation

* Update core/vm/instructions_test.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: opBenchmark, stop timer before sanity-test code

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: fix flaky test, don't attach empty slots/proofs (ethereum#24885)

* eth/protocols/snap: don't include empty snapshot slot slice

This PR fixes the snapshot storage serving handler. In snap protocol
the response is capped by the response size. Server can cutdown the
response if the accumulated byte size exceeds the local hard limit.

It means we can meet a special scenario that there is no storage slot
included for a requested account, but we attach the proof for this
account by mistake.

So in the prover side, when it meets a empty storage response but with
a valid proof proves there are some more slots left in the trie, then
requestor will reject this response and disconnect with server.

In this PR, if there is no storage slot served for the requested account,
then no proof should be attached as well.

* eth/protocols/snap: loosen restrictions for flaky tests

* eth/catalyst: fix flaky test in catalyst

* graphql: add raw fields to block and tx (ethereum#24816)

* eth/catalyst: set the correct LatestValidHash (ethereum#24855)

* eth/catalyst: set the correct LatestValidHash

* eth/catalyst: core: return LVH during reorg, rework invalid teminal block

* eth/catalyst: nitpicks

* cmd/geth: add `db check-state-content` to verify integrity of trie nodes (ethereum#24840)

This PR adds db tooling (geth db check-state-content)  to verify the integrity of trie nodes. It iterates through the 32-byte key space in the database, which is expected to contain RLP-encoded trie nodes, addressed by hash.

* all: use strings.EqualFold for string comparison (ethereum#24890)

* all: replace non-trivial uses of package ioutil with os (ethereum#24886)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb/remotedb, cmd: add support for remote (readonly) databases (ethereum#24836)

* ethdb/remotedb, cmd: add support for remote (readonly) databases

* ethdb/remotedb: minor changes

* ethdb/remotedb: close the conn

* cmd, ethdb: add rpc accessor for ancient data

* internal/ethapi: license

* ethdb/remotedb: linter fixes

* core, eth, internal, rpc: implement final block (ethereum#24282)

* eth: core: implement finalized block

* eth/catalyst: fix final block

* eth/catalyst: update finalized head gauge

* internal/jsre/deps: updated web3.js to allow for finalized block

* eth/catalyst: make sure only one thread can call fcu

* eth/catalyst: nitpicks

* eth/catalyst: use plain mutex

* eth: nitpicks

* eth/catalyst, miner: build the execution payload async (ethereum#24866)

* eth/catalyst: build the execution payload async

* miner: added comment, added test case

* eth/catalyst: miner: move async block production to miner

* eth/catalyst, miner: support generate seal block async

* miner: rework GetSealingBlockAsync to use a passed channel

* miner: apply rjl's diff

* eth/catalyst: nitpicks

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/tracers/js: goja tracer (ethereum#23773)

This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.

Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.

We expect the performace of JS tracing to be at least as good or better with
this change.

* params: update goerli bootnodes (ethereum#24900)

* params: update goerli bootnodes

* params: use ip for enodes

* params: fix broken linter

* ethdb/remotedb: fix flawed check in Has/HasAncient

* core: fix the order of address in queue (ethereum#24907)

reverse the order of address in queue

* tests: update reference tests (ethereum#24899)

* tests: update reference tests

* tests: fix flaw in state test execution

* f

* eth/tracers/js: add memory.length method (ethereum#24887)

* eth/catalyst: update implementation to spec (ethereum#24802)

* eth/catalyst: return invalid payload attributes error

* eth/catalyst: implement LVH as specified, add tests

* eth/catalyst: return current block hash not header hash

* eth/catalyst: fix test

* eth/catalyst: bring error codes in line with spec

* core, eth, les, rpc: polish catalyst errors, add context

* build/bot: add mac build script (ethereum#24917)

* build/bot: remove xctool invocation in macos build script (ethereum#24918)

* build/bot: add ppa-build.sh (ethereum#24919)

* build/bot: avoid install of python-bzrlib, python-paramiko in PPA build (ethereum#24921)

* build/bot: create .ssh directory in ppa-build.sh (ethereum#24922)

* core/state/snapshot: detect and clean up dangling storage snapshot in generation (ethereum#24811)

* core/state/snapshot: check dangling storages when generating snapshot

* core/state/snapshot: polish

* core/state/snapshot: wipe the last part of the dangling storages

* core/state/snapshot: fix and add tests

* core/state/snapshot: fix comment

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core, cmd: expose dangling storage detector for wider usage

* core/state/snapshot: rename variable

* core, ethdb: use global iterators for snapshot generation

* core/state/snapshot: polish

* cmd, core/state/snapshot: polish

* core/state/snapshot: polish

* Update core/state/snapshot/generate.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb: extend db test suite and fix memorydb iterator

* ethdb/dbtest: rollback changes

* ethdb/memorydb: simplify iteration

* core/state/snapshot: update dangling counter

* core/state/snapshot: release iterators

* core/state/snapshot: update metrics

* core/state/snapshot: update time metrics

* metrics/influxdb: temp solution to present counter meaningfully, remove it

* add debug log, revert later

* core/state/snapshot: fix iterator panic

* all: customized snapshot iterator for backward iteration

* core, ethdb: polish

* core/state/snapshot: remove debug log

* core/state/snapshot: address comments from peter

* core/state/snapshot: reopen the iterator at the next position

* ethdb, core/state/snapshot: address comment from peter

* core/state/snapshot: reopen exhausted iterators

Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* accounts/abi: validate fieldnames, fixes ethereum#24930 (ethereum#24932)

* common/compiler, cmd/abigen: remove solc/vyper compiler integration

* eth/tracers/js: drop duktape engine (ethereum#24934)

ethereum#23773 added a JS tracer which uses Goja as its engine. In this PR I remove the previous tracer which used duktape as well as remove the dependencies.

This PR also comes with 2 fixes in the Goja tracer and one small behavioural change:

    I had handled errors in the native Go functions by panicing. My oversight was that Goja only handles panics with a Goja.Value as argument. The difference is panic(goja.Value) allows JS to catch the exception whereas Interrupt(error) doesn't.
    There was a race in how I handled Stop.
    Because of 1. some of the methods that simply return nil on error (like memory.slice) now throw an exception.

* signer/core: always pad clique header extra data with space for sealer's signature (ethereum#24941)

* signer/core: always pad clique header extra data with space for sealer's signature

* capitalize comment

* go.mod: upgrade to btcsuite/btcd/btcec v2.2.0 (ethereum#24939)

This should fully resolve dependency conflict issues in modules
that also depend on btcsuite/btcd v0.22.0.

* params: update CHTs for Geth 1.10.18

* all: update license headers and AUTHORS from git history (ethereum#24947)

* AUTHORS: remove one more duplicate entry (ethereum#24950)

* go.mod: upgrade to docker v1.6.2 (ethereum#24956)

This upgrade is necessary to silence a Dependabot warning.

* params: go-ethereum v1.10.18 stable

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: flowerofdream <775654398@qq.com>
Co-authored-by: Yong Yang <yangyong775654@163.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Nic Jansma <nic@nicj.net>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Tatsuya Shimoda <tacoo@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Tangui Clairet <tangui.clairet@gmail.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Vaibhaw <kvaibhaw99@gmail.com>
Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
Co-authored-by: Koosha K <koosha--@users.noreply.github.com>
Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Nikita Kozhemyakin <enginegl.ec@gmail.com>
Co-authored-by: henopied <13500516+henopied@users.noreply.github.com>
Co-authored-by: John Difool <johndifoolpi@gmail.com>
Co-authored-by: tia-99 <67107070+tia-99@users.noreply.github.com>
Co-authored-by: Joshua Gutow <jbgutow@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: nujabes403 <nujabes403@gmail.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Evgeny Kolyakov <freaker2k7@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: milesvant <milesvant@gmail.com>
Co-authored-by: ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
Co-authored-by: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Rachel Franks <nfranks@protonmail.com>
Co-authored-by: ||= nil <103940716+nedifi@users.noreply.github.com>
Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
Co-authored-by: Qian Bin <cola.tin.com@gmail.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: Austin Roberts <austin.roberts@rivet.cloud>

Co-authored-by: Ayaz Abbas <ayaz38@live.co.uk>
Co-authored-by: Richard Howard <richardahoward@gmail.com>
Co-authored-by: AusIV <git@ausiv.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: flowerofdream <775654398@qq.com>
Co-authored-by: Yong Yang <yangyong775654@163.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Nic Jansma <nic@nicj.net>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Tatsuya Shimoda <tacoo@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Tangui Clairet <tangui.clairet@gmail.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Vaibhaw <kvaibhaw99@gmail.com>
Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
Co-authored-by: Koosha K <koosha--@users.noreply.github.com>
Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Nikita Kozhemyakin <enginegl.ec@gmail.com>
Co-authored-by: henopied <13500516+henopied@users.noreply.github.com>
Co-authored-by: John Difool <johndifoolpi@gmail.com>
Co-authored-by: tia-99 <67107070+tia-99@users.noreply.github.com>
Co-authored-by: Joshua Gutow <jbgutow@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: nujabes403 <nujabes403@gmail.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Evgeny Kolyakov <freaker2k7@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: milesvant <milesvant@gmail.com>
Co-authored-by: ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
Co-authored-by: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Rachel Franks <nfranks@protonmail.com>
Co-authored-by: ||= nil <103940716+nedifi@users.noreply.github.com>
Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
Co-authored-by: Qian Bin <cola.tin.com@gmail.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: Austin Roberts <austin.roberts@rivet.cloud>
dmarzzz pushed a commit to blocknative/go-ethereum that referenced this issue Jun 27, 2022
* params: begin v1.10.18 release cycle

* rlp: fix typo in comment (ethereum#24595)

Co-authored-by: Yong Yang <yangyong775654@163.com>

* core/state/snapshot: clean up the generation code (ethereum#24479)

* go.mod : upnp 1.0.3 stable version (ethereum#24573)

* internal/ethapi: add refund to StructLogRes (ethereum#24567)

* internal/ethapi: add refund to StructLogRes

* Update internal/ethapi/api.go

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* eth/tracers/logger: use omitempty to reduce log bloat  (ethereum#24547)

Makes the evm json output less verbose: omitting output of `memory` and `returndata` in case they are empty.

* common/compiler: add extra include paths to solidity compiler (ethereum#24541)

This PR adds a ExtraAllowedPath field to Solidity and exposes two APIs: CompileSource and CompileFiles, which were hidden inside CompileSolidityString and CompileSolidity before.

* core: verify genesis extradata for clique (ethereum#24470)

* Add extra-data checks for clique genesis

* Update genesis.go

* Update genesis.go

* core: simplify clique genesis check

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: change snapshot extension registration failure to warning instead of error (ethereum#24475)

* core: Change Snapshot extension registration failed to Debug

* Update eth/handler.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* trie, les, tests, core: implement trie tracer (ethereum#24403)

Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.

* core,eth: implement tx-level hooks for tracers (ethereum#24510)

* core,eth: add empty tx logger hooks

* core,eth: add initial and remaining gas to tx hooks

* store tx gasLimit in js tracer

* use gasLimit to compute intrinsic cost for js tracer

* re-use rules in transitiondb

* rm logs

* rm logs

* Mv some fields from Start to TxStart

* simplify sender lookup in prestate tracer

* mv env to TxStart

* Revert "mv env to TxStart"

This reverts commit 656939634b9aff19f55a1cd167345faf8b1ec310.

* Revert "simplify sender lookup in prestate tracer"

This reverts commit ab65bce48007cab99e68232e7aac2fe008338d50.

* Revert "Mv some fields from Start to TxStart"

This reverts commit aa50d3d9b2559addc80df966111ef5fb5d0c1b6b.

* fix intrinsic gas for prestate tracer

* add comments

* refactor

* fix test case

* simplify consumedGas calc in prestate tracer

* eth: clarify the error string on getlogs failure (ethereum#24617)

This PR makes the errors we spit out a bit more clear about what block is problematic.

* eth/downloader: retrieve pivot header from local chain if necessary (ethereum#24610)

* eth/downloader: retrieve pivot header from local chain if necessary

* eth/downloader: improve readability

* eth/downloader: update fix

* eth/downloader: add beacon sync tests

* eth/downloader: remove duplicated code

* README: update free space required (ethereum#24636)

* rpc: fixed a typo (ethereum#24642)

* eth/fetcher: if peers never respond, drop them

* eth/tracers: refactor traceTx to separate out struct logging (ethereum#24326)

* eth/tracers: refactor traceTx to separate out struct logging

review fix

Update eth/tracers/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

Mv ExecutionResult type to logger package

review fix

impl GetResult for StructLogger

make formatLogs private

confused exit and end..

account for intrinsicGas in structlogger, fix TraceCall test

Add Stop method to logger

Simplify traceTx

Fix test

rm logger from blockchain test

account for refund in structLogger

* use tx hooks in struct logger

* minor

* avoid executionResult in struct logger

* revert blockchain test changes

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core/state/snapshot: remove noop map item assignment

* cmd/geth: inspect snapshot dangling storage (ethereum#24643)

* cmd/geth: inspect snapshot dangling storage

* cmd/geth: make verify-state invoke verify-dangling

* accounts/abi: handle tuple arrays in ParseSelector (ethereum#24587)

Closes ethereum#24571

* all: use T.TempDir to create temporary test directories (ethereum#24633)

This commit replaces ioutil.TempDir with t.TempDir in tests. The
directory created by t.TempDir is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using ioutil.TempDir
had to be removed manually by calling os.RemoveAll, which is omitted in
some tests. The error handling boilerplate e.g.

	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}

is also tedious, but t.TempDir handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* les: fix panic in ultralight client sync (ethereum#24641)

* log: modify lock defer unlock order in sync handler (ethereum#24667)

This modifies the order of Lock() defer Unlock() to follow the more
typically used pattern.

* build/deb: update Debian control file to remove unencrypted git protocol (ethereum#24676)

* core/types: make "miner" optional in Header JSON (ethereum#24666)

"miner" is not set for pending block responses in some cases.

Fixes ethereum#24632

* cmd: set DefaultGasLimit to 30M (ethereum#24680)

* cmd: set DefaultGasLimit to 30M, rem deprec. Flag

* cmd: revert flag deprecation

* core: fix benchmark panic (ethereum#24657)

This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.

* abi/base: return error for pending call error (ethereum#24649)

If a pending contract call errors, return that error right away rather
than ignoring it to allow an error somewhere else. This is helpful for
callers to know if perhaps a call failed because of the context deadline
being expired. This change mirrors the behavior of non-pending contract
calls.

* build: add imports for go generate tools (ethereum#24682)

This adds a tools.go file to import all command packages used for
go:generate. Doing so makes it possible to execute go-based code
generators using 'go run', locking in the tool version using go.mod.

Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/tracers: make txhash blockhash accessible to native tracers (ethereum#24679)

* cmd/geth: support bigints for --override.terminaltotaldifficulty (ethereum#24646)


Co-authored-by: Felix Lange <fjl@twurst.com>

* eth/downloader: remove stale beacon headers as backfilling progresses (ethereum#24670)

* eth/downloader: remove stale beacon headers as backfilling progresses

* eth/downloader: remove leftover from a previous design

* eth/downloader: do partial beacon cleanups if chain is large

* eth/downloader: linter != heart

* build: upgrade -dlgo version to Go 1.18.1 (ethereum#24689)

* build: upgrade -dlgo version to Go 1.18.1

* build: upgrade -dlgo version for macOS to Go 1.18.1

* eth/downloader: resolve local header by hash for beacon sync (ethereum#24691)

* eth/downlaoder: resolve local header by hash for beacon sync

* eth/downloader: fix error message

* eth/downloader: cap the reverse header resolving

* eth/downloader: re-enable tests

* eth/downloader: add warning logs

* go.mod: upgrade btcec and add 'chainhash' module requirement (ethereum#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.

* trie: remove unused makeHashNode (ethereum#24702)

* core/vm: fix typo (ethereum#24714)

Was just browsing the code and found this.

* eth/downloader: fix typo in downloader.go (ethereum#24704)

synchornization -> synchronization

* eth/tracers/logger: remove unnecessary comparisons in accessList.equal (ethereum#24663)

This change removes extraneous/unnecessary checks for equality
when comparing 2 accessList values A and B. Given that we validate that
their lengths of A and B are equal, if so and if every element in A is
in B, reflexively every element in B is already in A. If that weren't
the case and an element g existed in A but not in B, that would mean
that there is an extra element and hence a mathematical contradiction.

Fixes ethereum#24658

* README.md: update Go min required version to 1.16 (ethereum#24713)

* .github: update CODEOWNERS (ethereum#24743)

* internal/flags: fix godoc (ethereum#24734)

* cmd/faucet: fix genesis flag and improve documentation (ethereum#24735)

* cmd/evm: ensure input length is even (ethereum#24721)

* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix

Co-authored-by: Martin Holst Swende <martin@swende.se>

* fix typo (ethereum#24731)

* mobile: fix receipt encoding to json (ethereum#24701)

* p2p: fix type of DiscSubprotocolError (ethereum#24747)

It was 'int' accidentally, should be DiscReason instead.

* all: use 'embed' instead of go-bindata (ethereum#24744)

* cmd/geth, core/state/snapshot: fix flaw in dangling-storage check + inspect difflayers (ethereum#24677)

This PR fixes the flaw that @rjl493456442 found in https://github.com/ethereum/go-ethereum/pull/#issuecomment-1093817551 , namely, that the snapshot iterator uses the combined (disk + difflayers) 'view', wheres the raw iterator uses only the disk 'view'.

This PR instead splits up the work: one phase is iterating the disk layer data, another phase is loading the journalled difflayers and performing the same check there.

* cmd/*: refactor get flag value (ethereum#24761)

* consensus/ethash: fix typos in var names (ethereum#24745)

* internal/ethapi: add db operations to api (ethereum#24739)

Adds `debug_dbGet` method to rpc api

* core/types: fix unhandled errors in TestTransactionCoding (ethereum#24692)

* cmd/utils: utilize beacon wrapper in makechain (ethereum#24620)

* cmd/utils: utilize beacon wrapper in makechain

* cmd/utils: fix fake-pow to also be wrapped in beacon

* consensus/misc: correct error message

* all: use common.FileExist for checking file existence (ethereum#24748)

* ethclient/gethclient: return storage proofs in GetProof (ethereum#24697)

Storage proofs were being unmarshalled from the RPC form to the go struct, but were not being included in the final returned struct.

* eth/filters: remove unused struct fields (ethereum#24782)

* cmd/clef: fixups to the python clef poc (ethereum#24440)

This PR fixes up the example python clef wrapper. The poc is intended to demonstrate how to wite a UI for clef, and had severely bitrotted.
With these changes, it "works" in the sense that all the built-in tests triggers the intended python callbacks (no errors about method not found). It does not "work" in the sense that the wrapper can be used as an actual UI. It will auto-reject any signing requests, for example.

* cmd/evm: make evm t8n handle post-merge transitions (ethereum#24546)

This adds the ability to run --state.fork=Merged, and have post-merge rules apply. When doing so, it also requires the input env to contain currentRandom, and enforces the currentDifficulty to be omitted or zero.

* cmd: group network and db path flags together (ethereum#24698)

This PR groups all built-in network flags together and list them in the command as a whole.

And all database path flags(datadir, ancient) are also grouped, since usually these two are
used together.

* accounts: fix typo in comments (ethereum#24805)

* docker: speed up docker image build (ethereum#24796)

This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer

* cmd/utils: double limit on free-disk monitor (ethereum#24781)

This PR doubles the limit on which to trigger automatic shutdown, and also changes the timer to run once every 30s instead of 60s.

* build: fix formatted logs (ethereum#24807)

Changed `log.Fatal` to `log.Fatalf()` as it has a parameter...

* build: ppa build for jammy (ubuntu 22.04)

* graphql: add rawReceipt field to transaction type (ethereum#24738)

* graphql: add tx receiptsRLP field

* use MarshalBinary

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* update schema

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* rename to rawReceipt

* indent fix

Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>

* eth/filters: fix code comment (ethereum#24799)

* cmd/geth: fix init genesis for dev (ethereum#24693)

* cmd/geth: fix init genesis for dev

* use ancient flag for init genesis cmd

* cmd, eth: fix required blocks regression

* core: fix WriteBlockAndSetHead documentation (ethereum#24818)

* core: recover state when beacon sets canonical head if it's missing (ethereum#24613)

* core: recover the state in SetChainHead if the head state is missing

* core: disable test logging

* core: address comment from martin

* core: improve log level in case state is recovered

* core, eth, les, light: rename SetChainHead to SetCanonical

* eth/protocols/eth: fix godoc comments (ethereum#24810)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/filters: remove explicit continue label in filterLogs (ethereum#24795)

The loop label can be removed because this 'continue' statement
is not in a nested loop.

* p2p/simulations: escape mockerType value from request (ethereum#24822)


Co-authored-by: Felix Lange <fjl@twurst.com>

* p2p/simulations: fix typo in network_test.go (ethereum#24824)

* miner: discard interrupted blocks (ethereum#24638)

During mining, when a new head arrives and interrupts the block building, the block being built should not be commited (but discarded). Committing the interrupted block introduces unnecessary delay, and possibly causes miner to mine on the previous head, which could result in higher uncle rate.

* core/rawdb: untie freezer and ancient chain data (ethereum#24684)

Previously freezer has only been used for storing ancient chain data, while obviously it can be used more. This PR unties the chain data and freezer, keep the minimal freezer structure and move all other logic (like incrementally freezing block data) into a separate structure called ChainFreezer.

This PR also extends the database interface by adding a new ancient store function AncientDatadir which can return the root directory of ancient store. The ancient root directory can be used when we want to open some other ancient-stores (e.g. reverse diff freezer).

* core/vm: implement EIP-3855: PUSH0 instruction (ethereum#24039)

* core/vm: Implement PUSH0

* Move PUSH0 to enable3855

* Add method doc

* eth/fetcher: avoid hang in tests (partial fix for ethereum#23331) (ethereum#23351)

* eth/fetcher: fix test to avoid hanging. Partial fix for ethereum#23331

* eth/filters: avoid dangling goroutines

* eth/fetcher: revert closing of proceed

* signer/fourbyte: import new signatures (ethereum#22865)

* abi: fix checks when all fields are indexed (ethereum#24792)

This PR fixes abi checks in the edge case where all arguments are indexed

* core/state/snapshot: fix race condition (ethereum#24685)

Fixes three race conditions found through fuzzing by David Theodore

* all: replace strings.Replace with string.ReplaceAll (ethereum#24835)

* internal: drop TestSignCliqueBlock (ethereum#24837)

* signer/fourbyte: remove offending signatures (ethereum#24842)

* core/vm: update benchmark to use Errorf instead of Sprintf (ethereum#24845)

* eth/protocols/snap: sort trienode heal requests by path (ethereum#24779)

* sort snap trienode heal requests

* eth/protocols/snap: remove debug code

* eth/protocols/snap: simplify sort, generate pathsets later

* eth/protocols/snap: review concern

* eth/protocols/snap: renamings

* eth/protocols/snap: add comments in Merge

* eth/protocols/snap: remove variable 'last' in Merge

* eth/protocols/snap: fix lint flaws in test

Co-authored-by: Felix Lange <fjl@twurst.com>

* cmd/geth: print info banner for --dev mode (ethereum#24759)


Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: clean up some dead functions (ethereum#24851)

* core/vm: separate opcode group for 0x20 range (ethereum#24850)

* ethclient: add PeerCount method (ethereum#24849)

* adding peer count function

* Update ethclient.go

Co-authored-by: Felix Lange <fjl@twurst.com>

* core/vm: optimize Memory.Set32 (ethereum#24847)

* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32

* graphql: fix long literal passed in a variable (ethereum#24864)

* core/vm: for tracing, do not report post-op memory

* internal/ethapi: add debug_getRawReceipts RPC method (ethereum#24773)

Adds a method to retrieve all the binary encoded receipts from a block

* params: set ropsten TTD for TheMerge (ethereum#24876)

* cmd/utils: add deprecation warning for Rinkeby

* core/asm: use strings.Builder and fix godoc issues (ethereum#24861)

* all: replace uses of ioutil with io and os (ethereum#24869)

* cmd/geth: update vulnerabilities.json testdata (ethereum#24856)

* core/vm: reduce overhead in instructions-benchmark (ethereum#24860)

* core/vm: reduce footprint of OP benchmark

* core/vm: for opBenchmark, add code to detect inputs mutation

* Update core/vm/instructions_test.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: opBenchmark, stop timer before sanity-test code

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth: fix flaky test, don't attach empty slots/proofs (ethereum#24885)

* eth/protocols/snap: don't include empty snapshot slot slice

This PR fixes the snapshot storage serving handler. In snap protocol
the response is capped by the response size. Server can cutdown the
response if the accumulated byte size exceeds the local hard limit.

It means we can meet a special scenario that there is no storage slot
included for a requested account, but we attach the proof for this
account by mistake.

So in the prover side, when it meets a empty storage response but with
a valid proof proves there are some more slots left in the trie, then
requestor will reject this response and disconnect with server.

In this PR, if there is no storage slot served for the requested account,
then no proof should be attached as well.

* eth/protocols/snap: loosen restrictions for flaky tests

* eth/catalyst: fix flaky test in catalyst

* graphql: add raw fields to block and tx (ethereum#24816)

* eth/catalyst: set the correct LatestValidHash (ethereum#24855)

* eth/catalyst: set the correct LatestValidHash

* eth/catalyst: core: return LVH during reorg, rework invalid teminal block

* eth/catalyst: nitpicks

* cmd/geth: add `db check-state-content` to verify integrity of trie nodes (ethereum#24840)

This PR adds db tooling (geth db check-state-content)  to verify the integrity of trie nodes. It iterates through the 32-byte key space in the database, which is expected to contain RLP-encoded trie nodes, addressed by hash.

* all: use strings.EqualFold for string comparison (ethereum#24890)

* all: replace non-trivial uses of package ioutil with os (ethereum#24886)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb/remotedb, cmd: add support for remote (readonly) databases (ethereum#24836)

* ethdb/remotedb, cmd: add support for remote (readonly) databases

* ethdb/remotedb: minor changes

* ethdb/remotedb: close the conn

* cmd, ethdb: add rpc accessor for ancient data

* internal/ethapi: license

* ethdb/remotedb: linter fixes

* core, eth, internal, rpc: implement final block (ethereum#24282)

* eth: core: implement finalized block

* eth/catalyst: fix final block

* eth/catalyst: update finalized head gauge

* internal/jsre/deps: updated web3.js to allow for finalized block

* eth/catalyst: make sure only one thread can call fcu

* eth/catalyst: nitpicks

* eth/catalyst: use plain mutex

* eth: nitpicks

* eth/catalyst, miner: build the execution payload async (ethereum#24866)

* eth/catalyst: build the execution payload async

* miner: added comment, added test case

* eth/catalyst: miner: move async block production to miner

* eth/catalyst, miner: support generate seal block async

* miner: rework GetSealingBlockAsync to use a passed channel

* miner: apply rjl's diff

* eth/catalyst: nitpicks

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/tracers/js: goja tracer (ethereum#23773)

This adds a JS tracer runtime environment based on the Goja VM. The new
runtime replaces the duktape runtime, which will be removed soon.

Goja is implemented in Go and is faster for cases where the Go <-> JS
transition overhead dominates overall performance. It is faster because
duktape is written in C, and the transition cost includes the cost of using
cgo. Another reason for using Goja is that go-duktape is not maintained
anymore.

We expect the performace of JS tracing to be at least as good or better with
this change.

* params: update goerli bootnodes (ethereum#24900)

* params: update goerli bootnodes

* params: use ip for enodes

* params: fix broken linter

* ethdb/remotedb: fix flawed check in Has/HasAncient

* core: fix the order of address in queue (ethereum#24907)

reverse the order of address in queue

* tests: update reference tests (ethereum#24899)

* tests: update reference tests

* tests: fix flaw in state test execution

* f

* eth/tracers/js: add memory.length method (ethereum#24887)

* eth/catalyst: update implementation to spec (ethereum#24802)

* eth/catalyst: return invalid payload attributes error

* eth/catalyst: implement LVH as specified, add tests

* eth/catalyst: return current block hash not header hash

* eth/catalyst: fix test

* eth/catalyst: bring error codes in line with spec

* core, eth, les, rpc: polish catalyst errors, add context

* build/bot: add mac build script (ethereum#24917)

* build/bot: remove xctool invocation in macos build script (ethereum#24918)

* build/bot: add ppa-build.sh (ethereum#24919)

* build/bot: avoid install of python-bzrlib, python-paramiko in PPA build (ethereum#24921)

* build/bot: create .ssh directory in ppa-build.sh (ethereum#24922)

* core/state/snapshot: detect and clean up dangling storage snapshot in generation (ethereum#24811)

* core/state/snapshot: check dangling storages when generating snapshot

* core/state/snapshot: polish

* core/state/snapshot: wipe the last part of the dangling storages

* core/state/snapshot: fix and add tests

* core/state/snapshot: fix comment

* README: remove mentions of fast sync (ethereum#24656)

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>

* core, cmd: expose dangling storage detector for wider usage

* core/state/snapshot: rename variable

* core, ethdb: use global iterators for snapshot generation

* core/state/snapshot: polish

* cmd, core/state/snapshot: polish

* core/state/snapshot: polish

* Update core/state/snapshot/generate.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* ethdb: extend db test suite and fix memorydb iterator

* ethdb/dbtest: rollback changes

* ethdb/memorydb: simplify iteration

* core/state/snapshot: update dangling counter

* core/state/snapshot: release iterators

* core/state/snapshot: update metrics

* core/state/snapshot: update time metrics

* metrics/influxdb: temp solution to present counter meaningfully, remove it

* add debug log, revert later

* core/state/snapshot: fix iterator panic

* all: customized snapshot iterator for backward iteration

* core, ethdb: polish

* core/state/snapshot: remove debug log

* core/state/snapshot: address comments from peter

* core/state/snapshot: reopen the iterator at the next position

* ethdb, core/state/snapshot: address comment from peter

* core/state/snapshot: reopen exhausted iterators

Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* accounts/abi: validate fieldnames, fixes ethereum#24930 (ethereum#24932)

* common/compiler, cmd/abigen: remove solc/vyper compiler integration

* eth/tracers/js: drop duktape engine (ethereum#24934)

ethereum#23773 added a JS tracer which uses Goja as its engine. In this PR I remove the previous tracer which used duktape as well as remove the dependencies.

This PR also comes with 2 fixes in the Goja tracer and one small behavioural change:

    I had handled errors in the native Go functions by panicing. My oversight was that Goja only handles panics with a Goja.Value as argument. The difference is panic(goja.Value) allows JS to catch the exception whereas Interrupt(error) doesn't.
    There was a race in how I handled Stop.
    Because of 1. some of the methods that simply return nil on error (like memory.slice) now throw an exception.

* signer/core: always pad clique header extra data with space for sealer's signature (ethereum#24941)

* signer/core: always pad clique header extra data with space for sealer's signature

* capitalize comment

* go.mod: upgrade to btcsuite/btcd/btcec v2.2.0 (ethereum#24939)

This should fully resolve dependency conflict issues in modules
that also depend on btcsuite/btcd v0.22.0.

* params: update CHTs for Geth 1.10.18

* all: update license headers and AUTHORS from git history (ethereum#24947)

* AUTHORS: remove one more duplicate entry (ethereum#24950)

* go.mod: upgrade to docker v1.6.2 (ethereum#24956)

This upgrade is necessary to silence a Dependabot warning.

* params: go-ethereum v1.10.18 stable

* params: begin v1.10.19 release cycle

* cmd/geth: exit when freezer has legacy receipts (ethereum#24943)

In ethereum#24028 we flagged a warning when finding legacy receipts in the freezer. This PR nudges users a bit more strongly by preventing geth from starting in this case until receipts have been migrated.

It also adds a flag --ignore-legacy-receipts which when present allows geth to start normally.

* cmd/abigen: accept combined-json via stdin (ethereum#24960)

* params: set emergency ropsten TTD to 100_000_000_000_000_000_000_000 (ethereum#24975)

* core: use less memory during reorgs (ethereum#24616)

This PR significantly reduces the memory consumption of a long reorg

* cmd/geth: extend traverseRawState command (ethereum#24954)

This PR adds node verification into traverseRawState command, so corrupted trie nodes can also be detected.

* consensus/clique: fix race condition (ethereum#24957)

* consensus/clique: remove race condition

* consensus/clique: fix one more signer data race

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* eth/catalyst: fix edge case in NewPayload (ethereum#24955)

Fixes an issue where we would accept a NewPayload where the grandparent is already post ttd, and the parent still has a Difficulty

* contracs/checkpointoracle: fix directives (ethereum#24944)

contracts/checkpointoracle: redefine go-generate logic

* eth/filters: use buffered channel to avoid goroutine leak (ethereum#24928)

* core/beacon: prevent invalid logsBloom length panic (ethereum#24946)

* core/beacon: prevent invalid logsBloom length panic

* core/beacon: prevent negative baseFeePerGas

* Update core/beacon/types.go

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/catalys: go format

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core: fix canonical hash marker update (ethereum#24996)

* core: fix reorg

* core: revert change for memory efficiency

* core: revert changes

* eth/tracers: add support for block overrides in debug_traceCall (ethereum#24871)

This PR adds support for block overrides when doing debug_traceCall.

- Previously, debug_traceCall against pending erroneously used a common.Hash{} stateroot when looking up the state, meaning that a totally empty state was used -- so it always failed,
- With this change, we reject executing debug_traceCall against pending.
- And we add ability to override all evm-visible header fields.

* tests/fuzzers/bls12381: Add BLST to fuzzing support (ethereum#24249)

* tests/fuzzers/bls12381: added blst library

* go.mod: added blst dependency

* tests/fuzzers/bls12381: stuff

* tests/fuzzers/bls12381: added blst to pairing fuzzer

* eth/catalyst: return 0x0 on Invalid block on top of pow block (ethereum#25006)

* node: make jwt test less dependent on time (ethereum#25016)

* consensus/misc: reduce allocations and improve comments in CalcBaseFee (ethereum#24958)

* consensus/misc: reduce allocations in CalcBaseFee

* consensus/misc: add formulas of CalcBaseFee

* go.mod: set go version to 1.17 (ethereum#24926)

set go version to 1.17

* go.mod: clean up (ethereum#25017)

* core/vm: optimize jumpdest analysis (ethereum#23500)

core/vm: optimize PUSH opcode discrimination

* tests/fuzzers/bls12381: fix blst deserializing (ethereum#25036)

* tests/fuzzers/bls12381: fix blst deserializing

* tests/fuzzers/bls12381: fix blst deserializing

* cmd/geth, core/state/snapshot: rework journal loading, implement account-check (ethereum#24765)

* cmd/geth, core/state/snapshot: rework journal loading, implement account-check

* core/state/snapshot, cmd/geth: polish code (#37)

* core/state/snapshot: minor nits

* core/state/snapshot: simplify error logic

* cmd/geth: go format

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>

* all: introduce trie owner notion (ethereum#24750)

* cmd, core/state, light, trie, eth: add trie owner notion

* all: refactor

* tests: fix goimports

* core/state/snapshot: fix ineffasigns

Co-authored-by: Martin Holst Swende <martin@swende.se>

* eth/api: use `hexutil.Bytes` for account range method (ethereum#25024)

eth/api: use hexutil.Bytes for range at methods

* eth/tracers: fix typo in 4byte_tracer_legacy.js (ethereum#25020)

indentifier -> identifier

* trie: move locking into trieDB insert method (ethereum#25030)

Move locking into trieDB insert function

* params: update ropsten terminal total difficulty block (ethereum#25018)

* eth/filters: fix getLogs for pending block (ethereum#24949)

* eth/filters: fix pending for getLogs

* add pending method to test backend

* fix block range validation

* accounts/abi/bind: fix duplicate field names in the generated go struct (ethereum#24924)

* accounts/abi/bind: fix duplicate field names in the generated go struct ethereum#24627

* accounts, cmd/abigen: resolve name conflicts

* ci lint, accounts/abi: remove unused function overloadedArgName

Co-authored-by: Gary Rong <garyrong0905@gmail.com>

* tests/fuzzers/bls12381: fix blst pairing (ethereum#25037)

* tests/fuzzers/bls12381: fix blst pairing

* tests/fuzzers/bls12381: only build on gofuzz

* tests/fuzzers/bls12381: remove unused code

* tests/fuzzers/bls12381: remove unused code

* p2p/discover: fix panicky test (ethereum#25038)

* accounts: increase parseURL test coverage (ethereum#25033)

accounts/url: add test logic what check null string to parseURL()

* eth, les, params: log chain config a bit saner (ethereum#24904)

Previously on Geth startup we just logged the chain config is a semi-json-y format. Whilst that worked while we had a handful of hard-forks defined, currently it's kind of unwieldy. 

This PR converts that original data dump and converts it into a user friendly - alas multiline - log output.

* p2p: use errors.Is for error comparison (ethereum#24882)


Co-authored-by: Felix Lange <fjl@twurst.com>

* rpc: swap out timer metrics to histograms

* eth/catalyst: remove unauthenticated 'engine' api (ethereum#24997)

Removes engine from any unauthenticated RPC service.

* core/types: remove unused field 'td' in Block (ethereum#25010)

* core/types: improve LogForStorage and ReceiptForStorage comments (ethereum#25032)


Co-authored-by: Felix Lange <fjl@twurst.com>

* core/evm: fix error in comment (ethereum#25040)


Co-authored-by: Martin Holst Swende <martin@swende.se>

* internal/ethapi: fix typo in comment (ethereum#25056)

typo error: keccack256 -> keccak256

* Chore:  Minimal gramatical errors (signleton -> singleton) (ethereum#25057)

core: fix typos

* all: more linters (ethereum#24783)

This enables the following linters

- typecheck
- unused
- staticcheck
- bidichk
- durationcheck
- exportloopref
- gosec

WIth a few exceptions.

- We use a deprecated protobuf in trezor. I didn't want to mess with that, since I cannot meaningfully test any changes there.
- The deprecated TypeMux is used in a few places still, so the warning for it is silenced for now.
- Using string type in context.WithValue is apparently wrong, one should use a custom type, to prevent collisions between different places in the hierarchy of callers. That should be fixed at some point, but may require some attention.
- The warnings for using weak random generator are squashed, since we use a lot of random without need for cryptographic guarantees.

* cmd/utils: update --ropsten description (ethereum#25078)

* readme,eth: remove references to eth.wiki (ethereum#25086)

* cmd/ethkey: use accounts.TextHash (ethereum#25069)

* common: improve pretty duration regex (ethereum#25073)

* common: improve pretty duration regex

* common: improve pretty duration regex

* all: prefer `new(big.Int)` over `big.NewInt(0)` (ethereum#25087)

minor performance improvement: `big.NewInt(0).Xxx` -> `new(big.Int).Xxx`

* eth: add missing period at end of sentences (ethereum#25058)

eth: add missing periods on end of comments

* eth: introduce eth67 protocol (ethereum#24093)

The new protocol version removes support for GetNodeData.
See https://eips.ethereum.org/EIPS/eip-4938 for more information.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>

* cmd, params: implement Gray Glacier hard-fork (EIP-5133) (ethereum#25088)

* cmd/geth, params: implement Gray Glacier (EIP-5133)

* cmd/evm: add gray glacier tests

* params: nitpicks

* params: fixes

* node: add info message when JWT secret is loaded (ethereum#25095)


Co-authored-by: Felix Lange <fjl@twurst.com>

* params: release Geth v1.10.19

Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: flowerofdream <775654398@qq.com>
Co-authored-by: Yong Yang <yangyong775654@163.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Co-authored-by: ucwong <ucwong@126.com>
Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Co-authored-by: zhiqiangxu <652732310@qq.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Nic Jansma <nic@nicj.net>
Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com>
Co-authored-by: John Adler <adlerjohn@users.noreply.github.com>
Co-authored-by: Tatsuya Shimoda <tacoo@users.noreply.github.com>
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
Co-authored-by: Tbnoapi <63448616+nuoomnoy02@users.noreply.github.com>
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Tangui Clairet <tangui.clairet@gmail.com>
Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: aaronbuchwald <aaron.buchwald56@gmail.com>
Co-authored-by: Vaibhaw <kvaibhaw99@gmail.com>
Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com>
Co-authored-by: Marius Kjærstad <sandakersmann@users.noreply.github.com>
Co-authored-by: Darioush Jalali <darioush.jalali@avalabs.org>
Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Emmanuel T Odeke <odeke@ualberta.ca>
Co-authored-by: Koosha K <koosha--@users.noreply.github.com>
Co-authored-by: s7v7nislands <s7v7nislands@gmail.com>
Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: Nikita Kozhemyakin <enginegl.ec@gmail.com>
Co-authored-by: henopied <13500516+henopied@users.noreply.github.com>
Co-authored-by: John Difool <johndifoolpi@gmail.com>
Co-authored-by: tia-99 <67107070+tia-99@users.noreply.github.com>
Co-authored-by: Joshua Gutow <jbgutow@gmail.com>
Co-authored-by: hero5512 <lvshuaino@gmail.com>
Co-authored-by: nujabes403 <nujabes403@gmail.com>
Co-authored-by: EXEC <execvy@gmail.com>
Co-authored-by: Evgeny Kolyakov <freaker2k7@users.noreply.github.com>
Co-authored-by: Ryan Schneider <ryanleeschneider@gmail.com>
Co-authored-by: milesvant <milesvant@gmail.com>
Co-authored-by: ImanSharaf <78227895+ImanSharaf@users.noreply.github.com>
Co-authored-by: Mateusz Morusiewicz <11313015+Ruteri@users.noreply.github.com>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Rachel Franks <nfranks@protonmail.com>
Co-authored-by: ||= nil <103940716+nedifi@users.noreply.github.com>
Co-authored-by: nedifi <nedifi@users.noreply.github.com>
Co-authored-by: Felipe Strozberg <48066928+FelStroz@users.noreply.github.com>
Co-authored-by: Qian Bin <cola.tin.com@gmail.com>
Co-authored-by: Håvard Anda Estensen <haavard.ae@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: zhaochonghe <41711151+zhaochonghe@users.noreply.github.com>
Co-authored-by: Eduard S <eduardsanou@posteo.net>
Co-authored-by: Austin Roberts <austin.roberts@rivet.cloud>
Co-authored-by: Harry Kalodner <harry.kalodner@gmail.com>
Co-authored-by: Boqin Qin(秦 伯钦) <Bobbqqin@gmail.com>
Co-authored-by: Ivan Kuznetsov <me@jeiwan.ru>
Co-authored-by: Jonathan Le Brun <42697488+icyfry@users.noreply.github.com>
Co-authored-by: Paweł Bylica <chfast@gmail.com>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
Co-authored-by: lwh <lwhile521@gmail.com>
Co-authored-by: Seungbae.yu <72970043+dbadoy@users.noreply.github.com>
Co-authored-by: Rajaram Gaunker <zimbabao@gmail.com>
Co-authored-by: henridf <henri@dubfer.com>
Co-authored-by: int88 <106391185+int88@users.noreply.github.com>
Co-authored-by: Luozhu <70309026+LuozhuZhang@users.noreply.github.com>
Co-authored-by: Gustavo Silva <GustavoRSSilva@users.noreply.github.com>
Co-authored-by: Ivan Aracki <aracki.ivan@gmail.com>
Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
p4u pushed a commit to vocdoni/blind-csp that referenced this issue Jul 18, 2022
Update btcd from v0.22.0-beta to v0.22.1 per the instructions on
btcsuite/btcd#1839 to work around an ambiguous
import via go-ethereum:

	github.com/vocdoni/blind-csp/saltedkey imports
		github.com/ethereum/go-ethereum/crypto imports
		github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
		github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
		github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
		github.com/btcsuite/btcd v0.22.0-beta (/home/mvdan/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
		github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/home/mvdan/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)
@qdm12
Copy link

qdm12 commented Aug 30, 2022

Hello all, I hope I won't spam this thread too much. However having read most of it, I can't figure out how to solve this dependency hell.

I have github.com/ethereum/go-ethereum v1.10.23 and github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect requirements, but it fails with the error message

github.com/ChainSafe/gossamer/lib/crypto/secp256k1 imports
        github.com/ethereum/go-ethereum/crypto imports
        github.com/btcsuite/btcd/btcec/v2/ecdsa tested by
        github.com/btcsuite/btcd/btcec/v2/ecdsa.test imports
        github.com/btcsuite/btcd/chaincfg/chainhash: ambiguous import: found package github.com/btcsuite/btcd/chaincfg/chainhash in multiple modules:
        github.com/btcsuite/btcd v0.22.0-beta (/go/pkg/mod/github.com/btcsuite/btcd@v0.22.0-beta/chaincfg/chainhash)
        github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 (/go/pkg/mod/github.com/btcsuite/btcd/chaincfg/chainhash@v1.0.1)

I am also trying to upgrade go-libp2p* libraries, so maybe this has also something to do with it?

Would anyone be able to rescue me 🙏

git clone --single-branch --depth 1 --branch qdm12/deps/libp2p https://github.com/ChainSafe/gossamer.git
cd gossamer
go mod tidy # fails
go get github.com/btcsuite/btcd # upgraded github.com/btcsuite/btcd v0.22.0-beta => v0.23.1
go mod tidy # succeeds
go mod tidy # fails

@chappjc
Copy link
Contributor

chappjc commented Aug 30, 2022

Pretty sure the issue in gossamer is the require on the old btcutil module that requires an old btcd. I think you'll want to change your btcutil import:

diff --git a/go.mod b/go.mod
index 50ff8f49..a13f3bfa 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ require (
        github.com/ChainSafe/go-schnorrkel v1.0.1-0.20220711122024-027d287d27bf
        github.com/OneOfOne/xxhash v1.2.8
        github.com/breml/rootcerts v0.2.6
-       github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce
+       github.com/btcsuite/btcd/btcutil v1.1.2
        github.com/chyeh/pubip v0.0.0-20170203095919-b7e679cf541c
        github.com/cosmos/go-bip39 v1.0.0
        github.com/dgraph-io/badger/v2 v2.2007.4

and update your import paths too e.g.

--- a/dot/rpc/modules/system_integration_test.go
+++ b/dot/rpc/modules/system_integration_test.go
@@ -13,7 +13,7 @@
        "testing"
        "time"
 
-       "github.com/btcsuite/btcutil/base58"
+       "github.com/btcsuite/btcd/btcutil/base58"

etc

@qdm12
Copy link

qdm12 commented Aug 30, 2022

Awesome thanks @chappjc ❤️ I really didn't spot that sneaky github.com/btcsuite/btcutil/base58 import! Sorry for hijacking the issue thread a bit.

cp-wjhan pushed a commit to cp-yoonjin/go-wemix that referenced this issue Dec 5, 2022
…m#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.
sadoci pushed a commit to wemixarchive/go-wemix that referenced this issue Jan 27, 2023
…m#24700)

See ethereum#24554 and btcsuite/btcd#1839

This is an attempt to resolve a Go module dependency issue that arises
when both 'github.com/btcsuite/btcd/btcec/v2' and the older, non-v2
btcd module are required as dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.