Skip to content

Commit df28027

Browse files
authored
Merge pull request #265 from SiaFoundation/nate/update-coreutils
Update coreutils
2 parents cd32fd3 + 984a474 commit df28027

File tree

6 files changed

+138
-184
lines changed

6 files changed

+138
-184
lines changed

.golangci.yml

Lines changed: 97 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,110 @@
1-
# Based off of the example file at https://github.com/golangci/golangci-lint
2-
3-
# options for analysis running
1+
version: "2"
42
run:
5-
# default concurrency is a available CPU number
63
concurrency: 4
7-
8-
# timeout for analysis, e.g. 30s, 5m, default is 1m
9-
timeout: 600s
10-
11-
# exit code when at least one issue was found, default is 1
124
issues-exit-code: 1
13-
14-
# include test files or not, default is true
155
tests: true
16-
17-
# list of build tags, all linters use it. Default is empty list.
18-
build-tags: []
19-
20-
# output configuration options
21-
output:
22-
# print lines of code with issue, default is true
23-
print-issued-lines: true
24-
25-
# print linter name in the end of issue text, default is true
26-
print-linter-name: true
27-
28-
# all available settings of specific linters
29-
linters-settings:
30-
## Enabled linters:
31-
govet:
32-
# report about shadowed variables
33-
disable-all: false
34-
35-
tagliatelle:
36-
case:
37-
rules:
38-
json: goCamel
39-
yaml: goCamel
40-
41-
42-
gocritic:
43-
# Which checks should be enabled; can't be combined with 'disabled-checks';
44-
# See https://go-critic.github.io/overview#checks-overview
45-
# To check which checks are enabled run `GL_DEBUG=gocritic golangci-lint run`
46-
# By default list of stable checks is used.
47-
enabled-tags:
48-
- diagnostic
49-
- style
50-
disabled-checks:
51-
# diagnostic
52-
- appendAssign
53-
- commentedOutCode
54-
- uncheckedInlineErr
55-
# style
56-
- httpNoBody
57-
- exitAfterDefer
58-
- ifElseChain
59-
- importShadow
60-
- initClause
61-
- nestingReduce
62-
- octalLiteral
63-
- paramTypeCombine
64-
- ptrToRefParam
65-
- stringsCompare
66-
- tooManyResultsChecker
67-
- typeDefFirst
68-
- typeUnparen
69-
- unlabelStmt
70-
- unnamedResult
71-
- whyNoLint
72-
revive:
73-
ignore-generated-header: true
74-
rules:
75-
- name: blank-imports
76-
disabled: false
77-
- name: bool-literal-in-expr
78-
disabled: false
79-
- name: confusing-naming
80-
disabled: false
81-
- name: confusing-results
82-
disabled: false
83-
- name: constant-logical-expr
84-
disabled: false
85-
- name: context-as-argument
86-
disabled: false
87-
- name: exported
88-
disabled: false
89-
- name: errorf
90-
disabled: false
91-
- name: if-return
92-
disabled: false
93-
- name: indent-error-flow
94-
disabled: true
95-
- name: increment-decrement
96-
disabled: false
97-
- name: modifies-value-receiver
98-
disabled: true
99-
- name: optimize-operands-order
100-
disabled: false
101-
- name: range-val-in-closure
102-
disabled: false
103-
- name: struct-tag
104-
disabled: false
105-
- name: superfluous-else
106-
disabled: false
107-
- name: time-equal
108-
disabled: false
109-
- name: unexported-naming
110-
disabled: false
111-
- name: unexported-return
112-
disabled: false
113-
- name: unnecessary-stmt
114-
disabled: false
115-
- name: unreachable-code
116-
disabled: false
117-
- name: package-comments
118-
disabled: true
119-
1206
linters:
121-
disable-all: true
122-
fast: false
7+
default: none
1238
enable:
124-
- tagliatelle
1259
- gocritic
126-
- gofmt
127-
- revive
12810
- govet
12911
- misspell
130-
- typecheck
12+
- revive
13+
- tagliatelle
13114
- whitespace
132-
15+
settings:
16+
gocritic:
17+
disabled-checks:
18+
- appendAssign
19+
- commentedOutCode
20+
- uncheckedInlineErr
21+
- httpNoBody
22+
- exitAfterDefer
23+
- ifElseChain
24+
- importShadow
25+
- initClause
26+
- nestingReduce
27+
- octalLiteral
28+
- paramTypeCombine
29+
- ptrToRefParam
30+
- stringsCompare
31+
- tooManyResultsChecker
32+
- typeDefFirst
33+
- typeUnparen
34+
- unlabelStmt
35+
- unnamedResult
36+
- whyNoLint
37+
enabled-tags:
38+
- diagnostic
39+
- style
40+
govet:
41+
disable-all: false
42+
revive:
43+
rules:
44+
- name: blank-imports
45+
disabled: false
46+
- name: bool-literal-in-expr
47+
disabled: false
48+
- name: confusing-naming
49+
disabled: false
50+
- name: confusing-results
51+
disabled: false
52+
- name: constant-logical-expr
53+
disabled: false
54+
- name: context-as-argument
55+
disabled: false
56+
- name: exported
57+
disabled: false
58+
- name: errorf
59+
disabled: false
60+
- name: if-return
61+
disabled: false
62+
- name: indent-error-flow
63+
disabled: true
64+
- name: increment-decrement
65+
disabled: false
66+
- name: modifies-value-receiver
67+
disabled: true
68+
- name: optimize-operands-order
69+
disabled: false
70+
- name: range-val-in-closure
71+
disabled: false
72+
- name: struct-tag
73+
disabled: false
74+
- name: superfluous-else
75+
disabled: false
76+
- name: time-equal
77+
disabled: false
78+
- name: unexported-naming
79+
disabled: false
80+
- name: unexported-return
81+
disabled: false
82+
- name: unnecessary-stmt
83+
disabled: false
84+
- name: unreachable-code
85+
disabled: false
86+
- name: package-comments
87+
disabled: true
88+
tagliatelle:
89+
case:
90+
rules:
91+
json: goCamel
92+
yaml: goCamel
93+
exclusions:
94+
generated: lax
95+
paths:
96+
- third_party$
97+
- builtin$
98+
- examples$
13399
issues:
134-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
135100
max-issues-per-linter: 0
136-
137-
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
138101
max-same-issues: 0
139-
140-
# List of regexps of issue texts to exclude, empty list by default.
141-
# But independently from this option we use default exclude patterns,
142-
# it can be disabled by `exclude-use-default: false`. To list all
143-
# excluded by default patterns execute `golangci-lint run --help`
144-
exclude: []
145-
146-
# Independently from option `exclude` we use default exclude patterns,
147-
# it can be disabled by this option. To list all
148-
# excluded by default patterns execute `golangci-lint run --help`.
149-
# Default value for this option is true.
150-
exclude-use-default: false
102+
formatters:
103+
enable:
104+
- gofmt
105+
exclusions:
106+
generated: lax
107+
paths:
108+
- third_party$
109+
- builtin$
110+
- examples$

api/server.go

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ type (
3939
Addr() string
4040
Peers() []*syncer.Peer
4141
Connect(ctx context.Context, addr string) (*syncer.Peer, error)
42-
BroadcastHeader(bh types.BlockHeader) error
43-
BroadcastTransactionSet(txns []types.Transaction) error
4442
BroadcastV2TransactionSet(index types.ChainIndex, txns []types.V2Transaction) error
4543
BroadcastV2BlockOutline(bo gateway.V2BlockOutline) error
4644
}
@@ -177,15 +175,13 @@ func (s *server) syncerBroadcastBlockHandler(jc jape.Context) {
177175
return
178176
} else if jc.Check("block is invalid", s.cm.AddBlocks([]types.Block{b})) != nil {
179177
return
178+
} else if b.V2 == nil {
179+
jc.Error(errors.New("v1 blocks are not supported"), http.StatusBadRequest)
180+
return
180181
}
181-
if b.V2 == nil {
182-
if jc.Check("failed to broadcast header", s.s.BroadcastHeader(b.Header())) != nil {
183-
return
184-
}
185-
} else {
186-
if jc.Check("failed to broadcast block outline", s.s.BroadcastV2BlockOutline(gateway.OutlineBlock(b, s.cm.PoolTransactions(), s.cm.V2PoolTransactions()))) != nil {
187-
return
188-
}
182+
183+
if jc.Check("failed to broadcast block outline", s.s.BroadcastV2BlockOutline(gateway.OutlineBlock(b, s.cm.PoolTransactions(), s.cm.V2PoolTransactions()))) != nil {
184+
return
189185
}
190186
}
191187

@@ -211,13 +207,11 @@ func (s *server) txpoolBroadcastHandler(jc jape.Context) {
211207
return
212208
}
213209
if len(tbr.Transactions) != 0 {
210+
// TODO: remove support for v1 transactions
214211
_, err := s.cm.AddPoolTransactions(tbr.Transactions)
215212
if jc.Check("invalid transaction set", err) != nil {
216213
return
217214
}
218-
if jc.Check("failed to broadcast transaction set", s.s.BroadcastTransactionSet(tbr.Transactions)) != nil {
219-
return
220-
}
221215
}
222216
if len(tbr.V2Transactions) != 0 {
223217
_, err := s.cm.AddV2PoolTransactions(tip, tbr.V2Transactions)

explorer/explorer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func waitForSync(t testing.TB, cm *chain.Manager, e *explorer.Explorer) {
4848

4949
func testV2Host(tb testing.TB, cm *chain.Manager) rhp4.TransportClient {
5050
hostKey := types.GeneratePrivateKey()
51-
w, err := wallet.NewSingleAddressWallet(hostKey, cm, ctestutil.NewEphemeralWalletStore(), ctestutil.MockSyncer{})
51+
w, err := wallet.NewSingleAddressWallet(hostKey, cm, ctestutil.NewEphemeralWalletStore(), &ctestutil.MockSyncer{})
5252
if err != nil {
5353
tb.Fatal(err)
5454
}
@@ -72,7 +72,7 @@ func testV2Host(tb testing.TB, cm *chain.Manager) rhp4.TransportClient {
7272
}
7373
tb.Cleanup(func() { l.Close() })
7474

75-
rs := rhp4.NewServer(hostKey, cm, s, ctestutil.NewEphemeralContractor(cm), w, ctestutil.NewEphemeralSettingsReporter(), ctestutil.NewEphemeralSectorStore())
75+
rs := rhp4.NewServer(hostKey, cm, ctestutil.NewEphemeralContractor(cm), w, ctestutil.NewEphemeralSettingsReporter(), ctestutil.NewEphemeralSectorStore())
7676
go siamux.Serve(l, rs, zap.NewNop())
7777

7878
// announce so the host is discoverable

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require (
66
github.com/google/go-cmp v0.7.0
77
github.com/mattn/go-sqlite3 v1.14.28
88
github.com/oschwald/geoip2-golang v1.11.0
9-
go.sia.tech/core v0.14.1
10-
go.sia.tech/coreutils v0.16.4
9+
go.sia.tech/core v0.14.3
10+
go.sia.tech/coreutils v0.16.6-0.20250725192801-b7206fb99580
1111
go.sia.tech/jape v0.14.0
1212
go.uber.org/zap v1.27.0
1313
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
@@ -26,11 +26,11 @@ require (
2626
go.sia.tech/mux v1.4.0 // indirect
2727
go.uber.org/mock v0.5.2 // indirect
2828
go.uber.org/multierr v1.11.0 // indirect
29-
golang.org/x/crypto v0.39.0 // indirect
30-
golang.org/x/mod v0.25.0 // indirect
31-
golang.org/x/net v0.41.0 // indirect
32-
golang.org/x/sync v0.15.0 // indirect
33-
golang.org/x/sys v0.33.0 // indirect
34-
golang.org/x/text v0.26.0 // indirect
35-
golang.org/x/tools v0.34.0 // indirect
29+
golang.org/x/crypto v0.40.0 // indirect
30+
golang.org/x/mod v0.26.0 // indirect
31+
golang.org/x/net v0.42.0 // indirect
32+
golang.org/x/sync v0.16.0 // indirect
33+
golang.org/x/sys v0.34.0 // indirect
34+
golang.org/x/text v0.27.0 // indirect
35+
golang.org/x/tools v0.35.0 // indirect
3636
)

go.sum

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
3030
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
3131
go.etcd.io/bbolt v1.4.2 h1:IrUHp260R8c+zYx/Tm8QZr04CX+qWS5PGfPdevhdm1I=
3232
go.etcd.io/bbolt v1.4.2/go.mod h1:Is8rSHO/b4f3XigBC0lL0+4FwAQv3HXEEIgFMuKHceM=
33-
go.sia.tech/core v0.14.1 h1:4MvZBjuZiz0IQk9eqU/NL8mTK5BAMca3L3lUzszGHqs=
34-
go.sia.tech/core v0.14.1/go.mod h1:Uhrw7JKxtDCr5ZW2homCKrRPKTgZBy9t35vfBWWFMxc=
35-
go.sia.tech/coreutils v0.16.4 h1:1uKEq6c2/Ad+pBNrhSYEx552MsJSed0PrcKaszII0nc=
36-
go.sia.tech/coreutils v0.16.4/go.mod h1:BmdMVo+MYSOhc2D/C04+JPgcmpwYgBguj0kk219uvBQ=
33+
go.sia.tech/core v0.14.3 h1:cqg+Ub5+FCBtwDs2qAsSXRRS7y9EfeQ3YSiDoQqYPlA=
34+
go.sia.tech/core v0.14.3/go.mod h1:LTwIv96zPnsUbHNOUlXmo73B1A3PCmFFjilr14R1/dY=
35+
go.sia.tech/coreutils v0.16.6-0.20250725192801-b7206fb99580 h1:dj8doTEf8tx9uT47jWiQqoxBYB0IydppAxCJnrbIIDg=
36+
go.sia.tech/coreutils v0.16.6-0.20250725192801-b7206fb99580/go.mod h1:KgkWPWGFsJE/Rq4bosAF60Maxu45JfaM5Kh7AEEGwJ0=
3737
go.sia.tech/jape v0.14.0 h1:hyocTKqvcji+rC1vDE1djINlpErQQVDS6zoLMmxW3Xs=
3838
go.sia.tech/jape v0.14.0/go.mod h1:tONxoKrNr0iQWzBCygwlTkGoGjuEhyVpLGInvGd2mGY=
3939
go.sia.tech/mux v1.4.0 h1:LgsLHtn7l+25MwrgaPaUCaS8f2W2/tfvHIdXps04sVo=
@@ -46,22 +46,22 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
4646
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
4747
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
4848
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
49-
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
50-
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
49+
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
50+
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
5151
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM=
5252
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc=
53-
golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w=
54-
golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
55-
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
56-
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
57-
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
58-
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
59-
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
60-
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
61-
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
62-
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
63-
golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo=
64-
golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg=
53+
golang.org/x/mod v0.26.0 h1:EGMPT//Ezu+ylkCijjPc+f4Aih7sZvaAr+O3EHBxvZg=
54+
golang.org/x/mod v0.26.0/go.mod h1:/j6NAhSk8iQ723BGAUyoAcn7SlD7s15Dp9Nd/SfeaFQ=
55+
golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs=
56+
golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8=
57+
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
58+
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
59+
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
60+
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
61+
golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
62+
golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
63+
golang.org/x/tools v0.35.0 h1:mBffYraMEf7aa0sB+NuKnuCy8qI/9Bughn8dC2Gu5r0=
64+
golang.org/x/tools v0.35.0/go.mod h1:NKdj5HkL/73byiZSJjqJgKn3ep7KjFkBOkR/Hps3VPw=
6565
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6666
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6767
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 commit comments

Comments
 (0)