Skip to content

Commit e474fee

Browse files
all: update dependencies and workflows
all: update versions, dependencies, types and workflows
2 parents 633321c + 39d1481 commit e474fee

File tree

9 files changed

+442
-662
lines changed

9 files changed

+442
-662
lines changed

.github/workflows/test.yaml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: node-crawler workflow
22

3-
43
on:
54
push:
65
branches:
@@ -16,26 +15,26 @@ jobs:
1615
lint:
1716
runs-on: ubuntu-latest
1817
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up Go
21-
uses: actions/setup-go@v2
22-
with:
23-
go-version: 1.20.5
24-
- name: Download golangci-lint
25-
run: wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
26-
- name: Lint
27-
run: ./bin/golangci-lint run --config .golangci.yml
28-
- name: Vet
29-
run: go vet ./...
18+
- uses: actions/checkout@v4
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: 1.24.2
23+
- name: Download golangci-lint
24+
run: wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
25+
- name: Lint
26+
run: ./bin/golangci-lint run --config .golangci.yml
27+
- name: Vet
28+
run: go vet ./...
3029

3130
test:
3231
runs-on: ubuntu-latest
3332
needs: lint
3433
steps:
35-
- uses: actions/checkout@v2
36-
- name: Set up Go
37-
uses: actions/setup-go@v2
38-
with:
39-
go-version: 1.20.5
40-
- name: Test
41-
run: go test -v ./...
34+
- uses: actions/checkout@v4
35+
- name: Set up Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: 1.24.2
39+
- name: Test
40+
run: go test -v ./...

.golangci.yml

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,42 @@
1-
# This file configures github.com/golangci/golangci-lint.
2-
1+
version: "2"
32
run:
4-
timeout: 20m
53
tests: true
6-
# default is true. Enables skipping of directories:
7-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
8-
skip-dirs-use-default: true
9-
104
linters:
11-
disable-all: true
5+
default: none
126
enable:
7+
- bidichk
8+
- durationcheck
139
- goconst
14-
- goimports
15-
- gosimple
1610
- govet
1711
- ineffassign
1812
- misspell
19-
- unconvert
20-
- typecheck
21-
# this repo contains a few copied files from go-ethereum,
22-
# and some of them have unused fields/functions
23-
#- unused
2413
- staticcheck
25-
- bidichk
26-
- durationcheck
27-
- exportloopref
14+
- unconvert
2815
- whitespace
29-
30-
# - structcheck # lots of false positives
31-
# - errcheck #lot of false positives
32-
# - contextcheck
33-
# - errchkjson # lots of false positives
34-
# - errorlint # this check crashes
35-
# - exhaustive # silly check
36-
# - makezero # false positives
37-
# - nilerr # several intentional
38-
39-
linters-settings:
40-
gofmt:
41-
simplify: true
42-
goconst:
43-
min-len: 3 # minimum length of string constant
44-
min-occurrences: 6 # minimum number of occurrences
16+
settings:
17+
goconst:
18+
min-len: 3
19+
min-occurrences: 6
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
paths:
28+
- third_party$
29+
- builtin$
30+
- examples$
31+
formatters:
32+
enable:
33+
- goimports
34+
settings:
35+
gofmt:
36+
simplify: true
37+
exclusions:
38+
generated: lax
39+
paths:
40+
- third_party$
41+
- builtin$
42+
- examples$

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Compile api
2-
FROM golang:1.21-alpine AS builder
2+
FROM golang:1.24.2-alpine AS builder
33
WORKDIR /app
44

55
COPY go.mod go.sum ./
@@ -8,7 +8,6 @@ RUN go mod download
88
COPY ./ ./
99
RUN go build ./cmd/crawler
1010

11-
1211
# Copy compiled stuff and run it
1312
FROM alpine
1413

cmd/crawler/crawlercmd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var (
5353
nodekeyFlag,
5454
timeoutFlag,
5555
workersFlag,
56-
utils.GoerliFlag,
56+
utils.HoodiFlag,
5757
utils.NetworkIdFlag,
5858
utils.SepoliaFlag,
5959
},
@@ -118,7 +118,7 @@ func crawlNodes(ctx *cli.Context) error {
118118
Timeout: ctx.Duration(timeoutFlag.Name),
119119
Workers: ctx.Uint64(workersFlag.Name),
120120
Sepolia: ctx.Bool(utils.SepoliaFlag.Name),
121-
Goerli: ctx.Bool(utils.GoerliFlag.Name),
121+
Hoodi: ctx.Bool(utils.HoodiFlag.Name),
122122
NodeDB: nodeDB,
123123
}
124124

cmd/crawler/setup.go

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ var (
3333
Name: "log.json",
3434
Usage: "Format logs with JSON",
3535
}
36-
backtraceAtFlag = cli.StringFlag{
37-
Name: "log.backtrace",
38-
Usage: "Request a stack trace at a specific logging statement (e.g. \"block.go:271\")",
39-
Value: "",
40-
}
41-
debugFlag = cli.BoolFlag{
42-
Name: "log.debug",
43-
Usage: "Prepends log messages with call-site location (file and line number)",
44-
}
4536
pprofFlag = cli.BoolFlag{
4637
Name: "pprof",
4738
Usage: "Enable the pprof HTTP server",
@@ -77,10 +68,8 @@ var (
7768

7869
// Flags holds all command-line flags required for debugging.
7970
var Flags = []cli.Flag{
80-
&backtraceAtFlag,
8171
&blockprofilerateFlag,
8272
&cpuprofileFlag,
83-
&debugFlag,
8473
&logjsonFlag,
8574
&memprofilerateFlag,
8675
&pprofAddrFlag,
@@ -94,43 +83,33 @@ var Flags = []cli.Flag{
9483
var glogger *log.GlogHandler
9584

9685
func init() {
97-
glogger = log.NewGlogHandler(log.StreamHandler(os.Stderr, log.TerminalFormat(false)))
86+
terminalOutput := io.Writer(os.Stderr)
87+
glogger := log.NewGlogHandler(log.NewTerminalHandler(terminalOutput, false))
9888
glogger.Verbosity(log.LvlInfo)
99-
log.Root().SetHandler(glogger)
89+
log.SetDefault(log.NewLogger(glogger))
10090
}
10191

10292
// Setup initializes profiling and logging based on the CLI flags.
10393
// It should be called as early as possible in the program.
10494
func Setup(ctx *cli.Context) error {
105-
var ostream log.Handler
10695
output := io.Writer(os.Stderr)
10796
if ctx.Bool(logjsonFlag.Name) {
108-
ostream = log.StreamHandler(output, log.JSONFormat())
97+
glogger = log.NewGlogHandler(log.JSONHandler(output))
10998
} else {
11099
usecolor := (isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb"
111100
if usecolor {
112101
output = colorable.NewColorableStderr()
113102
}
114-
ostream = log.StreamHandler(output, log.TerminalFormat(usecolor))
103+
glogger = log.NewGlogHandler(log.NewTerminalHandler(output, usecolor))
115104
}
116-
glogger.SetHandler(ostream)
117105

118106
// logging
119107
verbosity := ctx.Int(verbosityFlag.Name)
120-
glogger.Verbosity(log.Lvl(verbosity))
108+
glogger.Verbosity(log.FromLegacyLevel(verbosity))
121109
vmodule := ctx.String(vmoduleFlag.Name)
122110
glogger.Vmodule(vmodule)
123111

124-
debug := ctx.Bool(debugFlag.Name)
125-
if ctx.IsSet(debugFlag.Name) {
126-
debug = ctx.Bool(debugFlag.Name)
127-
}
128-
log.PrintOrigins(debug)
129-
130-
backtrace := ctx.String(backtraceAtFlag.Name)
131-
glogger.BacktraceAt(backtrace)
132-
133-
log.Root().SetHandler(glogger)
112+
log.SetDefault(log.NewLogger(glogger))
134113

135114
// profiling, tracing
136115
runtime.MemProfileRate = memprofilerateFlag.Value

0 commit comments

Comments
 (0)