Skip to content

Commit

Permalink
chore: replace tendermint with cometbft
Browse files Browse the repository at this point in the history
  • Loading branch information
haiyizxx committed Dec 9, 2024
1 parent 3cf9108 commit 90ec698
Show file tree
Hide file tree
Showing 21 changed files with 1,339 additions and 673 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go-generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.18
- 1.23
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.18
- 1.23
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
go-version:
- 1.18
- 1.23
os:
- ubuntu-22.04
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:experimental

FROM golang:1.18-alpine3.15 as build
FROM golang:1.23.4-alpine3.21 as build

RUN apk add --no-cache --update \
zeromq-dev \
Expand All @@ -12,7 +12,7 @@ WORKDIR tm-events
COPY . .
RUN make build

FROM alpine:3.15
FROM alpine:3.21

COPY --from=build /go/tm-events/bin/* /usr/local/bin/

4 changes: 2 additions & 2 deletions cmd/tmrpc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/axelarnetwork/utils/log"

tmlog "github.com/cometbft/cometbft/libs/log"
"github.com/cometbft/cometbft/rpc/client"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"
tmlog "github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/rpc/client"

"github.com/axelarnetwork/tm-events/events"
"github.com/axelarnetwork/tm-events/pubsub"
Expand Down
2 changes: 1 addition & 1 deletion events/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package events
import (
"context"

coretypes "github.com/tendermint/tendermint/rpc/core/types"
coretypes "github.com/cometbft/cometbft/rpc/core/types"

"github.com/axelarnetwork/utils/log"

Expand Down
2 changes: 1 addition & 1 deletion events/bus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

coretypes "github.com/cometbft/cometbft/rpc/core/types"
"github.com/stretchr/testify/assert"
coretypes "github.com/tendermint/tendermint/rpc/core/types"

testutils "github.com/axelarnetwork/utils/test"
"github.com/axelarnetwork/utils/test/rand"
Expand Down
4 changes: 2 additions & 2 deletions events/event.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package events

import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/json"
abci "github.com/cometbft/cometbft/abci/types"
"github.com/cometbft/cometbft/libs/json"
)

// Event stores type, module, action and attributes list of sdk
Expand Down
4 changes: 2 additions & 2 deletions events/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package events
import (
"testing"

abci "github.com/cometbft/cometbft/abci/types"
"github.com/stretchr/testify/assert"
abci "github.com/tendermint/tendermint/abci/types"
)

func TestEventMarshalling(t *testing.T) {
Expand All @@ -13,7 +13,7 @@ func TestEventMarshalling(t *testing.T) {
Event: abci.Event{
Type: "eventType",
Attributes: []abci.EventAttribute{
{Key: []byte("key1"), Value: []byte("value1")},
{Key: "key1", Value: "value1"},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion events/mock/alias.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mock

import (
tmpubsub "github.com/tendermint/tendermint/libs/pubsub"
tmpubsub "github.com/cometbft/cometbft/libs/pubsub"
)

//go:generate moq -pkg mock -out ./imported.go . Query
Expand Down
2 changes: 1 addition & 1 deletion events/mock/source.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions events/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"fmt"
"time"

coretypes "github.com/tendermint/tendermint/rpc/core/types"
coretypes "github.com/cometbft/cometbft/rpc/core/types"

"github.com/axelarnetwork/utils/log"

"github.com/cometbft/cometbft/libs/pubsub/query"
tm "github.com/cometbft/cometbft/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/tendermint/tendermint/libs/pubsub/query"
tm "github.com/tendermint/tendermint/types"

"github.com/axelarnetwork/utils"
)
Expand Down
10 changes: 5 additions & 5 deletions events/source2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"testing"
"time"

abci "github.com/cometbft/cometbft/abci/types"
coretypes "github.com/cometbft/cometbft/rpc/core/types"
tm "github.com/cometbft/cometbft/types"
"github.com/cucumber/godog"
"github.com/stretchr/testify/assert"
abci "github.com/tendermint/tendermint/abci/types"
coretypes "github.com/tendermint/tendermint/rpc/core/types"
tm "github.com/tendermint/tendermint/types"

testutils "github.com/axelarnetwork/utils/test"
"github.com/axelarnetwork/utils/test/rand"
Expand Down Expand Up @@ -389,8 +389,8 @@ func randomAttributes(count int64) []abci.EventAttribute {
attributes := make([]abci.EventAttribute, 0, count)
for i := 0; i < cap(attributes); i++ {
attributes = append(attributes, abci.EventAttribute{
Key: rand.BytesBetween(5, 100),
Value: rand.BytesBetween(5, 100),
Key: rand.StrBetween(5, 100),
Value: rand.StrBetween(5, 100),
Index: rand.Bools(0.5).Next(),
})
}
Expand Down
4 changes: 2 additions & 2 deletions events/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"
"time"

coretypes "github.com/cometbft/cometbft/rpc/core/types"
tm "github.com/cometbft/cometbft/types"
"github.com/stretchr/testify/assert"
coretypes "github.com/tendermint/tendermint/rpc/core/types"
tm "github.com/tendermint/tendermint/types"

testutils "github.com/axelarnetwork/utils/test"
"github.com/axelarnetwork/utils/test/rand"
Expand Down
107 changes: 57 additions & 50 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,100 +1,107 @@
module github.com/axelarnetwork/tm-events

go 1.18
go 1.23

require (
github.com/axelarnetwork/utils v0.0.0-20230615020512-c9d3f82faeb1
github.com/cosmos/cosmos-sdk v0.45.16
github.com/axelarnetwork/utils v0.0.0-20241209170710-4183082adf01
github.com/cometbft/cometbft v0.37.5
github.com/cosmos/cosmos-sdk v0.47.14
github.com/cucumber/godog v0.12.5
github.com/go-errors/errors v1.4.2
github.com/gogo/protobuf v1.3.3
github.com/matryer/moq v0.3.1
github.com/matryer/moq v0.5.1
github.com/smallnest/chanx v1.0.1-0.20211205150931-349643806662
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.27
golang.org/x/tools v0.9.3
github.com/spf13/cobra v1.8.1
github.com/stretchr/testify v1.9.0
golang.org/x/tools v0.28.0
)

require (
github.com/armon/go-metrics v0.4.1 // indirect
cosmossdk.io/errors v1.0.1 // indirect
cosmossdk.io/math v1.3.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cometbft/cometbft-db v0.7.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
github.com/cosmos/btcutil v1.0.4 // indirect
github.com/cosmos/gorocksdb v1.2.0 // indirect
github.com/cosmos/btcutil v1.0.5 // indirect
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
github.com/cosmos/gogoproto v1.7.0 // indirect
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
github.com/dgraph-io/ristretto v0.0.3 // indirect
github.com/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/gofrs/uuid v4.3.0+incompatible // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20210609091139-0a56a4bca00b // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.14.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
github.com/tendermint/tm-db v0.6.7 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/exp v0.0.0-20221019170559-20944726eadf // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/genproto v0.0.0-20230125152338-dcaf20b6aeaa // indirect
google.golang.org/grpc v1.52.3 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.30.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

// Fix DragonBerry vulnerability
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0

// use cometbft
replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27
Loading

0 comments on commit 90ec698

Please sign in to comment.