Skip to content

Commit 5e97e87

Browse files
committed
update dependency & go lint fixes
1 parent bb1ae65 commit 5e97e87

File tree

7 files changed

+14
-10
lines changed

7 files changed

+14
-10
lines changed

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ linters:
2222
- tparallel
2323
- unconvert
2424
- whitespace
25-
- wsl
25+
- wsl_v5
2626
settings:
2727
errcheck:
2828
check-type-assertions: true
@@ -39,6 +39,10 @@ linters:
3939
nolintlint:
4040
require-explanation: true
4141
require-specific: true
42+
wsl_v5:
43+
allow-first-in-block: true
44+
allow-whole-block: false
45+
branch-max-lines: 2
4246
exclusions:
4347
generated: lax
4448
presets:

cmd/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ func loadConfigFromFile(file string) (*checkpointz.Config, error) {
5454
}
5555

5656
yamlFile, err := os.ReadFile(file)
57-
5857
if err != nil {
5958
return nil, err
6059
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/ethpandaops/checkpointz
22

33
go 1.25.1
44

5-
replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20250925114125-8cac04566494
5+
replace github.com/attestantio/go-eth2-client => github.com/qu0b/go-eth2-client v0.0.0-20260102140736-77debf2f2683
66

77
require (
88
github.com/attestantio/go-eth2-client v0.27.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
156156
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
157157
github.com/pk910/dynamic-ssz v1.1.1 h1:b8sPR8fyhBvz8SHa2RH20SNtt5VDzAEY6fKsPCUcYX4=
158158
github.com/pk910/dynamic-ssz v1.1.1/go.mod h1:3zyemisUysY2PWACZ8LeZS2tAw8AkuTb2GaLmqYsg1I=
159-
github.com/pk910/go-eth2-client v0.0.0-20250925114125-8cac04566494 h1:PkeLES9m7cMwE97hNV2vfscpEgBbYc992DfeHqGFExo=
160-
github.com/pk910/go-eth2-client v0.0.0-20250925114125-8cac04566494/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
161159
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
162160
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
163161
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -175,6 +173,8 @@ github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8ki
175173
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
176174
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
177175
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
176+
github.com/qu0b/go-eth2-client v0.0.0-20260102140736-77debf2f2683 h1:5y0ylewlPVfEWwszsz6LpFPoc2yqMcJHSh0nDiHMgEg=
177+
github.com/qu0b/go-eth2-client v0.0.0-20260102140736-77debf2f2683/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
178178
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
179179
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
180180
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=

pkg/beacon/default.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ func (d *Default) ListFinalizedSlots(ctx context.Context) ([]phase0.Slot, error)
750750

751751
latestSlot := phase0.Slot(uint64(finality.Finalized.Epoch) * uint64(sp.SlotsPerEpoch))
752752

753-
//nolint:gosec // HistoricalEpochCount is a small positive config value, overflow not possible
753+
//nolint:gosec // HistoricalEpochCount is validated as positive in config.
754754
for i, val := uint64(latestSlot), uint64(latestSlot)-uint64(sp.SlotsPerEpoch)*uint64(d.config.HistoricalEpochCount); i > val; i -= uint64(sp.SlotsPerEpoch) {
755755
slots = append(slots, phase0.Slot(i))
756756
}

pkg/beacon/download.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,13 @@ func (d *Default) fetchHistoricalCheckpoints(ctx context.Context, checkpoint *v1
173173
// We'll derive the current finalized slot and then work back in intervals of SLOTS_PER_EPOCH.
174174
currentSlot := uint64(checkpoint.Finalized.Epoch) * uint64(sp.SlotsPerEpoch)
175175
for i := 1; i < d.config.HistoricalEpochCount; i++ {
176-
//nolint:gosec // i is a small positive loop counter, overflow not possible
176+
//nolint:gosec // i starts at 1 and increments, always positive.
177177
if uint64(i)*uint64(sp.SlotsPerEpoch) > currentSlot {
178178
break
179179
}
180180

181-
slot := phase0.Slot(currentSlot - uint64(i)*uint64(sp.SlotsPerEpoch))
182-
183-
slotsInScope[slot] = struct{}{}
181+
//nolint:gosec // i starts at 1 and increments, always positive.
182+
slotsInScope[phase0.Slot(currentSlot-uint64(i)*uint64(sp.SlotsPerEpoch))] = struct{}{}
184183
}
185184

186185
for slot := range slotsInScope {

pkg/cache/ttl.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func NewTTLMap(maxItems int, name, namespace string) (m *TTLMap) {
4040
go func() {
4141
for now := range time.Tick(time.Second * 1) {
4242
m.l.Lock()
43+
4344
for k, v := range m.m {
4445
if v.invincible {
4546
continue
@@ -49,6 +50,7 @@ func NewTTLMap(maxItems int, name, namespace string) (m *TTLMap) {
4950
m.delete(k, v.value, v.expiresAt)
5051
}
5152
}
53+
5254
m.l.Unlock()
5355
}
5456
}()

0 commit comments

Comments
 (0)