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

Merge v1.14.4 #381

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
6d51c1f
params: begin v1.14.4 release cycle
fjl May 9, 2024
0e456d9
.travis.yml: disable normal unit tests in cron job (#29746)
fjl May 9, 2024
74edc93
params: gofmt
fjl May 9, 2024
e5f5eae
core/state: remove slot dirtyness if it's set back to origin value (#…
rjl493456442 May 10, 2024
603fd89
event: fix typo (#29749)
cocoyeal May 10, 2024
47af69c
core, beacon, ethdb: fix typos (#29748)
hteevoli May 10, 2024
44a50c9
cmd, core, params, trie: add verkle access witness gas charging (#29338)
gballet May 10, 2024
2ac83e1
core/state: blocking prefetcher on term signal, parallel updates (#29…
karalabe May 13, 2024
5b3e3cd
tests: update tests (#29730)
rjl493456442 May 13, 2024
be32843
core/state: remove useless operation (#29769)
rjl493456442 May 14, 2024
8919c5c
core: deploy EIP-4788 contract in dev mode genesis (#29655)
0xbeny May 14, 2024
d2f00cb
.github: upgrade to action versions with node20 (#29776)
cario-dev May 14, 2024
7ed52c9
core: move balanceCheck addition in buyGas (#29762)
zhiqiangxu May 15, 2024
473ee8f
trie, eth/protocols/snap: sanitize the committed node data (#29485)
rjl493456442 May 16, 2024
be5df74
trie: update the `valid` function comments (#29809)
cocoyeal May 21, 2024
7fd7c1f
eth/tracers: fix basefee context for traceBlock (#29811)
holiman May 21, 2024
0d4cdb3
internal/ethapi: fix typos (#29784)
karlb May 23, 2024
fa58176
eth/tracers: fix json logger for evm blocktest (#29795)
s1na May 23, 2024
b779e46
Makefile: add fmt, update help (#29777)
tr1sm0s1n May 23, 2024
70bee97
metrics: fix out of range error message (#29821)
Halimao May 23, 2024
6a9158b
p2p/discover: improved node revalidation (#29572)
fjl May 23, 2024
cc9e2bd
p2p/enode: fix endpoint determination for IPv6 (#29801)
fjl May 23, 2024
61b3d93
p2p/enode: fix TCPEndpoint (#29827)
AaronChen0 May 23, 2024
08fe6a8
metrics: fix flaky test`TestExpDecaySampleNanosecondRegression` (#29832)
Halimao May 24, 2024
64b1cd8
p2p: fix typos (#29828)
gitglorythegreat May 24, 2024
b6474e9
metrics: add test for `SampleSnapshot.Sum` (#29831)
levisyin May 24, 2024
d1d9f34
core/types: clarify set inclusion in comments (#29839)
winterjihwan May 26, 2024
7f5cc02
metrics: fix function comment (#29843)
Wukingbow May 27, 2024
7224576
core, eth/protocols/snap, internal/ethapi: remove redundant types (#2…
tr1sm0s1n May 27, 2024
1a4e4a4
miner: fix TestBuildPayload sporadic failure (#29853)
May 27, 2024
5132768
eth/downloader: fix flaky test (#29852)
rjl493456442 May 27, 2024
ea6c160
eth/tracers: clear error for non-reverting pre-homestead fail (#29824)
s1na May 28, 2024
caafa93
all: improve some error strings (#29842)
trillom8 May 28, 2024
42471d7
core/vm/runtime: set random to enable merge-opcodes (#29799)
holiman May 28, 2024
871e55d
core/state: fix typos in comments (#29767)
gitglorythegreat May 28, 2024
61932e4
cmd/geth: update testdata (vulncheck) (#29714)
holiman May 28, 2024
b88051e
core/rawdb, triedb/pathdb: fix freezer read-only option (#29823)
rjl493456442 May 28, 2024
af0a327
p2p/discover: fix crash when revalidated node is removed (#29864)
fjl May 28, 2024
e517183
eth, eth/downloader: remove references to LightChain, LightSync (#29…
jwasinger May 28, 2024
171430c
core/state: remove unused error from prefetcher trie method (#29768)
jwasinger May 28, 2024
cc22e0c
p2p/discover: fix update logic in handleAddNode (#29836)
lightclient May 28, 2024
5534c84
go.mod: update a number of dependencies (#29763)
holiman May 29, 2024
daf4f72
p2p/simulations: remove stale information about docker adapter (#29874)
bugmaker9371 May 29, 2024
153f8da
p2p/nodestate: remove unused package (#29872)
lilasxie May 29, 2024
b8cf163
accounts: fix TestUpdateKeyfileContents (#29867)
May 29, 2024
06263b1
all: fix typos in comments (#29873)
polymaer May 29, 2024
2f0e63e
eth/downloader, eth/tracer: fix typos in comments (#29707)
trillom8 May 29, 2024
e26fa9e
core/state: fix typo in comment (#29639)
niuxiaojie81 May 29, 2024
94a8b29
p2p/discover: refactor node and endpoint representation (#29844)
fjl May 29, 2024
3fef534
build: upgrade to golangci-lint v1.59.0 (#29875)
fjl May 29, 2024
2f06c1e
cmd/devp2p: fix node.TCP -> node.UDP (#29879)
hattizai May 29, 2024
6bb13e8
eth/catalyst: ensure TxPool is synced in Fork (#29876)
fjl May 29, 2024
e015c11
ethdb: remove unnecessary function wrapper (#29888)
suiyuan1314 May 30, 2024
2262bf3
crypto/secp256k1: change receiver variable name to lowercase (#29889)
suiyuan1314 May 30, 2024
5d7d48f
eth/gasprice: add comment to constant (#29892)
yosuzzy May 30, 2024
bdc62f9
common/math: rename variable name `int` to `n` (#29890)
tianyeyouyou May 31, 2024
2613523
miner: lower default min miner tip from 1 gwei to 0.001 gwei (#29895)
karalabe May 31, 2024
d4b81f0
CODEOWNERS: @s1na owns core/tracing (#29899)
s1na May 31, 2024
c9e0b31
Supply delta live tracer (#29347)
ziogaschr Jun 3, 2024
d38b88a
core/state: introduce stateupdate structure (#29530)
rjl493456442 Jun 3, 2024
50405e2
cmd/evm/internal/t8ntool: fix a typo (#29887)
0xmountaintop Jun 3, 2024
b36c738
beacon/engine: prealloc capacity for map and slice (#29903)
mask-pp Jun 3, 2024
7270cba
log: fix a typo (#29883)
miles-six Jun 3, 2024
a6751d6
core/rawdb,eth/protocols,p2p: prealloc slice size (#29893)
tianyeyouyou Jun 3, 2024
adbbd8c
core/state: prefetch account trie while starting a prefetcher (#29919)
Jun 4, 2024
68c0ec0
trie: iterate values pre-order and fix seek behavior (#27838)
roysc Jun 4, 2024
682ae83
internal/ethapi: recap higher args.Gas with block GasLimit in DoEstim…
SangIlMo Jun 4, 2024
125fb1f
core/state: avoid data race (#29924)
rjl493456442 Jun 4, 2024
5550d83
params: release Geth v1.14.4
karalabe Jun 5, 2024
ff2765a
Merge commit '44a50c9f96386f44a8682d51cf7500044f6cbaea' into merge-v1…
amsanghi Nov 26, 2024
00fa50e
Merge commit '2ac83e197bc6417231d6faa2027486cf3e00b6d1' into merge-v1…
amsanghi Nov 26, 2024
a9eeb48
Merge commit '7ed52c949e66ca7874ba39e8d69b451615382edc' into merge-v1…
amsanghi Nov 26, 2024
290a726
Merge commit '0d4cdb3dbed9c0183110db65270bd5725bf392ec' into merge-v1…
amsanghi Nov 26, 2024
f1c09bc
Merge commit 'e015c1116f2c78a5b140d3fdc368f5d1abcd2eaf' into merge-v1…
amsanghi Nov 26, 2024
9a36184
Merge commit 'd38b88a5a10800e1632833e284c6500c240c012e' into merge-v1…
amsanghi Dec 9, 2024
e7a0bc0
Merge commit '682ae838b2312a4ec8e5581069039b567e33c7c2' into merge-v1…
amsanghi Dec 9, 2024
efd6772
Merge tag 'v1.14.4' into merge-v1.14.4
amsanghi Dec 9, 2024
2faf70c
Fix lint
amsanghi Dec 9, 2024
2d5eaae
Merge branch 'master' into merge-v1.14.4
amsanghi Dec 12, 2024
d14b36c
fix wasm store
amsanghi Dec 16, 2024
6352438
Changes based on PR comments
amsanghi Dec 17, 2024
e5e4c51
Merge branch 'master' into merge-v1.14.4
amsanghi Dec 18, 2024
126a2d4
Fix deterministic flag in geth v1.14.4 merge
PlasmaPower Dec 19, 2024
6b24c8d
Merge pull request #387 from OffchainLabs/v1.14.4-deterministic-fix
tsahee Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ core/ @karalabe @holiman @rjl493456442
eth/ @karalabe @holiman @rjl493456442
eth/catalyst/ @gballet
eth/tracers/ @s1na
core/tracing/ @s1na
graphql/ @s1na
les/ @zsfelfoldi @rjl493456442
light/ @zsfelfoldi @rjl493456442
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
if: false # not supported on OffchainLabs fork, ci.yml is used instead
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: 1.21.4
- name: Run tests
Expand Down
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ run:
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
skip-files:
- core/genesis_alloc.go

linters:
disable-all: true
Expand All @@ -26,6 +24,8 @@ linters:
- exportloopref
- whitespace

### linters we tried and will not be using:
###
# - structcheck # lots of false positives
# - errcheck #lot of false positives
# - contextcheck
Expand All @@ -40,6 +40,8 @@ linters-settings:
simplify: true

issues:
exclude-files:
- core/genesis_alloc.go
exclude-rules:
- path: crypto/bn256/cloudflare/optate.go
linters:
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:

# These builders run the tests
- stage: build
if: type = push
os: linux
arch: amd64
dist: noble
Expand All @@ -105,6 +106,7 @@ jobs:
- travis_wait 45 go run build/ci.go test $TEST_PACKAGES

- stage: build
if: type = push
os: linux
dist: noble
go: 1.21.x
Expand Down Expand Up @@ -146,5 +148,7 @@ jobs:
os: linux
dist: noble
go: 1.22.x
env:
- racetests
script:
- travis_wait 50 go run build/ci.go test -race $TEST_PACKAGES
- travis_wait 60 go run build/ci.go test -race $TEST_PACKAGES
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,43 @@
# with Go source code. If you know what GOPATH is then you probably
# don't need to bother with make.

.PHONY: geth all test lint clean devtools help
.PHONY: geth all test lint fmt clean devtools help

GOBIN = ./build/bin
GO ?= latest
GORUN = go run

#? geth: Build geth
#? geth: Build geth.
geth:
$(GORUN) build/ci.go install ./cmd/geth
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."

#? all: Build all packages and executables
#? all: Build all packages and executables.
all:
$(GORUN) build/ci.go install

#? test: Run the tests
#? test: Run the tests.
test: all
$(GORUN) build/ci.go test

#? lint: Run certain pre-selected linters
#? lint: Run certain pre-selected linters.
lint: ## Run linters.
$(GORUN) build/ci.go lint

#? clean: Clean go cache, built executables, and the auto generated folder
#? fmt: Ensure consistent code formatting.
fmt:
gofmt -s -w $(shell find . -name "*.go")

#? clean: Clean go cache, built executables, and the auto generated folder.
clean:
go clean -cache
rm -fr build/_workspace/pkg/ $(GOBIN)/*

# The devtools target installs tools required for 'go generate'.
# You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.

#? devtools: Install recommended developer tools
#? devtools: Install recommended developer tools.
devtools:
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
env GOBIN= go install github.com/fjl/gencodec@latest
Expand All @@ -45,5 +49,9 @@ devtools:

#? help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in go-ethereum:"
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@sed -n 's/^#?//p' $< | column -t -s ':' | sort | sed -e 's/^/ /'
9 changes: 6 additions & 3 deletions accounts/keystore/account_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ func TestUpdatedKeyfileContents(t *testing.T) {

// Create a temporary keystore to test with
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-updatedkeyfilecontents-test-%d-%d", os.Getpid(), rand.Int()))

// Create the directory
os.MkdirAll(dir, 0700)
defer os.RemoveAll(dir)

ks := NewKeyStore(dir, LightScryptN, LightScryptP)

list := ks.Accounts()
Expand All @@ -335,9 +340,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
if !waitWatcherStart(ks) {
t.Fatal("keystore watcher didn't start in time")
}
// Create the directory and copy a key file into it.
os.MkdirAll(dir, 0700)
defer os.RemoveAll(dir)
// Copy a key file into it
file := filepath.Join(dir, "aaa")

// Place one of our testfiles in there
Expand Down
6 changes: 5 additions & 1 deletion arbitrum/recordingdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ type RecordingKV struct {
inner *triedb.Database
diskDb ethdb.KeyValueStore
readDbEntries map[common.Hash][]byte
mutex sync.Mutex
enableBypass bool
}

func newRecordingKV(inner *triedb.Database, diskDb ethdb.KeyValueStore) *RecordingKV {
return &RecordingKV{inner, diskDb, make(map[common.Hash][]byte), false}
return &RecordingKV{inner, diskDb, make(map[common.Hash][]byte), sync.Mutex{}, false}
}

func (db *RecordingKV) Has(key []byte) (bool, error) {
return false, errors.New("recording KV doesn't support Has")
}

// Get may be called concurrently with other Get calls
func (db *RecordingKV) Get(key []byte) ([]byte, error) {
var hash common.Hash
var res []byte
Expand All @@ -66,6 +68,8 @@ func (db *RecordingKV) Get(key []byte) ([]byte, error) {
if crypto.Keccak256Hash(res) != hash {
return nil, fmt.Errorf("recording KV attempted to access non-hash key %v", hash)
}
db.mutex.Lock()
defer db.mutex.Unlock()
db.readDbEntries[hash] = res
return res, nil
}
Expand Down
2 changes: 1 addition & 1 deletion beacon/engine/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash,
if params.BaseFeePerGas != nil && (params.BaseFeePerGas.Sign() == -1 || params.BaseFeePerGas.BitLen() > 256) {
return nil, fmt.Errorf("invalid baseFeePerGas: %v", params.BaseFeePerGas)
}
var blobHashes []common.Hash
var blobHashes = make([]common.Hash, 0, len(txs))
for _, tx := range txs {
blobHashes = append(blobHashes, tx.BlobHashes()...)
}
Expand Down
2 changes: 1 addition & 1 deletion beacon/light/sync/head_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func TestValidatedHead(t *testing.T) {
ts.ServerEvent(EvNewOptimisticUpdate, testServer3, testOptUpdate4)
// finality should be requested from both servers
ts.Run(4, testServer1, ReqFinality{}, testServer3, ReqFinality{})
// future period annonced heads should be queued
// future period announced heads should be queued
ht.ExpValidated(t, 4, nil)

chain.SetNextSyncPeriod(2)
Expand Down
2 changes: 1 addition & 1 deletion beacon/types/exec_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func convertPayload[T payloadType](payload T, parentRoot *zrntcommon.Root) (*typ

block := types.NewBlockWithHeader(&header).WithBody(types.Body{Transactions: transactions, Withdrawals: withdrawals})
if hash := block.Hash(); hash != expectedHash {
return nil, fmt.Errorf("Sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash)
return nil, fmt.Errorf("sanity check failed, payload hash does not match (expected %x, got %x)", expectedHash, hash)
}
return block, nil
}
Expand Down
59 changes: 30 additions & 29 deletions build/checksums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,37 @@ cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39 go1.22.3.windo
40b37f4b068fc759f3a0dd61176a0f7570a4ba48bed8561c31d3967a3583981a go1.22.3.windows-arm.zip
59b76ee22b9b1c3afbf7f50e3cb4edb954d6c0d25e5e029ab5483a6804d61e71 go1.22.3.windows-arm64.zip

# version:golangci 1.55.2
# version:golangci 1.59.0
# https://github.com/golangci/golangci-lint/releases/
# https://github.com/golangci/golangci-lint/releases/download/v1.55.2/
632e96e6d5294fbbe7b2c410a49c8fa01c60712a0af85a567de85bcc1623ea21 golangci-lint-1.55.2-darwin-amd64.tar.gz
234463f059249f82045824afdcdd5db5682d0593052f58f6a3039a0a1c3899f6 golangci-lint-1.55.2-darwin-arm64.tar.gz
2bdd105e2d4e003a9058c33a22bb191a1e0f30fa0790acca0d8fbffac1d6247c golangci-lint-1.55.2-freebsd-386.tar.gz
e75056e8b082386676ce23eba455cf893931a792c0d87e1e3743c0aec33c7fb5 golangci-lint-1.55.2-freebsd-amd64.tar.gz
5789b933facaf6136bd23f1d50add67b79bbcf8dfdfc9069a37f729395940a66 golangci-lint-1.55.2-freebsd-armv6.tar.gz
7f21ab1008d05f32c954f99470fc86a83a059e530fe2add1d0b7d8ed4d8992a7 golangci-lint-1.55.2-freebsd-armv7.tar.gz
33ab06139b9219a28251f10821da94423db30285cc2af97494cbb2a281927de9 golangci-lint-1.55.2-illumos-amd64.tar.gz
57ce6f8ce3ad6ee45d7cc3d9a047545a851c2547637834a3fcb086c7b40b1e6b golangci-lint-1.55.2-linux-386.tar.gz
ca21c961a33be3bc15e4292dc40c98c8dcc5463a7b6768a3afc123761630c09c golangci-lint-1.55.2-linux-amd64.tar.gz
8eb0cee9b1dbf0eaa49871798c7f8a5b35f2960c52d776a5f31eb7d886b92746 golangci-lint-1.55.2-linux-arm64.tar.gz
3195f3e0f37d353fd5bd415cabcd4e263f5c29d3d0ffb176c26ff3d2c75eb3bb golangci-lint-1.55.2-linux-armv6.tar.gz
c823ee36eb1a719e171de1f2f5ca3068033dce8d9817232fd10ed71fd6650406 golangci-lint-1.55.2-linux-armv7.tar.gz
758a5d2a356dc494bd13ed4c0d4bf5a54a4dc91267ea5ecdd87b86c7ca0624e7 golangci-lint-1.55.2-linux-loong64.tar.gz
2c7b9abdce7cae802a67d583cd7c6dca520bff6d0e17c8535a918e2f2b437aa0 golangci-lint-1.55.2-linux-mips64.tar.gz
024e0a15b85352cc27271285526e16a4ab66d3e67afbbe446c9808c06cb8dbed golangci-lint-1.55.2-linux-mips64le.tar.gz
6b00f89ba5506c1de1efdd9fa17c54093013a294fefd8b9b31534db626a672ee golangci-lint-1.55.2-linux-ppc64le.tar.gz
0faa0d047d9bf7b703ed3ea65b6117043c93504f9ca1de25ae929d3901c73d4a golangci-lint-1.55.2-linux-riscv64.tar.gz
30dec9b22e7d5bb4e9d5ccea96da20f71cd7db3c8cf30b8ddc7cb9174c4d742a golangci-lint-1.55.2-linux-s390x.tar.gz
5a0ede48f79ad707902fdb29be8cd2abd8302dc122b65ebae3fdfc86751c7698 golangci-lint-1.55.2-netbsd-386.tar.gz
95af20a2e617126dd5b08122ece7819101070e1582a961067ce8c41172f901ad golangci-lint-1.55.2-netbsd-amd64.tar.gz
94fb7dacb7527847cc95d7120904e19a2a0a81a0d50d61766c9e0251da72ab9d golangci-lint-1.55.2-netbsd-armv6.tar.gz
ca906bce5fee9619400e4a321c56476fe4a4efb6ac4fc989d340eb5563348873 golangci-lint-1.55.2-netbsd-armv7.tar.gz
45b442f69fc8915c4500201c0247b7f3f69544dbc9165403a61f9095f2c57355 golangci-lint-1.55.2-windows-386.zip
f57d434d231d43417dfa631587522f8c1991220b43c8ffadb9c7bd279508bf81 golangci-lint-1.55.2-windows-amd64.zip
fd7dc8f4c6829ee6fafb252a4d81d2155cd35da7833665cbb25d53ce7cecd990 golangci-lint-1.55.2-windows-arm64.zip
1892c3c24f9e7ef44b02f6750c703864b6dc350129f3ec39510300007b2376f1 golangci-lint-1.55.2-windows-armv6.zip
a5e68ae73d38748b5269fad36ac7575e3c162a5dc63ef58abdea03cc5da4522a golangci-lint-1.55.2-windows-armv7.zip
# https://github.com/golangci/golangci-lint/releases/download/v1.59.0/
418acf7e255ddc0783e97129c9b03d9311b77826a5311d425a01c708a86417e7 golangci-lint-1.59.0-darwin-amd64.tar.gz
5f6a1d95a6dd69f6e328eb56dd311a38e04cfab79a1305fbf4957f4e203f47b6 golangci-lint-1.59.0-darwin-arm64.tar.gz
8899bf589185d49f747f3e5db9f0bde8a47245a100c64a3dd4d65e8e92cfc4f2 golangci-lint-1.59.0-freebsd-386.tar.gz
658212f138d9df2ac89427e22115af34bf387c0871d70f2a25101718946a014f golangci-lint-1.59.0-freebsd-amd64.tar.gz
4c6395ea40f314d3b6fa17d8997baab93464d5d1deeaab513155e625473bd03a golangci-lint-1.59.0-freebsd-armv6.tar.gz
ff37da4fbaacdb6bbae70fdbdbb1ba932a859956f788c82822fa06bef5b7c6b3 golangci-lint-1.59.0-freebsd-armv7.tar.gz
439739469ed2bda182b1ec276d40c40e02f195537f78e3672996741ad223d6b6 golangci-lint-1.59.0-illumos-amd64.tar.gz
940801d46790e40d0a097d8fee34e2606f0ef148cd039654029b0b8750a15ed6 golangci-lint-1.59.0-linux-386.tar.gz
3b14a439f33c4fff83dbe0349950d984042b9a1feb6c62f82787b598fc3ab5f4 golangci-lint-1.59.0-linux-amd64.tar.gz
c57e6c0b0fa03089a2611dceddd5bc5d206716cccdff8b149da8baac598719a1 golangci-lint-1.59.0-linux-arm64.tar.gz
93149e2d3b25ac754df9a23172403d8aa6d021a7e0d9c090a12f51897f68c9a0 golangci-lint-1.59.0-linux-armv6.tar.gz
d10ac38239d9efee3ee87b55c96cdf3fa09e1a525babe3ffdaaf65ccc48cf3dc golangci-lint-1.59.0-linux-armv7.tar.gz
047338114b4f0d5f08f0fb9a397b03cc171916ed0960be7dfb355c2320cd5e9c golangci-lint-1.59.0-linux-loong64.tar.gz
5632df0f7f8fc03a80a266130faef0b5902d280cf60621f1b2bdc1aef6d97ee9 golangci-lint-1.59.0-linux-mips64.tar.gz
71dd638c82fa4439171e7126d2c7a32b5d103bfdef282cea40c83632cb3d1f4b golangci-lint-1.59.0-linux-mips64le.tar.gz
6cf9ea0d34e91669948483f9ae7f07da319a879344373a1981099fbd890cde00 golangci-lint-1.59.0-linux-ppc64le.tar.gz
af0205fa6fbab197cee613c359947711231739095d21b5c837086233b36ad971 golangci-lint-1.59.0-linux-riscv64.tar.gz
a9d2fb93f3c688ebccef94f5dc96c0b07c4d20bf6556cddebd8442159b0c80f6 golangci-lint-1.59.0-linux-s390x.tar.gz
68ab4c57a847b8ace9679887f2f8b2b6760e57ee29dcde8c3f40dd8bb2654fa2 golangci-lint-1.59.0-netbsd-386.tar.gz
d277b8b435c19406d00de4d509eadf5a024a5782878332e9a1b7c02bb76e87a7 golangci-lint-1.59.0-netbsd-amd64.tar.gz
83211656be8dcfa1545af4f92894409f412d1f37566798cb9460a526593ad62c golangci-lint-1.59.0-netbsd-arm64.tar.gz
6c6866d28bf79fa9817a0f7d2b050890ed109cae80bdb4dfa39536a7226da237 golangci-lint-1.59.0-netbsd-armv6.tar.gz
11587566363bd03ca586b7df9776ccaed569fcd1f3489930ac02f9375b307503 golangci-lint-1.59.0-netbsd-armv7.tar.gz
466181a8967bafa495e41494f93a0bec829c2cf715de874583b0460b3b8ae2b8 golangci-lint-1.59.0-windows-386.zip
3317d8a87a99a49a0a1321d295c010790e6dbf43ee96b318f4b8bb23eae7a565 golangci-lint-1.59.0-windows-amd64.zip
b3af955c7fceac8220a36fc799e1b3f19d3b247d32f422caac5f9845df8f7316 golangci-lint-1.59.0-windows-arm64.zip
6f083c7d0c764e5a0e5bde46ee3e91ae357d80c194190fe1d9754392e9064c7e golangci-lint-1.59.0-windows-armv6.zip
3709b4dd425deadab27748778d08e03c0f804d7748f7dd5b6bb488d98aa031c7 golangci-lint-1.59.0-windows-armv7.zip

# This is the builder on PPA that will build Go itself (inception-y), don't modify!
#
Expand Down
2 changes: 1 addition & 1 deletion cmd/clef/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func listWallets(c *cli.Context) error {
// accountImport imports a raw hexadecimal private key via CLI.
func accountImport(c *cli.Context) error {
if c.Args().Len() != 1 {
return errors.New("<keyfile> must be given as first argument.")
return errors.New("<keyfile> must be given as first argument")
}
internalApi, ui, err := initInternalApi(c)
if err != nil {
Expand Down
57 changes: 57 additions & 0 deletions cmd/devp2p/discv4cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"net"
"net/http"
"strconv"
"strings"
"time"
Expand All @@ -28,9 +29,11 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/flags"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/p2p/discover"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/urfave/cli/v2"
)

Expand All @@ -45,6 +48,7 @@ var (
discv4ResolveJSONCommand,
discv4CrawlCommand,
discv4TestCommand,
discv4ListenCommand,
},
}
discv4PingCommand = &cli.Command{
Expand Down Expand Up @@ -75,6 +79,14 @@ var (
Flags: discoveryNodeFlags,
ArgsUsage: "<nodes.json file>",
}
discv4ListenCommand = &cli.Command{
Name: "listen",
Usage: "Runs a discovery node",
Action: discv4Listen,
Flags: flags.Merge(discoveryNodeFlags, []cli.Flag{
httpAddrFlag,
}),
}
discv4CrawlCommand = &cli.Command{
Name: "crawl",
Usage: "Updates a nodes.json file with random nodes found in the DHT",
Expand Down Expand Up @@ -131,6 +143,10 @@ var (
Usage: "Enode of the remote node under test",
EnvVars: []string{"REMOTE_ENODE"},
}
httpAddrFlag = &cli.StringFlag{
Name: "rpc",
Usage: "HTTP server listening address",
}
)

var discoveryNodeFlags = []cli.Flag{
Expand All @@ -154,6 +170,27 @@ func discv4Ping(ctx *cli.Context) error {
return nil
}

func discv4Listen(ctx *cli.Context) error {
disc, _ := startV4(ctx)
defer disc.Close()

fmt.Println(disc.Self())

httpAddr := ctx.String(httpAddrFlag.Name)
if httpAddr == "" {
// Non-HTTP mode.
select {}
}

api := &discv4API{disc}
log.Info("Starting RPC API server", "addr", httpAddr)
srv := rpc.NewServer()
srv.RegisterName("discv4", api)
http.DefaultServeMux.Handle("/", srv)
httpsrv := http.Server{Addr: httpAddr, Handler: http.DefaultServeMux}
return httpsrv.ListenAndServe()
}

func discv4RequestRecord(ctx *cli.Context) error {
n := getNodeArg(ctx)
disc, _ := startV4(ctx)
Expand Down Expand Up @@ -362,3 +399,23 @@ func parseBootnodes(ctx *cli.Context) ([]*enode.Node, error) {
}
return nodes, nil
}

type discv4API struct {
host *discover.UDPv4
}

func (api *discv4API) LookupRandom(n int) (ns []*enode.Node) {
it := api.host.RandomNodes()
for len(ns) < n && it.Next() {
ns = append(ns, it.Node())
}
return ns
}

func (api *discv4API) Buckets() [][]discover.BucketNode {
return api.host.TableBuckets()
}

func (api *discv4API) Self() *enode.Node {
return api.host.Self()
}
Loading
Loading