Skip to content

Commit 8f33c9b

Browse files
go.mod: update dependencies (#60)
* go.mod: update dependencies * stuff * .golangci: updated ci * ci: update golang
1 parent 964174e commit 8f33c9b

12 files changed

Lines changed: 363 additions & 237 deletions

File tree

.github/workflows/test-build-push.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: 1.22.7
23+
go-version: 1.23.8
2424
- name: Download golangci-lint
2525
run: wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
2626
- name: Lint
@@ -36,7 +36,7 @@ jobs:
3636
- name: Set up Go
3737
uses: actions/setup-go@v5
3838
with:
39-
go-version: 1.21.5
39+
go-version: 1.23.8
4040
- name: Test
4141
run: go test -v ./...
4242

.golangci.yml

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
# This file configures github.com/golangci/golangci-lint.
2-
2+
version: '2'
33
run:
4-
timeout: 20m
54
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-
105
linters:
11-
disable-all: true
6+
default: none
127
enable:
13-
- goconst
14-
- goimports
15-
- gosimple
8+
- bidichk
9+
- copyloopvar
10+
- durationcheck
11+
- gocheckcompilerdirectives
1612
- govet
1713
- ineffassign
14+
- mirror
1815
- misspell
16+
- reassign
17+
- revive # only certain checks enabled
18+
- staticcheck
1919
- unconvert
20-
- typecheck
2120
- unused
22-
- staticcheck
23-
- bidichk
24-
- durationcheck
25-
- exportloopref
21+
- usetesting
2622
- whitespace
27-
23+
### linters we tried and will not be using:
24+
###
2825
# - structcheck # lots of false positives
2926
# - errcheck #lot of false positives
3027
# - contextcheck
@@ -33,10 +30,67 @@ linters:
3330
# - exhaustive # silly check
3431
# - makezero # false positives
3532
# - nilerr # several intentional
36-
37-
linters-settings:
38-
gofmt:
39-
simplify: true
40-
goconst:
41-
min-len: 3 # minimum length of string constant
42-
min-occurrences: 6 # minimum number of occurrences
33+
settings:
34+
staticcheck:
35+
checks:
36+
# disable Quickfixes
37+
- -QF1*
38+
revive:
39+
enable-all-rules: false
40+
# here we enable specific useful rules
41+
# see https://golangci-lint.run/usage/linters/#revive for supported rules
42+
rules:
43+
- name: receiver-naming
44+
severity: warning
45+
disabled: false
46+
exclude:
47+
- ''
48+
exclusions:
49+
generated: lax
50+
presets:
51+
- comments
52+
- common-false-positives
53+
- legacy
54+
- std-error-handling
55+
rules:
56+
- linters:
57+
- deadcode
58+
- staticcheck
59+
path: crypto/bn256/cloudflare/optate.go
60+
- linters:
61+
- revive
62+
path: crypto/bn256/
63+
- path: cmd/utils/flags.go
64+
text: "SA1019: cfg.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
65+
- path: cmd/utils/flags.go
66+
text: "SA1019: ethconfig.Defaults.TxLookupLimit is deprecated: use 'TransactionHistory' instead."
67+
- path: internal/build/pgp.go
68+
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
69+
- path: core/vm/contracts.go
70+
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
71+
- path: (.+)\.go$
72+
text: 'SA1019: event.TypeMux is deprecated: use Feed'
73+
- path: (.+)\.go$
74+
text: 'SA1019: strings.Title is deprecated'
75+
- path: (.+)\.go$
76+
text: 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.'
77+
- path: (.+)\.go$
78+
text: 'SA1029: should not use built-in type string as key for value'
79+
paths:
80+
- core/genesis_alloc.go
81+
- third_party$
82+
- builtin$
83+
- examples$
84+
formatters:
85+
enable:
86+
- goimports
87+
settings:
88+
gofmt:
89+
simplify: true
90+
exclusions:
91+
generated: lax
92+
paths:
93+
- core/genesis_alloc.go
94+
- third_party$
95+
- builtin$
96+
- examples$

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.22.7-alpine3.20 AS builder
1+
FROM golang:1.23.8-alpine3.20 AS builder
22

33
WORKDIR /build
44
# Copy and download dependencies using go mod

cmd/london/london.go

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ package main
22

33
import (
44
"github.com/ethereum/go-ethereum/core/vm"
5-
"github.com/holiman/goevmlab/ops"
6-
"github.com/holiman/goevmlab/program"
5+
"github.com/ethereum/go-ethereum/core/vm/program"
76
)
87

98
func Selfdestructor() []byte {
@@ -17,36 +16,36 @@ func Selfdestructor() []byte {
1716
byte(vm.SELFDESTRUCT),
1817
}
1918

20-
initcode := program.NewProgram()
19+
initcode := program.New()
2120
initcode.Mstore(selfdestructTo, 0)
22-
initcode.Return(0, uint32(len(selfdestructTo)))
21+
initcode.Return(0, len(selfdestructTo))
2322

24-
program := program.NewProgram()
23+
program := program.New()
2524
Create(program, selfdestructTo, false, true)
26-
program.Op(ops.POP)
25+
program.Op(vm.POP)
2726
Create(program, selfdestructTo, true, false)
28-
program.Op(ops.POP)
29-
Create(program, initcode.Bytecode(), true, false)
27+
program.Op(vm.POP)
28+
Create(program, initcode.Bytes(), true, false)
3029
//program.CreateAndCall(initcode.Bytecode(), true, ops.STATICCALL)
3130
//program.CreateAndCall(initcode.Bytecode(), true, ops.DELEGATECALL)
32-
return program.Bytecode()
31+
return program.Bytes()
3332
}
3433

3534
func EfByte() []byte {
3635
inner := []byte{
3736
0xEF,
3837
}
3938

40-
initcode := program.NewProgram()
39+
initcode := program.New()
4140
initcode.Mstore(inner, 0)
42-
initcode.Return(0, uint32(len(inner)))
41+
initcode.Return(0, len(inner))
4342

44-
program := program.NewProgram()
45-
Create(program, initcode.Bytecode(), false, false)
46-
program.Op(ops.POP)
47-
Create(program, initcode.Bytecode(), true, true)
48-
program.Op(ops.POP)
49-
return program.Bytecode()
43+
program := program.New()
44+
Create(program, initcode.Bytes(), false, false)
45+
program.Op(vm.POP)
46+
Create(program, initcode.Bytes(), true, true)
47+
program.Op(vm.POP)
48+
return program.Bytes()
5049
}
5150

5251
func Create(p *program.Program, code []byte, inMemory bool, isCreate2 bool) {
@@ -55,7 +54,7 @@ func Create(p *program.Program, code []byte, inMemory bool, isCreate2 bool) {
5554
offset = 0
5655
size = len(code)
5756
salt = 0
58-
createOp = ops.CREATE
57+
createOp = vm.CREATE
5958
)
6059
// Load the code into mem
6160
if !inMemory {
@@ -64,7 +63,7 @@ func Create(p *program.Program, code []byte, inMemory bool, isCreate2 bool) {
6463
// Create it
6564
if isCreate2 {
6665
p.Push(salt)
67-
createOp = ops.CREATE2
66+
createOp = vm.CREATE2
6867
}
6968
p.Push(size).Push(offset).Push(value).Op(createOp)
7069
}

0 commit comments

Comments
 (0)