Skip to content

Commit d655351

Browse files
authored
Merge branch 'master' into export-rawdb-funcs
2 parents dccaf70 + 077cc89 commit d655351

File tree

164 files changed

+7549
-4747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+7549
-4747
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
accounts/usbwallet @karalabe
55
accounts/scwallet @gballet
66
accounts/abi @gballet @MariusVanDerWijden
7+
beacon/engine @lightclient
78
cmd/clef @holiman
9+
cmd/evm @holiman @MariusVanDerWijden @lightclient
810
consensus @karalabe
911
core/ @karalabe @holiman @rjl493456442
1012
eth/ @karalabe @holiman @rjl493456442
11-
eth/catalyst/ @gballet
13+
eth/catalyst/ @gballet @lightclient
1214
eth/tracers/ @s1na
1315
core/tracing/ @s1na
1416
graphql/ @s1na
17+
internal/ethapi @lightclient
18+
internal/era @lightclient
1519
les/ @zsfelfoldi @rjl493456442
1620
light/ @zsfelfoldi @rjl493456442
1721
node/ @fjl

.github/workflows/go.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/setup-go@v5
1818
with:
1919
go-version: 1.21.4
20+
cache: false
2021
- name: Run tests
2122
run: go test -short ./...
2223
env:

.golangci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ linters:
2323
- durationcheck
2424
- exportloopref
2525
- whitespace
26+
- revive # only certain checks enabled
2627

2728
### linters we tried and will not be using:
2829
###
@@ -38,6 +39,15 @@ linters:
3839
linters-settings:
3940
gofmt:
4041
simplify: true
42+
revive:
43+
enable-all-rules: false
44+
# here we enable specific useful rules
45+
# see https://golangci-lint.run/usage/linters/#revive for supported rules
46+
rules:
47+
- name: receiver-naming
48+
severity: warning
49+
disabled: false
50+
exclude: [""]
4151

4252
issues:
4353
exclude-files:
@@ -47,6 +57,9 @@ issues:
4757
linters:
4858
- deadcode
4959
- staticcheck
60+
- path: crypto/bn256/
61+
linters:
62+
- revive
5063
- path: internal/build/pgp.go
5164
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
5265
- path: core/vm/contracts.go

accounts/abi/bind/source.go.tpl

Lines changed: 487 additions & 0 deletions
Large diffs are not rendered by default.

accounts/abi/bind/template.go

Lines changed: 8 additions & 490 deletions
Large diffs are not rendered by default.

accounts/abi/type.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ type Type struct {
6464
var (
6565
// typeRegex parses the abi sub types
6666
typeRegex = regexp.MustCompile("([a-zA-Z]+)(([0-9]+)(x([0-9]+))?)?")
67+
68+
// sliceSizeRegex grab the slice size
69+
sliceSizeRegex = regexp.MustCompile("[0-9]+")
6770
)
6871

6972
// NewType creates a new reflection type of abi type given in t.
@@ -91,8 +94,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
9194
// grab the last cell and create a type from there
9295
sliced := t[i:]
9396
// grab the slice size with regexp
94-
re := regexp.MustCompile("[0-9]+")
95-
intz := re.FindAllString(sliced, -1)
97+
intz := sliceSizeRegex.FindAllString(sliced, -1)
9698

9799
if len(intz) == 0 {
98100
// is a slice

accounts/keystore/account_cache_test.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
325325
t.Parallel()
326326

327327
// Create a temporary keystore to test with
328-
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-updatedkeyfilecontents-test-%d-%d", os.Getpid(), rand.Int()))
329-
330-
// Create the directory
331-
os.MkdirAll(dir, 0700)
332-
defer os.RemoveAll(dir)
328+
dir := t.TempDir()
333329

334330
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
335331

accounts/scwallet/wallet.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ var (
7373
DerivationSignatureHash = sha256.Sum256(common.Hash{}.Bytes())
7474
)
7575

76+
var (
77+
// PinRegexp is the regular expression used to validate PIN codes.
78+
pinRegexp = regexp.MustCompile(`^[0-9]{6,}$`)
79+
80+
// PukRegexp is the regular expression used to validate PUK codes.
81+
pukRegexp = regexp.MustCompile(`^[0-9]{12,}$`)
82+
)
83+
7684
// List of APDU command-related constants
7785
const (
7886
claISO7816 = 0
@@ -380,15 +388,15 @@ func (w *Wallet) Open(passphrase string) error {
380388
case passphrase == "":
381389
return ErrPINUnblockNeeded
382390
case status.PinRetryCount > 0:
383-
if !regexp.MustCompile(`^[0-9]{6,}$`).MatchString(passphrase) {
391+
if !pinRegexp.MatchString(passphrase) {
384392
w.log.Error("PIN needs to be at least 6 digits")
385393
return ErrPINNeeded
386394
}
387395
if err := w.session.verifyPin([]byte(passphrase)); err != nil {
388396
return err
389397
}
390398
default:
391-
if !regexp.MustCompile(`^[0-9]{12,}$`).MatchString(passphrase) {
399+
if !pukRegexp.MatchString(passphrase) {
392400
w.log.Error("PUK needs to be at least 12 digits")
393401
return ErrPINUnblockNeeded
394402
}

0 commit comments

Comments
 (0)