Skip to content

Commit b3e1e44

Browse files
evan-forbesrach-id
andauthored
fix!: match protos for v0.38 to fix tx client (#2040)
These protos changed in v0.38 sometimes they don't cause issues due to bytes and strings being so similar for json objects. For example, if one prints and copies the response bytes directly, they can be unmarshalled like normal. However, they often do when decoding using comet's proprietary (and cursed) json decoding logic --------- Co-authored-by: CHAMI Rachid <[email protected]>
1 parent 7583567 commit b3e1e44

File tree

20 files changed

+346
-303
lines changed

20 files changed

+346
-303
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ jobs:
3636

3737
- uses: golangci/[email protected]
3838
with:
39-
version: v1.61.0
39+
version: v2.1.6
4040
args: --timeout 10m
4141
github-token: ${{ secrets.github_token }}

.golangci.yml

Lines changed: 142 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,156 @@
1+
version: "2"
12
linters:
23
enable:
34
- asciicheck
45
- bodyclose
56
- dogsled
67
- dupl
7-
- errcheck
8-
# - copyloopvar
98
- goconst
10-
- gofmt
11-
- goimports
12-
#- revive
13-
# - gosec
14-
- gosimple
15-
- govet
16-
- ineffassign
179
- misspell
18-
#- nakedret
1910
- nolintlint
2011
- prealloc
2112
- staticcheck
22-
# - structcheck // to be fixed by golangci-lint
23-
- stylecheck
24-
- typecheck
2513
- unconvert
26-
- unused
27-
14+
settings:
15+
depguard:
16+
rules:
17+
main:
18+
files:
19+
- $all
20+
- '!$test'
21+
allow:
22+
- $gostd
23+
- github.com/tendermint
24+
- github.com/cometbft
25+
- github.com/cosmos
26+
- github.com/gogo
27+
- github.com/Workiva/go-datastructures
28+
- github.com/ChainSafe/go-schnorrkel
29+
- github.com/creachadair/taskgroup
30+
- github.com/gtank/merlin
31+
- github.com/btcsuite/btcd/btcec/v2
32+
- github.com/BurntSushi/toml
33+
- github.com/go-git/go-git/v5
34+
- github.com/go-kit
35+
- github.com/go-logfmt/logfmt
36+
- github.com/gofrs/uuid
37+
- github.com/google
38+
- github.com/gorilla/websocket
39+
- github.com/informalsystems/tm-load-test/pkg/loadtest
40+
- github.com/lib/pq
41+
- github.com/libp2p/go-buffer-pool
42+
- github.com/Masterminds/semver/v3
43+
- github.com/minio/highwayhash
44+
- github.com/oasisprotocol/curve25519-voi
45+
- github.com/pkg/errors
46+
- github.com/prometheus
47+
- github.com/rcrowley/go-metrics
48+
- github.com/rs/cors
49+
- github.com/snikch/goodman
50+
- github.com/spf13
51+
- github.com/stretchr/testify/require
52+
- github.com/syndtr/goleveldb
53+
- github.com/influxdata/influxdb-client-go/v2
54+
- github.com/grafana/pyroscope-go
55+
- github.com/grafana/otel-profiling-go
56+
- github.com/celestiaorg/nmt
57+
test:
58+
files:
59+
- $test
60+
allow:
61+
- $gostd
62+
- github.com/cosmos
63+
- github.com/tendermint
64+
- github.com/cometbft
65+
- github.com/gogo
66+
- github.com/Workiva/go-datastructures
67+
- github.com/ChainSafe/go-schnorrkel
68+
- github.com/creachadair/taskgroup
69+
- github.com/gtank/merlin
70+
- github.com/adlio/schema
71+
- github.com/btcsuite/btcd
72+
- github.com/fortytw2/leaktest
73+
- github.com/go-kit
74+
- github.com/google/uuid
75+
- github.com/gorilla/websocket
76+
- github.com/lib/pq
77+
- github.com/oasisprotocol/curve25519-voi/primitives/merlin
78+
- github.com/ory/dockertest
79+
- github.com/pkg/errors
80+
- github.com/prometheus/client_golang/prometheus/promhttp
81+
- github.com/spf13
82+
- github.com/stretchr/testify
83+
dogsled:
84+
max-blank-identifiers: 3
85+
exclusions:
86+
generated: lax
87+
presets:
88+
- comments
89+
- common-false-positives
90+
- legacy
91+
- std-error-handling
92+
rules:
93+
- linters:
94+
- gosec
95+
- nolintlint
96+
- staticcheck
97+
path: _test\.go
98+
- linters:
99+
- gosec
100+
- nolintlint
101+
- staticcheck
102+
path: test/fuzz/
103+
- linters:
104+
- staticcheck
105+
text: "QF1008:"
106+
- linters:
107+
- staticcheck
108+
text: "QF1006:"
109+
- linters:
110+
- staticcheck
111+
text: "QF1003:"
112+
- linters:
113+
- staticcheck
114+
text: "S1009:"
115+
- linters:
116+
- staticcheck
117+
text: "QF1001:"
118+
- linters:
119+
- staticcheck
120+
text: "QF1002:"
121+
- linters:
122+
- staticcheck
123+
text: "QF1004:"
124+
- linters:
125+
- staticcheck
126+
text: "QF1005:"
127+
- linters:
128+
- staticcheck
129+
text: "QF1011:"
130+
- linters:
131+
- staticcheck
132+
text: "QF1012:"
133+
- linters:
134+
- goconst
135+
path: (.+)_test\.go
136+
- linters:
137+
- goconst
138+
text: "string `builtin` has"
139+
paths:
140+
- libs/pubsub/query/query.peg.go
141+
- third_party$
142+
- builtin$
143+
- examples$
28144
issues:
29-
exclude-files:
30-
- "libs/pubsub/query/query.peg.go"
31-
exclude-rules:
32-
- path: _test\.go
33-
linters:
34-
- gosec
35-
- staticcheck
36-
- nolintlint
37-
- path: test/fuzz/
38-
linters:
39-
- gosec
40-
- nolintlint
41-
- staticcheck
42145
max-same-issues: 50
43-
44-
linters-settings:
45-
dogsled:
46-
max-blank-identifiers: 3
47-
goconst:
48-
ignore-tests: true
49-
depguard:
50-
rules:
51-
main:
52-
files:
53-
- $all
54-
- "!$test"
55-
allow:
56-
- $gostd
57-
- github.com/tendermint
58-
- github.com/cometbft
59-
- github.com/cosmos
60-
- github.com/gogo
61-
- github.com/Workiva/go-datastructures
62-
- github.com/ChainSafe/go-schnorrkel
63-
- github.com/creachadair/taskgroup
64-
- github.com/gtank/merlin
65-
- github.com/btcsuite/btcd/btcec/v2
66-
- github.com/BurntSushi/toml
67-
- github.com/go-git/go-git/v5
68-
- github.com/go-kit
69-
- github.com/go-logfmt/logfmt
70-
- github.com/gofrs/uuid
71-
- github.com/google
72-
- github.com/gorilla/websocket
73-
- github.com/informalsystems/tm-load-test/pkg/loadtest
74-
- github.com/lib/pq
75-
- github.com/libp2p/go-buffer-pool
76-
- github.com/Masterminds/semver/v3
77-
- github.com/minio/highwayhash
78-
- github.com/oasisprotocol/curve25519-voi
79-
- github.com/pkg/errors
80-
- github.com/prometheus
81-
- github.com/rcrowley/go-metrics
82-
- github.com/rs/cors
83-
- github.com/snikch/goodman
84-
- github.com/spf13
85-
- github.com/stretchr/testify/require
86-
- github.com/syndtr/goleveldb
87-
# celestia-core specific
88-
- github.com/influxdata/influxdb-client-go/v2
89-
- github.com/grafana/pyroscope-go
90-
- github.com/grafana/otel-profiling-go
91-
- github.com/celestiaorg/nmt
92-
test:
93-
files:
94-
- "$test"
95-
allow:
96-
- $gostd
97-
- github.com/cosmos
98-
- github.com/tendermint
99-
- github.com/cometbft
100-
- github.com/gogo
101-
- github.com/Workiva/go-datastructures
102-
- github.com/ChainSafe/go-schnorrkel
103-
- github.com/creachadair/taskgroup
104-
- github.com/gtank/merlin
105-
- github.com/adlio/schema
106-
- github.com/btcsuite/btcd
107-
- github.com/fortytw2/leaktest
108-
- github.com/go-kit
109-
- github.com/google/uuid
110-
- github.com/gorilla/websocket
111-
- github.com/lib/pq
112-
- github.com/oasisprotocol/curve25519-voi/primitives/merlin
113-
- github.com/ory/dockertest
114-
- github.com/pkg/errors
115-
- github.com/prometheus/client_golang/prometheus/promhttp
116-
- github.com/spf13
117-
- github.com/stretchr/testify
146+
formatters:
147+
enable:
148+
- gofmt
149+
- goimports
150+
exclusions:
151+
generated: lax
152+
paths:
153+
- libs/pubsub/query/query.peg.go
154+
- third_party$
155+
- builtin$
156+
- examples$

abci/example/kvstore/kvstore.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,19 @@ func (app *Application) DeliverTx(req types.RequestDeliverTx) types.ResponseDeli
112112
{
113113
Type: "app",
114114
Attributes: []types.EventAttribute{
115-
{Key: []byte("creator"), Value: []byte("Cosmoshi Netowoko"), Index: true},
116-
{Key: []byte("key"), Value: key, Index: true},
117-
{Key: []byte("index_key"), Value: []byte("index is working"), Index: true},
118-
{Key: []byte("noindex_key"), Value: []byte("index is working"), Index: false},
115+
{Key: "creator", Value: "Cosmoshi Netowoko", Index: true},
116+
{Key: "key", Value: string(key), Index: true},
117+
{Key: "index_key", Value: "index is working", Index: true},
118+
{Key: "noindex_key", Value: "index is working", Index: false},
119119
},
120120
},
121121
{
122122
Type: "app",
123123
Attributes: []types.EventAttribute{
124-
{Key: []byte("creator"), Value: []byte("Cosmoshi"), Index: true},
125-
{Key: []byte("key"), Value: value, Index: true},
126-
{Key: []byte("index_key"), Value: []byte("index is working"), Index: true},
127-
{Key: []byte("noindex_key"), Value: []byte("index is working"), Index: false},
124+
{Key: "creator", Value: "Cosmoshi", Index: true},
125+
{Key: "key", Value: string(value), Index: true},
126+
{Key: "index_key", Value: "index is working", Index: true},
127+
{Key: "noindex_key", Value: "index is working", Index: false},
128128
},
129129
},
130130
}
@@ -202,13 +202,13 @@ func (app *Application) BeginBlock(req types.RequestBeginBlock) types.ResponseBe
202202
Type: "begin_event",
203203
Attributes: []types.EventAttribute{
204204
{
205-
Key: []byte("foo"),
206-
Value: []byte("100"),
205+
Key: "foo",
206+
Value: "100",
207207
Index: true,
208208
},
209209
{
210-
Key: []byte("bar"),
211-
Value: []byte("200"),
210+
Key: "bar",
211+
Value: "200",
212212
Index: true,
213213
},
214214
},
@@ -217,13 +217,13 @@ func (app *Application) BeginBlock(req types.RequestBeginBlock) types.ResponseBe
217217
Type: "begin_event",
218218
Attributes: []types.EventAttribute{
219219
{
220-
Key: []byte("foo"),
221-
Value: []byte("200"),
220+
Key: "foo",
221+
Value: "200",
222222
Index: true,
223223
},
224224
{
225-
Key: []byte("bar"),
226-
Value: []byte("300"),
225+
Key: "bar",
226+
Value: "300",
227227
Index: true,
228228
},
229229
},
@@ -237,13 +237,13 @@ func (app *Application) BeginBlock(req types.RequestBeginBlock) types.ResponseBe
237237
Type: "begin_event",
238238
Attributes: []types.EventAttribute{
239239
{
240-
Key: []byte("foo"),
241-
Value: []byte("400"),
240+
Key: "foo",
241+
Value: "400",
242242
Index: true,
243243
},
244244
{
245-
Key: []byte("bar"),
246-
Value: []byte("300"),
245+
Key: "bar",
246+
Value: "300",
247247
Index: true,
248248
},
249249
},

abci/types/messages_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func TestMarshalJSON(t *testing.T) {
2525
{
2626
Type: "testEvent",
2727
Attributes: []EventAttribute{
28-
{Key: []byte("pho"), Value: []byte("bo")},
28+
{Key: "pho", Value: "bo"},
2929
},
3030
},
3131
},
@@ -92,7 +92,7 @@ func TestWriteReadMessage2(t *testing.T) {
9292
{
9393
Type: "testEvent",
9494
Attributes: []EventAttribute{
95-
{Key: []byte("abc"), Value: []byte("def")},
95+
{Key: "abc", Value: "def"},
9696
},
9797
},
9898
},

0 commit comments

Comments
 (0)