Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump store to comet v1 #19991

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 18 additions & 12 deletions store/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module cosmossdk.io/store

go 1.21
go 1.22.2

require (
cosmossdk.io/errors v1.0.0
cosmossdk.io/log v1.3.1
cosmossdk.io/math v1.3.0
github.com/cometbft/cometbft v0.38.6
github.com/cometbft/cometbft v1.0.0-alpha.2.0.20240417065730-32803329c3e5
github.com/cosmos/cosmos-db v1.0.2
github.com/cosmos/gogoproto v1.4.12
github.com/cosmos/iavl v1.1.1
Expand All @@ -18,24 +18,27 @@ require (
github.com/hashicorp/go-plugin v1.5.2
github.com/hashicorp/golang-lru v1.0.2
github.com/spf13/cast v1.6.0 // indirect
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/tidwall/btree v1.7.0
golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f
google.golang.org/grpc v1.61.1
google.golang.org/grpc v1.63.2
google.golang.org/protobuf v1.33.0
gotest.tools/v3 v3.5.1
)

require github.com/cometbft/cometbft/api v1.0.0-alpha.2

require (
github.com/DataDog/zstd v1.5.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/cosmos/crypto v0.0.0-20240309083813-82ed2537802e // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/emicklei/dot v1.6.1 // indirect
Expand All @@ -50,29 +53,32 @@ require (
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/jhump/protoreflect v1.15.3 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.8.12 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.50.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.52.3 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
67 changes: 39 additions & 28 deletions store/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"
dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/iavl"
ics23 "github.com/cosmos/ics23/go"
Expand Down
2 changes: 1 addition & 1 deletion store/internal/maps/maps.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/cometbft/cometbft/crypto/merkle"
"github.com/cometbft/cometbft/crypto/tmhash"
cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"

"cosmossdk.io/store/internal/kv"
"cosmossdk.io/store/internal/tree"
Expand Down
2 changes: 1 addition & 1 deletion store/internal/proofs/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"math/bits"

cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"
ics23 "github.com/cosmos/ics23/go"
)

Expand Down
2 changes: 1 addition & 1 deletion store/internal/proofs/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package proofs
import (
"sort"

cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"
"golang.org/x/exp/maps"

"cosmossdk.io/math/unsafe"
Expand Down
2 changes: 1 addition & 1 deletion store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"sync"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
dbm "github.com/cosmos/cosmos-db"
protoio "github.com/cosmos/gogoproto/io"
gogotypes "github.com/cosmos/gogoproto/types"
Expand Down
4 changes: 2 additions & 2 deletions store/streaming/abci/examples/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (a *FilePlugin) writeToFile(file string, data []byte) error {
return nil
}

func (a *FilePlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
func (a *FilePlugin) ListenFinalizeBlock(ctx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, req))
if err := a.writeToFile("finalize-block-req", d1); err != nil {
Expand All @@ -55,7 +55,7 @@ func (a *FilePlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFi
return nil
}

func (a *FilePlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error {
func (a *FilePlugin) ListenCommit(ctx context.Context, res abci.CommitResponse, changeSet []*store.StoreKVPair) error {
fmt.Printf("listen-commit: block_height=%d data=%v", res.RetainHeight, changeSet)
d1 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, res))
d2 := []byte(fmt.Sprintf("%d:::%v\n", a.BlockHeight, changeSet))
Expand Down
4 changes: 2 additions & 2 deletions store/streaming/abci/examples/stdout/stdout.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ type StdoutPlugin struct {
BlockHeight int64
}

func (a *StdoutPlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
func (a *StdoutPlugin) ListenFinalizeBlock(ctx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
a.BlockHeight = req.Height
// process tx messages (i.e: sent to external system)
fmt.Printf("listen-finalize-block: block-height=%d req=%v res=%v", a.BlockHeight, req, res)
return nil
}

func (a *StdoutPlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*store.StoreKVPair) error {
func (a *StdoutPlugin) ListenCommit(ctx context.Context, res abci.CommitResponse, changeSet []*store.StoreKVPair) error {
// process block commit messages (i.e: sent to external system)
fmt.Printf("listen-commit: block_height=%d res=%v data=%v", a.BlockHeight, res, changeSet)
return nil
Expand Down
4 changes: 2 additions & 2 deletions store/streaming/abci/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type GRPCClient struct {
// It panics if a types.Context was not properly attached.
// When the node is configured to stop on listening errors,
// it will terminate immediately and exit with a non-zero code.
func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
ctx := goCtx.(storetypes.Context)
sm := ctx.StreamingManager()
request := &ListenFinalizeBlockRequest{Req: &req, Res: &res}
Expand All @@ -39,7 +39,7 @@ func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.Request
// It panics if a types.Context was not properly attached.
// When the node is configured to stop on listening errors,
// it will terminate immediately and exit with a non-zero code.
func (m *GRPCClient) ListenCommit(goCtx context.Context, res abci.ResponseCommit, changeSet []*storetypes.StoreKVPair) error {
func (m *GRPCClient) ListenCommit(goCtx context.Context, res abci.CommitResponse, changeSet []*storetypes.StoreKVPair) error {
ctx := goCtx.(storetypes.Context)
sm := ctx.StreamingManager()
request := &ListenCommitRequest{BlockHeight: ctx.BlockHeight(), Res: &res, ChangeSet: changeSet}
Expand Down
20 changes: 10 additions & 10 deletions store/streaming/abci/grpc.pb.go

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

14 changes: 7 additions & 7 deletions store/streaming/streaming_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

abci "github.com/cometbft/cometbft/abci/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
"github.com/cosmos/gogoproto/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -26,9 +26,9 @@ type PluginTestSuite struct {

workDir string

finalizeBlockReq abci.RequestFinalizeBlock
finalizeBlockRes abci.ResponseFinalizeBlock
commitRes abci.ResponseCommit
finalizeBlockReq abci.FinalizeBlockRequest
finalizeBlockRes abci.FinalizeBlockResponse
commitRes abci.CommitResponse

changeSet []*storetypes.StoreKVPair
}
Expand Down Expand Up @@ -67,14 +67,14 @@ func (s *PluginTestSuite) SetupTest() {

// test abci message types

s.finalizeBlockReq = abci.RequestFinalizeBlock{
s.finalizeBlockReq = abci.FinalizeBlockRequest{
Height: s.loggerCtx.BlockHeight(),
Txs: [][]byte{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}},
Misbehavior: []abci.Misbehavior{},
Hash: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9},
DecidedLastCommit: abci.CommitInfo{},
}
s.finalizeBlockRes = abci.ResponseFinalizeBlock{
s.finalizeBlockRes = abci.FinalizeBlockResponse{
Events: []abci.Event{},
ConsensusParamUpdates: &tmproto.ConsensusParams{},
ValidatorUpdates: []abci.ValidatorUpdate{},
Expand All @@ -89,7 +89,7 @@ func (s *PluginTestSuite) SetupTest() {
Log: "mockLog",
}},
}
s.commitRes = abci.ResponseCommit{}
s.commitRes = abci.CommitResponse{}

// test store kv pair types
for range [2000]int{} {
Expand Down
2 changes: 1 addition & 1 deletion store/types/commit_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types
import (
"crypto/sha256"

cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"

"cosmossdk.io/store/internal/maps"
)
Expand Down
18 changes: 9 additions & 9 deletions store/types/listening.pb.go

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

2 changes: 1 addition & 1 deletion store/types/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/cometbft/cometbft/crypto/merkle"
cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto"
cmtprotocrypto "github.com/cometbft/cometbft/api/cometbft/crypto/v1"
ics23 "github.com/cosmos/ics23/go"

errorsmod "cosmossdk.io/errors"
Expand Down