From 9122aad1ddcc639d7b514a8a247210a70c07589f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 22:39:42 +0000 Subject: [PATCH 01/52] fix(store): Fix the TestFileStreamingService unit test. (backport #14305) (#14309) Co-authored-by: Daniel Wedul Co-authored-by: Julien Robert --- store/streaming/file/service_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/streaming/file/service_test.go b/store/streaming/file/service_test.go index 0acf4502de06..fbbb55090167 100644 --- a/store/streaming/file/service_test.go +++ b/store/streaming/file/service_test.go @@ -118,7 +118,8 @@ func TestFileStreamingService(t *testing.T) { defer os.RemoveAll(testDir) testKeys := []types.StoreKey{mockStoreKey1, mockStoreKey2} - testStreamingService, err := NewStreamingService(testDir, testPrefix, testKeys, testMarshaller, true, false, false) + var err error + testStreamingService, err = NewStreamingService(testDir, testPrefix, testKeys, testMarshaller, true, false, false) require.Nil(t, err) require.IsType(t, &StreamingService{}, testStreamingService) require.Equal(t, testPrefix, testStreamingService.filePrefix) From e6419073fdd4f8341a2ba3a4269cdd4e2d689c3d Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 23 Dec 2022 01:03:23 +0100 Subject: [PATCH 02/52] feat(gov): support v1.Proposal in v1beta1.Proposal.Content (backport #14347) (#14400) --- CHANGELOG.md | 4 +++ x/gov/migrations/v046/convert.go | 28 ++++++++++++++------- x/gov/migrations/v046/convert_test.go | 36 +++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25800d8001b0..58cf9658293a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. + ## [v0.46.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.7) - 2022-12-13 ### Features diff --git a/x/gov/migrations/v046/convert.go b/x/gov/migrations/v046/convert.go index 267418064e34..e368a0b2b2b6 100644 --- a/x/gov/migrations/v046/convert.go +++ b/x/gov/migrations/v046/convert.go @@ -5,6 +5,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" @@ -13,6 +14,7 @@ import ( // ConvertToLegacyProposal takes a new proposal and attempts to convert it to the // legacy proposal format. This conversion is best effort. New proposal types that // don't have a legacy message will return a "nil" content. +// Returns error when the amount of messages in `proposal` is different than one. func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error) { var err error legacyProposal := v1beta1.Proposal{ @@ -46,17 +48,25 @@ func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error) { if err != nil { return v1beta1.Proposal{}, err } - for _, msg := range msgs { - if legacyMsg, ok := msg.(*v1.MsgExecLegacyContent); ok { - // check that the content struct can be unmarshalled - _, err := v1.LegacyContentFromMessage(legacyMsg) - if err != nil { - return v1beta1.Proposal{}, err - } - legacyProposal.Content = legacyMsg.Content + if len(msgs) != 1 { + return v1beta1.Proposal{}, sdkerrors.ErrInvalidType.Wrap("can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of proposal messages is more than one") + } + if legacyMsg, ok := msgs[0].(*v1.MsgExecLegacyContent); ok { + // check that the content struct can be unmarshalled + _, err := v1.LegacyContentFromMessage(legacyMsg) + if err != nil { + return v1beta1.Proposal{}, err } + legacyProposal.Content = legacyMsg.Content + return legacyProposal, nil } - return legacyProposal, nil + // hack to fill up the content with the first message + // this is to support clients that have not yet (properly) use gov/v1 endpoints + // https://github.com/cosmos/cosmos-sdk/issues/14334 + // VerifyBasic assures that we have at least one message. + legacyProposal.Content, err = codectypes.NewAnyWithValue(msgs[0]) + + return legacyProposal, err } func ConvertToLegacyTallyResult(tally *v1.TallyResult) (v1beta1.TallyResult, error) { diff --git a/x/gov/migrations/v046/convert_test.go b/x/gov/migrations/v046/convert_test.go index 64375e796aef..aa4250df14e3 100644 --- a/x/gov/migrations/v046/convert_test.go +++ b/x/gov/migrations/v046/convert_test.go @@ -5,10 +5,12 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/tx" v046 "github.com/cosmos/cosmos-sdk/x/gov/migrations/v046" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/stretchr/testify/require" ) @@ -60,11 +62,45 @@ func TestConvertToLegacyProposal(t *testing.T) { require.Equal(t, v1beta1Proposal.FinalTallyResult.No, sdk.NewInt(0)) require.Equal(t, v1beta1Proposal.FinalTallyResult.NoWithVeto, sdk.NewInt(0)) require.Equal(t, v1beta1Proposal.FinalTallyResult.Abstain, sdk.NewInt(0)) + tp, ok := v1beta1Proposal.Content.GetCachedValue().(*v1beta1.TextProposal) + require.Truef(t, ok, "expected *TextProposal, got %T", v1beta1Proposal.Content.GetCachedValue()) + require.Equal(t, tp.Title, "title") + require.Equal(t, tp.Description, "description") } }) } } +func TestConvertToLegacyProposalContent(t *testing.T) { + msg := upgradetypes.MsgSoftwareUpgrade{Authority: "gov module", Plan: upgradetypes.Plan{Name: "test upgrade"}} + msgsAny, err := tx.SetMsgs([]sdk.Msg{&msg}) + require.NoError(t, err) + tallyResult := v1.EmptyTallyResult() + proposal := v1.Proposal{ + Id: 1, + Status: v1.StatusDepositPeriod, + Messages: msgsAny, + Metadata: "proposal metadata", + FinalTallyResult: &tallyResult, + } + + legacyP, err := v046.ConvertToLegacyProposal(proposal) + require.NoError(t, err) + tp, ok := legacyP.Content.GetCachedValue().(*upgradetypes.MsgSoftwareUpgrade) + require.Truef(t, ok, "expected *MsgSoftwareUpgrade, got %T", legacyP.Content.GetCachedValue()) + require.Equal(t, &msg, tp) + + // more than one message is not supported + proposal.Messages, err = tx.SetMsgs([]sdk.Msg{&msg, &msg}) + require.NoError(t, err) + _, err = v046.ConvertToLegacyProposal(proposal) + require.ErrorIs(t, sdkerrors.ErrInvalidType, err) + + // zero messages is not supported + proposal.Messages = nil + _, err = v046.ConvertToLegacyProposal(proposal) + require.ErrorIs(t, sdkerrors.ErrInvalidType, err) +} func TestConvertToLegacyTallyResult(t *testing.T) { tallyResult := v1.EmptyTallyResult() testCases := map[string]struct { From 4ed78884ae67ef1282ab4d8c45fe07e541783bdb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 27 Dec 2022 00:08:56 +0100 Subject: [PATCH 03/52] feat!: remove x/gov/migrations/v046.Migrate_V046_6_To_V046_7 (#14422) --- CHANGELOG.md | 4 ++++ x/gov/migrations/v046/store.go | 14 -------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58cf9658293a..d0784642de46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. +### API Breaking + +* (x/gov) [#14422](https://github.com/cosmos/cosmos-sdk/pull/14422) Remove `Migrate_V046_6_To_V046_7` function which shouldn't be used for chains which already migrated to 0.46. + ## [v0.46.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.7) - 2022-12-13 ### Features diff --git a/x/gov/migrations/v046/store.go b/x/gov/migrations/v046/store.go index 9fbcf9f3413d..5da5d253fe47 100644 --- a/x/gov/migrations/v046/store.go +++ b/x/gov/migrations/v046/store.go @@ -93,17 +93,3 @@ func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.Binar return migrateProposals(store, cdc) } - -// Migrate_V046_4_To_V046_5 is a helper function to migrate chains from <=v0.46.6 -// to v0.46.7 ONLY. -// -// IMPORTANT: Please do not use this function if you are upgrading to v0.46 -// from <=v0.45. -// -// This function migrates the store in-place by fixing the gov votes weight to -// be stored as decimals strings (instead of the sdk.Dec BigInt representation). -// -// The store is expected to be the gov store, and not any prefixed substore. -func Migrate_V046_6_To_V046_7(store sdk.KVStore, cdc codec.BinaryCodec) error { - return migrateVotes(store, cdc) -} From e7dd5e0bdc8aabadb0d4ae13bdb143f92c1cdf4c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 1 Jan 2023 15:56:39 +0100 Subject: [PATCH 04/52] fix: return anteEvents when postHandler fail (backport #14448) (#14459) Co-authored-by: yihuang --- CHANGELOG.md | 4 ++++ baseapp/baseapp.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0784642de46..dedbccb2a812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. +### Bug Fixes + +* (ante) [#14448](https://github.com/cosmos/cosmos-sdk/pull/14448) Return anteEvents when postHandler fail. + ### API Breaking * (x/gov) [#14422](https://github.com/cosmos/cosmos-sdk/pull/14422) Remove `Migrate_V046_6_To_V046_7` function which shouldn't be used for chains which already migrated to 0.46. diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index a094c1be6c34..78d57763726e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -729,7 +729,7 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re newCtx, err := app.postHandler(postCtx, tx, mode == runTxModeSimulate) if err != nil { - return gInfo, nil, nil, priority, err + return gInfo, nil, anteEvents, priority, err } result.Events = append(result.Events, newCtx.EventManager().ABCIEvents()...) From 93fd49d29ded8fd2f04f2a634957846b74d8d212 Mon Sep 17 00:00:00 2001 From: Marko Date: Thu, 5 Jan 2023 14:42:49 +0100 Subject: [PATCH 05/52] chore: backport pr 13881 (#14349) Co-authored-by: yihuang Co-authored-by: Julien Robert Co-authored-by: Matt Kocubinski --- CHANGELOG.md | 5 +- go.mod | 1 + go.sum | 2 + store/cachekv/benchmark_test.go | 161 ++++++++++++++ store/cachekv/internal/btree.go | 80 +++++++ store/cachekv/internal/btree_test.go | 202 ++++++++++++++++++ store/cachekv/internal/memiterator.go | 137 ++++++++++++ store/cachekv/{ => internal}/mergeiterator.go | 53 +++-- store/cachekv/memiterator.go | 57 ----- store/cachekv/search_benchmark_test.go | 4 +- store/cachekv/store.go | 47 ++-- store/cachekv/store_test.go | 146 +++++++++++++ 12 files changed, 782 insertions(+), 113 deletions(-) create mode 100644 store/cachekv/benchmark_test.go create mode 100644 store/cachekv/internal/btree.go create mode 100644 store/cachekv/internal/btree_test.go create mode 100644 store/cachekv/internal/memiterator.go rename store/cachekv/{ => internal}/mergeiterator.go (86%) delete mode 100644 store/cachekv/memiterator.go diff --git a/CHANGELOG.md b/CHANGELOG.md index dedbccb2a812..21526ee3e3cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. * (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. ### Bug Fixes @@ -59,13 +60,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24). * [#13651](https://github.com/cosmos/cosmos-sdk/pull/13651) Update `server/config/config.GetConfig` function. -* [#13781](https://github.com/cosmos/cosmos-sdk/pull/13781) Remove `client/keys.KeysCdc`. * [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go. ### State Machine Breaking * (x/gov) [#14214](https://github.com/cosmos/cosmos-sdk/pull/14214) Fix gov v0.46 migration to v1 votes. - * Also provide a helper function `govv046.Migrate_V0466_To_V0467` for migrating a chain already on v0.46 with versions <=v0.46.6 to the latest v0.46.7 correct state. + * Also provide a helper function `govv046.Migrate_V0466_To_V0467` for migrating a chain already on v0.46 with versions <=v0.46.6 to the latest v0.46.7 correct state. * (x/group) [#14071](https://github.com/cosmos/cosmos-sdk/pull/14071) Don't re-tally proposal after voting period end if they have been marked as ACCEPTED or REJECTED. ### API Breaking Changes @@ -239,6 +239,7 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8 * (x/group) [#12888](https://github.com/cosmos/cosmos-sdk/pull/12888) Fix event propagation to the current context of `x/group` message execution `[]sdk.Result`. * (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration. +* (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache. ## [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - 2022-07-26 diff --git a/go.mod b/go.mod index af7a597cccc2..dc789b4e79c2 100644 --- a/go.mod +++ b/go.mod @@ -53,6 +53,7 @@ require ( github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 + github.com/tidwall/btree v1.5.0 golang.org/x/crypto v0.2.0 golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a diff --git a/go.sum b/go.sum index 1a250e71fa80..354198c92ace 100644 --- a/go.sum +++ b/go.sum @@ -952,6 +952,8 @@ github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZD github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= +github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= +github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= diff --git a/store/cachekv/benchmark_test.go b/store/cachekv/benchmark_test.go new file mode 100644 index 000000000000..2db62ba5d6c6 --- /dev/null +++ b/store/cachekv/benchmark_test.go @@ -0,0 +1,161 @@ +package cachekv_test + +import ( + fmt "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/store" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" +) + +func DoBenchmarkDeepContextStack(b *testing.B, depth int) { + begin := []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} + end := []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} + key := storetypes.NewKVStoreKey("test") + + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db) + cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) + cms.LoadLatestVersion() + ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) + + var stack ContextStack + stack.Reset(ctx) + + for i := 0; i < depth; i++ { + stack.Snapshot() + + store := stack.CurrentContext().KVStore(key) + store.Set(begin, []byte("value")) + } + + store := stack.CurrentContext().KVStore(key) + + b.ResetTimer() + for i := 0; i < b.N; i++ { + it := store.Iterator(begin, end) + it.Valid() + it.Key() + it.Value() + it.Next() + it.Close() + } +} + +func BenchmarkDeepContextStack1(b *testing.B) { + DoBenchmarkDeepContextStack(b, 1) +} + +func BenchmarkDeepContextStack3(b *testing.B) { + DoBenchmarkDeepContextStack(b, 3) +} +func BenchmarkDeepContextStack10(b *testing.B) { + DoBenchmarkDeepContextStack(b, 10) +} + +func BenchmarkDeepContextStack13(b *testing.B) { + DoBenchmarkDeepContextStack(b, 13) +} + +// cachedContext is a pair of cache context and its corresponding commit method. +// They are obtained from the return value of `context.CacheContext()`. +type cachedContext struct { + ctx sdk.Context + commit func() +} + +// ContextStack manages the initial context and a stack of cached contexts, +// to support the `StateDB.Snapshot` and `StateDB.RevertToSnapshot` methods. +// +// Copied from an old version of ethermint +type ContextStack struct { + // Context of the initial state before transaction execution. + // It's the context used by `StateDB.CommitedState`. + initialCtx sdk.Context + cachedContexts []cachedContext +} + +// CurrentContext returns the top context of cached stack, +// if the stack is empty, returns the initial context. +func (cs *ContextStack) CurrentContext() sdk.Context { + l := len(cs.cachedContexts) + if l == 0 { + return cs.initialCtx + } + return cs.cachedContexts[l-1].ctx +} + +// Reset sets the initial context and clear the cache context stack. +func (cs *ContextStack) Reset(ctx sdk.Context) { + cs.initialCtx = ctx + if len(cs.cachedContexts) > 0 { + cs.cachedContexts = []cachedContext{} + } +} + +// IsEmpty returns true if the cache context stack is empty. +func (cs *ContextStack) IsEmpty() bool { + return len(cs.cachedContexts) == 0 +} + +// Commit commits all the cached contexts from top to bottom in order and clears the stack by setting an empty slice of cache contexts. +func (cs *ContextStack) Commit() { + // commit in order from top to bottom + for i := len(cs.cachedContexts) - 1; i >= 0; i-- { + if cs.cachedContexts[i].commit == nil { + panic(fmt.Sprintf("commit function at index %d should not be nil", i)) + } else { + cs.cachedContexts[i].commit() + } + } + cs.cachedContexts = []cachedContext{} +} + +// CommitToRevision commit the cache after the target revision, +// to improve efficiency of db operations. +func (cs *ContextStack) CommitToRevision(target int) error { + if target < 0 || target >= len(cs.cachedContexts) { + return fmt.Errorf("snapshot index %d out of bound [%d..%d)", target, 0, len(cs.cachedContexts)) + } + + // commit in order from top to bottom + for i := len(cs.cachedContexts) - 1; i > target; i-- { + if cs.cachedContexts[i].commit == nil { + return fmt.Errorf("commit function at index %d should not be nil", i) + } + cs.cachedContexts[i].commit() + } + cs.cachedContexts = cs.cachedContexts[0 : target+1] + + return nil +} + +// Snapshot pushes a new cached context to the stack, +// and returns the index of it. +func (cs *ContextStack) Snapshot() int { + i := len(cs.cachedContexts) + ctx, commit := cs.CurrentContext().CacheContext() + cs.cachedContexts = append(cs.cachedContexts, cachedContext{ctx: ctx, commit: commit}) + return i +} + +// RevertToSnapshot pops all the cached contexts after the target index (inclusive). +// the target should be snapshot index returned by `Snapshot`. +// This function panics if the index is out of bounds. +func (cs *ContextStack) RevertToSnapshot(target int) { + if target < 0 || target >= len(cs.cachedContexts) { + panic(fmt.Errorf("snapshot index %d out of bound [%d..%d)", target, 0, len(cs.cachedContexts))) + } + cs.cachedContexts = cs.cachedContexts[:target] +} + +// RevertAll discards all the cache contexts. +func (cs *ContextStack) RevertAll() { + if len(cs.cachedContexts) > 0 { + cs.RevertToSnapshot(0) + } +} diff --git a/store/cachekv/internal/btree.go b/store/cachekv/internal/btree.go new file mode 100644 index 000000000000..142f754bbd38 --- /dev/null +++ b/store/cachekv/internal/btree.go @@ -0,0 +1,80 @@ +package internal + +import ( + "bytes" + "errors" + + "github.com/tidwall/btree" +) + +const ( + // The approximate number of items and children per B-tree node. Tuned with benchmarks. + // copied from memdb. + bTreeDegree = 32 +) + +var errKeyEmpty = errors.New("key cannot be empty") + +// BTree implements the sorted cache for cachekv store, +// we don't use MemDB here because cachekv is used extensively in sdk core path, +// we need it to be as fast as possible, while `MemDB` is mainly used as a mocking db in unit tests. +// +// We choose tidwall/btree over google/btree here because it provides API to implement step iterator directly. +type BTree struct { + tree btree.BTreeG[item] +} + +// NewBTree creates a wrapper around `btree.BTreeG`. +func NewBTree() *BTree { + return &BTree{tree: *btree.NewBTreeGOptions(byKeys, btree.Options{ + Degree: bTreeDegree, + // Contract: cachekv store must not be called concurrently + NoLocks: true, + })} +} + +func (bt *BTree) Set(key, value []byte) { + bt.tree.Set(newItem(key, value)) +} + +func (bt *BTree) Get(key []byte) []byte { + i, found := bt.tree.Get(newItem(key, nil)) + if !found { + return nil + } + return i.value +} + +func (bt *BTree) Delete(key []byte) { + bt.tree.Delete(newItem(key, nil)) +} + +func (bt *BTree) Iterator(start, end []byte) (*memIterator, error) { + if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { + return nil, errKeyEmpty + } + return NewMemIterator(start, end, bt, make(map[string]struct{}), true), nil +} + +func (bt *BTree) ReverseIterator(start, end []byte) (*memIterator, error) { + if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { + return nil, errKeyEmpty + } + return NewMemIterator(start, end, bt, make(map[string]struct{}), false), nil +} + +// item is a btree item with byte slices as keys and values +type item struct { + key []byte + value []byte +} + +// byKeys compares the items by key +func byKeys(a, b item) bool { + return bytes.Compare(a.key, b.key) == -1 +} + +// newItem creates a new pair item. +func newItem(key, value []byte) item { + return item{key: key, value: value} +} diff --git a/store/cachekv/internal/btree_test.go b/store/cachekv/internal/btree_test.go new file mode 100644 index 000000000000..f85a8bbaf109 --- /dev/null +++ b/store/cachekv/internal/btree_test.go @@ -0,0 +1,202 @@ +package internal + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" +) + +func TestGetSetDelete(t *testing.T) { + db := NewBTree() + + // A nonexistent key should return nil. + value := db.Get([]byte("a")) + require.Nil(t, value) + + // Set and get a value. + db.Set([]byte("a"), []byte{0x01}) + db.Set([]byte("b"), []byte{0x02}) + value = db.Get([]byte("a")) + require.Equal(t, []byte{0x01}, value) + + value = db.Get([]byte("b")) + require.Equal(t, []byte{0x02}, value) + + // Deleting a non-existent value is fine. + db.Delete([]byte("x")) + + // Delete a value. + db.Delete([]byte("a")) + + value = db.Get([]byte("a")) + require.Nil(t, value) + + db.Delete([]byte("b")) + + value = db.Get([]byte("b")) + require.Nil(t, value) +} + +func TestDBIterator(t *testing.T) { + db := NewBTree() + + for i := 0; i < 10; i++ { + if i != 6 { // but skip 6. + db.Set(int642Bytes(int64(i)), []byte{}) + } + } + + // Blank iterator keys should error + _, err := db.ReverseIterator([]byte{}, nil) + require.Equal(t, errKeyEmpty, err) + _, err = db.ReverseIterator(nil, []byte{}) + require.Equal(t, errKeyEmpty, err) + + itr, err := db.Iterator(nil, nil) + require.NoError(t, err) + verifyIterator(t, itr, []int64{0, 1, 2, 3, 4, 5, 7, 8, 9}, "forward iterator") + + ritr, err := db.ReverseIterator(nil, nil) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{9, 8, 7, 5, 4, 3, 2, 1, 0}, "reverse iterator") + + itr, err = db.Iterator(nil, int642Bytes(0)) + require.NoError(t, err) + verifyIterator(t, itr, []int64(nil), "forward iterator to 0") + + ritr, err = db.ReverseIterator(int642Bytes(10), nil) + require.NoError(t, err) + verifyIterator(t, ritr, []int64(nil), "reverse iterator from 10 (ex)") + + itr, err = db.Iterator(int642Bytes(0), nil) + require.NoError(t, err) + verifyIterator(t, itr, []int64{0, 1, 2, 3, 4, 5, 7, 8, 9}, "forward iterator from 0") + + itr, err = db.Iterator(int642Bytes(1), nil) + require.NoError(t, err) + verifyIterator(t, itr, []int64{1, 2, 3, 4, 5, 7, 8, 9}, "forward iterator from 1") + + ritr, err = db.ReverseIterator(nil, int642Bytes(10)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{9, 8, 7, 5, 4, 3, 2, 1, 0}, "reverse iterator from 10 (ex)") + + ritr, err = db.ReverseIterator(nil, int642Bytes(9)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{8, 7, 5, 4, 3, 2, 1, 0}, "reverse iterator from 9 (ex)") + + ritr, err = db.ReverseIterator(nil, int642Bytes(8)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{7, 5, 4, 3, 2, 1, 0}, "reverse iterator from 8 (ex)") + + itr, err = db.Iterator(int642Bytes(5), int642Bytes(6)) + require.NoError(t, err) + verifyIterator(t, itr, []int64{5}, "forward iterator from 5 to 6") + + itr, err = db.Iterator(int642Bytes(5), int642Bytes(7)) + require.NoError(t, err) + verifyIterator(t, itr, []int64{5}, "forward iterator from 5 to 7") + + itr, err = db.Iterator(int642Bytes(5), int642Bytes(8)) + require.NoError(t, err) + verifyIterator(t, itr, []int64{5, 7}, "forward iterator from 5 to 8") + + itr, err = db.Iterator(int642Bytes(6), int642Bytes(7)) + require.NoError(t, err) + verifyIterator(t, itr, []int64(nil), "forward iterator from 6 to 7") + + itr, err = db.Iterator(int642Bytes(6), int642Bytes(8)) + require.NoError(t, err) + verifyIterator(t, itr, []int64{7}, "forward iterator from 6 to 8") + + itr, err = db.Iterator(int642Bytes(7), int642Bytes(8)) + require.NoError(t, err) + verifyIterator(t, itr, []int64{7}, "forward iterator from 7 to 8") + + ritr, err = db.ReverseIterator(int642Bytes(4), int642Bytes(5)) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{4}, "reverse iterator from 5 (ex) to 4") + + ritr, err = db.ReverseIterator(int642Bytes(4), int642Bytes(6)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{5, 4}, "reverse iterator from 6 (ex) to 4") + + ritr, err = db.ReverseIterator(int642Bytes(4), int642Bytes(7)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{5, 4}, "reverse iterator from 7 (ex) to 4") + + ritr, err = db.ReverseIterator(int642Bytes(5), int642Bytes(6)) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{5}, "reverse iterator from 6 (ex) to 5") + + ritr, err = db.ReverseIterator(int642Bytes(5), int642Bytes(7)) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{5}, "reverse iterator from 7 (ex) to 5") + + ritr, err = db.ReverseIterator(int642Bytes(6), int642Bytes(7)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64(nil), "reverse iterator from 7 (ex) to 6") + + ritr, err = db.ReverseIterator(int642Bytes(10), nil) + require.NoError(t, err) + verifyIterator(t, ritr, []int64(nil), "reverse iterator to 10") + + ritr, err = db.ReverseIterator(int642Bytes(6), nil) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{9, 8, 7}, "reverse iterator to 6") + + ritr, err = db.ReverseIterator(int642Bytes(5), nil) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{9, 8, 7, 5}, "reverse iterator to 5") + + ritr, err = db.ReverseIterator(int642Bytes(8), int642Bytes(9)) + require.NoError(t, err) + verifyIterator(t, ritr, []int64{8}, "reverse iterator from 9 (ex) to 8") + + ritr, err = db.ReverseIterator(int642Bytes(2), int642Bytes(4)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64{3, 2}, "reverse iterator from 4 (ex) to 2") + + ritr, err = db.ReverseIterator(int642Bytes(4), int642Bytes(2)) + require.NoError(t, err) + verifyIterator(t, ritr, + []int64(nil), "reverse iterator from 2 (ex) to 4") + + // Ensure that the iterators don't panic with an empty database. + db2 := NewBTree() + + itr, err = db2.Iterator(nil, nil) + require.NoError(t, err) + verifyIterator(t, itr, nil, "forward iterator with empty db") + + ritr, err = db2.ReverseIterator(nil, nil) + require.NoError(t, err) + verifyIterator(t, ritr, nil, "reverse iterator with empty db") +} + +func verifyIterator(t *testing.T, itr *memIterator, expected []int64, msg string) { + i := 0 + for itr.Valid() { + key := itr.Key() + require.Equal(t, expected[i], bytes2Int64(key), "iterator: %d mismatches", i) + itr.Next() + i++ + } + require.Equal(t, i, len(expected), "expected to have fully iterated over all the elements in iter") + require.NoError(t, itr.Close()) +} + +func int642Bytes(i int64) []byte { + return sdk.Uint64ToBigEndian(uint64(i)) +} + +func bytes2Int64(buf []byte) int64 { + return int64(sdk.BigEndianToUint64(buf)) +} diff --git a/store/cachekv/internal/memiterator.go b/store/cachekv/internal/memiterator.go new file mode 100644 index 000000000000..2bceb8bc77df --- /dev/null +++ b/store/cachekv/internal/memiterator.go @@ -0,0 +1,137 @@ +package internal + +import ( + "bytes" + "errors" + + "github.com/cosmos/cosmos-sdk/store/types" + "github.com/tidwall/btree" +) + +var _ types.Iterator = (*memIterator)(nil) + +// memIterator iterates over iterKVCache items. +// if key is nil, means it was deleted. +// Implements Iterator. +type memIterator struct { + iter btree.GenericIter[item] + + start []byte + end []byte + ascending bool + lastKey []byte + deleted map[string]struct{} + valid bool +} + +func NewMemIterator(start, end []byte, items *BTree, deleted map[string]struct{}, ascending bool) *memIterator { + iter := items.tree.Iter() + var valid bool + if ascending { + if start != nil { + valid = iter.Seek(newItem(start, nil)) + } else { + valid = iter.First() + } + } else { + if end != nil { + valid = iter.Seek(newItem(end, nil)) + if !valid { + valid = iter.Last() + } else { + // end is exclusive + valid = iter.Prev() + } + } else { + valid = iter.Last() + } + } + + mi := &memIterator{ + iter: iter, + start: start, + end: end, + ascending: ascending, + lastKey: nil, + deleted: deleted, + valid: valid, + } + + if mi.valid { + mi.valid = mi.keyInRange(mi.Key()) + } + + return mi +} + +func (mi *memIterator) Domain() (start []byte, end []byte) { + return mi.start, mi.end +} + +func (mi *memIterator) Close() error { + mi.iter.Release() + return nil +} + +func (mi *memIterator) Error() error { + if !mi.Valid() { + return errors.New("invalid memIterator") + } + return nil +} + +func (mi *memIterator) Valid() bool { + return mi.valid +} + +func (mi *memIterator) Next() { + mi.assertValid() + + if mi.ascending { + mi.valid = mi.iter.Next() + } else { + mi.valid = mi.iter.Prev() + } + + if mi.valid { + mi.valid = mi.keyInRange(mi.Key()) + } +} + +func (mi *memIterator) keyInRange(key []byte) bool { + if mi.ascending && mi.end != nil && bytes.Compare(key, mi.end) >= 0 { + return false + } + if !mi.ascending && mi.start != nil && bytes.Compare(key, mi.start) < 0 { + return false + } + return true +} + +func (mi *memIterator) Key() []byte { + return mi.iter.Item().key +} + +func (mi *memIterator) Value() []byte { + item := mi.iter.Item() + key := item.key + // We need to handle the case where deleted is modified and includes our current key + // We handle this by maintaining a lastKey object in the iterator. + // If the current key is the same as the last key (and last key is not nil / the start) + // then we are calling value on the same thing as last time. + // Therefore we don't check the mi.deleted to see if this key is included in there. + if _, ok := mi.deleted[string(key)]; ok { + if mi.lastKey == nil || !bytes.Equal(key, mi.lastKey) { + // not re-calling on old last key + return nil + } + } + mi.lastKey = key + return item.value +} + +func (mi *memIterator) assertValid() { + if err := mi.Error(); err != nil { + panic(err) + } +} diff --git a/store/cachekv/mergeiterator.go b/store/cachekv/internal/mergeiterator.go similarity index 86% rename from store/cachekv/mergeiterator.go rename to store/cachekv/internal/mergeiterator.go index a6c7a035aba0..4186a178a863 100644 --- a/store/cachekv/mergeiterator.go +++ b/store/cachekv/internal/mergeiterator.go @@ -1,4 +1,4 @@ -package cachekv +package internal import ( "bytes" @@ -18,17 +18,20 @@ type cacheMergeIterator struct { parent types.Iterator cache types.Iterator ascending bool + + valid bool } var _ types.Iterator = (*cacheMergeIterator)(nil) -func newCacheMergeIterator(parent, cache types.Iterator, ascending bool) *cacheMergeIterator { +func NewCacheMergeIterator(parent, cache types.Iterator, ascending bool) *cacheMergeIterator { iter := &cacheMergeIterator{ parent: parent, cache: cache, ascending: ascending, } + iter.valid = iter.skipUntilExistsOrInvalid() return iter } @@ -40,42 +43,38 @@ func (iter *cacheMergeIterator) Domain() (start, end []byte) { // Valid implements Iterator. func (iter *cacheMergeIterator) Valid() bool { - return iter.skipUntilExistsOrInvalid() + return iter.valid } // Next implements Iterator func (iter *cacheMergeIterator) Next() { - iter.skipUntilExistsOrInvalid() iter.assertValid() - // If parent is invalid, get the next cache item. - if !iter.parent.Valid() { + switch { + case !iter.parent.Valid(): + // If parent is invalid, get the next cache item. iter.cache.Next() - return - } - - // If cache is invalid, get the next parent item. - if !iter.cache.Valid() { + case !iter.cache.Valid(): + // If cache is invalid, get the next parent item. iter.parent.Next() - return - } - - // Both are valid. Compare keys. - keyP, keyC := iter.parent.Key(), iter.cache.Key() - switch iter.compare(keyP, keyC) { - case -1: // parent < cache - iter.parent.Next() - case 0: // parent == cache - iter.parent.Next() - iter.cache.Next() - case 1: // parent > cache - iter.cache.Next() + default: + // Both are valid. Compare keys. + keyP, keyC := iter.parent.Key(), iter.cache.Key() + switch iter.compare(keyP, keyC) { + case -1: // parent < cache + iter.parent.Next() + case 0: // parent == cache + iter.parent.Next() + iter.cache.Next() + case 1: // parent > cache + iter.cache.Next() + } } + iter.valid = iter.skipUntilExistsOrInvalid() } // Key implements Iterator func (iter *cacheMergeIterator) Key() []byte { - iter.skipUntilExistsOrInvalid() iter.assertValid() // If parent is invalid, get the cache key. @@ -106,7 +105,6 @@ func (iter *cacheMergeIterator) Key() []byte { // Value implements Iterator func (iter *cacheMergeIterator) Value() []byte { - iter.skipUntilExistsOrInvalid() iter.assertValid() // If parent is invalid, get the cache value. @@ -137,11 +135,12 @@ func (iter *cacheMergeIterator) Value() []byte { // Close implements Iterator func (iter *cacheMergeIterator) Close() error { + err1 := iter.cache.Close() if err := iter.parent.Close(); err != nil { return err } - return iter.cache.Close() + return err1 } // Error returns an error if the cacheMergeIterator is invalid defined by the diff --git a/store/cachekv/memiterator.go b/store/cachekv/memiterator.go deleted file mode 100644 index a12ff9acfd11..000000000000 --- a/store/cachekv/memiterator.go +++ /dev/null @@ -1,57 +0,0 @@ -package cachekv - -import ( - "bytes" - - dbm "github.com/tendermint/tm-db" - - "github.com/cosmos/cosmos-sdk/store/types" -) - -// memIterator iterates over iterKVCache items. -// if key is nil, means it was deleted. -// Implements Iterator. -type memIterator struct { - types.Iterator - - lastKey []byte - deleted map[string]struct{} -} - -func newMemIterator(start, end []byte, items *dbm.MemDB, deleted map[string]struct{}, ascending bool) *memIterator { - var ( - iter types.Iterator - err error - ) - - if ascending { - iter, err = items.Iterator(start, end) - } else { - iter, err = items.ReverseIterator(start, end) - } - - if err != nil { - panic(err) - } - - return &memIterator{ - Iterator: iter, - lastKey: nil, - deleted: deleted, - } -} - -func (mi *memIterator) Value() []byte { - key := mi.Iterator.Key() - // We need to handle the case where deleted is modified and includes our current key - // We handle this by maintaining a lastKey object in the iterator. - // If the current key is the same as the last key (and last key is not nil / the start) - // then we are calling value on the same thing as last time. - // Therefore we don't check the mi.deleted to see if this key is included in there. - reCallingOnOldLastKey := (mi.lastKey != nil) && bytes.Equal(key, mi.lastKey) - if _, ok := mi.deleted[string(key)]; ok && !reCallingOnOldLastKey { - return nil - } - mi.lastKey = key - return mi.Iterator.Value() -} diff --git a/store/cachekv/search_benchmark_test.go b/store/cachekv/search_benchmark_test.go index 921bff4e3864..4007c7cda202 100644 --- a/store/cachekv/search_benchmark_test.go +++ b/store/cachekv/search_benchmark_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - db "github.com/tendermint/tm-db" + "github.com/cosmos/cosmos-sdk/store/cachekv/internal" ) func BenchmarkLargeUnsortedMisses(b *testing.B) { @@ -39,6 +39,6 @@ func generateStore() *Store { return &Store{ cache: cache, unsortedCache: unsorted, - sortedCache: db.NewMemDB(), + sortedCache: internal.NewBTree(), } } diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 0ebc52268548..42354fa78be3 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -9,10 +9,10 @@ import ( dbm "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/internal/conv" + "github.com/cosmos/cosmos-sdk/store/cachekv/internal" "github.com/cosmos/cosmos-sdk/store/tracekv" "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/tendermint/tendermint/libs/math" ) // cValue represents a cached value. @@ -30,7 +30,7 @@ type Store struct { cache map[string]*cValue deleted map[string]struct{} unsortedCache map[string]struct{} - sortedCache *dbm.MemDB // always ascending sorted + sortedCache *internal.BTree // always ascending sorted parent types.KVStore } @@ -42,7 +42,7 @@ func NewStore(parent types.KVStore) *Store { cache: make(map[string]*cValue), deleted: make(map[string]struct{}), unsortedCache: make(map[string]struct{}), - sortedCache: dbm.NewMemDB(), + sortedCache: internal.NewBTree(), parent: parent, } } @@ -101,6 +101,11 @@ func (store *Store) Write() { store.mtx.Lock() defer store.mtx.Unlock() + if len(store.cache) == 0 && len(store.deleted) == 0 && len(store.unsortedCache) == 0 { + store.sortedCache = internal.NewBTree() + return + } + // We need a copy of all of the keys. // Not the best, but probably not a bottleneck depending. keys := make([]string, 0, len(store.cache)) @@ -144,7 +149,7 @@ func (store *Store) Write() { for key := range store.unsortedCache { delete(store.unsortedCache, key) } - store.sortedCache = dbm.NewMemDB() + store.sortedCache = internal.NewBTree() } // CacheWrap implements CacheWrapper. @@ -183,9 +188,9 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { } store.dirtyItems(start, end) - cache = newMemIterator(start, end, store.sortedCache, store.deleted, ascending) + cache = internal.NewMemIterator(start, end, store.sortedCache, store.deleted, ascending) - return newCacheMergeIterator(parent, cache, ascending) + return internal.NewCacheMergeIterator(parent, cache, ascending) } func findStartIndex(strL []string, startQ string) int { @@ -273,7 +278,7 @@ const minSortSize = 1024 // Constructs a slice of dirty items, to use w/ memIterator. func (store *Store) dirtyItems(start, end []byte) { startStr, endStr := conv.UnsafeBytesToStr(start), conv.UnsafeBytesToStr(end) - if startStr > endStr { + if end != nil && startStr > endStr { // Nothing to do here. return } @@ -288,6 +293,7 @@ func (store *Store) dirtyItems(start, end []byte) { // than just not having the cache. if n < minSortSize { for key := range store.unsortedCache { + // dbm.IsKeyInDomain is nil safe and returns true iff key is greater than start if dbm.IsKeyInDomain(conv.UnsafeStrToBytes(key), start, end) { cacheValue := store.cache[key] unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.value}) @@ -308,24 +314,18 @@ func (store *Store) dirtyItems(start, end []byte) { // Now find the values within the domain // [start, end) startIndex := findStartIndex(strL, startStr) - endIndex := findEndIndex(strL, endStr) - - if endIndex < 0 { - endIndex = len(strL) - 1 - } if startIndex < 0 { startIndex = 0 } - // Since we spent cycles to sort the values, we should process and remove a reasonable amount - // ensure start to end is at least minSortSize in size - // if below minSortSize, expand it to cover additional values - // this amortizes the cost of processing elements across multiple calls - if endIndex-startIndex < minSortSize { - endIndex = math.MinInt(startIndex+minSortSize, len(strL)-1) - if endIndex-startIndex < minSortSize { - startIndex = math.MaxInt(endIndex-minSortSize, 0) - } + var endIndex int + if end == nil { + endIndex = len(strL) - 1 + } else { + endIndex = findEndIndex(strL, endStr) + } + if endIndex < 0 { + endIndex = len(strL) - 1 } kvL := make([]*kv.Pair, 0) @@ -364,10 +364,7 @@ func (store *Store) clearUnsortedCacheSubset(unsorted []*kv.Pair, sortState sort store.sortedCache.Set(item.Key, []byte{}) continue } - err := store.sortedCache.Set(item.Key, item.Value) - if err != nil { - panic(err) - } + store.sortedCache.Set(item.Key, item.Value) } } diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index d589932d30fc..3ef99fd6f144 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -120,6 +120,7 @@ func TestCacheKVIteratorBounds(t *testing.T) { i++ } require.Equal(t, nItems, i) + require.NoError(t, itr.Close()) // iterate over none itr = st.Iterator(bz("money"), nil) @@ -128,6 +129,7 @@ func TestCacheKVIteratorBounds(t *testing.T) { i++ } require.Equal(t, 0, i) + require.NoError(t, itr.Close()) // iterate over lower itr = st.Iterator(keyFmt(0), keyFmt(3)) @@ -139,6 +141,7 @@ func TestCacheKVIteratorBounds(t *testing.T) { i++ } require.Equal(t, 3, i) + require.NoError(t, itr.Close()) // iterate over upper itr = st.Iterator(keyFmt(2), keyFmt(4)) @@ -150,6 +153,64 @@ func TestCacheKVIteratorBounds(t *testing.T) { i++ } require.Equal(t, 4, i) + require.NoError(t, itr.Close()) +} + +func TestCacheKVReverseIteratorBounds(t *testing.T) { + st := newCacheKVStore() + + // set some items + nItems := 5 + for i := 0; i < nItems; i++ { + st.Set(keyFmt(i), valFmt(i)) + } + + // iterate over all of them + itr := st.ReverseIterator(nil, nil) + i := 0 + for ; itr.Valid(); itr.Next() { + k, v := itr.Key(), itr.Value() + require.Equal(t, keyFmt(nItems-1-i), k) + require.Equal(t, valFmt(nItems-1-i), v) + i++ + } + require.Equal(t, nItems, i) + require.NoError(t, itr.Close()) + + // iterate over none + itr = st.ReverseIterator(bz("money"), nil) + i = 0 + for ; itr.Valid(); itr.Next() { + i++ + } + require.Equal(t, 0, i) + require.NoError(t, itr.Close()) + + // iterate over lower + end := 3 + itr = st.ReverseIterator(keyFmt(0), keyFmt(end)) + i = 0 + for ; itr.Valid(); itr.Next() { + i++ + k, v := itr.Key(), itr.Value() + require.Equal(t, keyFmt(end-i), k) + require.Equal(t, valFmt(end-i), v) + } + require.Equal(t, 3, i) + require.NoError(t, itr.Close()) + + // iterate over upper + end = 4 + itr = st.ReverseIterator(keyFmt(2), keyFmt(end)) + i = 0 + for ; itr.Valid(); itr.Next() { + i++ + k, v := itr.Key(), itr.Value() + require.Equal(t, keyFmt(end-i), k) + require.Equal(t, valFmt(end-i), v) + } + require.Equal(t, 2, i) + require.NoError(t, itr.Close()) } func TestCacheKVMergeIteratorBasics(t *testing.T) { @@ -291,6 +352,25 @@ func TestCacheKVMergeIteratorChunks(t *testing.T) { assertIterateDomainCheck(t, st, truth, []keyRange{{0, 15}, {25, 35}, {38, 40}, {45, 80}}) } +func TestCacheKVMergeIteratorDomain(t *testing.T) { + st := newCacheKVStore() + + itr := st.Iterator(nil, nil) + start, end := itr.Domain() + require.Equal(t, start, end) + require.NoError(t, itr.Close()) + + itr = st.Iterator(keyFmt(40), keyFmt(60)) + start, end = itr.Domain() + require.Equal(t, keyFmt(40), start) + require.Equal(t, keyFmt(60), end) + require.NoError(t, itr.Close()) + + start, end = st.ReverseIterator(keyFmt(0), keyFmt(80)).Domain() + require.Equal(t, keyFmt(0), start) + require.Equal(t, keyFmt(80), end) +} + func TestCacheKVMergeIteratorRandom(t *testing.T) { st := newCacheKVStore() truth := dbm.NewMemDB() @@ -306,6 +386,67 @@ func TestCacheKVMergeIteratorRandom(t *testing.T) { } } +func TestNilEndIterator(t *testing.T) { + const SIZE = 3000 + + tests := []struct { + name string + write bool + startIndex int + end []byte + }{ + {name: "write=false, end=nil", write: false, end: nil, startIndex: 1000}, + {name: "write=false, end=nil; full key scan", write: false, end: nil, startIndex: 2000}, + {name: "write=true, end=nil", write: true, end: nil, startIndex: 1000}, + {name: "write=false, end=non-nil", write: false, end: keyFmt(3000), startIndex: 1000}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + st := newCacheKVStore() + + for i := 0; i < SIZE; i++ { + kstr := keyFmt(i) + st.Set(kstr, valFmt(i)) + } + + if tt.write { + st.Write() + } + + itr := st.Iterator(keyFmt(tt.startIndex), tt.end) + i := tt.startIndex + j := 0 + for itr.Valid() { + require.Equal(t, keyFmt(i), itr.Key()) + require.Equal(t, valFmt(i), itr.Value()) + itr.Next() + i++ + j++ + } + + require.Equal(t, SIZE-tt.startIndex, j) + require.NoError(t, itr.Close()) + }) + } +} + +// TestIteratorDeadlock demonstrate the deadlock issue in cache store. +func TestIteratorDeadlock(t *testing.T) { + mem := dbadapter.Store{DB: dbm.NewMemDB()} + store := cachekv.NewStore(mem) + // the channel buffer is 64 and received once, so put at least 66 elements. + for i := 0; i < 66; i++ { + store.Set([]byte(fmt.Sprintf("key%d", i)), []byte{1}) + } + it := store.Iterator(nil, nil) + defer it.Close() + store.Set([]byte("key20"), []byte{1}) + // it'll be blocked here with previous version, or enable lock on btree. + it2 := store.Iterator(nil, nil) + defer it2.Close() +} + //------------------------------------------------------------------------------------------- // do some random ops @@ -388,6 +529,7 @@ func assertIterateDomain(t *testing.T, st types.KVStore, expectedN int) { i++ } require.Equal(t, expectedN, i) + require.NoError(t, itr.Close()) } func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []keyRange) { @@ -419,6 +561,8 @@ func assertIterateDomainCheck(t *testing.T, st types.KVStore, mem dbm.DB, r []ke require.False(t, itr.Valid()) require.False(t, itr2.Valid()) + require.NoError(t, itr.Close()) + require.NoError(t, itr2.Close()) } func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) { @@ -428,6 +572,8 @@ func assertIterateDomainCompare(t *testing.T, st types.KVStore, mem dbm.DB) { require.NoError(t, err) checkIterators(t, itr, itr2) checkIterators(t, itr2, itr) + require.NoError(t, itr.Close()) + require.NoError(t, itr2.Close()) } func checkIterators(t *testing.T, itr, itr2 types.Iterator) { From 36784a8a7a933c8f31930ad6302321be375a8509 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 7 Jan 2023 12:19:18 +0000 Subject: [PATCH 06/52] fix: wrong address set in `EventUpdateGroupPolicy` (backport #14526) (#14528) Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + x/group/keeper/keeper_test.go | 22 ++++++++++++++++++++++ x/group/keeper/msg_server.go | 3 +-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21526ee3e3cb..068f02fb5fc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (x/group) [#14526](https://github.com/cosmos/cosmos-sdk/pull/14526) Fix wrong address set in `EventUpdateGroupPolicy`. * (ante) [#14448](https://github.com/cosmos/cosmos-sdk/pull/14448) Return anteEvents when postHandler fail. ### API Breaking diff --git a/x/group/keeper/keeper_test.go b/x/group/keeper/keeper_test.go index 8664dfecddd1..56a748018965 100644 --- a/x/group/keeper/keeper_test.go +++ b/x/group/keeper/keeper_test.go @@ -438,6 +438,9 @@ func (s *TestSuite) TestUpdateGroupMetadata() { res, err := s.keeper.GroupInfo(ctx, &group.QueryGroupInfoRequest{GroupId: groupID}) s.Require().NoError(err) s.Assert().Equal(spec.expStored, res.Info) + + events := sdkCtx.EventManager().ABCIEvents() + s.Require().Len(events, 1) // EventUpdateGroup }) } } @@ -721,6 +724,9 @@ func (s *TestSuite) TestUpdateGroupMembers() { s.Assert().Equal(spec.expMembers[i].Member.AddedAt, loadedMembers[i].Member.AddedAt) s.Assert().Equal(spec.expMembers[i].GroupId, loadedMembers[i].GroupId) } + + events := sdkCtx.EventManager().ABCIEvents() + s.Require().Len(events, 1) // EventUpdateGroup }) } } @@ -1242,6 +1248,22 @@ func (s *TestSuite) TestUpdateGroupPolicyMetadata() { }) s.Require().NoError(err) s.Assert().Equal(spec.expGroupPolicy, res.Info) + + // check events + var hasUpdateGroupPolicyEvent bool + events := s.ctx.(sdk.Context).EventManager().ABCIEvents() + for _, event := range events { + event, err := sdk.ParseTypedEvent(event) + if err == nil { + if e, ok := event.(*group.EventUpdateGroupPolicy); ok { + s.Require().Equal(e.Address, groupPolicyAddr) + hasUpdateGroupPolicyEvent = true + break + } + } + } + + s.Require().True(hasUpdateGroupPolicyEvent) }) } } diff --git a/x/group/keeper/msg_server.go b/x/group/keeper/msg_server.go index 0023c57a90b4..3947f0adad50 100644 --- a/x/group/keeper/msg_server.go +++ b/x/group/keeper/msg_server.go @@ -911,8 +911,7 @@ func (k Keeper) doUpdateGroupPolicy(ctx sdk.Context, groupPolicy string, admin s return err } - err = ctx.EventManager().EmitTypedEvent(&group.EventUpdateGroupPolicy{Address: admin}) - if err != nil { + if err = ctx.EventManager().EmitTypedEvent(&group.EventUpdateGroupPolicy{Address: groupPolicyInfo.Address}); err != nil { return err } From b7a62feda412df868d93531bb79d21c918a4b4c7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 16:56:19 +0000 Subject: [PATCH 07/52] build: bump `bgentry/speakasy` to pseudo version (backport #14633) (#14638) Co-authored-by: Julien Robert --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index dc789b4e79c2..316a64d82c89 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/math v1.0.0-beta.3 github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.0 - github.com/bgentry/speakeasy v0.1.0 + github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 github.com/btcsuite/btcd v0.22.1 github.com/celestiaorg/smt v0.3.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e diff --git a/go.sum b/go.sum index 354198c92ace..eb05fbe37bae 100644 --- a/go.sum +++ b/go.sum @@ -143,8 +143,9 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= -github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= +github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= From 89e956c021edb1ec3e9d496b5efbcd11f3997d27 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 18:52:48 +0100 Subject: [PATCH 08/52] refactor: reduce tendermint deps (backport #14616) (#14663) Co-authored-by: Julien Robert --- crypto/armor.go | 2 +- crypto/armor_test.go | 2 +- crypto/keyring/keyring.go | 2 +- crypto/keys/bcrypt/base64.go | 35 ++++ crypto/keys/bcrypt/bcrypt.go | 291 ++++++++++++++++++++++++++++++ crypto/keys/utils.go | 13 ++ crypto/ledger/ledger_mock.go | 16 +- crypto/ledger/ledger_secp256k1.go | 22 ++- go.mod | 8 +- go.sum | 15 +- 10 files changed, 375 insertions(+), 31 deletions(-) create mode 100644 crypto/keys/bcrypt/base64.go create mode 100644 crypto/keys/bcrypt/bcrypt.go create mode 100644 crypto/keys/utils.go diff --git a/crypto/armor.go b/crypto/armor.go index ff265532d13c..1ad0eefe3e7f 100644 --- a/crypto/armor.go +++ b/crypto/armor.go @@ -6,11 +6,11 @@ import ( "fmt" "io" - "github.com/tendermint/crypto/bcrypt" "github.com/tendermint/tendermint/crypto" "golang.org/x/crypto/openpgp/armor" // nolint: staticcheck "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/crypto/keys/bcrypt" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/xsalsa20symmetric" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/crypto/armor_test.go b/crypto/armor_test.go index cc278aab6c38..5365d89dd239 100644 --- a/crypto/armor_test.go +++ b/crypto/armor_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/crypto/bcrypt" tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/xsalsa20symmetric" @@ -17,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/cosmos/cosmos-sdk/crypto/keys/bcrypt" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/simapp" diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index d34bfe3c0369..8d5c707f1a9c 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -12,13 +12,13 @@ import ( "github.com/99designs/keyring" "github.com/pkg/errors" - "github.com/tendermint/crypto/bcrypt" tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/cosmos/cosmos-sdk/client/input" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/crypto" "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keys/bcrypt" "github.com/cosmos/cosmos-sdk/crypto/ledger" "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/crypto/keys/bcrypt/base64.go b/crypto/keys/bcrypt/base64.go new file mode 100644 index 000000000000..fc3116090818 --- /dev/null +++ b/crypto/keys/bcrypt/base64.go @@ -0,0 +1,35 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package bcrypt + +import "encoding/base64" + +const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" + +var bcEncoding = base64.NewEncoding(alphabet) + +func base64Encode(src []byte) []byte { + n := bcEncoding.EncodedLen(len(src)) + dst := make([]byte, n) + bcEncoding.Encode(dst, src) + for dst[n-1] == '=' { + n-- + } + return dst[:n] +} + +func base64Decode(src []byte) ([]byte, error) { + numOfEquals := 4 - (len(src) % 4) + for i := 0; i < numOfEquals; i++ { + src = append(src, '=') + } + + dst := make([]byte, bcEncoding.DecodedLen(len(src))) + n, err := bcEncoding.Decode(dst, src) + if err != nil { + return nil, err + } + return dst[:n], nil +} diff --git a/crypto/keys/bcrypt/bcrypt.go b/crypto/keys/bcrypt/bcrypt.go new file mode 100644 index 000000000000..4093f8cdb192 --- /dev/null +++ b/crypto/keys/bcrypt/bcrypt.go @@ -0,0 +1,291 @@ +// MODIFIED BY TENDERMINT TO EXPOSE `salt` in `GenerateFromPassword`. +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing +// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf +package bcrypt + +// The code is a port of Provos and Mazières's C implementation. +import ( + "crypto/subtle" + "errors" + "fmt" + "strconv" + + "golang.org/x/crypto/blowfish" //nolint:staticcheck // used in original https://cs.opensource.google/go/x/crypto/+/master:bcrypt/bcrypt.go +) + +const ( + MinCost int = 4 // the minimum allowable cost as passed in to GenerateFromPassword + MaxCost int = 31 // the maximum allowable cost as passed in to GenerateFromPassword + DefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword +) + +// ErrMismatchedHashAndPassword is returned from CompareHashAndPassword when a password and hash do +// not match. +var ErrMismatchedHashAndPassword = errors.New("crypto/bcrypt: hashedPassword is not the hash of the given password") + +// ErrHashTooShort is returned from CompareHashAndPassword when a hash is too short to +// be a bcrypt hash. +var ErrHashTooShort = errors.New("crypto/bcrypt: hashedSecret too short to be a bcrypted password") + +// The error returned from CompareHashAndPassword when a hash was created with +// a bcrypt algorithm newer than this implementation. +type HashVersionTooNewError byte + +func (hv HashVersionTooNewError) Error() string { + return fmt.Sprintf("crypto/bcrypt: bcrypt algorithm version '%c' requested is newer than current version '%c'", byte(hv), majorVersion) +} + +// The error returned from CompareHashAndPassword when a hash starts with something other than '$' +type InvalidHashPrefixError byte + +func (ih InvalidHashPrefixError) Error() string { + return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih)) +} + +type InvalidCostError int + +func (ic InvalidCostError) Error() string { + return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), MinCost, MaxCost) +} + +const ( + majorVersion = '2' + minorVersion = 'a' + maxSaltSize = 16 + maxCryptedHashSize = 23 + encodedSaltSize = 22 + encodedHashSize = 31 + minHashSize = 59 +) + +// magicCipherData is an IV for the 64 Blowfish encryption calls in +// bcrypt(). It's the string "OrpheanBeholderScryDoubt" in big-endian bytes. +var magicCipherData = []byte{ + 0x4f, 0x72, 0x70, 0x68, + 0x65, 0x61, 0x6e, 0x42, + 0x65, 0x68, 0x6f, 0x6c, + 0x64, 0x65, 0x72, 0x53, + 0x63, 0x72, 0x79, 0x44, + 0x6f, 0x75, 0x62, 0x74, +} + +type hashed struct { + hash []byte + salt []byte + cost int // allowed range is MinCost to MaxCost + major byte + minor byte +} + +// GenerateFromPassword returns the bcrypt hash of the password at the given +// cost. If the cost given is less than MinCost, the cost will be set to +// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package, +// to compare the returned hashed password with its cleartext version. +func GenerateFromPassword(salt []byte, password []byte, cost int) ([]byte, error) { + if len(salt) != maxSaltSize { + return nil, fmt.Errorf("salt len must be %v", maxSaltSize) + } + p, err := newFromPassword(salt, password, cost) + if err != nil { + return nil, err + } + return p.Hash(), nil +} + +// CompareHashAndPassword compares a bcrypt hashed password with its possible +// plaintext equivalent. Returns nil on success, or an error on failure. +func CompareHashAndPassword(hashedPassword, password []byte) error { + p, err := newFromHash(hashedPassword) + if err != nil { + return err + } + + otherHash, err := bcrypt(password, p.cost, p.salt) + if err != nil { + return err + } + + otherP := &hashed{otherHash, p.salt, p.cost, p.major, p.minor} + if subtle.ConstantTimeCompare(p.Hash(), otherP.Hash()) == 1 { + return nil + } + + return ErrMismatchedHashAndPassword +} + +// Cost returns the hashing cost used to create the given hashed +// password. When, in the future, the hashing cost of a password system needs +// to be increased in order to adjust for greater computational power, this +// function allows one to establish which passwords need to be updated. +func Cost(hashedPassword []byte) (int, error) { + p, err := newFromHash(hashedPassword) + if err != nil { + return 0, err + } + return p.cost, nil +} + +func newFromPassword(salt []byte, password []byte, cost int) (*hashed, error) { + if cost < MinCost { + cost = DefaultCost + } + p := new(hashed) + p.major = majorVersion + p.minor = minorVersion + + err := checkCost(cost) + if err != nil { + return nil, err + } + p.cost = cost + + p.salt = base64Encode(salt) + hash, err := bcrypt(password, p.cost, p.salt) + if err != nil { + return nil, err + } + p.hash = hash + return p, err +} + +func newFromHash(hashedSecret []byte) (*hashed, error) { + if len(hashedSecret) < minHashSize { + return nil, ErrHashTooShort + } + p := new(hashed) + n, err := p.decodeVersion(hashedSecret) + if err != nil { + return nil, err + } + hashedSecret = hashedSecret[n:] + n, err = p.decodeCost(hashedSecret) + if err != nil { + return nil, err + } + hashedSecret = hashedSecret[n:] + + // The "+2" is here because we'll have to append at most 2 '=' to the salt + // when base64 decoding it in expensiveBlowfishSetup(). + p.salt = make([]byte, encodedSaltSize, encodedSaltSize+2) + copy(p.salt, hashedSecret[:encodedSaltSize]) + + hashedSecret = hashedSecret[encodedSaltSize:] + p.hash = make([]byte, len(hashedSecret)) + copy(p.hash, hashedSecret) + + return p, nil +} + +func bcrypt(password []byte, cost int, salt []byte) ([]byte, error) { + cipherData := make([]byte, len(magicCipherData)) + copy(cipherData, magicCipherData) + + c, err := expensiveBlowfishSetup(password, uint32(cost), salt) + if err != nil { + return nil, err + } + + for i := 0; i < 24; i += 8 { + for j := 0; j < 64; j++ { + c.Encrypt(cipherData[i:i+8], cipherData[i:i+8]) + } + } + + // Bug compatibility with C bcrypt implementations. We only encode 23 of + // the 24 bytes encrypted. + hsh := base64Encode(cipherData[:maxCryptedHashSize]) + return hsh, nil +} + +func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) { + csalt, err := base64Decode(salt) + if err != nil { + return nil, err + } + + // Bug compatibility with C bcrypt implementations. They use the trailing + // NULL in the key string during expansion. + // We copy the key to prevent changing the underlying array. + ckey := append(key[:len(key):len(key)], 0) //nolint:gocritic // used in original https://cs.opensource.google/go/x/crypto/+/master:bcrypt/bcrypt.go + + c, err := blowfish.NewSaltedCipher(ckey, csalt) + if err != nil { + return nil, err + } + + var i, rounds uint64 + rounds = 1 << cost + for i = 0; i < rounds; i++ { + blowfish.ExpandKey(ckey, c) + blowfish.ExpandKey(csalt, c) + } + + return c, nil +} + +func (p *hashed) Hash() []byte { + arr := make([]byte, 60) + arr[0] = '$' + arr[1] = p.major + n := 2 + if p.minor != 0 { + arr[2] = p.minor + n = 3 + } + arr[n] = '$' + n++ + copy(arr[n:], []byte(fmt.Sprintf("%02d", p.cost))) + n += 2 + arr[n] = '$' + n++ + copy(arr[n:], p.salt) + n += encodedSaltSize + copy(arr[n:], p.hash) + n += encodedHashSize + return arr[:n] +} + +func (p *hashed) decodeVersion(sbytes []byte) (int, error) { + if sbytes[0] != '$' { + return -1, InvalidHashPrefixError(sbytes[0]) + } + if sbytes[1] > majorVersion { + return -1, HashVersionTooNewError(sbytes[1]) + } + p.major = sbytes[1] + n := 3 + if sbytes[2] != '$' { + p.minor = sbytes[2] + n++ + } + return n, nil +} + +// sbytes should begin where decodeVersion left off. +func (p *hashed) decodeCost(sbytes []byte) (int, error) { + cost, err := strconv.Atoi(string(sbytes[0:2])) + if err != nil { + return -1, err + } + err = checkCost(cost) + if err != nil { + return -1, err + } + p.cost = cost + return 3, nil +} + +func (p *hashed) String() string { + return fmt.Sprintf("&{hash: %#v, salt: %#v, cost: %d, major: %c, minor: %c}", string(p.hash), p.salt, p.cost, p.major, p.minor) +} + +func checkCost(cost int) error { + if cost < MinCost || cost > MaxCost { + return InvalidCostError(cost) + } + return nil +} diff --git a/crypto/keys/utils.go b/crypto/keys/utils.go new file mode 100644 index 000000000000..2b81337d33c8 --- /dev/null +++ b/crypto/keys/utils.go @@ -0,0 +1,13 @@ +package keys + +import ( + "math/big" + + "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" +) + +// Replicates https://github.com/cosmos/cosmos-sdk/blob/44fbb0df9cea049d588e76bf930177d777552cf3/crypto/ledger/ledger_secp256k1.go#L228 +// DO NOT USE. This is a temporary workaround that is cleaned-up in v0.47+ +func IsOverHalfOrder(sigS *big.Int) bool { + return !ecdsa.IsSNormalized(sigS) +} diff --git a/crypto/ledger/ledger_mock.go b/crypto/ledger/ledger_mock.go index 740a773d12ce..97c6f65f43bb 100644 --- a/crypto/ledger/ledger_mock.go +++ b/crypto/ledger/ledger_mock.go @@ -10,7 +10,6 @@ import ( "github.com/pkg/errors" "github.com/cosmos/go-bip39" - secp256k1 "github.com/tendermint/btcd/btcec" "github.com/tendermint/tendermint/crypto" "github.com/cosmos/cosmos-sdk/crypto/hd" @@ -38,11 +37,11 @@ func (mock LedgerSECP256K1Mock) Close() error { // as per the original API, it returns an uncompressed key func (mock LedgerSECP256K1Mock) GetPublicKeySECP256K1(derivationPath []uint32) ([]byte, error) { if derivationPath[0] != 44 { - return nil, errors.New("Invalid derivation path") + return nil, errors.New("invalid derivation path") } if derivationPath[1] != sdk.GetConfig().GetCoinType() { - return nil, errors.New("Invalid derivation path") + return nil, errors.New("invalid derivation path") } seed, err := bip39.NewSeedWithErrorChecking(testdata.TestMnemonic, "") @@ -57,7 +56,7 @@ func (mock LedgerSECP256K1Mock) GetPublicKeySECP256K1(derivationPath []uint32) ( return nil, err } - _, pubkeyObject := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv[:]) + _, pubkeyObject := btcec.PrivKeyFromBytes(btcec.S256(), derivedPriv) return pubkeyObject.SerializeUncompressed(), nil } @@ -71,7 +70,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3 } // re-serialize in the 33-byte compressed format - cmp, err := btcec.ParsePubKey(pk[:], btcec.S256()) + cmp, err := btcec.ParsePubKey(pk, btcec.S256()) if err != nil { return nil, "", fmt.Errorf("error parsing public key: %v", err) } @@ -98,16 +97,13 @@ func (mock LedgerSECP256K1Mock) SignSECP256K1(derivationPath []uint32, message [ return nil, err } - priv, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), derivedPriv[:]) - + priv, _ := btcec.PrivKeyFromBytes(btcec.S256(), derivedPriv) sig, err := priv.Sign(crypto.Sha256(message)) if err != nil { return nil, err } - // Need to return DER as the ledger does - sig2 := btcec.Signature{R: sig.R, S: sig.S} - return sig2.Serialize(), nil + return sig.Serialize(), nil } // ShowAddressSECP256K1 shows the address for the corresponding bip32 derivation path diff --git a/crypto/ledger/ledger_secp256k1.go b/crypto/ledger/ledger_secp256k1.go index dffded571ab5..fc862c2d08fc 100644 --- a/crypto/ledger/ledger_secp256k1.go +++ b/crypto/ledger/ledger_secp256k1.go @@ -2,14 +2,14 @@ package ledger import ( "fmt" + "math/big" "os" "github.com/btcsuite/btcd/btcec" "github.com/pkg/errors" - tmbtcec "github.com/tendermint/btcd/btcec" - "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keys" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -173,8 +173,22 @@ func convertDERtoBER(signatureDER []byte) ([]byte, error) { if err != nil { return nil, err } - sigBER := tmbtcec.Signature{R: sigDER.R, S: sigDER.S} - return sigBER.Serialize(), nil + + // based on https://github.com/tendermint/btcd/blob/ec996c5/btcec/signature.go#L33-L50 + // low 'S' malleability breaker + sigS := sigDER.S + if keys.IsOverHalfOrder(sigS) { + sigS = new(big.Int).Sub(btcec.S256().N, sigS) + } + + rBytes := sigDER.R.Bytes() + sBytes := sigS.Bytes() + sigBytes := make([]byte, 64) + // 0 pad the byte arrays from the left if they aren't big enough. + copy(sigBytes[32-len(rBytes):32], rBytes) + copy(sigBytes[64-len(sBytes):64], sBytes) + + return sigBytes, nil } func getDevice() (SECP256K1, error) { diff --git a/go.mod b/go.mod index 316a64d82c89..5ca8411a7bc2 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.0 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 - github.com/btcsuite/btcd v0.22.1 + github.com/btcsuite/btcd v0.22.2 github.com/celestiaorg/smt v0.3.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/cockroachdb/apd/v2 v2.0.2 @@ -19,7 +19,7 @@ require ( github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/iavl v0.19.4 - github.com/cosmos/ledger-cosmos-go v0.12.1 + github.com/cosmos/ledger-cosmos-go v0.12.2 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 @@ -48,8 +48,6 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 - github.com/tendermint/btcd v0.1.1 - github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 @@ -141,7 +139,7 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zondax/hid v0.9.1 // indirect - github.com/zondax/ledger-go v0.14.0 // indirect + github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect golang.org/x/net v0.2.0 // indirect diff --git a/go.sum b/go.sum index eb05fbe37bae..4e3ac700676a 100644 --- a/go.sum +++ b/go.sum @@ -151,8 +151,9 @@ github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx2 github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= -github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= +github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -243,8 +244,8 @@ github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= -github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w= -github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g= +github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= +github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -943,10 +944,6 @@ github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= -github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= -github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= -github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= @@ -996,8 +993,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -github.com/zondax/ledger-go v0.14.0 h1:dlMC7aO8Wss1CxBq2I96kZ69Nh1ligzbs8UWOtq/AsA= -github.com/zondax/ledger-go v0.14.0/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= +github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= +github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= From 3a051e1f32bab7ac6a92e269d19c23202fb44e61 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 23 Jan 2023 19:52:48 +0100 Subject: [PATCH 09/52] chore: prepare v0.46.8 release (#14624) --- CHANGELOG.md | 3 +++ RELEASE_NOTES.md | 17 ++++++----------- go.mod | 2 ++ go.sum | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 068f02fb5fc1..bf9de76481cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,10 +37,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2022-01-23 + ### Improvements * [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general. * (x/gov) [#14347](https://github.com/cosmos/cosmos-sdk/pull/14347) Support `v1.Proposal` message in `v1beta1.Proposal.Content`. +* (deps) Use Informal System fork of Tendermint version to [v0.34.24](https://github.com/informalsystems/tendermint/releases/tag/v0.34.24). ### Bug Fixes diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index cabe154c0b82..16bfb4e59c67 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,14 +1,13 @@ -# Cosmos SDK v0.46.7 Release Notes +# Cosmos SDK v0.46.8 Release Notes -This release introduces bug fixes and improvements. Notably, the upgrade to Tendermint [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24). +This release introduces bug fixes and improvements. Notably, the SDK have now switched to Informal Systems' Tendermint fork. +Their fork has no changes compared to the upstream Tendermint, but it is now [maintained by Informal Systems](https://twitter.com/informalinc/status/1613580954383040512). Chains are invited to do the same. -Please read the release notes of [v0.46.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.5) if you are upgrading from `<=0.46.4`. +Moreover, this release contains a store fix. The changes have been tested against a v0.46.x chain mainnet with no issues. However, there is a low probability of an edge case happening. Hence, it is recommended to do a **coordinated upgrade** to avoid any issues. -A critical vulnerability has been fixed in the group module. For safety, `v0.46.5` and `v0.46.6` are retracted, even though chains not using the group module are not affected. When using the group module, please upgrade immediately to `v0.46.7`. +Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -An issue has been discovered in the gov module's votes migration. It does not impact proposals and votes tallying, but the gRPC queries on votes are incorrect. This issue is fixed in `v0.46.7`, however: -- if your chain is already on v0.46 using `<= v0.46.6`, a **coordinated upgrade** to v0.46.7 is required. You can use the helper function `govv046.Migrate_V046_6_To_V046_7` for migrating a chain **already on v0.46 with versions <=v0.46.6** to the latest v0.46.7 correct state. -- if your chain is on a previous version <= v0.45, then simply use v0.46.7 when upgrading to v0.46. +Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.7...v0.46.8 **NOTE**: The changes mentioned in `v0.46.3` are no longer required. The following replace directive can be removed from the chains. @@ -18,7 +17,3 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8 ``` Instead, `github.com/confio/ics23/go` must be **bumped to `v0.9.0`**. - -Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. - -Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.6...v0.46.7 diff --git a/go.mod b/go.mod index 5ca8411a7bc2..73cbb494d468 100644 --- a/go.mod +++ b/go.mod @@ -164,6 +164,8 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 + // use informal system fork of tendermint + github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.24 ) retract ( diff --git a/go.sum b/go.sum index 4e3ac700676a..185ddb5d7f2e 100644 --- a/go.sum +++ b/go.sum @@ -596,6 +596,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= +github.com/informalsystems/tendermint v0.34.24 h1:2beNEg5tp+U5oj/Md+0xDBsMHGbdue31T3OrstS6xS0= +github.com/informalsystems/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -946,8 +948,6 @@ github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70 github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= -github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= -github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= From c8d250acbd68473592bb014a3c1a41d0f57659e6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 11:04:25 +0000 Subject: [PATCH 10/52] fix: Fix Evidence CLI query flag parsing (backport #13458) (#14799) Co-authored-by: Likhita Polavarapu <78951027+likhita-809@users.noreply.github.com> Co-authored-by: HuangYi Co-authored-by: Julien Robert --- CHANGELOG.md | 4 ++++ x/evidence/client/cli/query.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf9de76481cf..855e81ddfabd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +- (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) + ## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2022-01-23 ### Improvements diff --git a/x/evidence/client/cli/query.go b/x/evidence/client/cli/query.go index bf74325f949f..e40465a84b9a 100644 --- a/x/evidence/client/cli/query.go +++ b/x/evidence/client/cli/query.go @@ -32,7 +32,6 @@ $ %s query %s --page=2 --limit=50 ), ), Args: cobra.MaximumNArgs(1), - DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: QueryEvidenceCmd(), } From 76d47b4b6f18e2835f1a47902ddc2102b2cdfdee Mon Sep 17 00:00:00 2001 From: yihuang Date: Sat, 28 Jan 2023 02:17:56 +0800 Subject: [PATCH 11/52] fix: nested iterator on cache store (#14798) --- CHANGELOG.md | 1 + store/cachekv/internal/btree.go | 6 +++++ store/cachekv/store.go | 2 +- store/cachekv/store_test.go | 44 +++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 855e81ddfabd..7206a732110b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +- (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. - (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) ## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2022-01-23 diff --git a/store/cachekv/internal/btree.go b/store/cachekv/internal/btree.go index 142f754bbd38..8d18caa1853d 100644 --- a/store/cachekv/internal/btree.go +++ b/store/cachekv/internal/btree.go @@ -63,6 +63,12 @@ func (bt *BTree) ReverseIterator(start, end []byte) (*memIterator, error) { return NewMemIterator(start, end, bt, make(map[string]struct{}), false), nil } +func (bt *BTree) Copy() *BTree { + return &BTree{ + tree: *bt.tree.Copy(), + } +} + // item is a btree item with byte slices as keys and values type item struct { key []byte diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 42354fa78be3..36be56eea751 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -188,7 +188,7 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { } store.dirtyItems(start, end) - cache = internal.NewMemIterator(start, end, store.sortedCache, store.deleted, ascending) + cache = internal.NewMemIterator(start, end, store.sortedCache.Copy(), store.deleted, ascending) return internal.NewCacheMergeIterator(parent, cache, ascending) } diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index 3ef99fd6f144..2bf59f59d5c3 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -2,6 +2,7 @@ package cachekv_test import ( "fmt" + "strconv" "testing" "github.com/stretchr/testify/require" @@ -684,3 +685,46 @@ func BenchmarkCacheKVStoreGetKeyFound(b *testing.B) { st.Get([]byte{byte((i & 0xFF0000) >> 16), byte((i & 0xFF00) >> 8), byte(i & 0xFF)}) } } + +func TestIteratorNested(t *testing.T) { + mem := dbadapter.Store{DB: dbm.NewMemDB()} + store := cachekv.NewStore(mem) + + // setup: + // - (owner, contract id) -> contract + // - (contract id, record id) -> record + owner1 := 1 + contract1 := 1 + contract2 := 2 + record1 := 1 + record2 := 2 + store.Set([]byte(fmt.Sprintf("c%04d%04d", owner1, contract1)), []byte("contract1")) + store.Set([]byte(fmt.Sprintf("c%04d%04d", owner1, contract2)), []byte("contract2")) + store.Set([]byte(fmt.Sprintf("R%04d%04d", contract1, record1)), []byte("contract1-record1")) + store.Set([]byte(fmt.Sprintf("R%04d%04d", contract1, record2)), []byte("contract1-record2")) + store.Set([]byte(fmt.Sprintf("R%04d%04d", contract2, record1)), []byte("contract2-record1")) + store.Set([]byte(fmt.Sprintf("R%04d%04d", contract2, record2)), []byte("contract2-record2")) + + it := types.KVStorePrefixIterator(store, []byte(fmt.Sprintf("c%04d", owner1))) + defer it.Close() + + var records []string + for ; it.Valid(); it.Next() { + contractID, err := strconv.ParseInt(string(it.Key()[5:]), 10, 32) + require.NoError(t, err) + + it2 := types.KVStorePrefixIterator(store, []byte(fmt.Sprintf("R%04d", contractID))) + for ; it2.Valid(); it2.Next() { + records = append(records, string(it2.Value())) + } + + it2.Close() + } + + require.Equal(t, []string{ + "contract1-record1", + "contract1-record2", + "contract2-record1", + "contract2-record2", + }, records) +} From 5e7dcbcce1e9d3acaf54a90a618666eb3cf3d7a9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 12:27:55 +0000 Subject: [PATCH 12/52] chore: update IAVL (backport #14830) (#14835) Co-authored-by: Marko --- go.mod | 2 +- go.sum | 4 ++-- store/iavl/store.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 73cbb494d468..4b8102bdb91a 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-alpha7 github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/iavl v0.19.4 + github.com/cosmos/iavl v0.19.5-rc.1 github.com/cosmos/ledger-cosmos-go v0.12.2 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index 185ddb5d7f2e..a226b5ec89f2 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= -github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/iavl v0.19.5-rc.1 h1:4PjF2PdScyPbN1WbXpiQU21YtyonnrMU31xN74g8Rkg= +github.com/cosmos/iavl v0.19.5-rc.1/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= diff --git a/store/iavl/store.go b/store/iavl/store.go index a22d8935c202..45a9e6496389 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -273,7 +273,7 @@ func (st *Store) Export(version int64) (*iavl.Exporter, error) { if !ok || tree == nil { return nil, fmt.Errorf("iavl export failed: unable to fetch tree for version %v", version) } - return tree.Export(), nil + return tree.Export() } // Import imports an IAVL tree at the given version, returning an iavl.Importer for importing. From 70589eb845a4c8c471429fc832e2922f8631eb81 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 12:00:00 +0000 Subject: [PATCH 13/52] feat: add config `iavl-lazy-loading` to enable lazy loading of iavl store (backport #14189) (#14862) Co-authored-by: yihuang Co-authored-by: marbar3778 --- CHANGELOG.md | 11 +++++++++++ baseapp/options.go | 5 +++++ go.mod | 2 +- go.sum | 4 ++-- server/config/config.go | 4 ++++ server/config/toml.go | 4 ++++ server/mock/store.go | 4 ++++ server/start.go | 1 + server/util.go | 1 + store/iavl/store.go | 5 +++++ store/iavl/tree.go | 5 +++++ store/rootmulti/store.go | 7 ++++++- store/types/store.go | 3 +++ 13 files changed, 52 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7206a732110b..88c07345c297 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,17 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. + * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker + + ```toml + # IAVLLazyLoading enable/disable the lazy loading of iavl store. + # Default is false. + iavl-lazy-loading = "" + ``` + ### Bug Fixes - (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. diff --git a/baseapp/options.go b/baseapp/options.go index 59b6a2dcc3d8..84b57e2e92e5 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -69,6 +69,11 @@ func SetIAVLDisableFastNode(disable bool) func(*BaseApp) { return func(bapp *BaseApp) { bapp.cms.SetIAVLDisableFastNode(disable) } } +// SetIAVLLazyLoading enables/disables lazy loading of the IAVL store. +func SetIAVLLazyLoading(lazyLoading bool) func(*BaseApp) { + return func(bapp *BaseApp) { bapp.cms.SetLazyLoading(lazyLoading) } +} + // SetInterBlockCache provides a BaseApp option function that sets the // inter-block cache. func SetInterBlockCache(cache sdk.MultiStorePersistentCache) func(*BaseApp) { diff --git a/go.mod b/go.mod index 4b8102bdb91a..24d71a15008b 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-alpha7 github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/iavl v0.19.5-rc.1 + github.com/cosmos/iavl v0.19.5-rc.2 github.com/cosmos/ledger-cosmos-go v0.12.2 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index a226b5ec89f2..bef8f811b0c8 100644 --- a/go.sum +++ b/go.sum @@ -240,8 +240,8 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.5-rc.1 h1:4PjF2PdScyPbN1WbXpiQU21YtyonnrMU31xN74g8Rkg= -github.com/cosmos/iavl v0.19.5-rc.1/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/iavl v0.19.5-rc.2 h1:kd97TVlTZWpyM17PjMtXJg0ONCvuCHhG/oU8XXytvK4= +github.com/cosmos/iavl v0.19.5-rc.2/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= diff --git a/server/config/config.go b/server/config/config.go index fe84b28271d0..40087b149603 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -91,6 +91,9 @@ type BaseConfig struct { // IAVLDisableFastNode enables or disables the fast sync node. IAVLDisableFastNode bool `mapstructure:"iavl-disable-fastnode"` + // IAVLLazyLoading enable/disable the lazy loading of iavl store. + IAVLLazyLoading bool `mapstructure:"iavl-lazy-loading"` + // AppDBBackend defines the type of Database to use for the application and snapshots databases. // An empty string indicates that the Tendermint config's DBBackend value should be used. AppDBBackend string `mapstructure:"app-db-backend"` @@ -285,6 +288,7 @@ func DefaultConfig() *Config { IndexEvents: make([]string, 0), IAVLCacheSize: 781250, // 50 MB IAVLDisableFastNode: false, + IAVLLazyLoading: false, AppDBBackend: "", }, Telemetry: telemetry.Config{ diff --git a/server/config/toml.go b/server/config/toml.go index 57fdafa3262a..920201b330e4 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -78,6 +78,10 @@ iavl-cache-size = {{ .BaseConfig.IAVLCacheSize }} # Default is false. iavl-disable-fastnode = {{ .BaseConfig.IAVLDisableFastNode }} +# EXPERIMENTAL: IAVLLazyLoading enable/disable the lazy loading of iavl store. +# Default is false. +iavl-lazy-loading = {{ .BaseConfig.IAVLLazyLoading }} + # AppDBBackend defines the database backend type to use for the application and snapshots DBs. # An empty string indicates that a fallback will be used. # First fallback is the deprecated compile-time types.DBBackend value. diff --git a/server/mock/store.go b/server/mock/store.go index d427806f72e9..17e20de54e00 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -134,6 +134,10 @@ func (ms multiStore) SetIAVLDisableFastNode(disable bool) { panic("not implemented") } +func (ms multiStore) SetLazyLoading(bool) { + panic("not implemented") +} + func (ms multiStore) SetInitialVersion(version int64) error { panic("not implemented") } diff --git a/server/start.go b/server/start.go index 402c88d7479e..b10518f2efb6 100644 --- a/server/start.go +++ b/server/start.go @@ -58,6 +58,7 @@ const ( FlagMinRetainBlocks = "min-retain-blocks" FlagIAVLCacheSize = "iavl-cache-size" FlagDisableIAVLFastNode = "iavl-disable-fastnode" + FlagIAVLLazyLoading = "iavl-lazy-loading" // state sync-related flags FlagStateSyncSnapshotInterval = "state-sync.snapshot-interval" diff --git a/server/util.go b/server/util.go index e211bd245844..1834da6c3384 100644 --- a/server/util.go +++ b/server/util.go @@ -457,5 +457,6 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) { baseapp.SetSnapshot(snapshotStore, snapshotOptions), baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(FlagIAVLCacheSize))), baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(FlagDisableIAVLFastNode))), + baseapp.SetIAVLLazyLoading(cast.ToBool(appOpts.Get(FlagIAVLLazyLoading))), } } diff --git a/store/iavl/store.go b/store/iavl/store.go index 45a9e6496389..3cf6c1dedbf2 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -239,6 +239,11 @@ func (st *Store) LoadVersionForOverwriting(targetVersion int64) (int64, error) { return st.tree.LoadVersionForOverwriting(targetVersion) } +// LazyLoadVersionForOverwriting is the lazy version of LoadVersionForOverwriting. +func (st *Store) LazyLoadVersionForOverwriting(targetVersion int64) (int64, error) { + return st.tree.LazyLoadVersionForOverwriting(targetVersion) +} + // Implements types.KVStore. func (st *Store) Iterator(start, end []byte) types.Iterator { iterator, err := st.tree.Iterator(start, end, true) diff --git a/store/iavl/tree.go b/store/iavl/tree.go index 81350fc34a8b..f8e2843f61c6 100644 --- a/store/iavl/tree.go +++ b/store/iavl/tree.go @@ -35,6 +35,7 @@ type ( Iterator(start, end []byte, ascending bool) (types.Iterator, error) AvailableVersions() []int LoadVersionForOverwriting(targetVersion int64) (int64, error) + LazyLoadVersionForOverwriting(targetVersion int64) (int64, error) } // immutableTree is a simple wrapper around a reference to an iavl.ImmutableTree @@ -104,3 +105,7 @@ func (it *immutableTree) AvailableVersions() []int { func (it *immutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error) { panic("cannot call 'LoadVersionForOverwriting' on an immutable IAVL tree") } + +func (it *immutableTree) LazyLoadVersionForOverwriting(targetVersion int64) (int64, error) { + panic("cannot call 'LazyLoadVersionForOverwriting' on an immutable IAVL tree") +} diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index d02944d95800..3b5fede4321d 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -966,7 +966,12 @@ func (rs *Store) RollbackToVersion(target int64) error { // If the store is wrapped with an inter-block cache, we must first unwrap // it to get the underlying IAVL store. store = rs.GetCommitKVStore(key) - _, err := store.(*iavl.Store).LoadVersionForOverwriting(target) + var err error + if rs.lazyLoading { + _, err = store.(*iavl.Store).LazyLoadVersionForOverwriting(target) + } else { + _, err = store.(*iavl.Store).LoadVersionForOverwriting(target) + } if err != nil { return err } diff --git a/store/types/store.go b/store/types/store.go index ef5ff36c8c42..7ad4da2cc0a3 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -188,6 +188,9 @@ type CommitMultiStore interface { // SetIAVLDisableFastNode enables/disables fastnode feature on iavl. SetIAVLDisableFastNode(disable bool) + // SetIAVLLazyLoading enable/disable lazy loading on iavl. + SetLazyLoading(lazyLoading bool) + // RollbackToVersion rollback the db to specific version(height). RollbackToVersion(version int64) error From 6654184f04bc30be8ec817352cfccee750b06f1b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 19:05:56 +0100 Subject: [PATCH 14/52] chore: bump IAVL to v0.19.5 (backport #14889) (#14892) Co-authored-by: Julien Robert --- CHANGELOG.md | 20 +++++++++++--------- RELEASE_NOTES.md | 19 ++++--------------- go.mod | 14 +++++++++----- go.sum | 27 ++++++++++++++------------- 4 files changed, 38 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88c07345c297..3488e553a8ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,23 +37,25 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-04 + ### Improvements * (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. - * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker + * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker - ```toml - # IAVLLazyLoading enable/disable the lazy loading of iavl store. - # Default is false. - iavl-lazy-loading = "" - ``` + ```toml + # IAVLLazyLoading enable/disable the lazy loading of iavl store. + # Default is false. + iavl-lazy-loading = "" + ``` ### Bug Fixes -- (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. -- (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) +* (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. +* (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) -## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2022-01-23 +## [v0.46.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.8) - 2023-01-23 ### Improvements diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 16bfb4e59c67..60f9309f9214 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,19 +1,8 @@ -# Cosmos SDK v0.46.8 Release Notes +# Cosmos SDK v0.46.9 Release Notes -This release introduces bug fixes and improvements. Notably, the SDK have now switched to Informal Systems' Tendermint fork. -Their fork has no changes compared to the upstream Tendermint, but it is now [maintained by Informal Systems](https://twitter.com/informalinc/status/1613580954383040512). Chains are invited to do the same. - -Moreover, this release contains a store fix. The changes have been tested against a v0.46.x chain mainnet with no issues. However, there is a low probability of an edge case happening. Hence, it is recommended to do a **coordinated upgrade** to avoid any issues. +This release introduces bug fixes and improvements. Notably an extra config in the `app.toml`, `iavl-lazy-loading`, to enable lazy loading of IAVL store. +Changes to be made in the `app.toml` can be found in the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md). Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.7...v0.46.8 - -**NOTE**: The changes mentioned in `v0.46.3` are no longer required. The following replace directive can be removed from the chains. - -```go -# Can be deleted from go.mod -replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 -``` - -Instead, `github.com/confio/ics23/go` must be **bumped to `v0.9.0`**. +Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.8...v0.46.9 diff --git a/go.mod b/go.mod index 24d71a15008b..46c6fa398b45 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/cosmos/cosmos-proto v1.0.0-alpha7 github.com/cosmos/cosmos-sdk/db v1.0.0-beta.1 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/iavl v0.19.5-rc.2 + github.com/cosmos/iavl v0.19.5 github.com/cosmos/ledger-cosmos-go v0.12.2 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 @@ -67,6 +67,7 @@ require ( cloud.google.com/go/iam v0.4.0 // indirect cloud.google.com/go/storage v1.22.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect + github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/aws/aws-sdk-go v1.40.45 // indirect @@ -77,14 +78,14 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect - github.com/danieljoos/wincred v1.0.2 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect + github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-kit/kit v0.12.0 // indirect @@ -112,7 +113,6 @@ require ( github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.15.11 // indirect github.com/lib/pq v1.10.6 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -157,7 +157,11 @@ require ( ) replace ( - github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + // use cosmos fork of keyring + github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 + // dgrijalva/jwt-go is deprecated and doesn't receive security updates. + // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 + github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 diff --git a/go.sum b/go.sum index bef8f811b0c8..2a368ac62b23 100644 --- a/go.sum +++ b/go.sum @@ -75,6 +75,8 @@ filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmG filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFNuPos7vHmWXfszqImLppbc0wEhh6JBfJIUgw= git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= @@ -240,10 +242,10 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.5-rc.2 h1:kd97TVlTZWpyM17PjMtXJg0ONCvuCHhG/oU8XXytvK4= -github.com/cosmos/iavl v0.19.5-rc.2/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= +github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= +github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= +github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -254,8 +256,8 @@ github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -276,7 +278,6 @@ github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KP github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= @@ -293,8 +294,8 @@ github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= +github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= +github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -385,6 +386,7 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -632,8 +634,6 @@ github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8 github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= @@ -752,6 +752,7 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neilotoole/errgroup v0.1.6/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -927,7 +928,6 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3 github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -1204,7 +1204,6 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1267,6 +1266,7 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1595,6 +1595,7 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= From d899eafd3fa83667b105515d74a0c35b383914f5 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Sat, 4 Feb 2023 00:48:45 +0100 Subject: [PATCH 15/52] build(deps): bump tendermint to v0.34.25 (#14903) --- CHANGELOG.md | 3 ++- go.mod | 16 +++++++++------- go.sum | 32 +++++++++++++++++--------------- 3 files changed, 28 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3488e553a8ff..0c3fd3c7ff75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,10 +37,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-04 +## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-06 ### Improvements +* (deps) Bump Tendermint version to [v0.34.25](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25). * (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker diff --git a/go.mod b/go.mod index 46c6fa398b45..bbdc32c96cd2 100644 --- a/go.mod +++ b/go.mod @@ -49,10 +49,10 @@ require ( github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.24 + github.com/tendermint/tendermint v0.34.25 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 - golang.org/x/crypto v0.2.0 + golang.org/x/crypto v0.4.0 golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a google.golang.org/grpc v1.50.1 @@ -73,6 +73,7 @@ require ( github.com/aws/aws-sdk-go v1.40.45 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.1 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect @@ -80,6 +81,7 @@ require ( github.com/creachadair/taskgroup v0.3.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect @@ -142,11 +144,11 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.2.0 // indirect + golang.org/x/net v0.4.0 // indirect golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.93.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -169,7 +171,7 @@ replace ( github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 // use informal system fork of tendermint - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.24 + github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.25 ) retract ( diff --git a/go.sum b/go.sum index 2a368ac62b23..1994c794f745 100644 --- a/go.sum +++ b/go.sum @@ -158,6 +158,8 @@ github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= @@ -165,7 +167,6 @@ github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufo github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= -github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ= github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= @@ -264,6 +265,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= @@ -598,8 +600,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/tendermint v0.34.24 h1:2beNEg5tp+U5oj/Md+0xDBsMHGbdue31T3OrstS6xS0= -github.com/informalsystems/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= +github.com/informalsystems/tendermint v0.34.25 h1:KlTF1ECfJI2KmM1w1YGai5hoLJ0ZOKjVwGAaElEBPtE= +github.com/informalsystems/tendermint v0.34.25/go.mod h1:TCGT4eRe5OW979YKVTpFOM57B4YkN+7FSDWpsgzAGwY= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -1041,8 +1043,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE= -golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= +golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1085,7 +1087,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= +golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1148,8 +1150,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1287,13 +1289,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1303,8 +1305,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1376,7 +1378,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= +golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 04de09326cd64a14c9ac61084805783d5a6de942 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Sun, 5 Feb 2023 14:19:52 +0100 Subject: [PATCH 16/52] build(deps): bump tendermint to v0.34.26 (#14911) --- CHANGELOG.md | 2 +- go.mod | 22 +++++++++++----------- go.sum | 39 ++++++++++++++++++++------------------- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c3fd3c7ff75..3f6373a3dad5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements -* (deps) Bump Tendermint version to [v0.34.25](https://github.com/informalsystems/tendermint/releases/tag/v0.34.25). +* (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). * (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker diff --git a/go.mod b/go.mod index bbdc32c96cd2..5e11a5223011 100644 --- a/go.mod +++ b/go.mod @@ -38,21 +38,21 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/mattn/go-isatty v0.0.16 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 - github.com/prometheus/common v0.34.0 + github.com/prometheus/client_golang v1.14.0 + github.com/prometheus/common v0.37.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 github.com/rs/zerolog v1.27.0 github.com/spf13/cast v1.5.0 - github.com/spf13/cobra v1.6.0 + github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.25 + github.com/tendermint/tendermint v0.34.26 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 - golang.org/x/crypto v0.4.0 + golang.org/x/crypto v0.5.0 golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a google.golang.org/grpc v1.50.1 @@ -130,7 +130,7 @@ require ( github.com/pelletier/go-toml/v2 v2.0.5 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rs/cors v1.8.2 // indirect @@ -144,11 +144,11 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.4.0 // indirect + golang.org/x/net v0.5.0 // indirect golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/term v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/api v0.93.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -171,7 +171,7 @@ replace ( github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 // use informal system fork of tendermint - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.25 + github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 ) retract ( diff --git a/go.sum b/go.sum index 1994c794f745..fdad2d9ee858 100644 --- a/go.sum +++ b/go.sum @@ -600,8 +600,8 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/tendermint v0.34.25 h1:KlTF1ECfJI2KmM1w1YGai5hoLJ0ZOKjVwGAaElEBPtE= -github.com/informalsystems/tendermint v0.34.25/go.mod h1:TCGT4eRe5OW979YKVTpFOM57B4YkN+7FSDWpsgzAGwY= +github.com/informalsystems/tendermint v0.34.26 h1:89XvVexAy62geGWxmDmdmmJvfindx+Su2oTuwfSWMeU= +github.com/informalsystems/tendermint v0.34.26/go.mod h1:q3uAZ/t5+MblQhFuHSd4flqaLDx7iUtWpwWbwvHAFhs= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -825,15 +825,16 @@ github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3O github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -844,8 +845,8 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -912,8 +913,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= -github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1043,8 +1044,8 @@ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= -golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1150,8 +1151,8 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1289,13 +1290,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1305,8 +1306,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 82138c9a0b8eb3f2cb19e14cca634cf6986f31c6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 11:49:23 +0100 Subject: [PATCH 17/52] fix: return named error for write validators (backport #14919) (#14921) Co-authored-by: mmsqe Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + x/staking/genesis.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f6373a3dad5..fbe5b73f9110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (cli) [#14919](https://github.com/cosmos/cosmos-sdk/pull/#14919) Fix never assigned error when write validators. * (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration. * (cli) [#14799](https://github.com/cosmos/cosmos-sdk/pull/14799) Fix Evidence CLI query flag parsing (backport #13458) diff --git a/x/staking/genesis.go b/x/staking/genesis.go index 5b94b8adf48b..7bed1c10e3d9 100644 --- a/x/staking/genesis.go +++ b/x/staking/genesis.go @@ -12,14 +12,16 @@ import ( ) // WriteValidators returns a slice of bonded genesis validators. -func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator, err error) { +func WriteValidators(ctx sdk.Context, keeper keeper.Keeper) (vals []tmtypes.GenesisValidator, returnErr error) { keeper.IterateLastValidators(ctx, func(_ int64, validator types.ValidatorI) (stop bool) { pk, err := validator.ConsPubKey() if err != nil { + returnErr = err return true } tmPk, err := cryptocodec.ToTmPubKeyInterface(pk) if err != nil { + returnErr = err return true } From 0b64514027ed9f0adf9fdb7841ada7911b3e34d2 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Tue, 7 Feb 2023 11:52:03 +0100 Subject: [PATCH 18/52] build(deps): bump btcd in v0.46 (#14846) Co-authored-by: yihuang Co-authored-by: Julien Robert Co-authored-by: Elias Naur <103319121+elias-orijtech@users.noreply.github.com> Co-authored-by: Marko --- CHANGELOG.md | 3 +- crypto/hd/hdpath.go | 4 +- crypto/keys/secp256k1/secp256k1.go | 4 +- .../keys/secp256k1/secp256k1_internal_test.go | 2 +- crypto/keys/secp256k1/secp256k1_nocgo.go | 52 +++++++------------ crypto/keys/secp256k1/secp256k1_nocgo_test.go | 23 +++++--- crypto/keys/secp256k1/secp256k1_test.go | 13 +++-- crypto/keys/utils.go | 13 ----- crypto/ledger/ledger_mock.go | 17 +++--- crypto/ledger/ledger_notavail.go | 2 +- crypto/ledger/ledger_secp256k1.go | 35 +++++++------ go.mod | 9 ++-- go.sum | 13 +++-- server/rosetta/converter.go | 4 +- 14 files changed, 91 insertions(+), 103 deletions(-) delete mode 100644 crypto/keys/utils.go diff --git a/CHANGELOG.md b/CHANGELOG.md index fbe5b73f9110..f94b2f80ca6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,10 +37,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-06 +## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-07 ### Improvements +* (deps) [#14846](https://github.com/cosmos/cosmos-sdk/pull/14846) Bump btcd. * (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). * (store) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. * A new field has been added to the app.toml. This alllows nodes with larger databases to startup quicker diff --git a/crypto/hd/hdpath.go b/crypto/hd/hdpath.go index 172e3e0f76bd..3216bf40e2c6 100644 --- a/crypto/hd/hdpath.go +++ b/crypto/hd/hdpath.go @@ -10,7 +10,7 @@ import ( "strconv" "strings" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" ) // NewParams creates a BIP 44 parameter object from the params: @@ -225,7 +225,7 @@ func derivePrivateKey(privKeyBytes [32]byte, chainCode [32]byte, index uint32, h data = append([]byte{byte(0)}, privKeyBytes[:]...) } else { // this can't return an error: - _, ecPub := btcec.PrivKeyFromBytes(btcec.S256(), privKeyBytes[:]) + _, ecPub := btcec.PrivKeyFromBytes(privKeyBytes[:]) pubkeyBytes := ecPub.SerializeCompressed() data = pubkeyBytes diff --git a/crypto/keys/secp256k1/secp256k1.go b/crypto/keys/secp256k1/secp256k1.go index 51034275cd94..0d5d849d438b 100644 --- a/crypto/keys/secp256k1/secp256k1.go +++ b/crypto/keys/secp256k1/secp256k1.go @@ -8,7 +8,7 @@ import ( "io" "math/big" - secp256k1 "github.com/btcsuite/btcd/btcec" + secp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/tendermint/tendermint/crypto" "golang.org/x/crypto/ripemd160" // nolint: staticcheck // necessary for Bitcoin address format @@ -37,7 +37,7 @@ func (privKey *PrivKey) Bytes() []byte { // PubKey performs the point-scalar multiplication from the privKey on the // generator point to get the pubkey. func (privKey *PrivKey) PubKey() cryptotypes.PubKey { - _, pubkeyObject := secp256k1.PrivKeyFromBytes(secp256k1.S256(), privKey.Key) + _, pubkeyObject := secp256k1.PrivKeyFromBytes(privKey.Key) pk := pubkeyObject.SerializeCompressed() return &PubKey{Key: pk} } diff --git a/crypto/keys/secp256k1/secp256k1_internal_test.go b/crypto/keys/secp256k1/secp256k1_internal_test.go index 7cbe5949f70c..8350f3faa930 100644 --- a/crypto/keys/secp256k1/secp256k1_internal_test.go +++ b/crypto/keys/secp256k1/secp256k1_internal_test.go @@ -5,7 +5,7 @@ import ( "math/big" "testing" - btcSecp256k1 "github.com/btcsuite/btcd/btcec" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" ) diff --git a/crypto/keys/secp256k1/secp256k1_nocgo.go b/crypto/keys/secp256k1/secp256k1_nocgo.go index e12a410a81cc..ac7f521488c0 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo.go @@ -4,29 +4,22 @@ package secp256k1 import ( - "math/big" - - secp256k1 "github.com/btcsuite/btcd/btcec" + secp256k1 "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/ecdsa" "github.com/tendermint/tendermint/crypto" ) -// used to reject malleable signatures -// see: -// - https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/signature_nocgo.go#L90-L93 -// - https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/crypto.go#L39 -var secp256k1halfN = new(big.Int).Rsh(secp256k1.S256().N, 1) - // Sign creates an ECDSA signature on curve Secp256k1, using SHA256 on the msg. // The returned signature will be of the form R || S (in lower-S form). func (privKey *PrivKey) Sign(msg []byte) ([]byte, error) { - priv, _ := secp256k1.PrivKeyFromBytes(secp256k1.S256(), privKey.Key) - sig, err := priv.Sign(crypto.Sha256(msg)) + priv, _ := secp256k1.PrivKeyFromBytes(privKey.Key) + sig, err := ecdsa.SignCompact(priv, crypto.Sha256(msg), false) if err != nil { return nil, err } - sigBytes := serializeSig(sig) - return sigBytes, nil + // remove the first byte which is compactSigRecoveryCode + return sig[1:], nil } // VerifyBytes verifies a signature of the form R || S. @@ -35,7 +28,7 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { if len(sigStr) != 64 { return false } - pub, err := secp256k1.ParsePubKey(pubKey.Key, secp256k1.S256()) + pub, err := secp256k1.ParsePubKey(pubKey.Key) if err != nil { return false } @@ -43,7 +36,13 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { signature := signatureFromBytes(sigStr) // Reject malleable signatures. libsecp256k1 does this check but btcec doesn't. // see: https://github.com/ethereum/go-ethereum/blob/f9401ae011ddf7f8d2d95020b7446c17f8d98dc1/crypto/signature_nocgo.go#L90-L93 - if signature.S.Cmp(secp256k1halfN) > 0 { + // Serialize() would negate S value if it is over half order. + // Hence, if the signature is different after Serialize() if should be rejected. + modifiedSignature, parseErr := ecdsa.ParseDERSignature(signature.Serialize()) + if parseErr != nil { + return false + } + if !signature.IsEqual(modifiedSignature) { return false } return signature.Verify(crypto.Sha256(msg), pub) @@ -51,21 +50,10 @@ func (pubKey *PubKey) VerifySignature(msg []byte, sigStr []byte) bool { // Read Signature struct from R || S. Caller needs to ensure // that len(sigStr) == 64. -func signatureFromBytes(sigStr []byte) *secp256k1.Signature { - return &secp256k1.Signature{ - R: new(big.Int).SetBytes(sigStr[:32]), - S: new(big.Int).SetBytes(sigStr[32:64]), - } -} - -// Serialize signature to R || S. -// R, S are padded to 32 bytes respectively. -func serializeSig(sig *secp256k1.Signature) []byte { - rBytes := sig.R.Bytes() - sBytes := sig.S.Bytes() - sigBytes := make([]byte, 64) - // 0 pad the byte arrays from the left if they aren't big enough. - copy(sigBytes[32-len(rBytes):32], rBytes) - copy(sigBytes[64-len(sBytes):64], sBytes) - return sigBytes +func signatureFromBytes(sigStr []byte) *ecdsa.Signature { + var r secp256k1.ModNScalar + r.SetByteSlice(sigStr[:32]) + var s secp256k1.ModNScalar + s.SetByteSlice(sigStr[32:64]) + return ecdsa.NewSignature(&r, &s) } diff --git a/crypto/keys/secp256k1/secp256k1_nocgo_test.go b/crypto/keys/secp256k1/secp256k1_nocgo_test.go index 060b2815a01e..f38a5bf4fd45 100644 --- a/crypto/keys/secp256k1/secp256k1_nocgo_test.go +++ b/crypto/keys/secp256k1/secp256k1_nocgo_test.go @@ -6,7 +6,7 @@ package secp256k1 import ( "testing" - secp256k1 "github.com/btcsuite/btcd/btcec" + secp256k1 "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" ) @@ -19,20 +19,29 @@ func TestSignatureVerificationAndRejectUpperS(t *testing.T) { priv := GenPrivKey() sigStr, err := priv.Sign(msg) require.NoError(t, err) - sig := signatureFromBytes(sigStr) - require.False(t, sig.S.Cmp(secp256k1halfN) > 0) + var r secp256k1.ModNScalar + r.SetByteSlice(sigStr[:32]) + var s secp256k1.ModNScalar + s.SetByteSlice(sigStr[32:64]) + require.False(t, s.IsOverHalfOrder()) pub := priv.PubKey() require.True(t, pub.VerifySignature(msg, sigStr)) // malleate: - sig.S.Sub(secp256k1.S256().CurveParams.N, sig.S) - require.True(t, sig.S.Cmp(secp256k1halfN) > 0) - malSigStr := serializeSig(sig) + var S256 secp256k1.ModNScalar + S256.SetByteSlice(secp256k1.S256().N.Bytes()) + s.Negate().Add(&S256) + require.True(t, s.IsOverHalfOrder()) + rBytes := r.Bytes() + sBytes := s.Bytes() + malSigStr := make([]byte, 64) + copy(malSigStr[32-len(rBytes):32], rBytes[:]) + copy(malSigStr[64-len(sBytes):64], sBytes[:]) require.False(t, pub.VerifySignature(msg, malSigStr), "VerifyBytes incorrect with malleated & invalid S. sig=%v, key=%v", - sig, + malSigStr, priv, ) } diff --git a/crypto/keys/secp256k1/secp256k1_test.go b/crypto/keys/secp256k1/secp256k1_test.go index 63f5579459f1..651665ad4e8e 100644 --- a/crypto/keys/secp256k1/secp256k1_test.go +++ b/crypto/keys/secp256k1/secp256k1_test.go @@ -7,7 +7,8 @@ import ( "math/big" "testing" - btcSecp256k1 "github.com/btcsuite/btcd/btcec" + btcSecp256k1 "github.com/btcsuite/btcd/btcec/v2" + btcecdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" "github.com/cosmos/btcutil/base58" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -64,7 +65,7 @@ func TestSignAndValidateSecp256k1(t *testing.T) { // ---- // Test cross packages verification msgHash := crypto.Sha256(msg) - btcPrivKey, btcPubKey := btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), privKey.Key) + btcPrivKey, btcPubKey := btcSecp256k1.PrivKeyFromBytes(privKey.Key) // This fails: malformed signature: no header magic // btcSig, err := secp256k1.ParseSignature(sig, secp256k1.S256()) // require.NoError(t, err) @@ -77,9 +78,11 @@ func TestSignAndValidateSecp256k1(t *testing.T) { ok := ecdsa.Verify(btcPubKey.ToECDSA(), msgHash, r, s) require.True(t, ok) - sig2, err := btcPrivKey.Sign(msgHash) + sig2, err := btcecdsa.SignCompact(btcPrivKey, msgHash, false) + // Chop off compactSigRecoveryCode. + sig2 = sig2[1:] require.NoError(t, err) - pubKey.VerifySignature(msg, sig2.Serialize()) + pubKey.VerifySignature(msg, sig2) // ---- // Mutate the signature, just one bit. @@ -98,7 +101,7 @@ func TestSecp256k1LoadPrivkeyAndSerializeIsIdentity(t *testing.T) { // This function creates a private and public key in the underlying libraries format. // The private key is basically calling new(big.Int).SetBytes(pk), which removes leading zero bytes - priv, _ := btcSecp256k1.PrivKeyFromBytes(btcSecp256k1.S256(), privKeyBytes[:]) + priv, _ := btcSecp256k1.PrivKeyFromBytes(privKeyBytes[:]) // this takes the bytes returned by `(big int).Bytes()`, and if the length is less than 32 bytes, // pads the bytes from the left with zero bytes. Therefore these two functions composed // result in the identity function on privKeyBytes, hence the following equality check diff --git a/crypto/keys/utils.go b/crypto/keys/utils.go deleted file mode 100644 index 2b81337d33c8..000000000000 --- a/crypto/keys/utils.go +++ /dev/null @@ -1,13 +0,0 @@ -package keys - -import ( - "math/big" - - "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" -) - -// Replicates https://github.com/cosmos/cosmos-sdk/blob/44fbb0df9cea049d588e76bf930177d777552cf3/crypto/ledger/ledger_secp256k1.go#L228 -// DO NOT USE. This is a temporary workaround that is cleaned-up in v0.47+ -func IsOverHalfOrder(sigS *big.Int) bool { - return !ecdsa.IsSNormalized(sigS) -} diff --git a/crypto/ledger/ledger_mock.go b/crypto/ledger/ledger_mock.go index 97c6f65f43bb..21e18cc6c99a 100644 --- a/crypto/ledger/ledger_mock.go +++ b/crypto/ledger/ledger_mock.go @@ -4,11 +4,11 @@ package ledger import ( + "errors" "fmt" - "github.com/btcsuite/btcd/btcec" - "github.com/pkg/errors" - + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/ecdsa" "github.com/cosmos/go-bip39" "github.com/tendermint/tendermint/crypto" @@ -56,7 +56,7 @@ func (mock LedgerSECP256K1Mock) GetPublicKeySECP256K1(derivationPath []uint32) ( return nil, err } - _, pubkeyObject := btcec.PrivKeyFromBytes(btcec.S256(), derivedPriv) + _, pubkeyObject := btcec.PrivKeyFromBytes(derivedPriv) return pubkeyObject.SerializeUncompressed(), nil } @@ -70,7 +70,7 @@ func (mock LedgerSECP256K1Mock) GetAddressPubKeySECP256K1(derivationPath []uint3 } // re-serialize in the 33-byte compressed format - cmp, err := btcec.ParsePubKey(pk, btcec.S256()) + cmp, err := btcec.ParsePubKey(pk) if err != nil { return nil, "", fmt.Errorf("error parsing public key: %v", err) } @@ -97,11 +97,8 @@ func (mock LedgerSECP256K1Mock) SignSECP256K1(derivationPath []uint32, message [ return nil, err } - priv, _ := btcec.PrivKeyFromBytes(btcec.S256(), derivedPriv) - sig, err := priv.Sign(crypto.Sha256(message)) - if err != nil { - return nil, err - } + priv, _ := btcec.PrivKeyFromBytes(derivedPriv) + sig := ecdsa.Sign(priv, crypto.Sha256(message)) return sig.Serialize(), nil } diff --git a/crypto/ledger/ledger_notavail.go b/crypto/ledger/ledger_notavail.go index 578c33d4369c..4cc53e211c3f 100644 --- a/crypto/ledger/ledger_notavail.go +++ b/crypto/ledger/ledger_notavail.go @@ -6,7 +6,7 @@ package ledger import ( - "github.com/pkg/errors" + "errors" ) // If ledger support (build tag) has been enabled, which implies a CGO dependency, diff --git a/crypto/ledger/ledger_secp256k1.go b/crypto/ledger/ledger_secp256k1.go index fc862c2d08fc..29f50ad4e212 100644 --- a/crypto/ledger/ledger_secp256k1.go +++ b/crypto/ledger/ledger_secp256k1.go @@ -1,15 +1,15 @@ package ledger import ( + "errors" "fmt" "math/big" "os" - "github.com/btcsuite/btcd/btcec" - "github.com/pkg/errors" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcec/v2/ecdsa" "github.com/cosmos/cosmos-sdk/crypto/hd" - "github.com/cosmos/cosmos-sdk/crypto/keys" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -169,24 +169,29 @@ func warnIfErrors(f func() error) { } func convertDERtoBER(signatureDER []byte) ([]byte, error) { - sigDER, err := btcec.ParseDERSignature(signatureDER, btcec.S256()) + sigDER, err := ecdsa.ParseDERSignature(signatureDER) if err != nil { return nil, err } + sigStr := sigDER.Serialize() + // The format of a DER encoded signature is as follows: + // 0x30 0x02 0x02 + r, s := new(big.Int), new(big.Int) + r.SetBytes(sigStr[4 : 4+sigStr[3]]) + s.SetBytes(sigStr[4+sigStr[3]+2:]) + + sModNScalar := new(btcec.ModNScalar) + sModNScalar.SetByteSlice(s.Bytes()) // based on https://github.com/tendermint/btcd/blob/ec996c5/btcec/signature.go#L33-L50 - // low 'S' malleability breaker - sigS := sigDER.S - if keys.IsOverHalfOrder(sigS) { - sigS = new(big.Int).Sub(btcec.S256().N, sigS) + if sModNScalar.IsOverHalfOrder() { + s = new(big.Int).Sub(btcec.S256().N, s) } - rBytes := sigDER.R.Bytes() - sBytes := sigS.Bytes() sigBytes := make([]byte, 64) // 0 pad the byte arrays from the left if they aren't big enough. - copy(sigBytes[32-len(rBytes):32], rBytes) - copy(sigBytes[64-len(sBytes):64], sBytes) + copy(sigBytes[32-len(r.Bytes()):32], r.Bytes()) + copy(sigBytes[64-len(s.Bytes()):64], s.Bytes()) return sigBytes, nil } @@ -198,7 +203,7 @@ func getDevice() (SECP256K1, error) { device, err := discoverLedger() if err != nil { - return nil, errors.Wrap(err, "ledger nano S") + return nil, fmt.Errorf("ledger nano S: %w", err) } return device, nil @@ -252,7 +257,7 @@ func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (types.PubKey, error } // re-serialize in the 33-byte compressed format - cmp, err := btcec.ParsePubKey(publicKey, btcec.S256()) + cmp, err := btcec.ParsePubKey(publicKey) if err != nil { return nil, fmt.Errorf("error parsing public key: %v", err) } @@ -276,7 +281,7 @@ func getPubKeyAddrSafe(device SECP256K1, path hd.BIP44Params, hrp string) (types } // re-serialize in the 33-byte compressed format - cmp, err := btcec.ParsePubKey(publicKey, btcec.S256()) + cmp, err := btcec.ParsePubKey(publicKey) if err != nil { return nil, "", fmt.Errorf("error parsing public key: %v", err) } diff --git a/go.mod b/go.mod index 5e11a5223011..9330a7a22760 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.3 github.com/99designs/keyring v1.2.1 - github.com/armon/go-metrics v0.4.0 - github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 - github.com/btcsuite/btcd v0.22.2 + github.com/armon/go-metrics v0.4.1 + github.com/bgentry/speakeasy v0.1.0 + github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/celestiaorg/smt v0.3.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/cockroachdb/apd/v2 v2.0.2 @@ -73,8 +73,7 @@ require ( github.com/aws/aws-sdk-go v1.40.45 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cenkalti/backoff/v4 v4.1.1 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect diff --git a/go.sum b/go.sum index fdad2d9ee858..dd446840ea8c 100644 --- a/go.sum +++ b/go.sum @@ -120,8 +120,8 @@ github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-metrics v0.4.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q= -github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= @@ -145,17 +145,15 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= -github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/btcsuite/btcd v0.0.0-20190315201642-aa6e0f35703c/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.21.0-beta.0.20201114000516-e9c7a5ac6401/go.mod h1:Sv4JPQ3/M+teHz9Bo5jBpkNcP0x6r7rdihlNL/7tTAs= +github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= -github.com/btcsuite/btcd v0.22.2 h1:vBZ+lGGd1XubpOWO67ITJpAEsICWhA0YzqkcpkgNBfo= -github.com/btcsuite/btcd v0.22.2/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= github.com/btcsuite/btcd/btcec/v2 v2.1.2/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= @@ -182,8 +180,9 @@ github.com/celestiaorg/smt v0.3.0 h1:Hc6m8fIVRajrg/Saf8ivX4xw551LHzOs8kqeadd6h9s github.com/celestiaorg/smt v0.3.0/go.mod h1:/sdYDakowo/XaxS2Fl7CBqtuf/O2uTqF2zmAUFAtAiw= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/cenkalti/backoff/v4 v4.1.1 h1:G2HAfAmvm/GcKan2oOQpBXOd2tT2G57ZnZGWa1PxPBQ= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= diff --git a/server/rosetta/converter.go b/server/rosetta/converter.go index 7e0e27376a9d..e7cce56bd134 100644 --- a/server/rosetta/converter.go +++ b/server/rosetta/converter.go @@ -7,7 +7,7 @@ import ( "reflect" "cosmossdk.io/math" - "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcd/btcec/v2" rosettatypes "github.com/coinbase/rosetta-sdk-go/types" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto" @@ -649,7 +649,7 @@ func (c converter) PubKey(pubKey *rosettatypes.PublicKey) (cryptotypes.PubKey, e return nil, crgerrs.WrapError(crgerrs.ErrUnsupportedCurve, "only secp256k1 supported") } - cmp, err := btcec.ParsePubKey(pubKey.Bytes, btcec.S256()) + cmp, err := btcec.ParsePubKey(pubKey.Bytes) if err != nil { return nil, crgerrs.WrapError(crgerrs.ErrBadArgument, err.Error()) } From 5e1a340c5bb2e486a71c6ebe2e3373bd5cdf57ff Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:32:39 +0100 Subject: [PATCH 19/52] ci: update release slack channel and algolia api key (backport #14942) (#14945) Co-authored-by: Julien Robert --- .github/workflows/release.yml | 2 +- docs/.vuepress/config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34095509f6e7..544fcb1b4b24 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: uses: rtCamp/action-slack-notify@v2.2.0 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - SLACK_CHANNEL: cosmos-sdk + SLACK_CHANNEL: cosmos-tech SLACK_USERNAME: Cosmos SDK Release Bot SLACK_ICON: https://avatars.githubusercontent.com/t/5997665?size=64 SLACK_COLOR: good diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index b21c74c5a28e..57edfc9cc14c 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -26,7 +26,7 @@ module.exports = { label: "sdk", algolia: { id: "QLS2QSP47E", - key: "067b84458bfa80c295e1d4f12c461911", + key: "4d9feeb481e3cfef8f91bbc63e090042", index: "cosmos_network_vue" }, versions: [ From 6aa42d43eafd8669ac7894e367739d3d2854ce27 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 07:24:42 -0500 Subject: [PATCH 20/52] feat: support profiling block replay during abci handshake (backport #14953) (#14964) Co-authored-by: yihuang Co-authored-by: Julien Robert --- CHANGELOG.md | 4 +++ server/start.go | 70 ++++++++++++++++++++++++++++++------------------- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f94b2f80ca6a..04568b2d3e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. + ## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-07 ### Improvements diff --git a/server/start.go b/server/start.go index b10518f2efb6..0f5bd05d3eb2 100644 --- a/server/start.go +++ b/server/start.go @@ -137,11 +137,15 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. withTM, _ := cmd.Flags().GetBool(flagWithTendermint) if !withTM { serverCtx.Logger.Info("starting ABCI without Tendermint") - return startStandAlone(serverCtx, appCreator) + return wrapCPUProfile(serverCtx, func() error { + return startStandAlone(serverCtx, appCreator) + }) } // amino is needed here for backwards compatibility of REST routes - err = startInProcess(serverCtx, clientCtx, appCreator) + err = wrapCPUProfile(serverCtx, func() error { + return startInProcess(serverCtx, clientCtx, appCreator) + }) errCode, ok := err.(ErrorCode) if !ok { return err @@ -249,27 +253,6 @@ func startStandAlone(ctx *Context, appCreator types.AppCreator) error { func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.AppCreator) error { cfg := ctx.Config home := cfg.RootDir - var cpuProfileCleanup func() - - if cpuProfile := ctx.Viper.GetString(flagCPUProfile); cpuProfile != "" { - f, err := os.Create(cpuProfile) - if err != nil { - return err - } - - ctx.Logger.Info("starting CPU profiler", "profile", cpuProfile) - if err := pprof.StartCPUProfile(f); err != nil { - return err - } - - cpuProfileCleanup = func() { - ctx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) - pprof.StopCPUProfile() - if err := f.Close(); err != nil { - ctx.Logger.Info("failed to close cpu-profile file", "profile", cpuProfile, "err", err.Error()) - } - } - } db, err := openDB(home, GetAppDBBackend(ctx.Viper)) if err != nil { @@ -504,10 +487,6 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App _ = tmNode.Stop() } - if cpuProfileCleanup != nil { - cpuProfileCleanup() - } - if apiSrv != nil { _ = apiSrv.Close() } @@ -525,3 +504,40 @@ func startTelemetry(cfg serverconfig.Config) (*telemetry.Metrics, error) { } return telemetry.New(cfg.Telemetry) } + +// wrapCPUProfile runs callback in a goroutine, then wait for quit signals. +func wrapCPUProfile(ctx *Context, callback func() error) error { + if cpuProfile := ctx.Viper.GetString(flagCPUProfile); cpuProfile != "" { + f, err := os.Create(cpuProfile) + if err != nil { + return err + } + + ctx.Logger.Info("starting CPU profiler", "profile", cpuProfile) + if err := pprof.StartCPUProfile(f); err != nil { + return err + } + + defer func() { + ctx.Logger.Info("stopping CPU profiler", "profile", cpuProfile) + pprof.StopCPUProfile() + if err := f.Close(); err != nil { + ctx.Logger.Info("failed to close cpu-profile file", "profile", cpuProfile, "err", err.Error()) + } + }() + } + + errCh := make(chan error) + go func() { + errCh <- callback() + }() + + select { + case err := <-errCh: + return err + + case <-time.After(types.ServerStartTime): + } + + return WaitForQuitSignals() +} From 06406f6a70f228bbb6d09b45a4e343477f1ef7e9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 16 Feb 2023 17:37:35 +0100 Subject: [PATCH 21/52] fix: avoid broadcasting tx through query (backport #15044) (#15047) Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: Julien Robert --- CHANGELOG.md | 2 ++ RELEASE_NOTES.md | 7 +++---- baseapp/abci.go | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04568b2d3e62..30bf59c12d83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16 + ### Improvements * (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 60f9309f9214..c5f8b0140af2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,8 +1,7 @@ -# Cosmos SDK v0.46.9 Release Notes +# Cosmos SDK v0.46.10 Release Notes -This release introduces bug fixes and improvements. Notably an extra config in the `app.toml`, `iavl-lazy-loading`, to enable lazy loading of IAVL store. -Changes to be made in the `app.toml` can be found in the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md). +This release improves CPU profiling when using the `--cpu-profile` flag, and fixes a possible way to DoS a node. Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.8...v0.46.9 +Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.9...v0.46.10 diff --git a/baseapp/abci.go b/baseapp/abci.go index d93779d02943..7147d6d88593 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -400,6 +400,10 @@ func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) { telemetry.IncrCounter(1, "query", req.Path) defer telemetry.MeasureSince(time.Now(), req.Path) + if req.Path == "/cosmos.tx.v1beta1.Service/BroadcastTx" { + return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace) + } + // handle gRPC routes first rather than calling splitPath because '/' characters // are used as part of gRPC paths if grpcHandler := app.grpcQueryRouter.Route(req.Path); grpcHandler != nil { From a8556b66c0dcbd86887a367bf5ba683f3a021010 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 17 Feb 2023 17:57:32 +0000 Subject: [PATCH 22/52] fix: create snapshot dir for rocksdb backend (backport #15054) (#15065) Co-authored-by: yihuang --- server/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/util.go b/server/util.go index 1834da6c3384..2d9d02eb6834 100644 --- a/server/util.go +++ b/server/util.go @@ -431,6 +431,10 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) { } snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") + if err = os.MkdirAll(snapshotDir, os.ModePerm); err != nil { + panic(fmt.Errorf("failed to create snapshots directory: %w", err)) + } + snapshotDB, err := dbm.NewDB("metadata", GetAppDBBackend(appOpts), snapshotDir) if err != nil { panic(err) From 5848fd3295515f48a6024963f25849c7aebd3680 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:37:12 +0100 Subject: [PATCH 23/52] chore: Add check for uneven stores' height (backport #14410) (#15115) Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com> Co-authored-by: marbar3778 --- CHANGELOG.md | 1 + go.mod | 3 +-- store/rootmulti/store.go | 22 ++++++++++------ store/rootmulti/store_test.go | 39 +++++++++++++++++++++++++++++ x/upgrade/types/storeloader_test.go | 5 ---- 5 files changed, 55 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30bf59c12d83..ee70a2a12afb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. +* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. ## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-07 diff --git a/go.mod b/go.mod index 9330a7a22760..b0eb00e1a443 100644 --- a/go.mod +++ b/go.mod @@ -49,7 +49,7 @@ require ( github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.26 + github.com/tendermint/tendermint v0.34.24 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 golang.org/x/crypto v0.5.0 @@ -167,7 +167,6 @@ replace ( // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 - github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 // use informal system fork of tendermint github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 3b5fede4321d..dd81d771eec5 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -134,11 +134,7 @@ func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db db if _, ok := rs.keysByName[key.Name()]; ok { panic(fmt.Sprintf("store duplicate store key name %v", key)) } - rs.storesParams[key] = storeParams{ - key: key, - typ: typ, - db: db, - } + rs.storesParams[key] = newStoreParams(key, db, typ, 0) rs.keysByName[key.Name()] = key } @@ -231,8 +227,10 @@ func (rs *Store) loadVersion(ver int64, upgrades *types.StoreUpgrades) error { commitID := rs.getCommitID(infos, key.Name()) // If it has been added, set the initial version - if upgrades.IsAdded(key.Name()) { + if upgrades.IsAdded(key.Name()) || upgrades.RenamedFrom(key.Name()) != "" { storeParams.initialVersion = uint64(ver) + 1 + } else if commitID.Version != ver && storeParams.typ == types.StoreTypeIAVL { + return fmt.Errorf("version of store %s mismatch root store's version; expected %d got %d", key.Name(), ver, commitID.Version) } store, err := rs.loadCommitStoreFromParams(key, commitID, storeParams) @@ -252,8 +250,7 @@ func (rs *Store) loadVersion(ver int64, upgrades *types.StoreUpgrades) error { // handle renames specially // make an unregistered key to satisfy loadCommitStore params oldKey := types.NewKVStoreKey(oldName) - oldParams := storeParams - oldParams.key = oldKey + oldParams := newStoreParams(oldKey, storeParams.db, storeParams.typ, 0) // load from the old name oldStore, err := rs.loadCommitStoreFromParams(oldKey, rs.getCommitID(infos, oldName), oldParams) @@ -1009,6 +1006,15 @@ type storeParams struct { initialVersion uint64 } +func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { // nolint + return storeParams{ + key: key, + db: db, + typ: typ, + initialVersion: initialVersion, + } +} + func GetLatestVersion(db dbm.DB) int64 { bz, err := db.Get([]byte(latestVersionKey)) if err != nil { diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 26204bceb21b..0e78e0f95bed 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -273,6 +273,12 @@ func TestMultistoreLoadWithUpgrade(t *testing.T) { require.Equal(t, migratedID.Version, int64(2)) reload, _ := newMultiStoreWithModifiedMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) + // unmount store3 since store3 was deleted + unmountStore(reload, "store3") + + rs3, _ := reload.GetStoreByName("store3").(types.KVStore) + require.Nil(t, rs3) + err = reload.LoadLatestVersion() require.Nil(t, err) require.Equal(t, migratedID, reload.LastCommitID()) @@ -607,6 +613,32 @@ func TestMultiStore_PruningRestart(t *testing.T) { } } +// TestUnevenStoresHeightCheck tests if loading root store correctly errors when +// there's any module store with the wrong height +func TestUnevenStoresHeightCheck(t *testing.T) { + var db dbm.DB = dbm.NewMemDB() + store := newMultiStoreWithMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) + err := store.LoadLatestVersion() + require.Nil(t, err) + + // commit to increment store's height + store.Commit() + + // mount store4 to root store + store.MountStoreWithDB(types.NewKVStoreKey("store4"), types.StoreTypeIAVL, nil) + + // load the stores without upgrades + err = store.LoadLatestVersion() + require.Error(t, err) + + // now, let's load with upgrades... + upgrades := &types.StoreUpgrades{ + Added: []string{"store4"}, + } + err = store.LoadLatestVersionAndUpgrade(upgrades) + require.Nil(t, err) +} + func TestSetInitialVersion(t *testing.T) { db := dbm.NewMemDB() multi := newMultiStoreWithMounts(db, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)) @@ -868,6 +900,13 @@ func newMultiStoreWithModifiedMounts(db dbm.DB, pruningOpts pruningtypes.Pruning return store, upgrades } +func unmountStore(rootStore *Store, storeKeyName string) { + sk := rootStore.keysByName[storeKeyName] + delete(rootStore.stores, sk) + delete(rootStore.storesParams, sk) + delete(rootStore.keysByName, storeKeyName) +} + func checkStore(t *testing.T, store *Store, expect, got types.CommitID) { require.Equal(t, expect, got) require.Equal(t, expect, store.LastCommitID()) diff --git a/x/upgrade/types/storeloader_test.go b/x/upgrade/types/storeloader_test.go index 6aaefa69d198..783c15caa346 100644 --- a/x/upgrade/types/storeloader_test.go +++ b/x/upgrade/types/storeloader_test.go @@ -151,11 +151,6 @@ func TestSetLoader(t *testing.T) { res := app.Commit() require.NotNil(t, res.Data) - // checking the case of the store being renamed - if tc.setLoader != nil { - checkStore(t, db, upgradeHeight, tc.origStoreKey, k, nil) - } - // check db is properly updated checkStore(t, db, upgradeHeight, tc.loadStoreKey, k, v) }) From 8499d162abf9e85d8833ce9f2ede6ca7d4051420 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 16:45:47 +0100 Subject: [PATCH 24/52] refactor!: remove store v2alpha1 (#15152) --- CHANGELOG.md | 6 +- go.mod | 1 - go.sum | 2 - store/transient/store_test.go | 2 +- store/v2alpha1/dbadapter/store.go | 92 --- store/v2alpha1/dbadapter/store_test.go | 105 --- store/v2alpha1/mem/store.go | 45 -- store/v2alpha1/mem/store_test.go | 39 - store/v2alpha1/multi/cache_store.go | 36 - store/v2alpha1/multi/doc.go | 19 - store/v2alpha1/multi/migration.go | 68 -- store/v2alpha1/multi/migration_test.go | 107 --- store/v2alpha1/multi/proof.go | 52 -- store/v2alpha1/multi/proof_test.go | 125 ---- store/v2alpha1/multi/snapshot.go | 172 ----- store/v2alpha1/multi/snapshot_test.go | 317 -------- store/v2alpha1/multi/store.go | 915 ----------------------- store/v2alpha1/multi/store_test.go | 986 ------------------------- store/v2alpha1/multi/sub_store.go | 117 --- store/v2alpha1/multi/test_util.go | 88 --- store/v2alpha1/multi/view_store.go | 178 ----- store/v2alpha1/smt/ics23.go | 124 ---- store/v2alpha1/smt/ics23_test.go | 108 --- store/v2alpha1/smt/proof.go | 93 --- store/v2alpha1/smt/proof_test.go | 69 -- store/v2alpha1/smt/store.go | 143 ---- store/v2alpha1/smt/store_test.go | 46 -- store/v2alpha1/transient/store.go | 47 -- store/v2alpha1/transient/store_test.go | 27 - store/v2alpha1/types.go | 111 --- 30 files changed, 6 insertions(+), 4234 deletions(-) delete mode 100644 store/v2alpha1/dbadapter/store.go delete mode 100644 store/v2alpha1/dbadapter/store_test.go delete mode 100644 store/v2alpha1/mem/store.go delete mode 100644 store/v2alpha1/mem/store_test.go delete mode 100644 store/v2alpha1/multi/cache_store.go delete mode 100644 store/v2alpha1/multi/doc.go delete mode 100644 store/v2alpha1/multi/migration.go delete mode 100644 store/v2alpha1/multi/migration_test.go delete mode 100644 store/v2alpha1/multi/proof.go delete mode 100644 store/v2alpha1/multi/proof_test.go delete mode 100644 store/v2alpha1/multi/snapshot.go delete mode 100644 store/v2alpha1/multi/snapshot_test.go delete mode 100644 store/v2alpha1/multi/store.go delete mode 100644 store/v2alpha1/multi/store_test.go delete mode 100644 store/v2alpha1/multi/sub_store.go delete mode 100644 store/v2alpha1/multi/test_util.go delete mode 100644 store/v2alpha1/multi/view_store.go delete mode 100644 store/v2alpha1/smt/ics23.go delete mode 100644 store/v2alpha1/smt/ics23_test.go delete mode 100644 store/v2alpha1/smt/proof.go delete mode 100644 store/v2alpha1/smt/proof_test.go delete mode 100644 store/v2alpha1/smt/store.go delete mode 100644 store/v2alpha1/smt/store_test.go delete mode 100644 store/v2alpha1/transient/store.go delete mode 100644 store/v2alpha1/transient/store_test.go delete mode 100644 store/v2alpha1/types.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ee70a2a12afb..2d752bb18aa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,12 +37,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## Improvements + +* (store) [#15152](https://github.com/cosmos/cosmos-sdk/pull/15152) Remove unmaintained and experimental `store/v2alpha1`. +* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. + ## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16 ### Improvements * (cli) [#14953](https://github.com/cosmos/cosmos-sdk/pull/14953) Enable profiling block replay during abci handshake with `--cpu-profile`. -* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. ## [v0.46.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.9) - 2022-02-07 diff --git a/go.mod b/go.mod index b0eb00e1a443..59dbcc12dc13 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,6 @@ require ( github.com/armon/go-metrics v0.4.1 github.com/bgentry/speakeasy v0.1.0 github.com/btcsuite/btcd/btcec/v2 v2.3.2 - github.com/celestiaorg/smt v0.3.0 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e github.com/cockroachdb/apd/v2 v2.0.2 github.com/coinbase/rosetta-sdk-go v0.7.9 diff --git a/go.sum b/go.sum index dd446840ea8c..18465df7d274 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,6 @@ github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46f github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/celestiaorg/smt v0.3.0 h1:Hc6m8fIVRajrg/Saf8ivX4xw551LHzOs8kqeadd6h9s= -github.com/celestiaorg/smt v0.3.0/go.mod h1:/sdYDakowo/XaxS2Fl7CBqtuf/O2uTqF2zmAUFAtAiw= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= diff --git a/store/transient/store_test.go b/store/transient/store_test.go index 900e6cb7a918..48324aa9491d 100644 --- a/store/transient/store_test.go +++ b/store/transient/store_test.go @@ -8,7 +8,7 @@ import ( pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" "github.com/cosmos/cosmos-sdk/store/transient" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" + "github.com/cosmos/cosmos-sdk/store/types" ) var k, v = []byte("hello"), []byte("world") diff --git a/store/v2alpha1/dbadapter/store.go b/store/v2alpha1/dbadapter/store.go deleted file mode 100644 index 1cbd6c83585b..000000000000 --- a/store/v2alpha1/dbadapter/store.go +++ /dev/null @@ -1,92 +0,0 @@ -package dbadapter - -import ( - "io" - - dbm "github.com/cosmos/cosmos-sdk/db" - dbutil "github.com/cosmos/cosmos-sdk/internal/db" - "github.com/cosmos/cosmos-sdk/store/cachekv" - "github.com/cosmos/cosmos-sdk/store/listenkv" - "github.com/cosmos/cosmos-sdk/store/tracekv" - "github.com/cosmos/cosmos-sdk/store/types" -) - -var _ types.KVStore = Store{} - -// Wrapper type for dbm.Db with implementation of KVStore -type Store struct { - DB dbm.DBReadWriter -} - -// Get wraps the underlying DB's Get method panicing on error. -func (dsa Store) Get(key []byte) []byte { - v, err := dsa.DB.Get(key) - if err != nil { - panic(err) - } - - return v -} - -// Has wraps the underlying DB's Has method panicing on error. -func (dsa Store) Has(key []byte) bool { - ok, err := dsa.DB.Has(key) - if err != nil { - panic(err) - } - - return ok -} - -// Set wraps the underlying DB's Set method panicing on error. -func (dsa Store) Set(key, value []byte) { - types.AssertValidKey(key) - if err := dsa.DB.Set(key, value); err != nil { - panic(err) - } -} - -// Delete wraps the underlying DB's Delete method panicing on error. -func (dsa Store) Delete(key []byte) { - if err := dsa.DB.Delete(key); err != nil { - panic(err) - } -} - -// Iterator wraps the underlying DB's Iterator method panicing on error. -func (dsa Store) Iterator(start, end []byte) types.Iterator { - iter, err := dsa.DB.Iterator(start, end) - if err != nil { - panic(err) - } - return dbutil.DBToStoreIterator(iter) -} - -// ReverseIterator wraps the underlying DB's ReverseIterator method panicing on error. -func (dsa Store) ReverseIterator(start, end []byte) types.Iterator { - iter, err := dsa.DB.ReverseIterator(start, end) - if err != nil { - panic(err) - } - return dbutil.DBToStoreIterator(iter) -} - -// GetStoreType returns the type of the store. -func (dsa Store) GetStoreType() types.StoreType { - return types.StoreTypeDB -} - -// CacheWrap branches the underlying store. -func (dsa Store) CacheWrap() types.CacheWrap { - return cachekv.NewStore(dsa) -} - -// CacheWrapWithTrace implements KVStore. -func (dsa Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(dsa, w, tc)) -} - -// CacheWrapWithListeners implements the CacheWrapper interface. -func (dsa Store) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap { - return cachekv.NewStore(listenkv.NewStore(dsa, storeKey, listeners)) -} diff --git a/store/v2alpha1/dbadapter/store_test.go b/store/v2alpha1/dbadapter/store_test.go deleted file mode 100644 index 9bfa68518ab0..000000000000 --- a/store/v2alpha1/dbadapter/store_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package dbadapter_test - -import ( - "bytes" - "errors" - "testing" - - "github.com/golang/mock/gomock" - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/store/cachekv" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" - mocks "github.com/cosmos/cosmos-sdk/tests/mocks/db" -) - -var errFoo = errors.New("dummy") - -func TestAccessors(t *testing.T) { - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - mockDB := mocks.NewMockDBReadWriter(mockCtrl) - store := dbadapter.Store{mockDB} - key := []byte("test") - value := []byte("testvalue") - - require.Panics(t, func() { store.Set(nil, []byte("value")) }, "setting a nil key should panic") - require.Panics(t, func() { store.Set([]byte(""), []byte("value")) }, "setting an empty key should panic") - - require.Equal(t, types.StoreTypeDB, store.GetStoreType()) - - retFoo := []byte("xxx") - mockDB.EXPECT().Get(gomock.Eq(key)).Times(1).Return(retFoo, nil) - require.True(t, bytes.Equal(retFoo, store.Get(key))) - require.Equal(t, []byte{1, 2, 3}, []byte{1, 2, 3}) - - mockDB.EXPECT().Get(gomock.Eq(key)).Times(1).Return(nil, errFoo) - require.Panics(t, func() { store.Get(key) }) - - mockDB.EXPECT().Has(gomock.Eq(key)).Times(1).Return(true, nil) - require.True(t, store.Has(key)) - - mockDB.EXPECT().Has(gomock.Eq(key)).Times(1).Return(false, nil) - require.False(t, store.Has(key)) - - mockDB.EXPECT().Has(gomock.Eq(key)).Times(1).Return(false, errFoo) - require.Panics(t, func() { store.Has(key) }) - - mockDB.EXPECT().Set(gomock.Eq(key), gomock.Eq(value)).Times(1).Return(nil) - require.NotPanics(t, func() { store.Set(key, value) }) - - mockDB.EXPECT().Set(gomock.Eq(key), gomock.Eq(value)).Times(1).Return(errFoo) - require.Panics(t, func() { store.Set(key, value) }) - - mockDB.EXPECT().Delete(gomock.Eq(key)).Times(1).Return(nil) - require.NotPanics(t, func() { store.Delete(key) }) - - mockDB.EXPECT().Delete(gomock.Eq(key)).Times(1).Return(errFoo) - require.Panics(t, func() { store.Delete(key) }) -} - -func TestIterators(t *testing.T) { - mockCtrl := gomock.NewController(t) - defer mockCtrl.Finish() - - mockDB := mocks.NewMockDBReadWriter(mockCtrl) - store := dbadapter.Store{mockDB} - key := []byte("test") - value := []byte("testvalue") - - start, end := key, []byte("test_end") - - mockDB.EXPECT().Iterator(gomock.Eq(start), gomock.Eq(end)).Times(1).Return(nil, errFoo) - require.Panics(t, func() { store.Iterator(start, end) }) - - mockDB.EXPECT().ReverseIterator(gomock.Eq(start), gomock.Eq(end)).Times(1).Return(nil, errFoo) - require.Panics(t, func() { store.ReverseIterator(start, end) }) - - mockIter := mocks.NewMockIterator(mockCtrl) - mockIter.EXPECT().Next().Times(1).Return(true) - mockIter.EXPECT().Key().Times(1).Return(key) - mockIter.EXPECT().Value().Times(1).Return(value) - - mockDB.EXPECT().Iterator(gomock.Eq(start), gomock.Eq(end)).Times(1).Return(mockIter, nil) - iter := store.Iterator(start, end) - - require.Equal(t, key, iter.Key()) - require.Equal(t, value, iter.Value()) -} - -func TestCacheWraps(t *testing.T) { - mockCtrl := gomock.NewController(t) - mockDB := mocks.NewMockDBReadWriter(mockCtrl) - store := dbadapter.Store{mockDB} - - cacheWrapper := store.CacheWrap() - require.IsType(t, &cachekv.Store{}, cacheWrapper) - - cacheWrappedWithTrace := store.CacheWrapWithTrace(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithTrace) - - cacheWrappedWithListeners := store.CacheWrapWithListeners(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithListeners) -} diff --git a/store/v2alpha1/mem/store.go b/store/v2alpha1/mem/store.go deleted file mode 100644 index 3c8fa82bbaba..000000000000 --- a/store/v2alpha1/mem/store.go +++ /dev/null @@ -1,45 +0,0 @@ -package mem - -import ( - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/db/memdb" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" -) - -var ( - _ types.KVStore = (*Store)(nil) - _ types.Committer = (*Store)(nil) -) - -// Store implements an in-memory only KVStore. Entries are persisted between -// commits and thus between blocks. State in Memory store is not committed as part of app state but maintained privately by each node -type Store struct { - dbadapter.Store - conn dbm.DBConnection -} - -// NewStore constructs a new in-memory store. -func NewStore() *Store { - db := memdb.NewDB() - return &Store{ - Store: dbadapter.Store{DB: db.ReadWriter()}, - conn: db, - } -} - -// GetStoreType returns the Store's type. -func (s Store) GetStoreType() types.StoreType { - return types.StoreTypeMemory -} - -// Commit commits to the underlying DB. -func (s *Store) Commit() (id types.CommitID) { - return -} - -func (s *Store) SetPruning(pruningtypes.PruningOptions) {} -func (s *Store) GetPruning() pruningtypes.PruningOptions { return pruningtypes.PruningOptions{} } - -func (s Store) LastCommitID() (id types.CommitID) { return } diff --git a/store/v2alpha1/mem/store_test.go b/store/v2alpha1/mem/store_test.go deleted file mode 100644 index 297e2a75df76..000000000000 --- a/store/v2alpha1/mem/store_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package mem_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/mem" -) - -func TestStore(t *testing.T) { - store := mem.NewStore() - key, value := []byte("key"), []byte("value") - - require.Equal(t, types.StoreTypeMemory, store.GetStoreType()) - - require.Nil(t, store.Get(key)) - store.Set(key, value) - require.Equal(t, value, store.Get(key)) - - newValue := []byte("newValue") - store.Set(key, newValue) - require.Equal(t, newValue, store.Get(key)) - - store.Delete(key) - require.Nil(t, store.Get(key)) -} - -func TestCommit(t *testing.T) { - store := mem.NewStore() - key, value := []byte("key"), []byte("value") - - store.Set(key, value) - id := store.Commit() - require.True(t, id.IsZero()) - require.True(t, store.LastCommitID().IsZero()) - require.Equal(t, value, store.Get(key)) -} diff --git a/store/v2alpha1/multi/cache_store.go b/store/v2alpha1/multi/cache_store.go deleted file mode 100644 index 5d7ee786da43..000000000000 --- a/store/v2alpha1/multi/cache_store.go +++ /dev/null @@ -1,36 +0,0 @@ -package multi - -import ( - "github.com/cosmos/cosmos-sdk/store/cachekv" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" -) - -// GetKVStore implements BasicMultiStore. -func (cs *cacheStore) GetKVStore(skey types.StoreKey) types.KVStore { - key := skey.Name() - sub, has := cs.substores[key] - if !has { - sub = cachekv.NewStore(cs.source.GetKVStore(skey)) - cs.substores[key] = sub - } - // Wrap with trace/listen if needed. Note: we don't cache this, so users must get a new substore after - // modifying tracers/listeners. - return cs.wrapTraceListen(sub, skey) -} - -// Write implements CacheMultiStore. -func (cs *cacheStore) Write() { - for _, sub := range cs.substores { - sub.Write() - } -} - -// CacheMultiStore implements BasicMultiStore. -// This recursively wraps the CacheMultiStore in another cache store. -func (cs *cacheStore) CacheMultiStore() types.CacheMultiStore { - return &cacheStore{ - source: cs, - substores: map[string]types.CacheKVStore{}, - traceListenMixin: newTraceListenMixin(), - } -} diff --git a/store/v2alpha1/multi/doc.go b/store/v2alpha1/multi/doc.go deleted file mode 100644 index 87f5b88705c9..000000000000 --- a/store/v2alpha1/multi/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -// This package provides concrete implementations of the store/v2alpha1 "MultiStore" types, including -// CommitMultiStore, CacheMultiStore, and BasicMultiStore (as read-only stores at past versions). -// -// Substores are declared as part of a schema within StoreOptions. -// The schema cannot be changed once a CommitMultiStore is initialized, and changes to the schema must be done -// by migrating via StoreOptions.Upgrades. If a past version is accessed, it will be loaded with the past schema. -// Stores may be declared as StoreTypePersistent, StoreTypeMemory (not persisted after close), or -// StoreTypeTransient (not persisted across commits). Non-persistent substores cannot be migrated or accessed -// in past versions. -// -// A declared persistent substore is initially empty and stores nothing in the backing DB until a value is set. -// A non-empty store is stored within a prefixed subdomain of the backing DB (using db/prefix). -// If the MultiStore is configured to use a separate DBConnection for StateCommitmentDB, it will store the -// state commitment (SC) store (as an SMT) in subdomains there, and the "flat" state is stored in the main DB. -// Each substore's SC is allocated as an independent SMT, and query proofs contain two components: a proof -// of a key's (non)existence within the substore SMT, and a proof of the substore's existence within the -// MultiStore (using the Merkle map proof spec (TendermintSpec)). - -package multi diff --git a/store/v2alpha1/multi/migration.go b/store/v2alpha1/multi/migration.go deleted file mode 100644 index 7481b421ac3b..000000000000 --- a/store/v2alpha1/multi/migration.go +++ /dev/null @@ -1,68 +0,0 @@ -package multi - -import ( - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/store/iavl" - "github.com/cosmos/cosmos-sdk/store/mem" - v1Store "github.com/cosmos/cosmos-sdk/store/rootmulti" - "github.com/cosmos/cosmos-sdk/store/transient" - "github.com/cosmos/cosmos-sdk/store/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// MigrateFromV1 will migrate the state from iavl to smt -func MigrateFromV1(rootMultiStore *v1Store.Store, store2db dbm.DBConnection, storeConfig StoreConfig) (*Store, error) { - type namedStore struct { - *iavl.Store - name string - } - var stores []namedStore - for _, storeKey := range rootMultiStore.StoreKeysByName() { - keyName := storeKey.Name() - switch store := rootMultiStore.GetStoreByName(keyName).(type) { - case *iavl.Store: - err := storeConfig.RegisterSubstore(keyName, types.StoreTypePersistent) - if err != nil { - return nil, err - } - stores = append(stores, namedStore{name: keyName, Store: store}) - case *transient.Store, *mem.Store: - continue - default: - return nil, sdkerrors.Wrapf(sdkerrors.ErrLogic, "don't know how to migrate store %q of type %T", keyName, store) - } - } - - // creating the new store of smt tree - rootStore, err := NewStore(store2db, storeConfig) - if err != nil { - return nil, err - } - - // if version is 0 there is no state data to commit - if rootMultiStore.LastCommitID().Version == 0 { - return rootStore, nil - } - - // iterate through the rootmulti stores and save the key/values into smt tree - for _, store := range stores { - subStore, err := rootStore.getSubstore(store.name) - if err != nil { - return nil, err - } - // iterate all iavl tree node key/values - iterator := store.Iterator(nil, nil) - for ; iterator.Valid(); iterator.Next() { - // set the iavl key,values into smt node - subStore.Set(iterator.Key(), iterator.Value()) - } - } - - // commit the all key/values from iavl to smt tree (SMT Store) - _, err = rootStore.commit(uint64(rootMultiStore.LastCommitID().Version)) - if err != nil { - return nil, err - } - - return rootStore, nil -} diff --git a/store/v2alpha1/multi/migration_test.go b/store/v2alpha1/multi/migration_test.go deleted file mode 100644 index bf7b0f921cd0..000000000000 --- a/store/v2alpha1/multi/migration_test.go +++ /dev/null @@ -1,107 +0,0 @@ -package multi - -import ( - "encoding/binary" - "fmt" - "math/rand" - "testing" - - "github.com/cosmos/cosmos-sdk/db/memdb" - "github.com/cosmos/cosmos-sdk/store/iavl" - "github.com/cosmos/cosmos-sdk/store/rootmulti" - "github.com/cosmos/cosmos-sdk/store/types" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/libs/log" - dbm "github.com/tendermint/tm-db" -) - -func TestMigrationV2(t *testing.T) { - r := rand.New(rand.NewSource(49872768940)) - - // setup a rootmulti store - db := dbm.NewMemDB() - v1Store := rootmulti.NewStore(db, log.NewNopLogger()) - - // mount the kvStores - var keys []*types.KVStoreKey - for i := uint8(0); i < 10; i++ { - key := types.NewKVStoreKey(fmt.Sprintf("store%v", i)) - v1Store.MountStoreWithDB(key, types.StoreTypeIAVL, nil) - keys = append(keys, key) - } - - err := v1Store.LoadLatestVersion() - require.Nil(t, err) - - // setup a random test data - for _, key := range keys { - store := v1Store.GetStore(key).(*iavl.Store) - store.Set([]byte("temp_data"), []byte("one")) - - for i := 0; i < len(keys); i++ { - k := make([]byte, 8) - v := make([]byte, 1024) - binary.BigEndian.PutUint64(k, uint64(i)) - _, err := r.Read(v) - if err != nil { - panic(err) - } - store.Set(k, v) - } - } - - testCases := []struct { - testName string - emptyStore bool - }{ - { - "Migration With Empty Store", - true, - }, - { - "Migration From Root Multi Store (IAVL) to SMT ", - false, - }, - } - - for _, testCase := range testCases { - if !testCase.emptyStore { - v1Store.Commit() - } - - // setup a new root store of smt - db2 := memdb.NewDB() - storeConfig := DefaultStoreConfig() - // migrating the iavl store (v1) to smt store (v2) - v2Store, err := MigrateFromV1(v1Store, db2, storeConfig) - require.NoError(t, err) - - for _, key := range keys { - v2StoreKVStore := v2Store.GetKVStore(key) - if testCase.emptyStore { - // check the empty store - require.Nil(t, v2StoreKVStore.Get([]byte("temp_data"))) - } else { - require.Equal(t, v2StoreKVStore.Get([]byte("temp_data")), []byte("one")) - } - require.Equal(t, v2Store.LastCommitID().Version, v1Store.LastCommitID().Version) - } - err = v2Store.Close() - require.NoError(t, err) - } -} - -// TestMigrateV2ForEmptyStore checking empty store migration -func TestMigrateV2ForEmptyStore(t *testing.T) { - // setup a rootmulti store - db := dbm.NewMemDB() - v1Store := rootmulti.NewStore(db, log.NewNopLogger()) - err := v1Store.LoadLatestVersion() - require.Nil(t, err) - db2 := memdb.NewDB() - storeConfig := DefaultStoreConfig() - // migrating the iavl store (v1) to smt store (v2) - v2Store, err := MigrateFromV1(v1Store, db2, storeConfig) - require.NoError(t, err) - require.Equal(t, v2Store.LastCommitID(), v1Store.LastCommitID()) -} diff --git a/store/v2alpha1/multi/proof.go b/store/v2alpha1/multi/proof.go deleted file mode 100644 index 1e8b538c5373..000000000000 --- a/store/v2alpha1/multi/proof.go +++ /dev/null @@ -1,52 +0,0 @@ -package multi - -import ( - "crypto/sha256" - - "github.com/tendermint/tendermint/crypto/merkle" - tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" - - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -// DefaultProofRuntime returns a ProofRuntime supporting SMT and simple merkle proofs. -func DefaultProofRuntime() (prt *merkle.ProofRuntime) { - prt = merkle.NewProofRuntime() - prt.RegisterOpDecoder(types.ProofOpSMTCommitment, types.CommitmentOpDecoder) - prt.RegisterOpDecoder(types.ProofOpSimpleMerkleCommitment, types.CommitmentOpDecoder) - return prt -} - -// Prove commitment of key within an smt store and return ProofOps -func proveKey(s *smt.Store, key []byte) (*tmcrypto.ProofOps, error) { - var ret tmcrypto.ProofOps - keyProof, err := s.GetProofICS23(key) - if err != nil { - return nil, err - } - hkey := sha256.Sum256(key) - ret.Ops = append(ret.Ops, types.NewSmtCommitmentOp(hkey[:], keyProof).ProofOp()) - return &ret, nil -} - -// GetProof returns ProofOps containing: a proof for the given key within this substore; -// and a proof of the substore's existence within the MultiStore. -func (s *viewSubstore) GetProof(key []byte) (*tmcrypto.ProofOps, error) { - ret, err := proveKey(s.stateCommitmentStore, key) - if err != nil { - return nil, err - } - - // Prove commitment of substore within root store - storeHashes, err := s.root.getMerkleRoots() - if err != nil { - return nil, err - } - storeProof, err := types.ProofOpFromMap(storeHashes, s.name) - if err != nil { - return nil, err - } - ret.Ops = append(ret.Ops, storeProof) - return ret, nil -} diff --git a/store/v2alpha1/multi/proof_test.go b/store/v2alpha1/multi/proof_test.go deleted file mode 100644 index 86e9fbfd2ed0..000000000000 --- a/store/v2alpha1/multi/proof_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package multi - -import ( - "crypto/sha256" - "testing" - - "github.com/stretchr/testify/require" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/db/memdb" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -// We hash keys produce SMT paths, so reflect that here -func keyPath(prefix, key string) string { - hashed := sha256.Sum256([]byte(key)) - return prefix + string(hashed[:]) -} - -func TestVerifySMTStoreProof(t *testing.T) { - // Create main tree for testing. - txn := memdb.NewDB().ReadWriter() - store := smt.NewStore(txn) - store.Set([]byte("MYKEY"), []byte("MYVALUE")) - root := store.Root() - - res, err := proveKey(store, []byte("MYKEY")) - require.NoError(t, err) - - // Verify good proof. - prt := DefaultProofRuntime() - err = prt.VerifyValue(res, root, keyPath("/", "MYKEY"), []byte("MYVALUE")) - require.NoError(t, err) - - // Fail to verify bad proofs. - err = prt.VerifyValue(res, root, keyPath("/", "MYKEY_NOT"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res, root, keyPath("/", "MYKEY/MYKEY"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res, root, keyPath("", "MYKEY"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res, root, keyPath("/", "MYKEY"), []byte("MYVALUE_NOT")) - require.Error(t, err) - - err = prt.VerifyValue(res, root, keyPath("/", "MYKEY"), []byte(nil)) - require.Error(t, err) -} - -func TestVerifyMultiStoreQueryProof(t *testing.T) { - db := memdb.NewDB() - store, err := NewStore(db, simpleStoreConfig(t)) - require.NoError(t, err) - - substore := store.GetKVStore(skey_1) - substore.Set([]byte("MYKEY"), []byte("MYVALUE")) - cid := store.Commit() - - res := store.Query(abci.RequestQuery{ - Path: "/store1/key", // required path to get key/value+proof - Data: []byte("MYKEY"), - Prove: true, - }) - require.NotNil(t, res.ProofOps) - - // Verify good proofs. - prt := DefaultProofRuntime() - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYKEY"), []byte("MYVALUE")) - require.NoError(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYKEY"), []byte("MYVALUE")) - require.NoError(t, err) - - // Fail to verify bad proofs. - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYKEY_NOT"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/MYKEY/", "MYKEY"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("store1/", "MYKEY"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/", "MYKEY"), []byte("MYVALUE")) - require.Error(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYKEY"), []byte("MYVALUE_NOT")) - require.Error(t, err) - - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYKEY"), []byte(nil)) - require.Error(t, err) -} - -func TestVerifyMultiStoreQueryProofAbsence(t *testing.T) { - db := memdb.NewDB() - store, err := NewStore(db, simpleStoreConfig(t)) - require.NoError(t, err) - - substore := store.GetKVStore(skey_1) - substore.Set([]byte("MYKEY"), []byte("MYVALUE")) - cid := store.Commit() - - res := store.Query(abci.RequestQuery{ - Path: "/store1/key", // required path to get key/value+proof - Data: []byte("MYABSENTKEY"), - Prove: true, - }) - require.NotNil(t, res.ProofOps) - - // Verify good proof. - prt := DefaultProofRuntime() - err = prt.VerifyAbsence(res.ProofOps, cid.Hash, keyPath("/store1/", "MYABSENTKEY")) - require.NoError(t, err) - - // Fail to verify bad proofs. - prt = DefaultProofRuntime() - err = prt.VerifyAbsence(res.ProofOps, cid.Hash, keyPath("/", "MYABSENTKEY")) - require.Error(t, err) - - prt = DefaultProofRuntime() - err = prt.VerifyValue(res.ProofOps, cid.Hash, keyPath("/store1/", "MYABSENTKEY"), []byte("")) - require.Error(t, err) -} diff --git a/store/v2alpha1/multi/snapshot.go b/store/v2alpha1/multi/snapshot.go deleted file mode 100644 index 434c5e1c6fc5..000000000000 --- a/store/v2alpha1/multi/snapshot.go +++ /dev/null @@ -1,172 +0,0 @@ -package multi - -import ( - "bytes" - "fmt" - "io" - "sort" - - protoio "github.com/gogo/protobuf/io" - - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// Snapshot implements snapshottypes.Snapshotter. -func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { - if height == 0 { - return snapshottypes.ErrInvalidSnapshotVersion - } - if height > uint64(rs.LastCommitID().Version) { - return sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot snapshot future height %v", height) - } - - // get the saved snapshot at height - vs, err := rs.getView(int64(height)) - if err != nil { - return sdkerrors.Wrap(err, fmt.Sprintf("error while get the version at height %d", height)) - } - - // sending the snapshot store schema - var storeByteKeys [][]byte - for sKey := range vs.schema { - if vs.schema[sKey] == storetypes.StoreTypePersistent { - storeByteKeys = append(storeByteKeys, []byte(sKey)) - } - } - - sort.Slice(storeByteKeys, func(i, j int) bool { - return bytes.Compare(storeByteKeys[i], storeByteKeys[j]) == -1 - }) - - err = protoWriter.WriteMsg(&snapshottypes.SnapshotItem{ - Item: &snapshottypes.SnapshotItem_Schema{ - Schema: &snapshottypes.SnapshotSchema{ - Keys: storeByteKeys, - }, - }, - }) - if err != nil { - return err - } - - for _, sKey := range storeByteKeys { - subStore, err := vs.getSubstore(string(sKey)) - if err != nil { - return err - } - - err = protoWriter.WriteMsg(&snapshottypes.SnapshotItem{ - Item: &snapshottypes.SnapshotItem_Store{ - Store: &snapshottypes.SnapshotStoreItem{ - Name: string(sKey), - }, - }, - }) - if err != nil { - return err - } - - iter := subStore.Iterator(nil, nil) - for ; iter.Valid(); iter.Next() { - err = protoWriter.WriteMsg(&snapshottypes.SnapshotItem{ - Item: &snapshottypes.SnapshotItem_KV{ - KV: &snapshottypes.SnapshotKVItem{ - Key: iter.Key(), - Value: iter.Value(), - }, - }, - }) - if err != nil { - return err - } - } - - err = iter.Close() - if err != nil { - return err - } - } - - return nil -} - -// Restore implements snapshottypes.Snapshotter. -func (rs *Store) Restore( - height uint64, format uint32, protoReader protoio.Reader, -) (snapshottypes.SnapshotItem, error) { - if err := snapshots.ValidRestoreHeight(format, height); err != nil { - return snapshottypes.SnapshotItem{}, err - } - - if rs.LastCommitID().Version != 0 { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrLogic, "cannot restore snapshot for non empty store at height %v", height) - } - - var subStore *substore - storeSchemaReceived := false - - var snapshotItem snapshottypes.SnapshotItem - -loop: - for { - snapshotItem = snapshottypes.SnapshotItem{} - err := protoReader.ReadMsg(&snapshotItem) - if err == io.EOF { - break - } else if err != nil { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(err, "invalid protobuf message") - } - - switch item := snapshotItem.Item.(type) { - case *snapshottypes.SnapshotItem_Schema: - receivedStoreSchema := make(StoreSchema, len(item.Schema.GetKeys())) - storeSchemaReceived = true - for _, sKey := range item.Schema.GetKeys() { - receivedStoreSchema[string(sKey)] = types.StoreTypePersistent - } - - if !rs.schema.equal(receivedStoreSchema) { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(sdkerrors.ErrLogic, "received schema does not match app schema") - } - - case *snapshottypes.SnapshotItem_Store: - storeName := item.Store.GetName() - // checking the store schema is received or not - if !storeSchemaReceived { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrLogic, "received store name before store schema %s", storeName) - } - // checking the store schema exists or not - if _, has := rs.schema[storeName]; !has { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrLogic, "store is missing from schema %s", storeName) - } - - // get the substore - subStore, err = rs.getSubstore(storeName) - if err != nil { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(err, fmt.Sprintf("error while getting the substore for key %s", storeName)) - } - - case *snapshottypes.SnapshotItem_KV: - if subStore == nil { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(sdkerrors.ErrLogic, "received KV Item before store item") - } - // update the key/value SMT.Store - subStore.Set(item.KV.Key, item.KV.Value) - - default: - break loop - } - } - - // commit the all key/values to store - _, err := rs.commit(height) - if err != nil { - return snapshotItem, sdkerrors.Wrap(err, fmt.Sprintf("error during commit the store at height %d", height)) - } - - return snapshotItem, nil -} diff --git a/store/v2alpha1/multi/snapshot_test.go b/store/v2alpha1/multi/snapshot_test.go deleted file mode 100644 index 77637910e768..000000000000 --- a/store/v2alpha1/multi/snapshot_test.go +++ /dev/null @@ -1,317 +0,0 @@ -package multi - -import ( - "crypto/sha256" - "encoding/binary" - "encoding/hex" - "errors" - "fmt" - "io" - "math/rand" - "sort" - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/db/memdb" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - "github.com/cosmos/cosmos-sdk/snapshots" - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - "github.com/cosmos/cosmos-sdk/store/types" -) - -func multiStoreConfig(t *testing.T, stores int) StoreConfig { - opts := DefaultStoreConfig() - opts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - - for i := 0; i < stores; i++ { - sKey := types.NewKVStoreKey(fmt.Sprintf("store%d", i)) - require.NoError(t, opts.RegisterSubstore(sKey.Name(), types.StoreTypePersistent)) - } - - return opts -} - -func newMultiStoreWithGeneratedData(t *testing.T, db dbm.DBConnection, stores int, storeKeys uint64) *Store { - cfg := multiStoreConfig(t, stores) - store, err := NewStore(db, cfg) - require.NoError(t, err) - r := rand.New(rand.NewSource(49872768940)) // Fixed seed for deterministic tests - - var sKeys []string - for sKey := range store.schema { - sKeys = append(sKeys, sKey) - } - - sort.Slice(sKeys, func(i, j int) bool { - return strings.Compare(sKeys[i], sKeys[j]) == -1 - }) - - for _, sKey := range sKeys { - sStore, err := store.getSubstore(sKey) - require.NoError(t, err) - for i := uint64(0); i < storeKeys; i++ { - k := make([]byte, 8) - v := make([]byte, 1024) - binary.BigEndian.PutUint64(k, i) - _, err := r.Read(v) - if err != nil { - panic(err) - } - sStore.Set(k, v) - } - } - store.Commit() - return store -} - -func newMultiStoreWithBasicData(t *testing.T, db dbm.DBConnection, stores int) *Store { - cfg := multiStoreConfig(t, stores) - store, err := NewStore(db, cfg) - require.NoError(t, err) - - for sKey := range store.schema { - sStore, err := store.getSubstore(sKey) - require.NoError(t, err) - for k, v := range alohaData { - sStore.Set([]byte(k), []byte(v)) - } - } - - store.Commit() - return store -} - -func newMultiStore(t *testing.T, db dbm.DBConnection, stores int) *Store { - cfg := multiStoreConfig(t, stores) - store, err := NewStore(db, cfg) - require.NoError(t, err) - return store -} - -func TestMultistoreSnapshot_Errors(t *testing.T) { - store := newMultiStoreWithBasicData(t, memdb.NewDB(), 4) - testcases := map[string]struct { - height uint64 - expectType error - }{ - "0 height": {0, snapshottypes.ErrInvalidSnapshotVersion}, - "1 height": {1, nil}, - } - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - chunks := make(chan io.ReadCloser) - streamWriter := snapshots.NewStreamWriter(chunks) - err := store.Snapshot(tc.height, streamWriter) - if tc.expectType != nil { - assert.True(t, errors.Is(err, tc.expectType)) - } - }) - } -} - -func TestMultistoreRestore_Errors(t *testing.T) { - store := newMultiStoreWithBasicData(t, memdb.NewDB(), 4) - testcases := map[string]struct { - height uint64 - format uint32 - expectErrorType error - }{ - "0 height": {0, snapshottypes.CurrentFormat, nil}, - "0 format": {1, 0, snapshottypes.ErrUnknownFormat}, - "unknown format": {1, 9, snapshottypes.ErrUnknownFormat}, - } - for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { - _, err := store.Restore(tc.height, tc.format, nil) - require.Error(t, err) - if tc.expectErrorType != nil { - assert.True(t, errors.Is(err, tc.expectErrorType)) - } - }) - } -} - -func TestMultistoreSnapshot_Checksum(t *testing.T) { - store := newMultiStoreWithGeneratedData(t, memdb.NewDB(), 5, 10000) - version := uint64(store.LastCommitID().Version) - - testcases := []struct { - format uint32 - chunkHashes []string - }{ - {1, []string{ - "b0635a30d94d56b6cd1073fbfa109fa90b194d0ff2397659b00934c844a1f6fb", - "8c32e05f312cf2dee6b7d2bdb41e1a2bb2372697f25504e676af1718245d8b63", - "05dfef0e32c34ef3900300f9de51f228d7fb204fa8f4e4d0d1529f083d122029", - "77d30aeeb427b0bdcedf3639adde1e822c15233d652782e171125280875aa492", - "c00c3801da889ea4370f0e647ffe1e291bd47f500e2a7269611eb4cc198b993f", - "6d565eb28776631f3e3e764decd53436c3be073a8a01fa5434afd539f9ae6eda", - }}, - } - for _, tc := range testcases { - tc := tc - t.Run(fmt.Sprintf("Format %v", tc.format), func(t *testing.T) { - chunks := make(chan io.ReadCloser, 100) - hashes := []string{} - go func() { - streamWriter := snapshots.NewStreamWriter(chunks) - defer streamWriter.Close() - require.NotNil(t, streamWriter) - err := store.Snapshot(version, streamWriter) - require.NoError(t, err) - }() - hasher := sha256.New() - for chunk := range chunks { - hasher.Reset() - _, err := io.Copy(hasher, chunk) - require.NoError(t, err) - hashes = append(hashes, hex.EncodeToString(hasher.Sum(nil))) - } - assert.Equal(t, tc.chunkHashes, hashes, "Snapshot output for format %v has changed", tc.format) - }) - } -} - -func TestMultistoreSnapshotRestore(t *testing.T) { - source := newMultiStoreWithGeneratedData(t, memdb.NewDB(), 3, 4) - target := newMultiStore(t, memdb.NewDB(), 3) - require.Equal(t, source.LastCommitID().Version, int64(1)) - version := uint64(source.LastCommitID().Version) - // check for target store restore - require.Equal(t, target.LastCommitID().Version, int64(0)) - - dummyExtensionItem := snapshottypes.SnapshotItem{ - Item: &snapshottypes.SnapshotItem_Extension{ - Extension: &snapshottypes.SnapshotExtensionMeta{ - Name: "test", - Format: 1, - }, - }, - } - - chunks := make(chan io.ReadCloser, 100) - go func() { - streamWriter := snapshots.NewStreamWriter(chunks) - require.NotNil(t, streamWriter) - defer streamWriter.Close() - err := source.Snapshot(version, streamWriter) - require.NoError(t, err) - // write an extension metadata - err = streamWriter.WriteMsg(&dummyExtensionItem) - require.NoError(t, err) - }() - - streamReader, err := snapshots.NewStreamReader(chunks) - require.NoError(t, err) - nextItem, err := target.Restore(version, snapshottypes.CurrentFormat, streamReader) - require.NoError(t, err) - require.Equal(t, *dummyExtensionItem.GetExtension(), *nextItem.GetExtension()) - - assert.Equal(t, source.LastCommitID(), target.LastCommitID()) - - for sKey := range source.schema { - sourceSubStore, err := source.getSubstore(sKey) - require.NoError(t, err) - targetSubStore, err := target.getSubstore(sKey) - require.NoError(t, err) - require.Equal(t, sourceSubStore, targetSubStore) - } - - // checking snapshot restoring for store with existed schema and without existing versions - target3 := newMultiStore(t, memdb.NewDB(), 4) - chunks3 := make(chan io.ReadCloser, 100) - go func() { - streamWriter3 := snapshots.NewStreamWriter(chunks3) - require.NotNil(t, streamWriter3) - defer streamWriter3.Close() - err := source.Snapshot(version, streamWriter3) - require.NoError(t, err) - }() - streamReader3, err := snapshots.NewStreamReader(chunks3) - require.NoError(t, err) - _, err = target3.Restore(version, snapshottypes.CurrentFormat, streamReader3) - require.Error(t, err) -} - -func BenchmarkMultistoreSnapshot100K(b *testing.B) { - benchmarkMultistoreSnapshot(b, 10, 10000) -} - -func BenchmarkMultistoreSnapshot1M(b *testing.B) { - benchmarkMultistoreSnapshot(b, 10, 100000) -} - -func BenchmarkMultistoreSnapshotRestore100K(b *testing.B) { - benchmarkMultistoreSnapshotRestore(b, 10, 10000) -} - -func BenchmarkMultistoreSnapshotRestore1M(b *testing.B) { - benchmarkMultistoreSnapshotRestore(b, 10, 100000) -} - -func benchmarkMultistoreSnapshot(b *testing.B, stores int, storeKeys uint64) { - b.Skip("Noisy with slow setup time, please see https://github.com/cosmos/cosmos-sdk/issues/8855.") - - b.ReportAllocs() - b.StopTimer() - source := newMultiStoreWithGeneratedData(nil, memdb.NewDB(), stores, storeKeys) - - version := source.LastCommitID().Version - require.EqualValues(b, 1, version) - b.StartTimer() - - for i := 0; i < b.N; i++ { - target := newMultiStore(nil, memdb.NewDB(), stores) - require.EqualValues(b, 0, target.LastCommitID().Version) - - chunks := make(chan io.ReadCloser) - go func() { - streamWriter := snapshots.NewStreamWriter(chunks) - require.NotNil(b, streamWriter) - err := source.Snapshot(uint64(version), streamWriter) - require.NoError(b, err) - }() - for reader := range chunks { - _, err := io.Copy(io.Discard, reader) - require.NoError(b, err) - err = reader.Close() - require.NoError(b, err) - } - } -} - -func benchmarkMultistoreSnapshotRestore(b *testing.B, stores int, storeKeys uint64) { - b.Skip("Noisy with slow setup time, please see https://github.com/cosmos/cosmos-sdk/issues/8855.") - - b.ReportAllocs() - b.StopTimer() - source := newMultiStoreWithGeneratedData(nil, memdb.NewDB(), stores, storeKeys) - version := uint64(source.LastCommitID().Version) - require.EqualValues(b, 1, version) - b.StartTimer() - - for i := 0; i < b.N; i++ { - target := newMultiStore(nil, memdb.NewDB(), stores) - require.EqualValues(b, 0, target.LastCommitID().Version) - - chunks := make(chan io.ReadCloser) - go func() { - writer := snapshots.NewStreamWriter(chunks) - require.NotNil(b, writer) - err := source.Snapshot(version, writer) - require.NoError(b, err) - }() - - reader, err := snapshots.NewStreamReader(chunks) - require.NoError(b, err) - _, err = target.Restore(version, snapshottypes.CurrentFormat, reader) - require.NoError(b, err) - require.Equal(b, source.LastCommitID(), target.LastCommitID()) - } -} diff --git a/store/v2alpha1/multi/store.go b/store/v2alpha1/multi/store.go deleted file mode 100644 index 4916adea6c81..000000000000 --- a/store/v2alpha1/multi/store.go +++ /dev/null @@ -1,915 +0,0 @@ -package multi - -import ( - "errors" - "fmt" - "io" - "math" - "strings" - "sync" - - abci "github.com/tendermint/tendermint/abci/types" - - dbm "github.com/cosmos/cosmos-sdk/db" - prefixdb "github.com/cosmos/cosmos-sdk/db/prefix" - util "github.com/cosmos/cosmos-sdk/internal" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - sdkmaps "github.com/cosmos/cosmos-sdk/store/internal/maps" - "github.com/cosmos/cosmos-sdk/store/listenkv" - "github.com/cosmos/cosmos-sdk/store/prefix" - "github.com/cosmos/cosmos-sdk/store/tracekv" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/mem" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/transient" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/cosmos/cosmos-sdk/types/kv" -) - -var ( - _ types.Queryable = (*Store)(nil) - _ types.CommitMultiStore = (*Store)(nil) - _ types.CacheMultiStore = (*cacheStore)(nil) - _ types.BasicMultiStore = (*viewStore)(nil) - _ types.KVStore = (*substore)(nil) -) - -var ( - // Root prefixes - merkleRootKey = []byte{0} // Key for root hash of namespace tree - schemaPrefix = []byte{1} // Prefix for store keys (namespaces) - contentPrefix = []byte{2} // Prefix for store contents - - // Per-substore prefixes - substoreMerkleRootKey = []byte{0} // Key for root hashes of Merkle trees - dataPrefix = []byte{1} // Prefix for state mappings - indexPrefix = []byte{2} // Prefix for Store reverse index - smtPrefix = []byte{3} // Prefix for SMT data - - ErrVersionDoesNotExist = errors.New("version does not exist") - ErrMaximumHeight = errors.New("maximum block height reached") -) - -func ErrStoreNotFound(skey string) error { - return fmt.Errorf("store does not exist for key: %s", skey) -} - -// StoreConfig is used to define a schema and other options and pass them to the MultiStore constructor. -type StoreConfig struct { - // Version pruning options for backing DBs. - Pruning pruningtypes.PruningOptions - // The minimum allowed version number. - InitialVersion uint64 - // The backing DB to use for the state commitment Merkle tree data. - // If nil, Merkle data is stored in the state storage DB under a separate prefix. - StateCommitmentDB dbm.DBConnection - - prefixRegistry - PersistentCache types.MultiStorePersistentCache - Upgrades []types.StoreUpgrades - - *traceListenMixin -} - -// StoreSchema defineds a mapping of substore keys to store types -type StoreSchema map[string]types.StoreType - -// Store is the main persistent store type implementing CommitMultiStore. -// Substores consist of an SMT-based state commitment store and state storage. -// Substores must be reserved in the StoreConfig or defined as part of a StoreUpgrade in order to be valid. -// Note: -// The state commitment data and proof are structured in the same basic pattern as the MultiStore, but use an SMT rather than IAVL tree: -// * The state commitment store of each substore consists of a independent SMT. -// * The state commitment of the root store consists of a Merkle map of all registered persistent substore names to the root hash of their corresponding SMTs -type Store struct { - stateDB dbm.DBConnection - stateTxn dbm.DBReadWriter - StateCommitmentDB dbm.DBConnection - stateCommitmentTxn dbm.DBReadWriter - - schema StoreSchema - mem *mem.Store - tran *transient.Store - mtx sync.RWMutex - - // Copied from StoreConfig - Pruning pruningtypes.PruningOptions - InitialVersion uint64 // if - *traceListenMixin - - PersistentCache types.MultiStorePersistentCache - substoreCache map[string]*substore -} - -type substore struct { - root *Store - name string - dataBucket dbm.DBReadWriter - indexBucket dbm.DBReadWriter - stateCommitmentStore *smt.Store -} - -// Branched state -type cacheStore struct { - source types.BasicMultiStore - substores map[string]types.CacheKVStore - *traceListenMixin -} - -// Read-only store for querying past versions -type viewStore struct { - stateView dbm.DBReader - stateCommitmentView dbm.DBReader - substoreCache map[string]*viewSubstore - schema StoreSchema -} - -type viewSubstore struct { - root *viewStore - name string - dataBucket dbm.DBReader - indexBucket dbm.DBReader - stateCommitmentStore *smt.Store -} - -// Builder type used to create a valid schema with no prefix conflicts -type prefixRegistry struct { - StoreSchema - reserved []string -} - -// Mixin type that to compose trace & listen state into each root store variant type -type traceListenMixin struct { - listeners map[string][]types.WriteListener - TraceWriter io.Writer - TraceContext types.TraceContext -} - -func newTraceListenMixin() *traceListenMixin { - return &traceListenMixin{listeners: map[string][]types.WriteListener{}} -} - -// DefaultStoreConfig returns a MultiStore config with an empty schema, a single backing DB, -// pruning with PruneDefault, no listeners and no tracer. -func DefaultStoreConfig() StoreConfig { - return StoreConfig{ - Pruning: pruningtypes.NewPruningOptions(pruningtypes.PruningDefault), - prefixRegistry: prefixRegistry{ - StoreSchema: StoreSchema{}, - }, - traceListenMixin: newTraceListenMixin(), - } -} - -// Returns true for valid store types for a MultiStore schema -func validSubStoreType(sst types.StoreType) bool { - switch sst { - case types.StoreTypePersistent: - return true - case types.StoreTypeMemory: - return true - case types.StoreTypeTransient: - return true - default: - return false - } -} - -// Returns true iff both schema maps match exactly (including mem/tran stores) -func (ss StoreSchema) equal(that StoreSchema) bool { - if len(ss) != len(that) { - return false - } - for key, val := range that { - myval, has := ss[key] - if !has { - return false - } - if val != myval { - return false - } - } - return true -} - -// Parses a schema from the DB -func readSavedSchema(bucket dbm.DBReader) (*prefixRegistry, error) { - ret := prefixRegistry{StoreSchema: StoreSchema{}} - it, err := bucket.Iterator(nil, nil) - if err != nil { - return nil, err - } - for it.Next() { - value := it.Value() - if len(value) != 1 || !validSubStoreType(types.StoreType(value[0])) { - return nil, fmt.Errorf("invalid mapping for store key: %v => %v", it.Key(), value) - } - ret.StoreSchema[string(it.Key())] = types.StoreType(value[0]) - ret.reserved = append(ret.reserved, string(it.Key())) // assume iter yields keys sorted - } - if err = it.Close(); err != nil { - return nil, err - } - return &ret, nil -} - -// NewStore constructs a MultiStore directly from a database. -// Creates a new store if no data exists; otherwise loads existing data. -func NewStore(db dbm.DBConnection, opts StoreConfig) (ret *Store, err error) { - versions, err := db.Versions() - if err != nil { - return - } - // If the DB is not empty, attempt to load existing data - if saved := versions.Count(); saved != 0 { - if opts.InitialVersion != 0 && versions.Last() < opts.InitialVersion { - return nil, fmt.Errorf("latest saved version is less than initial version: %v < %v", - versions.Last(), opts.InitialVersion) - } - } - // To abide by atomicity constraints, revert the DB to the last saved version, in case it contains - // committed data in the "working" version. - // This should only happen if Store.Commit previously failed. - err = db.Revert() - if err != nil { - return - } - stateTxn := db.ReadWriter() - defer func() { - if err != nil { - err = util.CombineErrors(err, stateTxn.Discard(), "stateTxn.Discard also failed") - } - }() - stateCommitmentTxn := stateTxn - if opts.StateCommitmentDB != nil { - var scVersions dbm.VersionSet - scVersions, err = opts.StateCommitmentDB.Versions() - if err != nil { - return - } - // Version sets of each DB must match - if !versions.Equal(scVersions) { - err = fmt.Errorf("different version history between Storage and StateCommitment DB ") - return - } - err = opts.StateCommitmentDB.Revert() - if err != nil { - return - } - stateCommitmentTxn = opts.StateCommitmentDB.ReadWriter() - } - - ret = &Store{ - stateDB: db, - stateTxn: stateTxn, - StateCommitmentDB: opts.StateCommitmentDB, - stateCommitmentTxn: stateCommitmentTxn, - mem: mem.NewStore(), - tran: transient.NewStore(), - - substoreCache: map[string]*substore{}, - - traceListenMixin: opts.traceListenMixin, - PersistentCache: opts.PersistentCache, - - Pruning: opts.Pruning, - InitialVersion: opts.InitialVersion, - } - - // Now load the substore schema - schemaView := prefixdb.NewPrefixReader(ret.stateDB.Reader(), schemaPrefix) - defer func() { - if err != nil { - err = util.CombineErrors(err, schemaView.Discard(), "schemaView.Discard also failed") - err = util.CombineErrors(err, ret.Close(), "base.Close also failed") - } - }() - reg, err := readSavedSchema(schemaView) - if err != nil { - return - } - // If the loaded schema is empty (for new store), just copy the config schema; - // Otherwise, verify it is identical to the config schema - if len(reg.StoreSchema) == 0 { - for k, v := range opts.StoreSchema { - reg.StoreSchema[k] = v - } - reg.reserved = make([]string, len(opts.reserved)) - copy(reg.reserved, opts.reserved) - } else if !reg.equal(opts.StoreSchema) { - - err = errors.New("loaded schema does not match configured schema") - return - - } - // Apply migrations, then clear old schema and write the new one - for _, upgrades := range opts.Upgrades { - err = reg.migrate(ret, upgrades) - if err != nil { - return - } - } - schemaWriter := prefixdb.NewPrefixWriter(ret.stateTxn, schemaPrefix) - it, err := schemaView.Iterator(nil, nil) - if err != nil { - return - } - for it.Next() { - err = schemaWriter.Delete(it.Key()) - if err != nil { - return - } - } - err = it.Close() - if err != nil { - return - } - err = schemaView.Discard() - if err != nil { - return - } - // NB. the migrated contents and schema are not committed until the next store.Commit - for skey, typ := range reg.StoreSchema { - err = schemaWriter.Set([]byte(skey), []byte{byte(typ)}) - if err != nil { - return - } - } - ret.schema = reg.StoreSchema - return ret, nil -} - -func (s *Store) Close() error { - err := s.stateTxn.Discard() - if s.StateCommitmentDB != nil { - err = util.CombineErrors(err, s.stateCommitmentTxn.Discard(), "stateCommitmentTxn.Discard also failed") - } - return err -} - -// Applies store upgrades to the DB contents. -func (pr *prefixRegistry) migrate(store *Store, upgrades types.StoreUpgrades) error { - // Get a view of current state to allow mutation while iterating - reader := store.stateDB.Reader() - scReader := reader - if store.StateCommitmentDB != nil { - scReader = store.StateCommitmentDB.Reader() - } - - for _, key := range upgrades.Deleted { - sst, ix, err := pr.storeInfo(key) - if err != nil { - return err - } - if sst != types.StoreTypePersistent { - return fmt.Errorf("prefix is for non-persistent substore: %v (%v)", key, sst) - } - pr.reserved = append(pr.reserved[:ix], pr.reserved[ix+1:]...) - delete(pr.StoreSchema, key) - - pfx := substorePrefix(key) - subReader := prefixdb.NewPrefixReader(reader, pfx) - it, err := subReader.Iterator(nil, nil) - if err != nil { - return err - } - for it.Next() { - store.stateTxn.Delete(it.Key()) - } - it.Close() - if store.StateCommitmentDB != nil { - subReader = prefixdb.NewPrefixReader(scReader, pfx) - it, err = subReader.Iterator(nil, nil) - if err != nil { - return err - } - for it.Next() { - store.stateCommitmentTxn.Delete(it.Key()) - } - it.Close() - } - } - for _, rename := range upgrades.Renamed { - sst, ix, err := pr.storeInfo(rename.OldKey) - if err != nil { - return err - } - if sst != types.StoreTypePersistent { - return fmt.Errorf("prefix is for non-persistent substore: %v (%v)", rename.OldKey, sst) - } - pr.reserved = append(pr.reserved[:ix], pr.reserved[ix+1:]...) - delete(pr.StoreSchema, rename.OldKey) - err = pr.RegisterSubstore(rename.NewKey, types.StoreTypePersistent) - if err != nil { - return err - } - - oldPrefix := substorePrefix(rename.OldKey) - newPrefix := substorePrefix(rename.NewKey) - subReader := prefixdb.NewPrefixReader(reader, oldPrefix) - subWriter := prefixdb.NewPrefixWriter(store.stateTxn, newPrefix) - it, err := subReader.Iterator(nil, nil) - if err != nil { - return err - } - for it.Next() { - subWriter.Set(it.Key(), it.Value()) - } - it.Close() - if store.StateCommitmentDB != nil { - subReader = prefixdb.NewPrefixReader(scReader, oldPrefix) - subWriter = prefixdb.NewPrefixWriter(store.stateCommitmentTxn, newPrefix) - it, err = subReader.Iterator(nil, nil) - if err != nil { - return err - } - for it.Next() { - subWriter.Set(it.Key(), it.Value()) - } - it.Close() - } - } - - for _, key := range upgrades.Added { - err := pr.RegisterSubstore(key, types.StoreTypePersistent) - if err != nil { - return err - } - } - return nil -} - -func substorePrefix(key string) []byte { - return append(contentPrefix, key...) -} - -// GetKVStore implements BasicMultiStore. -func (rs *Store) GetKVStore(skey types.StoreKey) types.KVStore { - key := skey.Name() - var parent types.KVStore - typ, has := rs.schema[key] - if !has { - panic(ErrStoreNotFound(key)) - } - switch typ { - case types.StoreTypeMemory: - parent = rs.mem - case types.StoreTypeTransient: - parent = rs.tran - case types.StoreTypePersistent: - default: - panic(fmt.Errorf("StoreType not supported: %v", typ)) // should never happen - } - var ret types.KVStore - if parent != nil { // store is non-persistent - ret = prefix.NewStore(parent, []byte(key)) - } else { // store is persistent - sub, err := rs.getSubstore(key) - if err != nil { - panic(err) - } - rs.substoreCache[key] = sub - ret = sub - } - // Wrap with trace/listen if needed. Note: we don't cache this, so users must get a new substore after - // modifying tracers/listeners. - return rs.wrapTraceListen(ret, skey) -} - -// Gets a persistent substore. This reads, but does not update the substore cache. -// Use it in cases where we need to access a store internally (e.g. read/write Merkle keys, queries) -func (rs *Store) getSubstore(key string) (*substore, error) { - if cached, has := rs.substoreCache[key]; has { - return cached, nil - } - pfx := substorePrefix(key) - stateRW := prefixdb.NewPrefixReadWriter(rs.stateTxn, pfx) - stateCommitmentRW := prefixdb.NewPrefixReadWriter(rs.stateCommitmentTxn, pfx) - var stateCommitmentStore *smt.Store - - rootHash, err := stateRW.Get(substoreMerkleRootKey) - if err != nil { - return nil, err - } - if rootHash != nil { - stateCommitmentStore = loadSMT(stateCommitmentRW, rootHash) - } else { - smtdb := prefixdb.NewPrefixReadWriter(stateCommitmentRW, smtPrefix) - stateCommitmentStore = smt.NewStore(smtdb) - } - - return &substore{ - root: rs, - name: key, - dataBucket: prefixdb.NewPrefixReadWriter(stateRW, dataPrefix), - indexBucket: prefixdb.NewPrefixReadWriter(stateRW, indexPrefix), - stateCommitmentStore: stateCommitmentStore, - }, nil -} - -// Resets a substore's state after commit (because root stateTxn has been discarded) -func (s *substore) refresh(rootHash []byte) { - pfx := substorePrefix(s.name) - stateRW := prefixdb.NewPrefixReadWriter(s.root.stateTxn, pfx) - stateCommitmentRW := prefixdb.NewPrefixReadWriter(s.root.stateCommitmentTxn, pfx) - s.dataBucket = prefixdb.NewPrefixReadWriter(stateRW, dataPrefix) - s.indexBucket = prefixdb.NewPrefixReadWriter(stateRW, indexPrefix) - s.stateCommitmentStore = loadSMT(stateCommitmentRW, rootHash) -} - -// Commit implements Committer. -func (s *Store) Commit() types.CommitID { - // Substores read-lock this mutex; lock to prevent racey invalidation of underlying txns - s.mtx.Lock() - defer s.mtx.Unlock() - // Determine the target version - versions, err := s.stateDB.Versions() - if err != nil { - panic(err) - } - target := versions.Last() + 1 - if target > math.MaxInt64 { - panic(ErrMaximumHeight) - } - // Fast forward to initial version if needed - if s.InitialVersion != 0 && target < s.InitialVersion { - target = s.InitialVersion - } - cid, err := s.commit(target) - if err != nil { - panic(err) - } - - // Prune if necessary - previous := cid.Version - 1 - if s.Pruning.Interval != 0 && cid.Version%int64(s.Pruning.Interval) == 0 { - // The range of newly prunable versions - lastPrunable := previous - int64(s.Pruning.KeepRecent) - firstPrunable := lastPrunable - int64(s.Pruning.Interval) - - for version := firstPrunable; version <= lastPrunable; version++ { - s.stateDB.DeleteVersion(uint64(version)) - - if s.StateCommitmentDB != nil { - s.StateCommitmentDB.DeleteVersion(uint64(version)) - } - } - } - - s.tran.Commit() - return *cid -} - -func (s *Store) getMerkleRoots() (ret map[string][]byte, err error) { - ret = map[string][]byte{} - for key := range s.schema { - sub, has := s.substoreCache[key] - if !has { - sub, err = s.getSubstore(key) - if err != nil { - return - } - } - ret[key] = sub.stateCommitmentStore.Root() - } - return -} - -// Calculates root hashes and commits to DB. Does not verify target version or perform pruning. -func (s *Store) commit(target uint64) (id *types.CommitID, err error) { - storeHashes, err := s.getMerkleRoots() - if err != nil { - return - } - // Update substore Merkle roots - for key, storeHash := range storeHashes { - pfx := substorePrefix(key) - stateW := prefixdb.NewPrefixReadWriter(s.stateTxn, pfx) - if err = stateW.Set(substoreMerkleRootKey, storeHash); err != nil { - return - } - } - rootHash := sdkmaps.HashFromMap(storeHashes) - if err = s.stateTxn.Set(merkleRootKey, rootHash); err != nil { - return - } - if err = s.stateTxn.Commit(); err != nil { - return - } - defer func() { - if err != nil { - err = util.CombineErrors(err, s.stateDB.Revert(), "stateDB.Revert also failed") - } - }() - err = s.stateDB.SaveVersion(target) - if err != nil { - return - } - - stateTxn := s.stateDB.ReadWriter() - defer func() { - if err != nil { - err = util.CombineErrors(err, stateTxn.Discard(), "stateTxn.Discard also failed") - } - }() - stateCommitmentTxn := stateTxn - - // If DBs are not separate, StateCommitment state has been committed & snapshotted - if s.StateCommitmentDB != nil { - // if any error is encountered henceforth, we must revert the state and SC dbs - defer func() { - if err != nil { - if delerr := s.stateDB.DeleteVersion(target); delerr != nil { - err = fmt.Errorf("%w: commit rollback failed: %v", err, delerr) - } - } - }() - - err = s.stateCommitmentTxn.Commit() - if err != nil { - return - } - defer func() { - if err != nil { - err = util.CombineErrors(err, s.StateCommitmentDB.Revert(), "stateCommitmentDB.Revert also failed") - } - }() - - err = s.StateCommitmentDB.SaveVersion(target) - if err != nil { - return - } - stateCommitmentTxn = s.StateCommitmentDB.ReadWriter() - } - - s.stateTxn = stateTxn - s.stateCommitmentTxn = stateCommitmentTxn - // the state of all live substores must be refreshed - for key, sub := range s.substoreCache { - sub.refresh(storeHashes[key]) - } - - return &types.CommitID{Version: int64(target), Hash: rootHash}, nil -} - -// LastCommitID implements Committer. -func (s *Store) LastCommitID() types.CommitID { - versions, err := s.stateDB.Versions() - if err != nil { - panic(err) - } - last := versions.Last() - if last == 0 { - return types.CommitID{} - } - // Latest Merkle root is the one currently stored - hash, err := s.stateTxn.Get(merkleRootKey) - if err != nil { - panic(err) - } - return types.CommitID{Version: int64(last), Hash: hash} -} - -// SetInitialVersion implements CommitMultiStore. -func (rs *Store) SetInitialVersion(version uint64) error { - rs.InitialVersion = version - return nil -} - -// GetVersion implements CommitMultiStore. -func (rs *Store) GetVersion(version int64) (types.BasicMultiStore, error) { - return rs.getView(version) -} - -// CacheMultiStore implements BasicMultiStore. -func (rs *Store) CacheMultiStore() types.CacheMultiStore { - return &cacheStore{ - source: rs, - substores: map[string]types.CacheKVStore{}, - traceListenMixin: newTraceListenMixin(), - } -} - -// PruneSnapshotHeight prunes the given height according to the prune strategy. -// If PruneNothing, this is a no-op. -// If other strategy, this height is persisted until it is -// less than - KeepRecent and % Interval == 0 -func (rs *Store) PruneSnapshotHeight(height int64) { - panic("not implemented") -} - -// SetSnapshotInterval sets the interval at which the snapshots are taken. -// It is used by the store to determine which heights to retain until after the snapshot is complete. -func (rs *Store) SetSnapshotInterval(snapshotInterval uint64) { - panic("not implemented") -} - -// parsePath expects a format like /[/] -// Must start with /, subpath may be empty -// Returns error if it doesn't start with / -func parsePath(path string) (storeName string, subpath string, err error) { - if !strings.HasPrefix(path, "/") { - return storeName, subpath, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid path: %s", path) - } - - paths := strings.SplitN(path[1:], "/", 2) - storeName = paths[0] - - if len(paths) == 2 { - subpath = "/" + paths[1] - } - - return storeName, subpath, nil -} - -// Query implements ABCI interface, allows queries. -// -// by default we will return from (latest height -1), -// as we will have merkle proofs immediately (header height = data height + 1) -// If latest-1 is not present, use latest (which must be present) -// if you care to have the latest data to see a tx results, you must -// explicitly set the height you want to see -func (rs *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { - if len(req.Data) == 0 { - return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrTxDecode, "query cannot be zero length"), false) - } - - // if height is 0, use the latest height - height := req.Height - if height == 0 { - versions, err := rs.stateDB.Versions() - if err != nil { - return sdkerrors.QueryResult(errors.New("failed to get version info"), false) - } - latest := versions.Last() - if versions.Exists(latest - 1) { - height = int64(latest - 1) - } else { - height = int64(latest) - } - } - if height < 0 { - return sdkerrors.QueryResult(fmt.Errorf("height overflow: %v", height), false) - } - res.Height = height - - storeName, subpath, err := parsePath(req.Path) - if err != nil { - return sdkerrors.QueryResult(sdkerrors.Wrapf(err, "failed to parse path"), false) - } - view, err := rs.getView(height) - if err != nil { - if errors.Is(err, dbm.ErrVersionDoesNotExist) { - err = sdkerrors.ErrInvalidHeight - } - return sdkerrors.QueryResult(sdkerrors.Wrapf(err, "failed to access height"), false) - } - - if _, has := rs.schema[storeName]; !has { - return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "no such store: %s", storeName), false) - } - substore, err := view.getSubstore(storeName) - if err != nil { - return sdkerrors.QueryResult(sdkerrors.Wrapf(err, "failed to access store: %s", storeName), false) - } - - switch subpath { - case "/key": - var err error - res.Key = req.Data // data holds the key bytes - res.Value = substore.Get(res.Key) - if !req.Prove { - break - } - // TODO: actual IBC compatible proof. This is a placeholder so unit tests can pass - res.ProofOps, err = substore.GetProof(res.Key) - if err != nil { - return sdkerrors.QueryResult(fmt.Errorf("merkle proof creation failed for key: %v", res.Key), false) - } - - case "/subspace": - res.Key = req.Data // data holds the subspace prefix - - pairs := kv.Pairs{ - Pairs: make([]kv.Pair, 0), - } - - res.Key = req.Data // data holds the subspace prefix - - iterator := substore.Iterator(res.Key, types.PrefixEndBytes(res.Key)) - for ; iterator.Valid(); iterator.Next() { - pairs.Pairs = append(pairs.Pairs, kv.Pair{Key: iterator.Key(), Value: iterator.Value()}) - } - iterator.Close() - - bz, err := pairs.Marshal() - if err != nil { - panic(fmt.Errorf("failed to marshal KV pairs: %w", err)) - } - - res.Value = bz - - default: - return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path), false) - } - - return res -} - -func loadSMT(stateCommitmentTxn dbm.DBReadWriter, root []byte) *smt.Store { - smtdb := prefixdb.NewPrefixReadWriter(stateCommitmentTxn, smtPrefix) - return smt.LoadStore(smtdb, root) -} - -// Returns closest index and whether it's a match -func binarySearch(hay []string, ndl string) (int, bool) { - var mid int - from, to := 0, len(hay)-1 - for from <= to { - mid = (from + to) / 2 - switch strings.Compare(hay[mid], ndl) { - case -1: - from = mid + 1 - case 1: - to = mid - 1 - default: - return mid, true - } - } - return from, false -} - -func (pr *prefixRegistry) storeInfo(key string) (sst types.StoreType, ix int, err error) { - ix, has := binarySearch(pr.reserved, key) - if !has { - err = fmt.Errorf("prefix does not exist: %v", key) - return - } - sst, has = pr.StoreSchema[key] - if !has { - err = fmt.Errorf("prefix is registered but not in schema: %v", key) - } - - return -} - -func (pr *prefixRegistry) RegisterSubstore(key string, typ types.StoreType) error { - if !validSubStoreType(typ) { - return fmt.Errorf("StoreType not supported: %v", typ) - } - - // Find the neighboring reserved prefix, and check for duplicates and conflicts - i, has := binarySearch(pr.reserved, key) - if has { - return fmt.Errorf("prefix already exists: %v", key) - } - if i > 0 && strings.HasPrefix(key, pr.reserved[i-1]) { - return fmt.Errorf("prefix conflict: '%v' exists, cannot add '%v'", pr.reserved[i-1], key) - } - if i < len(pr.reserved) && strings.HasPrefix(pr.reserved[i], key) { - return fmt.Errorf("prefix conflict: '%v' exists, cannot add '%v'", pr.reserved[i], key) - } - reserved := pr.reserved[:i] - reserved = append(reserved, key) - pr.reserved = append(reserved, pr.reserved[i:]...) - pr.StoreSchema[key] = typ - return nil -} - -func (tlm *traceListenMixin) AddListeners(skey types.StoreKey, listeners []types.WriteListener) { - key := skey.Name() - tlm.listeners[key] = append(tlm.listeners[key], listeners...) -} - -// ListeningEnabled returns if listening is enabled for a specific KVStore -func (tlm *traceListenMixin) ListeningEnabled(key types.StoreKey) bool { - if ls, has := tlm.listeners[key.Name()]; has { - return len(ls) != 0 - } - return false -} - -func (tlm *traceListenMixin) TracingEnabled() bool { - return tlm.TraceWriter != nil -} - -func (tlm *traceListenMixin) SetTracer(w io.Writer) { - tlm.TraceWriter = w -} - -func (tlm *traceListenMixin) SetTraceContext(tc types.TraceContext) { - tlm.TraceContext = tc -} - -func (tlm *traceListenMixin) wrapTraceListen(store types.KVStore, skey types.StoreKey) types.KVStore { - if tlm.TracingEnabled() { - store = tracekv.NewStore(store, tlm.TraceWriter, tlm.TraceContext) - } - if tlm.ListeningEnabled(skey) { - store = listenkv.NewStore(store, skey, tlm.listeners[skey.Name()]) - } - return store -} - -func (s *Store) GetPruning() pruningtypes.PruningOptions { return s.Pruning } -func (s *Store) SetPruning(po pruningtypes.PruningOptions) { s.Pruning = po } diff --git a/store/v2alpha1/multi/store_test.go b/store/v2alpha1/multi/store_test.go deleted file mode 100644 index de09003518d0..000000000000 --- a/store/v2alpha1/multi/store_test.go +++ /dev/null @@ -1,986 +0,0 @@ -package multi - -import ( - "bytes" - "math" - "testing" - - "github.com/stretchr/testify/require" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/cosmos/cosmos-sdk/codec" - codecTypes "github.com/cosmos/cosmos-sdk/codec/types" - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/db/memdb" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/types/kv" -) - -var ( - alohaData = map[string]string{ - "hello": "goodbye", - "aloha": "shalom", - } - skey_1 = types.NewKVStoreKey("store1") - skey_2 = types.NewKVStoreKey("store2") - skey_3 = types.NewKVStoreKey("store3") - skey_4 = types.NewKVStoreKey("store4") - skey_1b = types.NewKVStoreKey("store1b") - skey_2b = types.NewKVStoreKey("store2b") - skey_3b = types.NewKVStoreKey("store3b") -) - -func simpleStoreConfig(t *testing.T) StoreConfig { - opts := DefaultStoreConfig() - require.NoError(t, opts.RegisterSubstore(skey_1.Name(), types.StoreTypePersistent)) - return opts -} - -func storeConfig123(t *testing.T) StoreConfig { - opts := DefaultStoreConfig() - opts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - require.NoError(t, opts.RegisterSubstore(skey_1.Name(), types.StoreTypePersistent)) - require.NoError(t, opts.RegisterSubstore(skey_2.Name(), types.StoreTypePersistent)) - require.NoError(t, opts.RegisterSubstore(skey_3.Name(), types.StoreTypePersistent)) - return opts -} - -func newSubStoreWithData(t *testing.T, db dbm.DBConnection, storeData map[string]string) (*Store, types.KVStore) { - root, err := NewStore(db, simpleStoreConfig(t)) - require.NoError(t, err) - - store := root.GetKVStore(skey_1) - for k, v := range storeData { - store.Set([]byte(k), []byte(v)) - } - return root, store -} - -func TestGetSetHasDelete(t *testing.T) { - _, store := newSubStoreWithData(t, memdb.NewDB(), alohaData) - key := "hello" - - exists := store.Has([]byte(key)) - require.True(t, exists) - - require.EqualValues(t, []byte(alohaData[key]), store.Get([]byte(key))) - - value2 := "notgoodbye" - store.Set([]byte(key), []byte(value2)) - - require.EqualValues(t, value2, store.Get([]byte(key))) - - store.Delete([]byte(key)) - - exists = store.Has([]byte(key)) - require.False(t, exists) - - require.Panics(t, func() { store.Get(nil) }, "Get(nil key) should panic") - require.Panics(t, func() { store.Get([]byte{}) }, "Get(empty key) should panic") - require.Panics(t, func() { store.Has(nil) }, "Has(nil key) should panic") - require.Panics(t, func() { store.Has([]byte{}) }, "Has(empty key) should panic") - require.Panics(t, func() { store.Set(nil, []byte("value")) }, "Set(nil key) should panic") - require.Panics(t, func() { store.Set([]byte{}, []byte("value")) }, "Set(empty key) should panic") - require.Panics(t, func() { store.Set([]byte("key"), nil) }, "Set(nil value) should panic") - sub := store.(*substore) - sub.indexBucket = rwCrudFails{sub.indexBucket, nil} - require.Panics(t, func() { - store.Set([]byte("key"), []byte("value")) - }, "Set() when index fails should panic") -} - -func TestConstructors(t *testing.T) { - db := memdb.NewDB() - - store, err := NewStore(db, simpleStoreConfig(t)) - require.NoError(t, err) - _ = store.GetKVStore(skey_1) - store.Commit() - require.NoError(t, store.Close()) - - t.Run("fail to load if InitialVersion > lowest existing version", func(t *testing.T) { - opts := StoreConfig{InitialVersion: 5, Pruning: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing)} - store, err = NewStore(db, opts) - require.Error(t, err) - db.Close() - }) - - t.Run("can't load store when db.Versions fails", func(t *testing.T) { - store, err = NewStore(dbVersionsFails{memdb.NewDB()}, DefaultStoreConfig()) - require.Error(t, err) - store, err = NewStore(db, StoreConfig{StateCommitmentDB: dbVersionsFails{memdb.NewDB()}}) - require.Error(t, err) - }) - - db = memdb.NewDB() - merkledb := memdb.NewDB() - w := db.Writer() - t.Run("can't use a DB with open writers", func(t *testing.T) { - store, err = NewStore(db, DefaultStoreConfig()) - require.Error(t, err) - w.Discard() - w = merkledb.Writer() - store, err = NewStore(db, StoreConfig{StateCommitmentDB: merkledb}) - require.Error(t, err) - w.Discard() - }) - - t.Run("can't use DBs with different version history", func(t *testing.T) { - merkledb.SaveNextVersion() - store, err = NewStore(db, StoreConfig{StateCommitmentDB: merkledb}) - require.Error(t, err) - }) - merkledb.Close() - - t.Run("can't load existing store if we can't access root hash", func(t *testing.T) { - store, err = NewStore(db, simpleStoreConfig(t)) - require.NoError(t, err) - store.Commit() - require.NoError(t, store.Close()) - // ...whether because root is misssing - w = db.Writer() - s1RootKey := append(contentPrefix, substorePrefix(skey_1.Name())...) - s1RootKey = append(s1RootKey, merkleRootKey...) - w.Delete(s1RootKey) - w.Commit() - db.SaveNextVersion() - store, err = NewStore(db, DefaultStoreConfig()) - require.Error(t, err) - // ...or, because of an error - store, err = NewStore(dbRWCrudFails{db}, DefaultStoreConfig()) - require.Error(t, err) - }) -} - -func TestIterators(t *testing.T) { - _, store := newSubStoreWithData(t, memdb.NewDB(), map[string]string{ - string([]byte{0x00}): "0", - string([]byte{0x00, 0x00}): "0 0", - string([]byte{0x00, 0x01}): "0 1", - string([]byte{0x00, 0x02}): "0 2", - string([]byte{0x01}): "1", - }) - - testCase := func(t *testing.T, iter types.Iterator, expected []string) { - var i int - for i = 0; iter.Valid(); iter.Next() { - expectedValue := expected[i] - value := iter.Value() - require.EqualValues(t, string(value), expectedValue) - i++ - } - require.Equal(t, len(expected), i) - } - - testCase(t, store.Iterator(nil, nil), - []string{"0", "0 0", "0 1", "0 2", "1"}) - testCase(t, store.Iterator([]byte{0}, nil), - []string{"0", "0 0", "0 1", "0 2", "1"}) - testCase(t, store.Iterator([]byte{0}, []byte{0, 1}), - []string{"0", "0 0"}) - testCase(t, store.Iterator([]byte{0}, []byte{1}), - []string{"0", "0 0", "0 1", "0 2"}) - testCase(t, store.Iterator([]byte{0, 1}, []byte{1}), - []string{"0 1", "0 2"}) - testCase(t, store.Iterator(nil, []byte{1}), - []string{"0", "0 0", "0 1", "0 2"}) - testCase(t, store.Iterator([]byte{0}, []byte{0}), []string{}) // start = end - testCase(t, store.Iterator([]byte{1}, []byte{0}), []string{}) // start > end - - testCase(t, store.ReverseIterator(nil, nil), - []string{"1", "0 2", "0 1", "0 0", "0"}) - testCase(t, store.ReverseIterator([]byte{0}, nil), - []string{"1", "0 2", "0 1", "0 0", "0"}) - testCase(t, store.ReverseIterator([]byte{0}, []byte{0, 1}), - []string{"0 0", "0"}) - testCase(t, store.ReverseIterator([]byte{0}, []byte{1}), - []string{"0 2", "0 1", "0 0", "0"}) - testCase(t, store.ReverseIterator([]byte{0, 1}, []byte{1}), - []string{"0 2", "0 1"}) - testCase(t, store.ReverseIterator(nil, []byte{1}), - []string{"0 2", "0 1", "0 0", "0"}) - testCase(t, store.ReverseIterator([]byte{0}, []byte{0}), []string{}) // start = end - testCase(t, store.ReverseIterator([]byte{1}, []byte{0}), []string{}) // start > end - - testCase(t, types.KVStorePrefixIterator(store, []byte{0}), - []string{"0", "0 0", "0 1", "0 2"}) - testCase(t, types.KVStoreReversePrefixIterator(store, []byte{0}), - []string{"0 2", "0 1", "0 0", "0"}) - - require.Panics(t, func() { store.Iterator([]byte{}, nil) }, "Iterator(empty key) should panic") - require.Panics(t, func() { store.Iterator(nil, []byte{}) }, "Iterator(empty key) should panic") - require.Panics(t, func() { store.ReverseIterator([]byte{}, nil) }, "Iterator(empty key) should panic") - require.Panics(t, func() { store.ReverseIterator(nil, []byte{}) }, "Iterator(empty key) should panic") -} - -func TestCommit(t *testing.T) { - testBasic := func(opts StoreConfig) { - db := memdb.NewDB() - store, err := NewStore(db, opts) - require.NoError(t, err) - require.Zero(t, store.LastCommitID()) - idNew := store.Commit() - - // Adding one record changes the hash - s1 := store.GetKVStore(skey_1) - s1.Set([]byte{0}, []byte{0}) - idOne := store.Commit() - require.Equal(t, idNew.Version+1, idOne.Version) - require.NotEqual(t, idNew.Hash, idOne.Hash) - - // Hash of emptied store is same as new store - s1.Delete([]byte{0}) - idEmptied := store.Commit() - require.Equal(t, idNew.Hash, idEmptied.Hash) - - previd := idOne - for i := byte(1); i < 5; i++ { - s1.Set([]byte{i}, []byte{i}) - id := store.Commit() - lastid := store.LastCommitID() - require.Equal(t, id.Hash, lastid.Hash) - require.Equal(t, id.Version, lastid.Version) - require.NotEqual(t, previd.Hash, id.Hash) - require.NotEqual(t, previd.Version, id.Version) - } - } - basicOpts := simpleStoreConfig(t) - basicOpts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - t.Run("sanity tests for Merkle hashing", func(t *testing.T) { - testBasic(basicOpts) - }) - t.Run("sanity tests for Merkle hashing with separate DBs", func(t *testing.T) { - basicOpts.StateCommitmentDB = memdb.NewDB() - testBasic(basicOpts) - }) - - // test that we can recover from a failed commit - testFailedCommit := func(t *testing.T, - store *Store, - db dbm.DBConnection, - opts StoreConfig, - ) { - if db == nil { - db = store.stateDB - } - s1 := store.GetKVStore(skey_1) - s1.Set([]byte{0}, []byte{0}) - require.Panics(t, func() { store.Commit() }) - require.NoError(t, store.Close()) - - // No version should be saved in the backing DB(s) - versions, _ := db.Versions() - require.Equal(t, 0, versions.Count()) - if store.StateCommitmentDB != nil { - versions, _ = store.StateCommitmentDB.Versions() - require.Equal(t, 0, versions.Count()) - } - - // The store should now be reloaded successfully - store, err := NewStore(db, opts) - require.NoError(t, err) - s1 = store.GetKVStore(skey_1) - require.Nil(t, s1.Get([]byte{0})) - require.NoError(t, store.Close()) - } - - opts := simpleStoreConfig(t) - opts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - - // Ensure Store's commit is rolled back in each failure case... - t.Run("recover after failed Commit", func(t *testing.T) { - store, err := NewStore(dbRWCommitFails{memdb.NewDB()}, opts) - require.NoError(t, err) - testFailedCommit(t, store, nil, opts) - }) - // If SaveVersion and Revert both fail during Store.Commit, the DB will contain - // committed data that belongs to no version: non-atomic behavior from the Store user's perspective. - // So, that data must be reverted when the store is reloaded. - t.Run("recover after failed SaveVersion and Revert", func(t *testing.T) { - var db dbm.DBConnection - db = dbSaveVersionFails{memdb.NewDB()} - // Revert should succeed in initial NewStore call, but fail during Commit - db = dbRevertFails{db, []bool{false, true}} - store, err := NewStore(db, opts) - require.NoError(t, err) - testFailedCommit(t, store, nil, opts) - }) - // Repeat the above for StateCommitmentDB - t.Run("recover after failed StateCommitmentDB Commit", func(t *testing.T) { - opts.StateCommitmentDB = dbRWCommitFails{memdb.NewDB()} - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - testFailedCommit(t, store, nil, opts) - }) - t.Run("recover after failed StateCommitmentDB SaveVersion and Revert", func(t *testing.T) { - var db dbm.DBConnection - db = dbSaveVersionFails{memdb.NewDB()} - db = dbRevertFails{db, []bool{false, true}} - opts.StateCommitmentDB = db - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - testFailedCommit(t, store, nil, opts) - }) - - opts = simpleStoreConfig(t) - t.Run("recover after stateDB.Versions error triggers failure", func(t *testing.T) { - db := memdb.NewDB() - store, err := NewStore(db, opts) - require.NoError(t, err) - store.stateDB = dbVersionsFails{store.stateDB} - testFailedCommit(t, store, db, opts) - }) - t.Run("recover after stateTxn.Set error triggers failure", func(t *testing.T) { - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - store.stateTxn = rwCrudFails{store.stateTxn, merkleRootKey} - testFailedCommit(t, store, nil, opts) - }) - - t.Run("stateDB.DeleteVersion error triggers failure", func(t *testing.T) { - opts.StateCommitmentDB = memdb.NewDB() - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - store.stateCommitmentTxn = rwCommitFails{store.stateCommitmentTxn} - store.stateDB = dbDeleteVersionFails{store.stateDB} - require.Panics(t, func() { store.Commit() }) - }) - t.Run("height overflow triggers failure", func(t *testing.T) { - opts.StateCommitmentDB = nil - opts.InitialVersion = math.MaxInt64 - opts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - require.Equal(t, int64(math.MaxInt64), store.Commit().Version) - require.Panics(t, func() { store.Commit() }) - require.Equal(t, int64(math.MaxInt64), store.LastCommitID().Version) // version history not modified - }) - - t.Run("first commit version matches InitialVersion", func(t *testing.T) { - opts = simpleStoreConfig(t) - opts.InitialVersion = 5 - opts.Pruning = pruningtypes.NewPruningOptions(pruningtypes.PruningNothing) - opts.StateCommitmentDB = memdb.NewDB() - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - require.Equal(t, int64(5), store.Commit().Version) - }) - - // test improbable failures to fill out test coverage - opts = simpleStoreConfig(t) - store, err := NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - store.Commit() - store.stateDB = dbVersionsFails{store.stateDB} - require.Panics(t, func() { store.LastCommitID() }) - - opts = simpleStoreConfig(t) - opts.StateCommitmentDB = memdb.NewDB() - store, err = NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - store.Commit() - store.stateTxn = rwCrudFails{store.stateTxn, nil} - require.Panics(t, func() { store.LastCommitID() }) -} - -func sliceToSet(slice []uint64) map[uint64]struct{} { - res := make(map[uint64]struct{}) - for _, x := range slice { - res[x] = struct{}{} - } - return res -} - -func TestPruning(t *testing.T) { - // Save versions up to 10 and verify pruning at final commit - testCases := []struct { - pruningtypes.PruningOptions - kept []uint64 - }{ - {pruningtypes.NewCustomPruningOptions(2, 10), []uint64{8, 9, 10}}, - {pruningtypes.NewCustomPruningOptions(0, 10), []uint64{10}}, - {pruningtypes.NewPruningOptions(pruningtypes.PruningEverything), []uint64{8, 9, 10}}, - {pruningtypes.NewPruningOptions(pruningtypes.PruningNothing), []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}, - } - - for tci, tc := range testCases { - dbs := []dbm.DBConnection{memdb.NewDB(), memdb.NewDB()} - opts := simpleStoreConfig(t) - opts.Pruning = tc.PruningOptions - opts.StateCommitmentDB = dbs[1] - store, err := NewStore(dbs[0], opts) - require.NoError(t, err) - - s1 := store.GetKVStore(skey_1) - for i := byte(1); i <= 10; i++ { - s1.Set([]byte{i}, []byte{i}) - cid := store.Commit() - latest := uint64(i) - require.Equal(t, latest, uint64(cid.Version)) - } - - for _, db := range dbs { - versions, err := db.Versions() - require.NoError(t, err) - - kept := sliceToSet(tc.kept) - for v := uint64(1); v <= 10; v++ { - _, has := kept[v] - require.Equal(t, has, versions.Exists(v), "Version = %v; tc #%d", v, tci) - } - } - } - - // Test pruning interval - // Save up to 20th version while checking history at specific version checkpoints - testCheckPoints := map[uint64][]uint64{ - 5: {1, 2, 3, 4, 5}, - 10: {10}, - 15: {10, 11, 12, 13, 14, 15}, - 20: {20}, - } - - db := memdb.NewDB() - opts := simpleStoreConfig(t) - opts.Pruning = pruningtypes.NewCustomPruningOptions(0, 10) - store, err := NewStore(db, opts) - require.NoError(t, err) - - for i := byte(1); i <= 20; i++ { - store.GetKVStore(skey_1).Set([]byte{i}, []byte{i}) - - cid := store.Commit() - latest := uint64(i) - require.Equal(t, latest, uint64(cid.Version)) - - kept, has := testCheckPoints[latest] - if !has { - continue - } - - versions, err := db.Versions() - require.NoError(t, err) - - keptMap := sliceToSet(kept) - for v := uint64(1); v <= latest; v++ { - _, has := keptMap[v] - require.Equal(t, has, versions.Exists(v), "Version = %v; tc #%d", v, i) - } - } -} - -func queryPath(skey types.StoreKey, endp string) string { return "/" + skey.Name() + endp } - -func TestQuery(t *testing.T) { - k1, v1 := []byte("k1"), []byte("v1") - k2, v2 := []byte("k2"), []byte("v2") - v3 := []byte("v3") - - ksub := []byte("k") - KVs0 := kv.Pairs{} - KVs1 := kv.Pairs{ - Pairs: []kv.Pair{ - {Key: k1, Value: v1}, - {Key: k2, Value: v2}, - }, - } - KVs2 := kv.Pairs{ - Pairs: []kv.Pair{ - {Key: k1, Value: v3}, - {Key: k2, Value: v2}, - }, - } - - valExpSubEmpty, err := KVs0.Marshal() - require.NoError(t, err) - - valExpSub1, err := KVs1.Marshal() - require.NoError(t, err) - - valExpSub2, err := KVs2.Marshal() - require.NoError(t, err) - - store, err := NewStore(memdb.NewDB(), simpleStoreConfig(t)) - require.NoError(t, err) - cid := store.Commit() - ver := cid.Version - query := abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: k1, Height: ver} - querySub := abci.RequestQuery{Path: queryPath(skey_1, "/subspace"), Data: ksub, Height: ver} - queryHeight0 := abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: k1} - - // query subspace before anything set - qres := store.Query(querySub) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, valExpSubEmpty, qres.Value) - - sub := store.GetKVStore(skey_1) - require.NotNil(t, sub) - // set data - sub.Set(k1, v1) - sub.Set(k2, v2) - - t.Run("basic queries", func(t *testing.T) { - // set data without commit, doesn't show up - qres = store.Query(query) - require.True(t, qres.IsOK(), qres.Log) - require.Nil(t, qres.Value) - - // commit it, but still don't see on old version - cid = store.Commit() - qres = store.Query(query) - require.True(t, qres.IsOK(), qres.Log) - require.Nil(t, qres.Value) - - // but yes on the new version - query.Height = cid.Version - qres = store.Query(query) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v1, qres.Value) - // and for the subspace - querySub.Height = cid.Version - qres = store.Query(querySub) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, valExpSub1, qres.Value) - - // modify - sub.Set(k1, v3) - cid = store.Commit() - - // query will return old values, as height is fixed - qres = store.Query(query) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v1, qres.Value) - - // update to latest height in the query and we are happy - query.Height = cid.Version - qres = store.Query(query) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v3, qres.Value) - // try other key - query2 := abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: k2, Height: cid.Version} - qres = store.Query(query2) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v2, qres.Value) - // and for the subspace - querySub.Height = cid.Version - qres = store.Query(querySub) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, valExpSub2, qres.Value) - - // default (height 0) will show latest-1 - qres = store.Query(queryHeight0) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v1, qres.Value) - }) - - // querying an empty store will fail - store2, err := NewStore(memdb.NewDB(), simpleStoreConfig(t)) - require.NoError(t, err) - qres = store2.Query(queryHeight0) - require.True(t, qres.IsErr()) - - // default shows latest, if latest-1 does not exist - store2.GetKVStore(skey_1).Set(k1, v1) - store2.Commit() - qres = store2.Query(queryHeight0) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v1, qres.Value) - store2.Close() - - t.Run("failed queries", func(t *testing.T) { - // artificial error cases for coverage (should never happen with prescribed usage) - // ensure that height overflow triggers an error - require.NoError(t, err) - store2.stateDB = dbVersionsIs{store2.stateDB, dbm.NewVersionManager([]uint64{uint64(math.MaxInt64) + 1})} - qres = store2.Query(queryHeight0) - require.True(t, qres.IsErr()) - // failure to access versions triggers an error - store2.stateDB = dbVersionsFails{store.stateDB} - qres = store2.Query(queryHeight0) - require.True(t, qres.IsErr()) - store2.Close() - - // query with a nil or empty key fails - badquery := abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: []byte{}} - qres = store.Query(badquery) - require.True(t, qres.IsErr()) - badquery.Data = nil - qres = store.Query(badquery) - require.True(t, qres.IsErr()) - // querying an invalid height will fail - badquery = abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: k1, Height: store.LastCommitID().Version + 1} - qres = store.Query(badquery) - require.True(t, qres.IsErr()) - // or an invalid path - badquery = abci.RequestQuery{Path: queryPath(skey_1, "/badpath"), Data: k1} - qres = store.Query(badquery) - require.True(t, qres.IsErr()) - }) - - t.Run("queries with proof", func(t *testing.T) { - // test that proofs are generated with single and separate DBs - testProve := func() { - queryProve0 := abci.RequestQuery{Path: queryPath(skey_1, "/key"), Data: k1, Prove: true} - qres = store.Query(queryProve0) - require.True(t, qres.IsOK(), qres.Log) - require.Equal(t, v1, qres.Value) - require.NotNil(t, qres.ProofOps) - } - testProve() - store.Close() - - opts := simpleStoreConfig(t) - opts.StateCommitmentDB = memdb.NewDB() - store, err = NewStore(memdb.NewDB(), opts) - require.NoError(t, err) - store.GetKVStore(skey_1).Set(k1, v1) - store.Commit() - testProve() - store.Close() - }) -} - -func TestStoreConfig(t *testing.T) { - opts := DefaultStoreConfig() - // Fail with invalid types - require.Error(t, opts.RegisterSubstore(skey_1.Name(), types.StoreTypeDB)) - require.Error(t, opts.RegisterSubstore(skey_1.Name(), types.StoreTypeSMT)) - // Ensure that no prefix conflicts are allowed - require.NoError(t, opts.RegisterSubstore(skey_1.Name(), types.StoreTypePersistent)) - require.NoError(t, opts.RegisterSubstore(skey_2.Name(), types.StoreTypeMemory)) - require.NoError(t, opts.RegisterSubstore(skey_3b.Name(), types.StoreTypeTransient)) - require.Error(t, opts.RegisterSubstore(skey_1b.Name(), types.StoreTypePersistent)) - require.Error(t, opts.RegisterSubstore(skey_2b.Name(), types.StoreTypePersistent)) - require.Error(t, opts.RegisterSubstore(skey_3.Name(), types.StoreTypePersistent)) -} - -func TestMultiStoreBasic(t *testing.T) { - opts := DefaultStoreConfig() - err := opts.RegisterSubstore(skey_1.Name(), types.StoreTypePersistent) - require.NoError(t, err) - db := memdb.NewDB() - store, err := NewStore(db, opts) - require.NoError(t, err) - - store_1 := store.GetKVStore(skey_1) - require.NotNil(t, store_1) - store_1.Set([]byte{0}, []byte{0}) - val := store_1.Get([]byte{0}) - require.Equal(t, []byte{0}, val) - store_1.Delete([]byte{0}) - val = store_1.Get([]byte{0}) - require.Equal(t, []byte(nil), val) -} - -func TestGetVersion(t *testing.T) { - db := memdb.NewDB() - opts := storeConfig123(t) - store, err := NewStore(db, opts) - require.NoError(t, err) - - cid := store.Commit() - view, err := store.GetVersion(cid.Version) - require.NoError(t, err) - subview := view.GetKVStore(skey_1) - require.NotNil(t, subview) - - // version view should be read-only - require.Panics(t, func() { subview.Set([]byte{1}, []byte{1}) }) - require.Panics(t, func() { subview.Delete([]byte{0}) }) - // nonexistent version shouldn't be accessible - _, err = store.GetVersion(cid.Version + 1) - require.Equal(t, ErrVersionDoesNotExist, err) - - substore := store.GetKVStore(skey_1) - require.NotNil(t, substore) - substore.Set([]byte{0}, []byte{0}) - // setting a value shouldn't affect old version - require.False(t, subview.Has([]byte{0})) - - cid = store.Commit() - view, err = store.GetVersion(cid.Version) - require.NoError(t, err) - subview = view.GetKVStore(skey_1) - require.NotNil(t, subview) - // deleting a value shouldn't affect old version - substore.Delete([]byte{0}) - require.Equal(t, []byte{0}, subview.Get([]byte{0})) -} - -func TestMultiStoreMigration(t *testing.T) { - db := memdb.NewDB() - opts := storeConfig123(t) - store, err := NewStore(db, opts) - require.NoError(t, err) - - // write some data in all stores - k1, v1 := []byte("first"), []byte("store") - s1 := store.GetKVStore(skey_1) - require.NotNil(t, s1) - s1.Set(k1, v1) - - k2, v2 := []byte("second"), []byte("restore") - s2 := store.GetKVStore(skey_2) - require.NotNil(t, s2) - s2.Set(k2, v2) - - k3, v3 := []byte("third"), []byte("dropped") - s3 := store.GetKVStore(skey_3) - require.NotNil(t, s3) - s3.Set(k3, v3) - - k4, v4 := []byte("fourth"), []byte("created") - require.Panics(t, func() { store.GetKVStore(skey_4) }) - - cid := store.Commit() - require.NoError(t, store.Close()) - var migratedID types.CommitID - - // Load without changes and make sure it is sensible - store, err = NewStore(db, opts) - require.NoError(t, err) - - // let's query data to see it was saved properly - s2 = store.GetKVStore(skey_2) - require.NotNil(t, s2) - require.Equal(t, v2, s2.Get(k2)) - require.NoError(t, store.Close()) - - t.Run("basic migration", func(t *testing.T) { - // now, let's load with upgrades... - opts.Upgrades = []types.StoreUpgrades{ - { - Added: []string{skey_4.Name()}, - Renamed: []types.StoreRename{{ - OldKey: skey_2.Name(), - NewKey: skey_2b.Name(), - }}, - Deleted: []string{skey_3.Name()}, - }, - } - store, err = NewStore(db, opts) - require.Nil(t, err) - - // s1 was not changed - s1 = store.GetKVStore(skey_1) - require.NotNil(t, s1) - require.Equal(t, v1, s1.Get(k1)) - - // store2 is no longer valid - require.Panics(t, func() { store.GetKVStore(skey_2) }) - // store2b has the old data - rs2 := store.GetKVStore(skey_2b) - require.NotNil(t, rs2) - require.Equal(t, v2, rs2.Get(k2)) - - // store3 is gone - require.Panics(t, func() { s3 = store.GetKVStore(skey_3) }) - - // store4 is valid - s4 := store.GetKVStore(skey_4) - require.NotNil(t, s4) - values := 0 - it := s4.Iterator(nil, nil) - for ; it.Valid(); it.Next() { - values += 1 - } - require.Zero(t, values) - require.NoError(t, it.Close()) - // write something inside store4 - s4.Set(k4, v4) - - // store this migrated data, and load it again without migrations - migratedID = store.Commit() - require.Equal(t, migratedID.Version, int64(2)) - require.NoError(t, store.Close()) - }) - - t.Run("reload after migrations", func(t *testing.T) { - // fail to load the migrated store with the old schema - store, err = NewStore(db, storeConfig123(t)) - require.Error(t, err) - - // pass in a schema reflecting the migrations - migratedOpts := DefaultStoreConfig() - err = migratedOpts.RegisterSubstore(skey_1.Name(), types.StoreTypePersistent) - require.NoError(t, err) - err = migratedOpts.RegisterSubstore(skey_2b.Name(), types.StoreTypePersistent) - require.NoError(t, err) - err = migratedOpts.RegisterSubstore(skey_4.Name(), types.StoreTypePersistent) - require.NoError(t, err) - store, err = NewStore(db, migratedOpts) - require.Nil(t, err) - require.Equal(t, migratedID, store.LastCommitID()) - - // query this new store - rl1 := store.GetKVStore(skey_1) - require.NotNil(t, rl1) - require.Equal(t, v1, rl1.Get(k1)) - - rl2 := store.GetKVStore(skey_2b) - require.NotNil(t, rl2) - require.Equal(t, v2, rl2.Get(k2)) - - rl4 := store.GetKVStore(skey_4) - require.NotNil(t, rl4) - require.Equal(t, v4, rl4.Get(k4)) - }) - - t.Run("load view from before migrations", func(t *testing.T) { - // load and check a view of the store at first commit - view, err := store.GetVersion(cid.Version) - require.NoError(t, err) - - s1 = view.GetKVStore(skey_1) - require.NotNil(t, s1) - require.Equal(t, v1, s1.Get(k1)) - - s2 = view.GetKVStore(skey_2) - require.NotNil(t, s2) - require.Equal(t, v2, s2.Get(k2)) - - s3 = view.GetKVStore(skey_3) - require.NotNil(t, s3) - require.Equal(t, v3, s3.Get(k3)) - - require.Panics(t, func() { - view.GetKVStore(skey_4) - }) - }) -} - -func TestTrace(t *testing.T) { - key, value := []byte("test-key"), []byte("test-value") - tctx := types.TraceContext(map[string]interface{}{"blockHeight": 64}) - - expected_Set := "{\"operation\":\"write\",\"key\":\"dGVzdC1rZXk=\",\"value\":\"dGVzdC12YWx1ZQ==\",\"metadata\":{\"blockHeight\":64}}\n" - expected_Get := "{\"operation\":\"read\",\"key\":\"dGVzdC1rZXk=\",\"value\":\"dGVzdC12YWx1ZQ==\",\"metadata\":{\"blockHeight\":64}}\n" - expected_Get_missing := "{\"operation\":\"read\",\"key\":\"dGVzdC1rZXk=\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n" - expected_Delete := "{\"operation\":\"delete\",\"key\":\"dGVzdC1rZXk=\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n" - expected_IterKey := "{\"operation\":\"iterKey\",\"key\":\"dGVzdC1rZXk=\",\"value\":\"\",\"metadata\":{\"blockHeight\":64}}\n" - expected_IterValue := "{\"operation\":\"iterValue\",\"key\":\"\",\"value\":\"dGVzdC12YWx1ZQ==\",\"metadata\":{\"blockHeight\":64}}\n" - - db := memdb.NewDB() - opts := simpleStoreConfig(t) - require.NoError(t, opts.RegisterSubstore(skey_2.Name(), types.StoreTypeMemory)) - require.NoError(t, opts.RegisterSubstore(skey_3.Name(), types.StoreTypeTransient)) - - store, err := NewStore(db, opts) - require.NoError(t, err) - store.SetTraceContext(tctx) - require.False(t, store.TracingEnabled()) - - var buf bytes.Buffer - store.SetTracer(&buf) - require.True(t, store.TracingEnabled()) - - for _, skey := range []types.StoreKey{skey_1, skey_2, skey_3} { - buf.Reset() - store.GetKVStore(skey).Get(key) - require.Equal(t, expected_Get_missing, buf.String()) - - buf.Reset() - store.GetKVStore(skey).Set(key, value) - require.Equal(t, expected_Set, buf.String()) - - buf.Reset() - require.Equal(t, value, store.GetKVStore(skey).Get(key)) - require.Equal(t, expected_Get, buf.String()) - - iter := store.GetKVStore(skey).Iterator(nil, nil) - buf.Reset() - require.Equal(t, key, iter.Key()) - require.Equal(t, expected_IterKey, buf.String()) - buf.Reset() - require.Equal(t, value, iter.Value()) - require.Equal(t, expected_IterValue, buf.String()) - require.NoError(t, iter.Close()) - - buf.Reset() - store.GetKVStore(skey).Delete(key) - require.Equal(t, expected_Delete, buf.String()) - - } - store.SetTracer(nil) - require.False(t, store.TracingEnabled()) - require.NoError(t, store.Close()) -} - -func TestListeners(t *testing.T) { - kvPairs := []types.KVPair{ - {Key: []byte{1}, Value: []byte("v1")}, - {Key: []byte{2}, Value: []byte("v2")}, - {Key: []byte{3}, Value: []byte("v3")}, - } - - testCases := []struct { - key []byte - value []byte - skey types.StoreKey - }{ - { - key: kvPairs[0].Key, - value: kvPairs[0].Value, - skey: skey_1, - }, - { - key: kvPairs[1].Key, - value: kvPairs[1].Value, - skey: skey_2, - }, - { - key: kvPairs[2].Key, - value: kvPairs[2].Value, - skey: skey_3, - }, - } - - interfaceRegistry := codecTypes.NewInterfaceRegistry() - marshaller := codec.NewProtoCodec(interfaceRegistry) - - db := memdb.NewDB() - opts := simpleStoreConfig(t) - require.NoError(t, opts.RegisterSubstore(skey_2.Name(), types.StoreTypeMemory)) - require.NoError(t, opts.RegisterSubstore(skey_3.Name(), types.StoreTypeTransient)) - - store, err := NewStore(db, opts) - require.NoError(t, err) - - for i, tc := range testCases { - var buf bytes.Buffer - listener := types.NewStoreKVPairWriteListener(&buf, marshaller) - store.AddListeners(tc.skey, []types.WriteListener{listener}) - require.True(t, store.ListeningEnabled(tc.skey)) - - // Set case - expected := types.StoreKVPair{ - Key: tc.key, - Value: tc.value, - StoreKey: tc.skey.Name(), - Delete: false, - } - var kvpair types.StoreKVPair - - buf.Reset() - store.GetKVStore(tc.skey).Set(tc.key, tc.value) - require.NoError(t, marshaller.UnmarshalLengthPrefixed(buf.Bytes(), &kvpair)) - require.Equal(t, expected, kvpair, i) - - // Delete case - expected = types.StoreKVPair{ - Key: tc.key, - Value: nil, - StoreKey: tc.skey.Name(), - Delete: true, - } - kvpair = types.StoreKVPair{} - - buf.Reset() - store.GetKVStore(tc.skey).Delete(tc.key) - require.NoError(t, marshaller.UnmarshalLengthPrefixed(buf.Bytes(), &kvpair)) - require.Equal(t, expected, kvpair, i) - } - require.NoError(t, store.Close()) -} diff --git a/store/v2alpha1/multi/sub_store.go b/store/v2alpha1/multi/sub_store.go deleted file mode 100644 index 613b7ac2c412..000000000000 --- a/store/v2alpha1/multi/sub_store.go +++ /dev/null @@ -1,117 +0,0 @@ -package multi - -import ( - "crypto/sha256" - "io" - "sync" - - dbm "github.com/cosmos/cosmos-sdk/db" - dbutil "github.com/cosmos/cosmos-sdk/internal/db" - "github.com/cosmos/cosmos-sdk/store/cachekv" - "github.com/cosmos/cosmos-sdk/store/listenkv" - "github.com/cosmos/cosmos-sdk/store/tracekv" - "github.com/cosmos/cosmos-sdk/store/types" -) - -// Get implements KVStore. -func (s *substore) Get(key []byte) []byte { - s.root.mtx.RLock() - defer s.root.mtx.RUnlock() - - val, err := s.dataBucket.Get(key) - if err != nil { - panic(err) - } - return val -} - -// Has implements KVStore. -func (s *substore) Has(key []byte) bool { - s.root.mtx.RLock() - defer s.root.mtx.RUnlock() - - has, err := s.dataBucket.Has(key) - if err != nil { - panic(err) - } - return has -} - -// Set implements KVStore. -func (s *substore) Set(key, value []byte) { - s.root.mtx.Lock() - defer s.root.mtx.Unlock() - - err := s.dataBucket.Set(key, value) - if err != nil { - panic(err) - } - s.stateCommitmentStore.Set(key, value) - khash := sha256.Sum256(key) - err = s.indexBucket.Set(khash[:], key) - if err != nil { - panic(err) - } -} - -// Delete implements KVStore. -func (s *substore) Delete(key []byte) { - khash := sha256.Sum256(key) - s.root.mtx.Lock() - defer s.root.mtx.Unlock() - - s.stateCommitmentStore.Delete(key) - _ = s.indexBucket.Delete(khash[:]) - _ = s.dataBucket.Delete(key) -} - -type contentsIterator struct { - types.Iterator - locker sync.Locker -} - -func (s *substore) newSubstoreIterator(source dbm.Iterator) *contentsIterator { - locker := s.root.mtx.RLocker() - locker.Lock() - return &contentsIterator{dbutil.DBToStoreIterator(source), locker} -} - -func (it *contentsIterator) Close() error { - defer it.locker.Unlock() - return it.Iterator.Close() -} - -// Iterator implements KVStore. -func (s *substore) Iterator(start, end []byte) types.Iterator { - iter, err := s.dataBucket.Iterator(start, end) - if err != nil { - panic(err) - } - return s.newSubstoreIterator(iter) -} - -// ReverseIterator implements KVStore. -func (s *substore) ReverseIterator(start, end []byte) types.Iterator { - iter, err := s.dataBucket.ReverseIterator(start, end) - if err != nil { - panic(err) - } - return s.newSubstoreIterator(iter) -} - -// GetStoreType implements Store. -func (s *substore) GetStoreType() types.StoreType { - return types.StoreTypePersistent -} - -func (s *substore) CacheWrap() types.CacheWrap { - return cachekv.NewStore(s) -} - -func (s *substore) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(s, w, tc)) -} - -func (s *substore) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap { - return cachekv.NewStore(listenkv.NewStore(s, storeKey, listeners)) -} diff --git a/store/v2alpha1/multi/test_util.go b/store/v2alpha1/multi/test_util.go deleted file mode 100644 index d7005cd86f0b..000000000000 --- a/store/v2alpha1/multi/test_util.go +++ /dev/null @@ -1,88 +0,0 @@ -//nolint:unused -package multi - -import ( - "bytes" - "errors" - - dbm "github.com/cosmos/cosmos-sdk/db" -) - -type ( - dbDeleteVersionFails struct{ dbm.DBConnection } - dbRWCommitFails struct{ dbm.DBConnection } - dbRWCrudFails struct{ dbm.DBConnection } - dbSaveVersionFails struct{ dbm.DBConnection } - dbRevertFails struct { - dbm.DBConnection - // order of calls to fail on (eg. [1, 0] => first call fails; second succeeds) - failOn []bool - } -) - -type dbVersionsIs struct { - dbm.DBConnection - vset dbm.VersionSet -} -type ( - dbVersionsFails struct{ dbm.DBConnection } - rwCommitFails struct{ dbm.DBReadWriter } - rwCrudFails struct { - dbm.DBReadWriter - onKey []byte - } -) - -func (dbVersionsFails) Versions() (dbm.VersionSet, error) { return nil, errors.New("dbVersionsFails") } -func (db dbVersionsIs) Versions() (dbm.VersionSet, error) { return db.vset, nil } -func (db dbRWCrudFails) ReadWriter() dbm.DBReadWriter { - return rwCrudFails{db.DBConnection.ReadWriter(), nil} -} -func (dbSaveVersionFails) SaveVersion(uint64) error { return errors.New("dbSaveVersionFails") } -func (db dbRevertFails) Revert() error { - fail := false - if len(db.failOn) > 0 { - fail, db.failOn = db.failOn[0], db.failOn[1:] //nolint:staticcheck - } - if fail { - return errors.New("dbRevertFails") - } - return db.DBConnection.Revert() -} -func (dbDeleteVersionFails) DeleteVersion(uint64) error { return errors.New("dbDeleteVersionFails") } -func (tx rwCommitFails) Commit() error { - tx.Discard() - return errors.New("rwCommitFails") -} - -func (db dbRWCommitFails) ReadWriter() dbm.DBReadWriter { - return rwCommitFails{db.DBConnection.ReadWriter()} -} - -func (rw rwCrudFails) Get(k []byte) ([]byte, error) { - if rw.onKey == nil || bytes.Equal(rw.onKey, k) { - return nil, errors.New("rwCrudFails.Get") - } - return rw.DBReadWriter.Get(k) -} - -func (rw rwCrudFails) Has(k []byte) (bool, error) { - if rw.onKey == nil || bytes.Equal(rw.onKey, k) { - return false, errors.New("rwCrudFails.Has") - } - return rw.DBReadWriter.Has(k) -} - -func (rw rwCrudFails) Set(k []byte, v []byte) error { - if rw.onKey == nil || bytes.Equal(rw.onKey, k) { - return errors.New("rwCrudFails.Set") - } - return rw.DBReadWriter.Set(k, v) -} - -func (rw rwCrudFails) Delete(k []byte) error { - if rw.onKey == nil || bytes.Equal(rw.onKey, k) { - return errors.New("rwCrudFails.Delete") - } - return rw.DBReadWriter.Delete(k) -} diff --git a/store/v2alpha1/multi/view_store.go b/store/v2alpha1/multi/view_store.go deleted file mode 100644 index b06596c3161b..000000000000 --- a/store/v2alpha1/multi/view_store.go +++ /dev/null @@ -1,178 +0,0 @@ -package multi - -import ( - "errors" - "io" - - dbm "github.com/cosmos/cosmos-sdk/db" - prefixdb "github.com/cosmos/cosmos-sdk/db/prefix" - util "github.com/cosmos/cosmos-sdk/internal" - dbutil "github.com/cosmos/cosmos-sdk/internal/db" - "github.com/cosmos/cosmos-sdk/store/cachekv" - "github.com/cosmos/cosmos-sdk/store/listenkv" - "github.com/cosmos/cosmos-sdk/store/tracekv" - types "github.com/cosmos/cosmos-sdk/store/v2alpha1" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -var ErrReadOnly = errors.New("cannot modify read-only store") - -func (s *viewSubstore) GetStateCommitmentStore() *smt.Store { - return s.stateCommitmentStore -} - -// Get implements KVStore. -func (s *viewSubstore) Get(key []byte) []byte { - val, err := s.dataBucket.Get(key) - if err != nil { - panic(err) - } - return val -} - -// Has implements KVStore. -func (s *viewSubstore) Has(key []byte) bool { - has, err := s.dataBucket.Has(key) - if err != nil { - panic(err) - } - return has -} - -// Set implements KVStore. -func (s *viewSubstore) Set(key []byte, value []byte) { - panic(ErrReadOnly) -} - -// Delete implements KVStore. -func (s *viewSubstore) Delete(key []byte) { - panic(ErrReadOnly) -} - -// Iterator implements KVStore. -func (s *viewSubstore) Iterator(start, end []byte) types.Iterator { - iter, err := s.dataBucket.Iterator(start, end) - if err != nil { - panic(err) - } - return dbutil.DBToStoreIterator(iter) -} - -// ReverseIterator implements KVStore. -func (s *viewSubstore) ReverseIterator(start, end []byte) types.Iterator { - iter, err := s.dataBucket.ReverseIterator(start, end) - if err != nil { - panic(err) - } - return dbutil.DBToStoreIterator(iter) -} - -// GetStoreType implements Store. -func (s *viewSubstore) GetStoreType() types.StoreType { - return types.StoreTypePersistent -} - -func (st *viewSubstore) CacheWrap() types.CacheWrap { - return cachekv.NewStore(st) -} - -func (st *viewSubstore) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(st, w, tc)) -} - -func (st *viewSubstore) CacheWrapWithListeners(storeKey types.StoreKey, listeners []types.WriteListener) types.CacheWrap { - return cachekv.NewStore(listenkv.NewStore(st, storeKey, listeners)) -} - -func (s *viewStore) getMerkleRoots() (ret map[string][]byte, err error) { - ret = map[string][]byte{} - for key := range s.schema { - sub, has := s.substoreCache[key] - if !has { - sub, err = s.getSubstore(key) - if err != nil { - return - } - } - ret[key] = sub.stateCommitmentStore.Root() - } - return -} - -func (store *Store) getView(version int64) (ret *viewStore, err error) { - stateView, err := store.stateDB.ReaderAt(uint64(version)) - if err != nil { - return - } - defer func() { - if err != nil { - err = util.CombineErrors(err, stateView.Discard(), "stateView.Discard also failed") - } - }() - - stateCommitmentView := stateView - if store.StateCommitmentDB != nil { - stateCommitmentView, err = store.StateCommitmentDB.ReaderAt(uint64(version)) - if err != nil { - return - } - defer func() { - if err != nil { - err = util.CombineErrors(err, stateCommitmentView.Discard(), "stateCommitmentView.Discard also failed") - } - }() - } - // Now read this version's schema - schemaView := prefixdb.NewPrefixReader(stateView, schemaPrefix) - defer func() { - if err != nil { - err = util.CombineErrors(err, schemaView.Discard(), "schemaView.Discard also failed") - } - }() - pr, err := readSavedSchema(schemaView) - if err != nil { - return - } - // The migrated contents and schema are not committed until the next store.Commit - ret = &viewStore{ - stateView: stateView, - stateCommitmentView: stateCommitmentView, - substoreCache: map[string]*viewSubstore{}, - schema: pr.StoreSchema, - } - return ret, nil -} - -func (vs *viewStore) GetKVStore(skey types.StoreKey) types.KVStore { - key := skey.Name() - if _, has := vs.schema[key]; !has { - panic(ErrStoreNotFound(key)) - } - ret, err := vs.getSubstore(key) - if err != nil { - panic(err) - } - vs.substoreCache[key] = ret - return ret -} - -// Reads but does not update substore cache -func (vs *viewStore) getSubstore(key string) (*viewSubstore, error) { - if cached, has := vs.substoreCache[key]; has { - return cached, nil - } - pfx := substorePrefix(key) - stateR := prefixdb.NewPrefixReader(vs.stateView, pfx) - stateCommitmentR := prefixdb.NewPrefixReader(vs.stateCommitmentView, pfx) - rootHash, err := stateR.Get(merkleRootKey) - if err != nil { - return nil, err - } - return &viewSubstore{ - root: vs, - name: key, - dataBucket: prefixdb.NewPrefixReader(stateR, dataPrefix), - indexBucket: prefixdb.NewPrefixReader(stateR, indexPrefix), - stateCommitmentStore: loadSMT(dbm.ReaderAsReadWriter(stateCommitmentR), rootHash), - }, nil -} diff --git a/store/v2alpha1/smt/ics23.go b/store/v2alpha1/smt/ics23.go deleted file mode 100644 index 43b75a19788f..000000000000 --- a/store/v2alpha1/smt/ics23.go +++ /dev/null @@ -1,124 +0,0 @@ -// Here we implement proof generation according to the ICS-23 specification: -// https://github.com/cosmos/ibc/tree/master/spec/core/ics-023-vector-commitments - -package smt - -import ( - "crypto/sha256" - "fmt" - - dbm "github.com/cosmos/cosmos-sdk/db" - - ics23 "github.com/confio/ics23/go" -) - -func createIcs23Proof(store *Store, key []byte) (*ics23.CommitmentProof, error) { - ret := &ics23.CommitmentProof{} - path := sha256.Sum256(key) - has, err := store.tree.Has(key) - if err != nil { - return nil, err - } - if has { // Membership proof - value, err := store.values.Get(path[:]) - if err != nil { - return nil, err - } - if value == nil { - return nil, fmt.Errorf("value not found for: %v", key) - } - proof, err := store.tree.Prove(key) - if err != nil { - return nil, err - } - ret.Proof = &ics23.CommitmentProof_Exist{Exist: &ics23.ExistenceProof{ - Key: path[:], - Value: value, - Leaf: ics23.SmtSpec.LeafSpec, - Path: convertInnerOps(path[:], proof.SideNodes), - }} - } else { // Non-membership - nonexist, err := toNonExistenceProof(store, path) - if err != nil { - return nil, err - } - ret.Proof = &ics23.CommitmentProof_Nonexist{Nonexist: nonexist} - } - return ret, nil -} - -func toNonExistenceProof(store *Store, path [32]byte) (*ics23.NonExistenceProof, error) { - // Seek to our neighbors via the backing DB - getNext := func(it dbm.Iterator) (*ics23.ExistenceProof, error) { - defer it.Close() - if it.Next() { - value, err := store.values.Get(it.Key()) - if err != nil { - return nil, err - } - if value == nil { - return nil, fmt.Errorf("value not found for: %v", it.Value()) - } - proof, err := store.tree.Prove(it.Value()) // pass the preimage to Prove - if err != nil { - return nil, err - } - return &ics23.ExistenceProof{ - Key: it.Key(), - Value: value, - Leaf: ics23.SmtSpec.LeafSpec, - Path: convertInnerOps(it.Key(), proof.SideNodes), - }, nil - } - return nil, nil - } - var lproof, rproof *ics23.ExistenceProof - it, err := store.preimages.ReverseIterator(nil, path[:]) - if err != nil { - return nil, err - } - lproof, err = getNext(it) - if err != nil { - return nil, err - } - it, err = store.preimages.Iterator(path[:], nil) - if err != nil { - return nil, err - } - rproof, err = getNext(it) - if err != nil { - return nil, err - } - return &ics23.NonExistenceProof{ - Key: path[:], - Left: lproof, - Right: rproof, - }, nil -} - -func convertInnerOps(path []byte, sideNodes [][]byte) []*ics23.InnerOp { - depth := len(sideNodes) - inners := make([]*ics23.InnerOp, 0, depth) - for i := 0; i < len(sideNodes); i++ { - op := &ics23.InnerOp{ - Hash: ics23.HashOp_SHA256, - Prefix: []byte{1}, - } - if getBitAtFromMSB(path, depth-1-i) == 1 { - // right child is on path - op.Prefix = append(op.Prefix, sideNodes[i]...) - } else { - op.Suffix = sideNodes[i] - } - inners = append(inners, op) - } - return inners -} - -// getBitAtFromMSB gets the bit at an offset from the most significant bit -func getBitAtFromMSB(data []byte, position int) int { - if int(data[position/8])&(1<<(8-1-uint(position)%8)) > 0 { - return 1 - } - return 0 -} diff --git a/store/v2alpha1/smt/ics23_test.go b/store/v2alpha1/smt/ics23_test.go deleted file mode 100644 index a94cc6f0a477..000000000000 --- a/store/v2alpha1/smt/ics23_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package smt_test - -import ( - "crypto/sha256" - "testing" - - ics23 "github.com/confio/ics23/go" - "github.com/stretchr/testify/assert" - - "github.com/cosmos/cosmos-sdk/db/memdb" - store "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -func TestProofICS23(t *testing.T) { - txn := memdb.NewDB().ReadWriter() - s := store.NewStore(txn) - // pick keys whose hashes begin with different bits - key00 := []byte("foo") // 00101100 = sha256(foo)[0] - key01 := []byte("bill") // 01100010 - key10 := []byte("baz") // 10111010 - key11 := []byte("bar") // 11111100 - path00 := sha256.Sum256(key00) - path01 := sha256.Sum256(key01) - path10 := sha256.Sum256(key10) - val1 := []byte("0") - val2 := []byte("1") - - s.Set(key01, val1) - - // Membership - proof, err := s.GetProofICS23(key01) - assert.NoError(t, err) - nonexist := proof.GetNonexist() - assert.Nil(t, nonexist) - exist := proof.GetExist() - assert.NotNil(t, exist) - assert.Equal(t, 0, len(exist.Path)) - assert.NoError(t, exist.Verify(ics23.SmtSpec, s.Root(), path01[:], val1)) - - // Non-membership - proof, err = s.GetProofICS23(key00) // When leaf is leftmost node - assert.NoError(t, err) - nonexist = proof.GetNonexist() - assert.NotNil(t, nonexist) - assert.Nil(t, nonexist.Left) - assert.Equal(t, path00[:], nonexist.Key) - assert.NotNil(t, nonexist.Right) - assert.Equal(t, 0, len(nonexist.Right.Path)) - assert.NoError(t, nonexist.Verify(ics23.SmtSpec, s.Root(), path00[:])) - - proof, err = s.GetProofICS23(key10) // When rightmost - assert.NoError(t, err) - nonexist = proof.GetNonexist() - assert.NotNil(t, nonexist) - assert.NotNil(t, nonexist.Left) - assert.Equal(t, 0, len(nonexist.Left.Path)) - assert.Nil(t, nonexist.Right) - assert.NoError(t, nonexist.Verify(ics23.SmtSpec, s.Root(), path10[:])) - badNonexist := nonexist - - s.Set(key11, val2) - - proof, err = s.GetProofICS23(key10) // In between two keys - assert.NoError(t, err) - nonexist = proof.GetNonexist() - assert.NotNil(t, nonexist) - assert.Equal(t, path10[:], nonexist.Key) - assert.NotNil(t, nonexist.Left) - assert.Equal(t, 1, len(nonexist.Left.Path)) - assert.NotNil(t, nonexist.Right) - assert.Equal(t, 1, len(nonexist.Right.Path)) - assert.NoError(t, nonexist.Verify(ics23.SmtSpec, s.Root(), path10[:])) - - // Make sure proofs work with a loaded store - root := s.Root() - s = store.LoadStore(txn, root) - proof, err = s.GetProofICS23(key10) - assert.NoError(t, err) - nonexist = proof.GetNonexist() - assert.Equal(t, path10[:], nonexist.Key) - assert.NotNil(t, nonexist.Left) - assert.Equal(t, 1, len(nonexist.Left.Path)) - assert.NotNil(t, nonexist.Right) - assert.Equal(t, 1, len(nonexist.Right.Path)) - assert.NoError(t, nonexist.Verify(ics23.SmtSpec, s.Root(), path10[:])) - - // Invalid proofs should fail to verify - badExist := exist // expired proof - assert.Error(t, badExist.Verify(ics23.SmtSpec, s.Root(), path01[:], val1)) - - badExist = nonexist.Left - badExist.Key = key01 // .Key must contain key path - assert.Error(t, badExist.Verify(ics23.SmtSpec, s.Root(), path01[:], val1)) - - badExist = nonexist.Left - badExist.Path[0].Prefix = []byte{0} // wrong inner node prefix - assert.Error(t, badExist.Verify(ics23.SmtSpec, s.Root(), path01[:], val1)) - - badExist = nonexist.Left - badExist.Path = []*ics23.InnerOp{} // empty path - assert.Error(t, badExist.Verify(ics23.SmtSpec, s.Root(), path01[:], val1)) - - assert.Error(t, badNonexist.Verify(ics23.SmtSpec, s.Root(), path10[:])) - - badNonexist = nonexist - badNonexist.Key = key10 - assert.Error(t, badNonexist.Verify(ics23.SmtSpec, s.Root(), path10[:])) -} diff --git a/store/v2alpha1/smt/proof.go b/store/v2alpha1/smt/proof.go deleted file mode 100644 index d247f1bf6617..000000000000 --- a/store/v2alpha1/smt/proof.go +++ /dev/null @@ -1,93 +0,0 @@ -package smt - -import ( - "bytes" - "crypto/sha256" - "encoding/gob" - "hash" - - "github.com/celestiaorg/smt" - "github.com/cosmos/cosmos-sdk/store/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/tendermint/tendermint/crypto/merkle" - tmmerkle "github.com/tendermint/tendermint/proto/tendermint/crypto" -) - -type HasherType byte - -const ( - SHA256 HasherType = iota -) - -const ( - ProofType = "smt" -) - -type ProofOp struct { - Root []byte - Key []byte - Hasher HasherType - Proof smt.SparseMerkleProof -} - -var _ merkle.ProofOperator = (*ProofOp)(nil) - -// NewProofOp returns a ProofOp for a SparseMerkleProof. -func NewProofOp(root, key []byte, hasher HasherType, proof smt.SparseMerkleProof) *ProofOp { - return &ProofOp{ - Root: root, - Key: key, - Hasher: hasher, - Proof: proof, - } -} - -func (p *ProofOp) Run(args [][]byte) ([][]byte, error) { - switch len(args) { - case 0: // non-membership proof - if !smt.VerifyProof(p.Proof, p.Root, p.Key, []byte{}, getHasher(p.Hasher)) { - return nil, sdkerrors.Wrapf(types.ErrInvalidProof, "proof did not verify absence of key: %s", p.Key) - } - case 1: // membership proof - if !smt.VerifyProof(p.Proof, p.Root, p.Key, args[0], getHasher(p.Hasher)) { - return nil, sdkerrors.Wrapf(types.ErrInvalidProof, "proof did not verify existence of key %s with given value %x", p.Key, args[0]) - } - default: - return nil, sdkerrors.Wrapf(types.ErrInvalidProof, "args must be length 0 or 1, got: %d", len(args)) - } - return [][]byte{p.Root}, nil -} - -func (p *ProofOp) GetKey() []byte { - return p.Key -} - -func (p *ProofOp) ProofOp() tmmerkle.ProofOp { - var data bytes.Buffer - enc := gob.NewEncoder(&data) - enc.Encode(p) - return tmmerkle.ProofOp{ - Type: "smt", - Key: p.Key, - Data: data.Bytes(), - } -} - -func ProofDecoder(pop tmmerkle.ProofOp) (merkle.ProofOperator, error) { - dec := gob.NewDecoder(bytes.NewBuffer(pop.Data)) - var proof ProofOp - err := dec.Decode(&proof) - if err != nil { - return nil, err - } - return &proof, nil -} - -func getHasher(hasher HasherType) hash.Hash { - switch hasher { - case SHA256: - return sha256.New() - default: - return nil - } -} diff --git a/store/v2alpha1/smt/proof_test.go b/store/v2alpha1/smt/proof_test.go deleted file mode 100644 index a5b3bf4869ec..000000000000 --- a/store/v2alpha1/smt/proof_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package smt_test - -import ( - "crypto/sha256" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/celestiaorg/smt" - "github.com/cosmos/cosmos-sdk/db/memdb" - smtstore "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -func TestProofOpInterface(t *testing.T) { - hasher := sha256.New() - nodes, values := memdb.NewDB(), memdb.NewDB() - tree := smt.NewSparseMerkleTree(nodes.ReadWriter(), values.ReadWriter(), hasher) - key := []byte("foo") - value := []byte("bar") - root, err := tree.Update(key, value) - require.NoError(t, err) - require.NotEmpty(t, root) - - proof, err := tree.Prove(key) - require.True(t, smt.VerifyProof(proof, root, key, value, hasher)) - - storeProofOp := smtstore.NewProofOp(root, key, smtstore.SHA256, proof) - require.NotNil(t, storeProofOp) - // inclusion proof - r, err := storeProofOp.Run([][]byte{value}) - assert.NoError(t, err) - assert.NotEmpty(t, r) - assert.Equal(t, root, r[0]) - - // inclusion proof - wrong value - should fail - r, err = storeProofOp.Run([][]byte{key}) - assert.Error(t, err) - assert.Empty(t, r) - - // exclusion proof - should fail - r, err = storeProofOp.Run([][]byte{}) - assert.Error(t, err) - assert.Empty(t, r) - - // invalid request - should fail - r, err = storeProofOp.Run([][]byte{key, key}) - assert.Error(t, err) - assert.Empty(t, r) - - // encode - tmProofOp := storeProofOp.ProofOp() - assert.NotNil(t, tmProofOp) - assert.Equal(t, smtstore.ProofType, tmProofOp.Type) - assert.Equal(t, key, tmProofOp.Key, key) - assert.NotEmpty(t, tmProofOp.Data) - - // decode - decoded, err := smtstore.ProofDecoder(tmProofOp) - assert.NoError(t, err) - assert.NotNil(t, decoded) - assert.Equal(t, key, decoded.GetKey()) - - // run proof after decoding - r, err = decoded.Run([][]byte{value}) - assert.NoError(t, err) - assert.NotEmpty(t, r) - assert.Equal(t, root, r[0]) -} diff --git a/store/v2alpha1/smt/store.go b/store/v2alpha1/smt/store.go deleted file mode 100644 index 3965eae18dbe..000000000000 --- a/store/v2alpha1/smt/store.go +++ /dev/null @@ -1,143 +0,0 @@ -package smt - -import ( - "crypto/sha256" - "errors" - - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/db/prefix" - "github.com/cosmos/cosmos-sdk/store/types" - - "github.com/celestiaorg/smt" - ics23 "github.com/confio/ics23/go" - tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" -) - -var ( - _ types.BasicKVStore = (*Store)(nil) - _ smt.MapStore = (dbMapStore{}) -) - -var ( - nodesPrefix = []byte{0} - valuesPrefix = []byte{1} - preimagesPrefix = []byte{2} - - errKeyEmpty = errors.New("key is empty or nil") - errValueNil = errors.New("value is nil") -) - -// Store Implements types.KVStore and CommitKVStore. -type Store struct { - tree *smt.SparseMerkleTree - values dbm.DBReadWriter - // Map hashed keys back to preimage - preimages dbm.DBReadWriter -} - -// An smt.MapStore that wraps Get to raise smt.InvalidKeyError; -// smt.SparseMerkleTree expects this error to be returned when a key is not found -type dbMapStore struct{ dbm.DBReadWriter } - -func NewStore(db dbm.DBReadWriter) *Store { - nodes := prefix.NewPrefixReadWriter(db, nodesPrefix) - values := prefix.NewPrefixReadWriter(db, valuesPrefix) - preimages := prefix.NewPrefixReadWriter(db, preimagesPrefix) - return &Store{ - tree: smt.NewSparseMerkleTree(dbMapStore{nodes}, dbMapStore{values}, sha256.New()), - values: values, - preimages: preimages, - } -} - -func LoadStore(db dbm.DBReadWriter, root []byte) *Store { - nodes := prefix.NewPrefixReadWriter(db, nodesPrefix) - values := prefix.NewPrefixReadWriter(db, valuesPrefix) - preimages := prefix.NewPrefixReadWriter(db, preimagesPrefix) - return &Store{ - tree: smt.ImportSparseMerkleTree(dbMapStore{nodes}, dbMapStore{values}, sha256.New(), root), - values: values, - preimages: preimages, - } -} - -func (s *Store) GetProof(key []byte) (*tmcrypto.ProofOps, error) { - if len(key) == 0 { - return nil, errKeyEmpty - } - proof, err := s.tree.Prove(key) - if err != nil { - return nil, err - } - op := NewProofOp(s.tree.Root(), key, SHA256, proof) - return &tmcrypto.ProofOps{Ops: []tmcrypto.ProofOp{op.ProofOp()}}, nil -} - -func (s *Store) GetProofICS23(key []byte) (*ics23.CommitmentProof, error) { - return createIcs23Proof(s, key) -} - -func (s *Store) Root() []byte { return s.tree.Root() } - -// BasicKVStore interface below: - -// Get returns nil iff key doesn't exist. Panics on nil or empty key. -func (s *Store) Get(key []byte) []byte { - if len(key) == 0 { - panic(errKeyEmpty) - } - val, err := s.tree.Get(key) - if err != nil { - panic(err) - } - return val -} - -// Has checks if a key exists. Panics on nil or empty key. -func (s *Store) Has(key []byte) bool { - if len(key) == 0 { - panic(errKeyEmpty) - } - has, err := s.tree.Has(key) - if err != nil { - panic(err) - } - return has -} - -// Set sets the key. Panics on nil key or value. -func (s *Store) Set(key []byte, value []byte) { - if len(key) == 0 { - panic(errKeyEmpty) - } - if value == nil { - panic(errValueNil) - } - _, err := s.tree.Update(key, value) - if err != nil { - panic(err) - } - path := sha256.Sum256(key) - s.preimages.Set(path[:], key) -} - -// Delete deletes the key. Panics on nil key. -func (s *Store) Delete(key []byte) { - if len(key) == 0 { - panic(errKeyEmpty) - } - _, _ = s.tree.Delete(key) - path := sha256.Sum256(key) - s.preimages.Delete(path[:]) -} - -func (ms dbMapStore) Get(key []byte) ([]byte, error) { - val, err := ms.DBReadWriter.Get(key) - if err != nil { - return nil, err - } - if val == nil { - return nil, &smt.InvalidKeyError{Key: key} - } - return val, nil -} diff --git a/store/v2alpha1/smt/store_test.go b/store/v2alpha1/smt/store_test.go deleted file mode 100644 index 2ad50be53dda..000000000000 --- a/store/v2alpha1/smt/store_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package smt_test - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/cosmos/cosmos-sdk/db/memdb" - store "github.com/cosmos/cosmos-sdk/store/v2alpha1/smt" -) - -func TestGetSetHasDelete(t *testing.T) { - db := memdb.NewDB() - s := store.NewStore(db.ReadWriter()) - - s.Set([]byte("foo"), []byte("bar")) - assert.Equal(t, []byte("bar"), s.Get([]byte("foo"))) - assert.Equal(t, true, s.Has([]byte("foo"))) - s.Delete([]byte("foo")) - assert.Equal(t, false, s.Has([]byte("foo"))) - - assert.Panics(t, func() { s.Get(nil) }, "Get(nil key) should panic") - assert.Panics(t, func() { s.Get([]byte{}) }, "Get(empty key) should panic") - assert.Panics(t, func() { s.Has(nil) }, "Has(nil key) should panic") - assert.Panics(t, func() { s.Has([]byte{}) }, "Has(empty key) should panic") - assert.Panics(t, func() { s.Set(nil, []byte("value")) }, "Set(nil key) should panic") - assert.Panics(t, func() { s.Set([]byte{}, []byte("value")) }, "Set(empty key) should panic") - assert.Panics(t, func() { s.Set([]byte("key"), nil) }, "Set(nil value) should panic") -} - -func TestLoadStore(t *testing.T) { - db := memdb.NewDB() - txn := db.ReadWriter() - s := store.NewStore(txn) - - s.Set([]byte{0}, []byte{0}) - s.Set([]byte{1}, []byte{1}) - s.Delete([]byte{1}) - root := s.Root() - - s = store.LoadStore(txn, root) - assert.Equal(t, []byte{0}, s.Get([]byte{0})) - assert.False(t, s.Has([]byte{1})) - s.Set([]byte{2}, []byte{2}) - assert.NotEqual(t, root, s.Root()) -} diff --git a/store/v2alpha1/transient/store.go b/store/v2alpha1/transient/store.go deleted file mode 100644 index 586cc4e9d36e..000000000000 --- a/store/v2alpha1/transient/store.go +++ /dev/null @@ -1,47 +0,0 @@ -package transient - -import ( - dbm "github.com/cosmos/cosmos-sdk/db" - "github.com/cosmos/cosmos-sdk/db/memdb" - pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" - "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/dbadapter" -) - -var ( - _ types.KVStore = (*Store)(nil) - _ types.Committer = (*Store)(nil) -) - -// Store is a wrapper for a memory store which does not persist data. -type Store struct { - dbadapter.Store - conn dbm.DBConnection -} - -// NewStore constructs a new transient store. -func NewStore() *Store { - db := memdb.NewDB() - return &Store{ - Store: dbadapter.Store{DB: db.ReadWriter()}, - conn: db, - } -} - -// Implements Store. -func (ts *Store) GetStoreType() types.StoreType { - return types.StoreTypeTransient -} - -// Implements CommitStore -// Commit cleans up Store. -func (ts *Store) Commit() (id types.CommitID) { - ts.DB.Discard() - ts.Store = dbadapter.Store{DB: ts.conn.ReadWriter()} - return -} - -func (ts *Store) SetPruning(pruningtypes.PruningOptions) {} -func (ts *Store) GetPruning() pruningtypes.PruningOptions { return pruningtypes.PruningOptions{} } - -func (ts *Store) LastCommitID() (id types.CommitID) { return } diff --git a/store/v2alpha1/transient/store_test.go b/store/v2alpha1/transient/store_test.go deleted file mode 100644 index 272b7a34a8bc..000000000000 --- a/store/v2alpha1/transient/store_test.go +++ /dev/null @@ -1,27 +0,0 @@ -package transient_test - -import ( - "bytes" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/store/v2alpha1/transient" -) - -var k, v = []byte("hello"), []byte("world") - -func TestTransientStore(t *testing.T) { - tstore := transient.NewStore() - require.Nil(t, tstore.Get(k)) - tstore.Set(k, v) - require.Equal(t, v, tstore.Get(k)) - tstore.Commit() - require.Nil(t, tstore.Get(k)) - - emptyCommitID := tstore.LastCommitID() - require.Equal(t, emptyCommitID.Version, int64(0)) - require.True(t, bytes.Equal(emptyCommitID.Hash, nil)) - require.Equal(t, types.StoreTypeTransient, tstore.GetStoreType()) -} diff --git a/store/v2alpha1/types.go b/store/v2alpha1/types.go deleted file mode 100644 index 44c97ff4f52d..000000000000 --- a/store/v2alpha1/types.go +++ /dev/null @@ -1,111 +0,0 @@ -package types - -import ( - "io" - - snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" - v1 "github.com/cosmos/cosmos-sdk/store/types" -) - -// Re-export relevant original store types -type ( - StoreKey = v1.StoreKey - StoreType = v1.StoreType - CommitID = v1.CommitID - StoreUpgrades = v1.StoreUpgrades - StoreRename = v1.StoreRename - Iterator = v1.Iterator - - TraceContext = v1.TraceContext - WriteListener = v1.WriteListener - - BasicKVStore = v1.BasicKVStore - KVStore = v1.KVStore - Committer = v1.Committer - CommitKVStore = v1.CommitKVStore - CacheKVStore = v1.CacheKVStore - Queryable = v1.Queryable - CacheWrap = v1.CacheWrap - - KVStoreKey = v1.KVStoreKey - MemoryStoreKey = v1.MemoryStoreKey - TransientStoreKey = v1.TransientStoreKey - - KVPair = v1.KVPair - StoreKVPair = v1.StoreKVPair -) - -// Re-export relevant constants, values and utility functions -const ( - StoreTypeMemory = v1.StoreTypeMemory - StoreTypeTransient = v1.StoreTypeTransient - StoreTypeDB = v1.StoreTypeDB - StoreTypeSMT = v1.StoreTypeSMT - StoreTypePersistent = v1.StoreTypePersistent -) - -var ( - NewKVStoreKey = v1.NewKVStoreKey - PrefixEndBytes = v1.PrefixEndBytes - KVStorePrefixIterator = v1.KVStorePrefixIterator - KVStoreReversePrefixIterator = v1.KVStoreReversePrefixIterator - - NewStoreKVPairWriteListener = v1.NewStoreKVPairWriteListener - - ProofOpSMTCommitment = v1.ProofOpSMTCommitment - ProofOpSimpleMerkleCommitment = v1.ProofOpSimpleMerkleCommitment - - CommitmentOpDecoder = v1.CommitmentOpDecoder - ProofOpFromMap = v1.ProofOpFromMap - NewSmtCommitmentOp = v1.NewSmtCommitmentOp -) - -// BasicMultiStore defines a minimal interface for accessing root state. -type BasicMultiStore interface { - // Returns a KVStore which has access only to the namespace of the StoreKey. - // Panics if the key is not found in the schema. - GetKVStore(StoreKey) KVStore -} - -// mixin interface for trace and listen methods -type rootStoreTraceListen interface { - TracingEnabled() bool - SetTracer(w io.Writer) - SetTraceContext(TraceContext) - ListeningEnabled(key StoreKey) bool - AddListeners(key StoreKey, listeners []WriteListener) -} - -// CommitMultiStore defines a complete interface for persistent root state, including -// (read-only) access to past versions, pruning, trace/listen, and state snapshots. -type CommitMultiStore interface { - BasicMultiStore - rootStoreTraceListen - Committer - snapshottypes.Snapshotter - - // Gets a read-only view of the store at a specific version. - // Returns an error if the version is not found. - GetVersion(int64) (BasicMultiStore, error) - // Closes the store and all backing transactions. - Close() error - // Returns a branched whose modifications are later merged back in. - CacheMultiStore() CacheMultiStore - // Defines the minimum version number that can be saved by this store. - SetInitialVersion(uint64) error -} - -// CacheMultiStore defines a branch of the root state which can be written back to the source store. -type CacheMultiStore interface { - BasicMultiStore - rootStoreTraceListen - - // Returns a branched whose modifications are later merged back in. - CacheMultiStore() CacheMultiStore - // Write all cached changes back to the source store. Note: this overwrites any intervening changes. - Write() -} - -// MultiStorePersistentCache provides inter-block (persistent) caching capabilities for a CommitMultiStore. -// TODO: placeholder. Implement and redefine this -type MultiStorePersistentCache = v1.MultiStorePersistentCache From 3aaaf2cc7df748ffd8ff4f57688ed1000cf6cbfe Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 17:26:12 +0100 Subject: [PATCH 25/52] build: use cometbft in v0.46 (#15090) --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/cosmovisor-release.yml | 2 +- .github/workflows/release.yml | 4 +- .github/workflows/sims.yml | 10 +- .github/workflows/test-race.yml | 8 +- .github/workflows/test.yml | 14 +- CHANGELOG.md | 7 +- Dockerfile | 2 +- Makefile | 2 +- README.md | 2 +- RELEASE_NOTES.md | 18 +- baseapp/baseapp_test.go | 18 +- contrib/devtools/Dockerfile | 2 +- contrib/images/simd-dlv/Dockerfile | 2 +- contrib/images/simd-env/Dockerfile | 2 +- contrib/rosetta/rosetta-ci/Dockerfile | 2 +- contrib/rosetta/rosetta-cli/Dockerfile | 2 +- go.mod | 36 ++-- go.sum | 231 ++++------------------- proto/tendermint/abci/types.proto | 111 ++++++----- proto/tendermint/crypto/keys.proto | 2 +- proto/tendermint/types/evidence.proto | 2 +- proto/tendermint/types/params.proto | 3 +- proto/tendermint/types/types.proto | 42 +++-- scripts/protocgen.sh | 2 +- server/rollback.go | 2 +- server/start.go | 2 +- server/util.go | 2 +- snapshots/helpers_test.go | 1 - snapshots/manager_test.go | 2 +- snapshots/stream.go | 4 - snapshots/types/format.go | 2 +- store/rootmulti/snapshot_test.go | 2 +- store/rootmulti/store.go | 2 +- 34 files changed, 206 insertions(+), 341 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 968b24c94448..67de44c531e2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/cosmovisor-release.yml b/.github/workflows/cosmovisor-release.yml index 1a7100d5a780..f28ca050bfe7 100644 --- a/.github/workflows/cosmovisor-release.yml +++ b/.github/workflows/cosmovisor-release.yml @@ -13,7 +13,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 # get 'v*.*.*' part from 'cosmovisor/v*.*.*' and save to $GITHUB_ENV - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/cosmovisor/}" >> $GITHUB_ENV diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 544fcb1b4b24..23f965327abc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Unshallow run: git fetch --prune --unshallow - name: Create release @@ -42,4 +42,4 @@ jobs: SLACK_MESSAGE: "@channel :point_right: https://github.com/cosmos/cosmos-sdk/releases/tag/${{ github.ref_name }}" SLACK_FOOTER: "" SLACK_LINK_NAMES: true - MSG_MINIMAL: true \ No newline at end of file + MSG_MINIMAL: true diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index d7e97454a7b5..6a6e3723f6da 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - run: make build @@ -33,7 +33,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - name: Install runsim @@ -51,7 +51,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: actions/cache@v3 @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: actions/cache@v3 @@ -89,7 +89,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: actions/cache@v3 diff --git a/.github/workflows/test-race.yml b/.github/workflows/test-race.yml index 1b92805875d2..642ca23bbdcf 100644 --- a/.github/workflows/test-race.yml +++ b/.github/workflows/test-race.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - name: install tparse @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: @@ -60,7 +60,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Create a file with all core Cosmos SDK pkgs run: go list ./... > pkgs.txt - name: Split pkgs into 4 files @@ -94,7 +94,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5234cc89eba..2b1a8bc6008e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: @@ -48,7 +48,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: @@ -71,7 +71,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Create a file with all core Cosmos SDK pkgs run: go list ./... > pkgs.txt - name: Split pkgs into 4 files @@ -105,7 +105,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | @@ -201,7 +201,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v6.0.1 id: git_diff with: @@ -224,7 +224,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - name: Install runsim @@ -241,7 +241,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v6.0.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d752bb18aa2..c4bec9497aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,11 +37,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## Improvements +### Improvements +* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md). * (store) [#15152](https://github.com/cosmos/cosmos-sdk/pull/15152) Remove unmaintained and experimental `store/v2alpha1`. * (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. +### Bug Fixes + +* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in Go 1.19. + ## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16 ### Improvements diff --git a/Dockerfile b/Dockerfile index 026f222c594a..69718406a317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ # > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys add foo # > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.simappcli:/root/.simapp simapp simd keys list # TODO: demo connecting rest-server (or is this in server now?) -FROM golang:1.18-alpine AS build-env +FROM golang:1.19-alpine AS build-env # Install minimum necessary dependencies ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 diff --git a/Makefile b/Makefile index 442598e374f7..1bf7dbef792c 100644 --- a/Makefile +++ b/Makefile @@ -430,7 +430,7 @@ proto-lint: proto-check-breaking: @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main -TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.22/proto/tendermint +TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.27-alpha.2/proto/tendermint TM_CRYPTO_TYPES = proto/tendermint/crypto TM_ABCI_TYPES = proto/tendermint/abci diff --git a/README.md b/README.md index c00ce7ee656c..02f12fd6173d 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The Cosmos SDK is a framework for building blockchain applications. [Tendermint **WARNING**: The Cosmos SDK has mostly stabilized, but we are still making some breaking changes. -**Note**: Requires [Go 1.18+](https://go.dev/dl) +**Note**: Requires [Go 1.19+](https://go.dev/dl) ## Quick Start diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c5f8b0140af2..c7f064eea7cc 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,7 +1,19 @@ -# Cosmos SDK v0.46.10 Release Notes +# Cosmos SDK v0.46.11 Release Notes -This release improves CPU profiling when using the `--cpu-profile` flag, and fixes a possible way to DoS a node. +This release includes the migration to CometBFT. This migration should be not breaking. +From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: + +```go +// use cometbft +replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 +``` + +A more complete migration is happening in Cosmos SDK v0.47. + +Additionally, the SDK sets its minimum version to Go 1.19. +This is not because the SDK uses new Go 1.19 functionalities, but because we recommend chains as well to upgrade to Go 1.19 because Go 1.18 is not supported anymore. +We recommend applications to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -Full Commit History: https://github.com/cosmos/cosmos-sdk/compare/v0.46.9...v0.46.10 +**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.10...v0.46.11 diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index bf5d6b213e8d..99e4541b5ea3 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -1792,7 +1792,7 @@ func TestSnapshotWithPruning(t *testing.T) { pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing), }, expectedSnapshots: []*abci.Snapshot{ - {Height: 20, Format: 2, Chunks: 5}, + {Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5}, }, }, "prune everything with snapshot": { @@ -1804,7 +1804,7 @@ func TestSnapshotWithPruning(t *testing.T) { pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningEverything), }, expectedSnapshots: []*abci.Snapshot{ - {Height: 20, Format: 2, Chunks: 5}, + {Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5}, }, }, "default pruning with snapshot": { @@ -1816,7 +1816,7 @@ func TestSnapshotWithPruning(t *testing.T) { pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningDefault), }, expectedSnapshots: []*abci.Snapshot{ - {Height: 20, Format: 2, Chunks: 5}, + {Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5}, }, }, "custom": { @@ -1828,8 +1828,8 @@ func TestSnapshotWithPruning(t *testing.T) { pruningOpts: pruningtypes.NewCustomPruningOptions(12, 12), }, expectedSnapshots: []*abci.Snapshot{ - {Height: 25, Format: 2, Chunks: 6}, - {Height: 20, Format: 2, Chunks: 5}, + {Height: 25, Format: snapshottypes.CurrentFormat, Chunks: 6}, + {Height: 20, Format: snapshottypes.CurrentFormat, Chunks: 5}, }, }, "no snapshots": { @@ -1850,9 +1850,9 @@ func TestSnapshotWithPruning(t *testing.T) { pruningOpts: pruningtypes.NewPruningOptions(pruningtypes.PruningNothing), }, expectedSnapshots: []*abci.Snapshot{ - {Height: 9, Format: 2, Chunks: 2}, - {Height: 6, Format: 2, Chunks: 2}, - {Height: 3, Format: 2, Chunks: 1}, + {Height: 9, Format: snapshottypes.CurrentFormat, Chunks: 2}, + {Height: 6, Format: snapshottypes.CurrentFormat, Chunks: 2}, + {Height: 3, Format: snapshottypes.CurrentFormat, Chunks: 1}, }, }, } @@ -1928,7 +1928,7 @@ func TestLoadSnapshotChunk(t *testing.T) { }{ "Existing snapshot": {2, snapshottypes.CurrentFormat, 1, false}, "Missing height": {100, snapshottypes.CurrentFormat, 1, true}, - "Missing format": {2, 3, 1, true}, + "Missing format": {2, snapshottypes.CurrentFormat + 1, 1, true}, "Missing chunk": {2, snapshottypes.CurrentFormat, 9, true}, "Zero height": {0, snapshottypes.CurrentFormat, 1, true}, "Zero format": {2, 0, 1, true}, diff --git a/contrib/devtools/Dockerfile b/contrib/devtools/Dockerfile index 05bed5ac81bf..213950ec9e07 100644 --- a/contrib/devtools/Dockerfile +++ b/contrib/devtools/Dockerfile @@ -4,7 +4,7 @@ FROM bufbuild/buf:1.1.0 as BUILDER -FROM golang:1.18-alpine +FROM golang:1.19-alpine RUN apk add --no-cache \ nodejs \ diff --git a/contrib/images/simd-dlv/Dockerfile b/contrib/images/simd-dlv/Dockerfile index e88fc4da0d9e..78807305e3a0 100644 --- a/contrib/images/simd-dlv/Dockerfile +++ b/contrib/images/simd-dlv/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk add build-base git linux-headers libc-dev RUN go install github.com/go-delve/delve/cmd/dlv@latest diff --git a/contrib/images/simd-env/Dockerfile b/contrib/images/simd-env/Dockerfile index 0d3565375837..aaeab8c5e5b7 100644 --- a/contrib/images/simd-env/Dockerfile +++ b/contrib/images/simd-env/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk add build-base git linux-headers diff --git a/contrib/rosetta/rosetta-ci/Dockerfile b/contrib/rosetta/rosetta-ci/Dockerfile index d4cfc58528e9..a333fdc01b73 100644 --- a/contrib/rosetta/rosetta-ci/Dockerfile +++ b/contrib/rosetta/rosetta-ci/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine as build +FROM golang:1.19-alpine as build RUN apk add --no-cache tar git diff --git a/contrib/rosetta/rosetta-cli/Dockerfile b/contrib/rosetta/rosetta-cli/Dockerfile index da6ef2879239..f4fc15d9bced 100644 --- a/contrib/rosetta/rosetta-cli/Dockerfile +++ b/contrib/rosetta/rosetta-cli/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine as build +FROM golang:1.19-alpine as build RUN apk add git gcc libc-dev --no-cache diff --git a/go.mod b/go.mod index 59dbcc12dc13..0d6a1b9558ac 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -go 1.18 +go 1.19 module github.com/cosmos/cosmos-sdk @@ -48,23 +48,24 @@ require ( github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.24 + github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 golang.org/x/crypto v0.5.0 golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e - google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a - google.golang.org/grpc v1.50.1 + google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 + google.golang.org/grpc v1.52.0 google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 pgregory.net/rapid v0.4.7 sigs.k8s.io/yaml v1.3.0 ) require ( - cloud.google.com/go v0.102.1 // indirect - cloud.google.com/go/compute v1.7.0 // indirect - cloud.google.com/go/iam v0.4.0 // indirect - cloud.google.com/go/storage v1.22.1 // indirect + cloud.google.com/go v0.105.0 // indirect + cloud.google.com/go/compute v1.12.1 // indirect + cloud.google.com/go/compute/metadata v0.2.1 // indirect + cloud.google.com/go/iam v0.7.0 // indirect + cloud.google.com/go/storage v1.27.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect @@ -75,6 +76,7 @@ require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -95,12 +97,11 @@ require ( github.com/golang/glog v1.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.0.1 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect - github.com/googleapis/gax-go/v2 v2.4.0 // indirect - github.com/googleapis/go-type-adapters v1.0.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect + github.com/googleapis/gax-go/v2 v2.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect @@ -137,18 +138,19 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect golang.org/x/net v0.5.0 // indirect - golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect + golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect golang.org/x/sys v0.4.0 // indirect golang.org/x/term v0.4.0 // indirect golang.org/x/text v0.6.0 // indirect - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/api v0.93.0 // indirect + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect + google.golang.org/api v0.102.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -167,8 +169,8 @@ replace ( github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 - // use informal system fork of tendermint - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 + // use cometbft + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27-alpha.2 ) retract ( diff --git a/go.sum b/go.sum index 18465df7d274..94de6d3ab869 100644 --- a/go.sum +++ b/go.sum @@ -19,21 +19,8 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -41,18 +28,15 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= +cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= +cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= +cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.4.0 h1:YBYU00SCDzZJdHqVc4I5d6lsklcYIjQZa1YmEz4jlSE= -cloud.google.com/go/iam v0.4.0/go.mod h1:cbaZxyScUhxl7ZAkNWiALgihfP75wS/fUsVNaa1r3vA= +cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= +cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= +cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -63,8 +47,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= +cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= +cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= @@ -203,12 +187,6 @@ github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3h github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -216,6 +194,10 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/cometbft/cometbft v0.34.27-alpha.2 h1:ERW9qPlaHjshc6BuCAc5yfXcIWuDKAjGLCzJvQQ3YlM= +github.com/cometbft/cometbft v0.34.27-alpha.2/go.mod h1:6tEDwldPfO1ynAd9kx8j808atUVY0jUAJ18l3glfpuM= +github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= +github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -306,10 +288,6 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= @@ -404,7 +382,6 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -423,7 +400,6 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -433,8 +409,8 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/flatbuffers v1.11.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -448,8 +424,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -461,7 +435,6 @@ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXi github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -474,11 +447,6 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -486,19 +454,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0 h1:zO8WHNx/MYiAKJ3d5spxZXZE6KHmIQGQcAzwUzV7qQw= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= +github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= +github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= @@ -597,8 +558,6 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/tendermint v0.34.26 h1:89XvVexAy62geGWxmDmdmmJvfindx+Su2oTuwfSWMeU= -github.com/informalsystems/tendermint v0.34.26/go.mod h1:q3uAZ/t5+MblQhFuHSd4flqaLDx7iUtWpwWbwvHAFhs= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -946,6 +905,8 @@ github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= +github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= @@ -1009,7 +970,6 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -1073,7 +1033,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1133,9 +1092,7 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1143,11 +1100,6 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1159,19 +1111,10 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= +golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1183,7 +1126,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1245,47 +1187,26 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1372,19 +1293,14 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.6.0/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU= @@ -1411,28 +1327,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.93.0 h1:T2xt9gi0gHdxdnRkVQhT8mIvPaXKNsDNWz+L696M66M= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= +google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1485,54 +1381,9 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a h1:GH6UPn3ixhWcKDhpnEC55S75cerLPdpp3hrhfKYjZgw= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1557,23 +1408,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= +google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1588,7 +1424,6 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/proto/tendermint/abci/types.proto b/proto/tendermint/abci/types.proto index bcc7b036e290..44f86112938e 100644 --- a/proto/tendermint/abci/types.proto +++ b/proto/tendermint/abci/types.proto @@ -58,12 +58,13 @@ message RequestSetOption { } message RequestInitChain { - google.protobuf.Timestamp time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; + google.protobuf.Timestamp time = 1 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + string chain_id = 2; + ConsensusParams consensus_params = 3; + repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; + bytes app_state_bytes = 5; + int64 initial_height = 6; } message RequestQuery { @@ -105,8 +106,8 @@ message RequestListSnapshots {} // offers a snapshot to the application message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height + Snapshot snapshot = 1; // snapshot offered by peers + bytes app_hash = 2; // light client-verified app hash for snapshot height } // loads a snapshot chunk @@ -185,8 +186,8 @@ message ResponseInitChain { message ResponseQuery { uint32 code = 1; // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 index = 5; bytes key = 6; bytes value = 7; @@ -196,22 +197,24 @@ message ResponseQuery { } message ResponseBeginBlock { - repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated Event events = 1 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } message ResponseCheckTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; - string sender = 9; - int64 priority = 10; + repeated Event events = 7 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + string codespace = 8; + string sender = 9; + int64 priority = 10; - // mempool_error is set by Tendermint. + // mempool_error is set by CometBFT. // ABCI applictions creating a ResponseCheckTX should not set mempool_error. string mempool_error = 11; } @@ -219,20 +222,22 @@ message ResponseCheckTx { message ResponseDeliverTx { uint32 code = 1; bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic + string log = 3; // nondeterministic + string info = 4; // nondeterministic int64 gas_wanted = 5 [json_name = "gas_wanted"]; int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, - (gogoproto.jsontag) = "events,omitempty"]; // nondeterministic + repeated Event events = 7 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "events,omitempty" + ]; // nondeterministic string codespace = 8; } message ResponseEndBlock { repeated ValidatorUpdate validator_updates = 1 [(gogoproto.nullable) = false]; ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + repeated Event events = 3 + [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; } message ResponseCommit { @@ -249,12 +254,12 @@ message ResponseOfferSnapshot { Result result = 1; enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Snapshot accepted, apply chunks + ABORT = 2; // Abort all snapshot restoration + REJECT = 3; // Reject this specific snapshot, try others + REJECT_FORMAT = 4; // Reject all snapshots of this format, try others + REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others } } @@ -264,16 +269,16 @@ message ResponseLoadSnapshotChunk { message ResponseApplySnapshotChunk { Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban + repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply + repeated string reject_senders = 3; // Chunk senders to reject and ban enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others + UNKNOWN = 0; // Unknown result, abort all snapshot restoration + ACCEPT = 1; // Chunk successfully accepted + ABORT = 2; // Abort all snapshot restoration + RETRY = 3; // Retry chunk (combine with refetch and reject) + RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) + REJECT_SNAPSHOT = 5; // Reject this snapshot, try others } } @@ -307,14 +312,17 @@ message LastCommitInfo { // Later, transactions may be queried using these events. message Event { string type = 1; - repeated EventAttribute attributes = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "attributes,omitempty"]; + repeated EventAttribute attributes = 2 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "attributes,omitempty" + ]; } // EventAttribute is a single key-value pair, associated with an event. message EventAttribute { bytes key = 1; bytes value = 2; - bool index = 3; // nondeterministic + bool index = 3; // nondeterministic } // TxResult contains results of executing the transaction. @@ -332,9 +340,9 @@ message TxResult { // Validator message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) + bytes address = 1; // The first 20 bytes of SHA256(public key) // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power + int64 power = 3; // The voting power } // ValidatorUpdate @@ -362,7 +370,8 @@ message Evidence { // The height when the offense occurred int64 height = 3; // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp time = 4 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // Total voting power of the validator set in case the ABCI application does // not store historical validators. // https://github.com/tendermint/tendermint/issues/4581 @@ -373,11 +382,11 @@ message Evidence { // State Sync Types message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata + uint64 height = 1; // The height at which the snapshot was taken + uint32 format = 2; // The application-specific snapshot format + uint32 chunks = 3; // Number of chunks in the snapshot + bytes hash = 4; // Arbitrary snapshot hash, equal only if identical + bytes metadata = 5; // Arbitrary application metadata } //---------------------------------------- @@ -397,6 +406,8 @@ service ABCIApplication { rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); + rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) + returns (ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(RequestApplySnapshotChunk) + returns (ResponseApplySnapshotChunk); } diff --git a/proto/tendermint/crypto/keys.proto b/proto/tendermint/crypto/keys.proto index 16fd7adf3eef..5b94ddaec9ac 100644 --- a/proto/tendermint/crypto/keys.proto +++ b/proto/tendermint/crypto/keys.proto @@ -5,7 +5,7 @@ option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; import "gogoproto/gogo.proto"; -// PublicKey defines the keys available for use with Tendermint Validators +// PublicKey defines the keys available for use with Validators message PublicKey { option (gogoproto.compare) = true; option (gogoproto.equal) = true; diff --git a/proto/tendermint/types/evidence.proto b/proto/tendermint/types/evidence.proto index d9548a430296..451b8dca3c71 100644 --- a/proto/tendermint/types/evidence.proto +++ b/proto/tendermint/types/evidence.proto @@ -30,7 +30,7 @@ message LightClientAttackEvidence { int64 common_height = 2; repeated tendermint.types.Validator byzantine_validators = 3; int64 total_voting_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; } message EvidenceList { diff --git a/proto/tendermint/types/params.proto b/proto/tendermint/types/params.proto index 70789222a5d3..0de7d846fbd3 100644 --- a/proto/tendermint/types/params.proto +++ b/proto/tendermint/types/params.proto @@ -45,7 +45,8 @@ message EvidenceParams { // It should correspond with an app's "unbonding period" or other similar // mechanism for handling [Nothing-At-Stake // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; + google.protobuf.Duration max_age_duration = 2 + [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; // This sets the maximum size of total evidence in bytes that can be committed in a single block. // and should fall comfortably under the max block bytes. diff --git a/proto/tendermint/types/types.proto b/proto/tendermint/types/types.proto index 57efc33c5b7e..3ce1694594ff 100644 --- a/proto/tendermint/types/types.proto +++ b/proto/tendermint/types/types.proto @@ -54,7 +54,7 @@ message BlockID { // -------------------------------- -// Header defines the structure of a Tendermint block header. +// Header defines the structure of a block header. message Header { // basic block info tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; @@ -66,19 +66,19 @@ message Header { BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions + bytes last_commit_hash = 6; // commit from validators from the last block + bytes data_hash = 7; // transactions // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block + bytes validators_hash = 8; // validators for the current block + bytes next_validators_hash = 9; // validators for the next block + bytes consensus_hash = 10; // consensus params for current block + bytes app_hash = 11; // state after txs from the previous block + bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block + bytes evidence_hash = 13; // evidence included in the block + bytes proposer_address = 14; // original proposer of the block } // Data contains the set of transactions included in the block @@ -95,11 +95,13 @@ message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; - BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; + BlockID block_id = 4 + [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. + google.protobuf.Timestamp timestamp = 5 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes validator_address = 6; + int32 validator_index = 7; + bytes signature = 8; } // Commit contains the evidence that a block was committed by a set of validators. @@ -114,8 +116,9 @@ message Commit { message CommitSig { BlockIDFlag block_id_flag = 1; bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; + google.protobuf.Timestamp timestamp = 3 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 4; } message Proposal { @@ -124,8 +127,9 @@ message Proposal { int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; + google.protobuf.Timestamp timestamp = 6 + [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; + bytes signature = 7; } message SignedHeader { diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 7b61f31ea5f2..3e740c8b630a 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -39,4 +39,4 @@ cd .. cp -r github.com/cosmos/cosmos-sdk/* ./ rm -rf github.com -go mod tidy -compat=1.18 +go mod tidy -compat=1.19 diff --git a/server/rollback.go b/server/rollback.go index c3dba335466b..c5245589aacb 100644 --- a/server/rollback.go +++ b/server/rollback.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/types" "github.com/spf13/cobra" - tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" ) // NewRollbackCmd creates a command to rollback tendermint and multistore state by one height. diff --git a/server/start.go b/server/start.go index 0f5bd05d3eb2..208bfb8db674 100644 --- a/server/start.go +++ b/server/start.go @@ -12,7 +12,7 @@ import ( "github.com/spf13/cobra" "github.com/tendermint/tendermint/abci/server" - tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" tmos "github.com/tendermint/tendermint/libs/os" "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/p2p" diff --git a/server/util.go b/server/util.go index 2d9d02eb6834..98e82be44b03 100644 --- a/server/util.go +++ b/server/util.go @@ -20,7 +20,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" tmcfg "github.com/tendermint/tendermint/config" tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" diff --git a/snapshots/helpers_test.go b/snapshots/helpers_test.go index 24051a17a927..412b7de6caac 100644 --- a/snapshots/helpers_test.go +++ b/snapshots/helpers_test.go @@ -77,7 +77,6 @@ func snapshotItems(items [][]byte) [][]byte { _ = snapshottypes.WriteExtensionItem(protoWriter, item) } _ = protoWriter.Close() - _ = zWriter.Close() _ = bufWriter.Flush() _ = chunkWriter.Close() }() diff --git a/snapshots/manager_test.go b/snapshots/manager_test.go index 7fbddd6c7d6d..8f8e8d3da8d7 100644 --- a/snapshots/manager_test.go +++ b/snapshots/manager_test.go @@ -91,7 +91,7 @@ func TestManager_Take(t *testing.T) { Height: 5, Format: snapshotter.SnapshotFormat(), Chunks: 1, - Hash: []uint8{0xcd, 0x17, 0x9e, 0x7f, 0x28, 0xb6, 0x82, 0x90, 0xc7, 0x25, 0xf3, 0x42, 0xac, 0x65, 0x73, 0x50, 0xaa, 0xa0, 0x10, 0x5c, 0x40, 0x8c, 0xd5, 0x1, 0xed, 0x82, 0xb5, 0xca, 0x8b, 0xe0, 0x83, 0xa2}, + Hash: []uint8{0xcf, 0xd8, 0x16, 0xd2, 0xf8, 0x11, 0xe8, 0x90, 0x92, 0xf1, 0xfe, 0x3b, 0xea, 0xd2, 0x94, 0xfc, 0xfa, 0x4f, 0x9e, 0x2a, 0x91, 0xbe, 0xb0, 0x50, 0x83, 0xe9, 0x28, 0x62, 0x48, 0x6a, 0x4b, 0x4}, Metadata: types.Metadata{ ChunkHashes: checksums(expectChunks), }, diff --git a/snapshots/stream.go b/snapshots/stream.go index 935028313bb5..ce000f3e9c3d 100644 --- a/snapshots/stream.go +++ b/snapshots/stream.go @@ -57,10 +57,6 @@ func (sw *StreamWriter) Close() error { sw.chunkWriter.CloseWithError(err) return err } - if err := sw.zWriter.Close(); err != nil { - sw.chunkWriter.CloseWithError(err) - return err - } if err := sw.bufWriter.Flush(); err != nil { sw.chunkWriter.CloseWithError(err) return err diff --git a/snapshots/types/format.go b/snapshots/types/format.go index d5e960660ac9..317b6a6e329e 100644 --- a/snapshots/types/format.go +++ b/snapshots/types/format.go @@ -3,4 +3,4 @@ package types // CurrentFormat is the currently used format for snapshots. Snapshots using the same format // must be identical across all nodes for a given height, so this must be bumped when the binary // snapshot output changes. -const CurrentFormat uint32 = 2 +const CurrentFormat uint32 = 3 diff --git a/store/rootmulti/snapshot_test.go b/store/rootmulti/snapshot_test.go index bad1603da7c9..de7880788eee 100644 --- a/store/rootmulti/snapshot_test.go +++ b/store/rootmulti/snapshot_test.go @@ -128,7 +128,7 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { "aa048b4ee0f484965d7b3b06822cf0772cdcaad02f3b1b9055e69f2cb365ef3c", "7921eaa3ed4921341e504d9308a9877986a879fe216a099c86e8db66fcba4c63", "a4a864e6c02c9fca5837ec80dc84f650b25276ed7e4820cf7516ced9f9901b86", - "ca2879ac6e7205d257440131ba7e72bef784cd61642e32b847729e543c1928b9", + "980925390cc50f14998ecb1e87de719ca9dd7e72f5fefbe445397bf670f36c31", }}, } for _, tc := range testcases { diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index dd81d771eec5..74915695ab40 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -1006,7 +1006,7 @@ type storeParams struct { initialVersion uint64 } -func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { // nolint +func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { return storeParams{ key: key, db: db, From f1ec5fe98167fc29670d701b215ee141f94dd72d Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Feb 2023 22:10:32 +0100 Subject: [PATCH 26/52] chore: bump cometbft to v0.34.27 final (#15206) --- Makefile | 2 +- RELEASE_NOTES.md | 4 ++-- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 1bf7dbef792c..dff5e166c762 100644 --- a/Makefile +++ b/Makefile @@ -430,7 +430,7 @@ proto-lint: proto-check-breaking: @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main -TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.27-alpha.2/proto/tendermint +TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.27/proto/tendermint TM_CRYPTO_TYPES = proto/tendermint/crypto TM_ABCI_TYPES = proto/tendermint/abci diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c7f064eea7cc..91d8165e913f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,6 @@ # Cosmos SDK v0.46.11 Release Notes -This release includes the migration to CometBFT. This migration should be not breaking. +This release includes the migration to [CometBFT](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). This migration should be not breaking. From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: ```go @@ -8,7 +8,7 @@ From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your a replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ``` -A more complete migration is happening in Cosmos SDK v0.47. +A more complete migration is happening in Cosmos SDK v0.47.0. Additionally, the SDK sets its minimum version to Go 1.19. This is not because the SDK uses new Go 1.19 functionalities, but because we recommend chains as well to upgrade to Go 1.19 because Go 1.18 is not supported anymore. diff --git a/go.mod b/go.mod index 0d6a1b9558ac..d45aad66ba4e 100644 --- a/go.mod +++ b/go.mod @@ -144,11 +144,11 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.5.0 // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect - golang.org/x/sys v0.4.0 // indirect - golang.org/x/term v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.102.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -170,7 +170,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 // use cometbft - github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27-alpha.2 + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ) retract ( diff --git a/go.sum b/go.sum index 94de6d3ab869..12ad00eae55b 100644 --- a/go.sum +++ b/go.sum @@ -194,8 +194,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.34.27-alpha.2 h1:ERW9qPlaHjshc6BuCAc5yfXcIWuDKAjGLCzJvQQ3YlM= -github.com/cometbft/cometbft v0.34.27-alpha.2/go.mod h1:6tEDwldPfO1ynAd9kx8j808atUVY0jUAJ18l3glfpuM= +github.com/cometbft/cometbft v0.34.27 h1:ri6BvmwjWR0gurYjywcBqRe4bbwc3QVs9KRcCzgh/J0= +github.com/cometbft/cometbft v0.34.27/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -1100,8 +1100,8 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1208,13 +1208,13 @@ golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1224,8 +1224,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 1229bd17aa2a427459da71ab981a71d79968f236 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:55:25 +0100 Subject: [PATCH 27/52] fix: Change proposer address cast for `sdk_block` conversion (backport #15243) (#15245) Co-authored-by: Maksym Hontar <99190705+max-hontar@users.noreply.github.com> Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + client/grpc/tmservice/service_test.go | 6 +++--- client/grpc/tmservice/util.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4bec9497aa1..5dd14d02ea18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address. * (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in Go 1.19. ## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16 diff --git a/client/grpc/tmservice/service_test.go b/client/grpc/tmservice/service_test.go index 030e62d4f0dd..226b2feb88c9 100644 --- a/client/grpc/tmservice/service_test.go +++ b/client/grpc/tmservice/service_test.go @@ -88,8 +88,8 @@ func (s *IntegrationTestSuite) TestQueryLatestBlock() { s.Require().NoError(err) var blockInfoRes tmservice.GetLatestBlockResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes)) - s.Require().Equal(types.ValAddress(blockInfoRes.Block.Header.ProposerAddress).String(), blockInfoRes.SdkBlock.Header.ProposerAddress) - s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper") + s.Require().Equal(types.ConsAddress(blockInfoRes.Block.Header.ProposerAddress).String(), blockInfoRes.SdkBlock.Header.ProposerAddress) + s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons") } func (s *IntegrationTestSuite) TestQueryBlockByHeight() { @@ -101,7 +101,7 @@ func (s *IntegrationTestSuite) TestQueryBlockByHeight() { s.Require().NoError(err) var blockInfoRes tmservice.GetBlockByHeightResponse s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes)) - s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper") + s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons") } func (s *IntegrationTestSuite) TestQueryLatestValidatorSet() { diff --git a/client/grpc/tmservice/util.go b/client/grpc/tmservice/util.go index 9bbda0d2e26e..aeffaa84c3b7 100644 --- a/client/grpc/tmservice/util.go +++ b/client/grpc/tmservice/util.go @@ -21,7 +21,7 @@ func convertHeader(h tmprototypes.Header) Header { EvidenceHash: h.EvidenceHash, LastResultsHash: h.LastResultsHash, LastCommitHash: h.LastCommitHash, - ProposerAddress: sdk.ValAddress(h.ProposerAddress).String(), + ProposerAddress: sdk.ConsAddress(h.ProposerAddress).String(), } } From 578c160cdf49b7c885ef82198284f20cf09ad452 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 3 Mar 2023 12:43:19 +0100 Subject: [PATCH 28/52] fix: revert double close fix (#15255) --- snapshots/helpers_test.go | 1 + snapshots/manager_test.go | 2 +- snapshots/stream.go | 4 ++++ snapshots/types/format.go | 2 +- store/rootmulti/snapshot_test.go | 2 +- 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/snapshots/helpers_test.go b/snapshots/helpers_test.go index 412b7de6caac..24051a17a927 100644 --- a/snapshots/helpers_test.go +++ b/snapshots/helpers_test.go @@ -77,6 +77,7 @@ func snapshotItems(items [][]byte) [][]byte { _ = snapshottypes.WriteExtensionItem(protoWriter, item) } _ = protoWriter.Close() + _ = zWriter.Close() _ = bufWriter.Flush() _ = chunkWriter.Close() }() diff --git a/snapshots/manager_test.go b/snapshots/manager_test.go index 8f8e8d3da8d7..b71043022827 100644 --- a/snapshots/manager_test.go +++ b/snapshots/manager_test.go @@ -91,7 +91,7 @@ func TestManager_Take(t *testing.T) { Height: 5, Format: snapshotter.SnapshotFormat(), Chunks: 1, - Hash: []uint8{0xcf, 0xd8, 0x16, 0xd2, 0xf8, 0x11, 0xe8, 0x90, 0x92, 0xf1, 0xfe, 0x3b, 0xea, 0xd2, 0x94, 0xfc, 0xfa, 0x4f, 0x9e, 0x2a, 0x91, 0xbe, 0xb0, 0x50, 0x83, 0xe9, 0x28, 0x62, 0x48, 0x6a, 0x4b, 0x4}, + Hash: []uint8{0x14, 0x38, 0x97, 0x96, 0xba, 0xe4, 0x81, 0xaf, 0x6c, 0xac, 0xff, 0xa5, 0xb8, 0x7e, 0x63, 0x4b, 0xac, 0x69, 0x3f, 0x38, 0x90, 0x5c, 0x7d, 0x57, 0xb3, 0xf, 0x69, 0x73, 0xb3, 0xa0, 0xe0, 0xad}, Metadata: types.Metadata{ ChunkHashes: checksums(expectChunks), }, diff --git a/snapshots/stream.go b/snapshots/stream.go index ce000f3e9c3d..935028313bb5 100644 --- a/snapshots/stream.go +++ b/snapshots/stream.go @@ -57,6 +57,10 @@ func (sw *StreamWriter) Close() error { sw.chunkWriter.CloseWithError(err) return err } + if err := sw.zWriter.Close(); err != nil { + sw.chunkWriter.CloseWithError(err) + return err + } if err := sw.bufWriter.Flush(); err != nil { sw.chunkWriter.CloseWithError(err) return err diff --git a/snapshots/types/format.go b/snapshots/types/format.go index 317b6a6e329e..d5e960660ac9 100644 --- a/snapshots/types/format.go +++ b/snapshots/types/format.go @@ -3,4 +3,4 @@ package types // CurrentFormat is the currently used format for snapshots. Snapshots using the same format // must be identical across all nodes for a given height, so this must be bumped when the binary // snapshot output changes. -const CurrentFormat uint32 = 3 +const CurrentFormat uint32 = 2 diff --git a/store/rootmulti/snapshot_test.go b/store/rootmulti/snapshot_test.go index de7880788eee..f8b058656d33 100644 --- a/store/rootmulti/snapshot_test.go +++ b/store/rootmulti/snapshot_test.go @@ -128,7 +128,7 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { "aa048b4ee0f484965d7b3b06822cf0772cdcaad02f3b1b9055e69f2cb365ef3c", "7921eaa3ed4921341e504d9308a9877986a879fe216a099c86e8db66fcba4c63", "a4a864e6c02c9fca5837ec80dc84f650b25276ed7e4820cf7516ced9f9901b86", - "980925390cc50f14998ecb1e87de719ca9dd7e72f5fefbe445397bf670f36c31", + "8ca5b957e36fa13e704c31494649b2a74305148d70d70f0f26dee066b615c1d0", }}, } for _, tc := range testcases { From 5023392bd9718679668dd8e88a792a6defa63c00 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 3 Mar 2023 20:25:55 +0100 Subject: [PATCH 29/52] chore: prepare v0.46.11 release (#15259) --- CHANGELOG.md | 3 ++- RELEASE_NOTES.md | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dd14d02ea18..90ecc29180d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03 + ### Improvements * (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md). @@ -46,7 +48,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address. -* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in Go 1.19. ## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 91d8165e913f..381bb7ca8b0f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,6 +1,7 @@ # Cosmos SDK v0.46.11 Release Notes -This release includes the migration to [CometBFT](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). This migration should be not breaking. +This release includes the migration to [CometBFT v0.34.27](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). +This migration should be not be breaking for chains. From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: ```go @@ -8,11 +9,9 @@ From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your a replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ``` -A more complete migration is happening in Cosmos SDK v0.47.0. - -Additionally, the SDK sets its minimum version to Go 1.19. -This is not because the SDK uses new Go 1.19 functionalities, but because we recommend chains as well to upgrade to Go 1.19 because Go 1.18 is not supported anymore. -We recommend applications to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. +Additionally, the SDK sets its minimum version to Go 1.19. This is not because the SDK uses new Go 1.19 functionalities, but to signal that we recommend chains to upgrade to Go 1.19 — Go 1.18 is not supported by the Go Team anymore. +Note, that SDK recommends chains to use the same Go version across all of their network. +We recommend, as well, chains to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. From 570392aee8d4b701c42d7677e3e6a0d880f633f3 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 9 Mar 2023 19:06:23 +0800 Subject: [PATCH 30/52] feat: add extend cb to avoid unmarshal state twice for sim test (backport: #15305) (#15321) --- CHANGELOG.md | 1 + simapp/state.go | 13 +++++++++++++ types/simulation/types.go | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ecc29180d3..c0d3d0831022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog ## [Unreleased] +* (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState. ## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03 diff --git a/simapp/state.go b/simapp/state.go index 135863c5bd7c..21e71470b24e 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -27,6 +27,14 @@ import ( // It panics if the user provides files for both of them. // If a file is not given for the genesis or the sim params, it creates a randomized one. func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn { + return AppStateFnWithExtendedCb(cdc, simManager, nil) +} + +// AppStateFnWithExtendedCb returns the initial application state using a genesis or the simulation parameters. +// It panics if the user provides files for both of them. +// If a file is not given for the genesis or the sim params, it creates a randomized one. +// cb is the callback function to extend rawState. +func AppStateFnWithExtendedCb(cdc codec.JSONCodec, simManager *module.SimulationManager, cb func(rawState map[string]json.RawMessage)) simtypes.AppStateFn { return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { if FlagGenesisTimeValue == 0 { @@ -127,6 +135,11 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty rawState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingState) rawState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankState) + // extend state from callback function + if cb != nil { + cb(rawState) + } + // replace appstate appState, err = json.Marshal(rawState) if err != nil { diff --git a/types/simulation/types.go b/types/simulation/types.go index 199f47fa38e2..bdc0b59659d0 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -161,6 +161,11 @@ type AppStateFn func(r *rand.Rand, accs []Account, config Config) ( appState json.RawMessage, accounts []Account, chainId string, genesisTimestamp time.Time, ) +// AppStateFnWithExtendedCb returns the app state json bytes and the genesis accounts +type AppStateFnWithExtendedCb func(r *rand.Rand, accs []Account, config Config) ( + appState json.RawMessage, accounts []Account, chainId string, genesisTimestamp time.Time, +) + // RandomAccountFn returns a slice of n random simulation accounts type RandomAccountFn func(r *rand.Rand, n int) []Account From f939979e11c21cfa8896cab7fbd6d2bdfa380063 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Sat, 11 Mar 2023 00:56:30 +0800 Subject: [PATCH 31/52] feat: add extend cb with genesisState for sim test (backport: #15305) (#15349) --- CHANGELOG.md | 4 +++- simapp/state.go | 29 ++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d3d0831022..96f0e0c451bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog ## [Unreleased] -* (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState. + +### Improvements +* (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. ## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03 diff --git a/simapp/state.go b/simapp/state.go index 21e71470b24e..836891cda88d 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -27,14 +27,21 @@ import ( // It panics if the user provides files for both of them. // If a file is not given for the genesis or the sim params, it creates a randomized one. func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simtypes.AppStateFn { - return AppStateFnWithExtendedCb(cdc, simManager, nil) + genesisState := NewDefaultGenesisState(cdc) + return AppStateFnWithExtendedCb(cdc, simManager, genesisState, nil) } // AppStateFnWithExtendedCb returns the initial application state using a genesis or the simulation parameters. // It panics if the user provides files for both of them. // If a file is not given for the genesis or the sim params, it creates a randomized one. +// genesisState is the genesis state of the app. // cb is the callback function to extend rawState. -func AppStateFnWithExtendedCb(cdc codec.JSONCodec, simManager *module.SimulationManager, cb func(rawState map[string]json.RawMessage)) simtypes.AppStateFn { +func AppStateFnWithExtendedCb( + cdc codec.JSONCodec, + simManager *module.SimulationManager, + genesisState map[string]json.RawMessage, + cb func(rawState map[string]json.RawMessage), +) simtypes.AppStateFn { return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { if FlagGenesisTimeValue == 0 { @@ -72,11 +79,11 @@ func AppStateFnWithExtendedCb(cdc codec.JSONCodec, simManager *module.Simulation if err != nil { panic(err) } - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) + appState, simAccs = AppStateRandomizedFnWithState(simManager, r, cdc, accs, genesisTimestamp, appParams, genesisState) default: appParams := make(simtypes.AppParams) - appState, simAccs = AppStateRandomizedFn(simManager, r, cdc, accs, genesisTimestamp, appParams) + appState, simAccs = AppStateRandomizedFnWithState(simManager, r, cdc, accs, genesisTimestamp, appParams, genesisState) } rawState := make(map[string]json.RawMessage) @@ -155,8 +162,20 @@ func AppStateRandomizedFn( simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, ) (json.RawMessage, []simtypes.Account) { - numAccs := int64(len(accs)) genesisState := NewDefaultGenesisState(cdc) + return AppStateRandomizedFnWithState(simManager, r, cdc, accs, genesisTimestamp, appParams, genesisState) +} + +// AppStateRandomizedFnWithState creates calls each module's GenesisState generator function +// and creates the simulation params +// genesisState is the genesis state of the app. +// This function will not exist in v0.47, but be replaced by AppStateRandomizedFn with an extra genesisState argument. +func AppStateRandomizedFnWithState( + simManager *module.SimulationManager, r *rand.Rand, cdc codec.JSONCodec, + accs []simtypes.Account, genesisTimestamp time.Time, appParams simtypes.AppParams, + genesisState map[string]json.RawMessage, +) (json.RawMessage, []simtypes.Account) { + numAccs := int64(len(accs)) // generate a random amount of initial stake coins and a random initial // number of bonded accounts From f382e4340673ea5382005c71f19a6408f1f0bbee Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 10:37:38 +0100 Subject: [PATCH 32/52] fix: add extra check in vesting (backport #15373) (#15383) Co-authored-by: Julien Robert --- CHANGELOG.md | 5 +++++ x/auth/vesting/msg_server.go | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f0e0c451bb..3d62f194f5d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,8 +38,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] ### Improvements + * (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. +### Bug Fixes + +* (x/auth/vesting) [#15383](https://github.com/cosmos/cosmos-sdk/pull/15383) Add extra checks when creating a periodic vesting account. + ## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03 ### Improvements diff --git a/x/auth/vesting/msg_server.go b/x/auth/vesting/msg_server.go index afcd2681e1bb..c3dd5785163d 100644 --- a/x/auth/vesting/msg_server.go +++ b/x/auth/vesting/msg_server.go @@ -79,8 +79,7 @@ func (s msgServer) CreateVestingAccount(goCtx context.Context, msg *types.MsgCre } }() - err = bk.SendCoins(ctx, from, to, msg.Amount) - if err != nil { + if err = bk.SendCoins(ctx, from, to, msg.Amount); err != nil { return nil, err } @@ -140,8 +139,7 @@ func (s msgServer) CreatePermanentLockedAccount(goCtx context.Context, msg *type } }() - err = bk.SendCoins(ctx, from, to, msg.Amount) - if err != nil { + if err = bk.SendCoins(ctx, from, to, msg.Amount); err != nil { return nil, err } @@ -175,11 +173,14 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, msg *type } var totalCoins sdk.Coins - for _, period := range msg.VestingPeriods { totalCoins = totalCoins.Add(period.Amount...) } + if err := bk.IsSendEnabledCoins(ctx, totalCoins...); err != nil { + return nil, err + } + baseAccount := authtypes.NewBaseAccountWithAddress(to) baseAccount = ak.NewAccount(ctx, baseAccount).(*authtypes.BaseAccount) vestingAccount := types.NewPeriodicVestingAccount(baseAccount, totalCoins.Sort(), msg.StartTime, msg.VestingPeriods) @@ -200,8 +201,7 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, msg *type } }() - err = bk.SendCoins(ctx, from, to, totalCoins) - if err != nil { + if err = bk.SendCoins(ctx, from, to, totalCoins); err != nil { return nil, err } From e1da9c54e813f13041c90821ffad81d693c40ae2 Mon Sep 17 00:00:00 2001 From: Marko Date: Fri, 17 Mar 2023 12:02:10 +0100 Subject: [PATCH 33/52] docs: update cosmwasm link (#15441) --- docs/CosmWasm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CosmWasm/README.md b/docs/CosmWasm/README.md index 409f31ebda4c..b6a14810b38c 100644 --- a/docs/CosmWasm/README.md +++ b/docs/CosmWasm/README.md @@ -10,4 +10,4 @@ parent: >CosmWasm is written as a module that can plug into the Cosmos SDK. This means that anyone currently building a blockchain using the Cosmos SDK can quickly and easily add CosmWasm smart contracting support to their chain, without adjusting existing logic. -Read more about writing smart contracts with CosmWasm at their [documentation site](https://docs.cosmwasm.com/docs/1.0/), or visit [the repository](https://github.com/CosmWasm/cosmwasm). +Read more about writing smart contracts with CosmWasm at their [documentation site](https://book.cosmwasm.com/), or visit [the repository](https://github.com/CosmWasm/cosmwasm). From 431e42a730851b607ab6a10da3096f162fad28ee Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 17 Mar 2023 14:57:52 +0100 Subject: [PATCH 34/52] fix: remove extra `;` in service.proto (#15443) --- proto/cosmos/tx/v1beta1/service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/cosmos/tx/v1beta1/service.proto b/proto/cosmos/tx/v1beta1/service.proto index 4dd9b5354067..f6c39d52baaa 100644 --- a/proto/cosmos/tx/v1beta1/service.proto +++ b/proto/cosmos/tx/v1beta1/service.proto @@ -50,7 +50,7 @@ message GetTxsEventRequest { // pagination defines a pagination for the request. // Deprecated post v0.46.x: use page and limit instead. cosmos.base.query.v1beta1.PageRequest pagination = 2 [deprecated = true]; - ; + OrderBy order_by = 3; // page is the page number to query, starts at 1. If not provided, will default to first page. uint64 page = 4; From 8726f4203c31c3b16e52d6c26aa697264fc5a070 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 12:11:21 +0100 Subject: [PATCH 35/52] fix: flaky group genesis sim (backport #15447) (#15461) Co-authored-by: Robert Zaremba --- x/group/simulation/genesis.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/x/group/simulation/genesis.go b/x/group/simulation/genesis.go index 7f30a4fc7303..66b471fa5e47 100644 --- a/x/group/simulation/genesis.go +++ b/x/group/simulation/genesis.go @@ -21,6 +21,16 @@ const ( GroupVote = "group-vote" ) +func checkAccExists(acc sdk.AccAddress, g []*group.GroupMember, lastIndex int) bool { + s := acc.String() + for i := 0; i < lastIndex; i++ { + if g[i].Member.Address == s { + return true + } + } + return false +} + func getGroups(r *rand.Rand, accounts []simtypes.Account) []*group.GroupInfo { groups := make([]*group.GroupInfo, 3) for i := 0; i < 3; i++ { @@ -40,6 +50,9 @@ func getGroupMembers(r *rand.Rand, accounts []simtypes.Account) []*group.GroupMe groupMembers := make([]*group.GroupMember, 3) for i := 0; i < 3; i++ { acc, _ := simtypes.RandomAcc(r, accounts) + for checkAccExists(acc.Address, groupMembers, i) { + acc, _ = simtypes.RandomAcc(r, accounts) + } groupMembers[i] = &group.GroupMember{ GroupId: uint64(i + 1), Member: &group.Member{ @@ -147,6 +160,11 @@ func getVoteOption(index int) group.VoteOption { // RandomizedGenState generates a random GenesisState for the group module. func RandomizedGenState(simState *module.SimulationState) { + // The test requires we have at least 3 accounts. + if len(simState.Accounts) < 3 { + return + } + // groups var groups []*group.GroupInfo simState.AppParams.GetOrGenerate( From 31adbba958f69148ad49a1deed92c98395930db3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 17:28:43 +0000 Subject: [PATCH 36/52] feat: add delegator to withdraw address (backport #15462) (#15473) Co-authored-by: Marko --- CHANGELOG.md | 1 + x/distribution/keeper/delegation.go | 1 + x/distribution/types/events.go | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d62f194f5d8..1cb9cdd92521 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. +* (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards ### Bug Fixes diff --git a/x/distribution/keeper/delegation.go b/x/distribution/keeper/delegation.go index a5531e33f775..f94e1a73b4be 100644 --- a/x/distribution/keeper/delegation.go +++ b/x/distribution/keeper/delegation.go @@ -205,6 +205,7 @@ func (k Keeper) withdrawDelegationRewards(ctx sdk.Context, val stakingtypes.Vali types.EventTypeWithdrawRewards, sdk.NewAttribute(sdk.AttributeKeyAmount, emittedRewards.String()), sdk.NewAttribute(types.AttributeKeyValidator, val.GetOperator().String()), + sdk.NewAttribute(types.AttributeKeyDelegator, del.GetDelegatorAddr().String()), ), ) diff --git a/x/distribution/types/events.go b/x/distribution/types/events.go index ce4c0ef62e3c..9ca631db0076 100644 --- a/x/distribution/types/events.go +++ b/x/distribution/types/events.go @@ -11,6 +11,6 @@ const ( AttributeKeyWithdrawAddress = "withdraw_address" AttributeKeyValidator = "validator" - - AttributeValueCategory = ModuleName + AttributeKeyDelegator = "delegator" + AttributeValueCategory = ModuleName ) From 8d053c2a9554fbf7b75433d8aa7c880cbcaec752 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:30:40 +0100 Subject: [PATCH 37/52] docs: improve proto vesting docs about time attributes (backport #15474) (#15481) Co-authored-by: Julien Robert --- Makefile | 2 +- proto/cosmos/vesting/v1beta1/tx.proto | 2 ++ proto/cosmos/vesting/v1beta1/vesting.proto | 3 +++ scripts/protocgen.sh | 2 -- x/auth/vesting/types/tx.pb.go | 10 ++++++---- x/auth/vesting/types/vesting.pb.go | 7 +++++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index dff5e166c762..8de4eb33af80 100644 --- a/Makefile +++ b/Makefile @@ -406,6 +406,7 @@ proto-gen: @echo "Generating Protobuf files" @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \ sh ./scripts/protocgen.sh; fi + @go mod tidy # This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed proto-gen-any: @@ -423,7 +424,6 @@ proto-format: @if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \ find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi - proto-lint: @$(DOCKER_BUF) lint --error-format=json diff --git a/proto/cosmos/vesting/v1beta1/tx.proto b/proto/cosmos/vesting/v1beta1/tx.proto index 27511ba80cbd..732fe12536b2 100644 --- a/proto/cosmos/vesting/v1beta1/tx.proto +++ b/proto/cosmos/vesting/v1beta1/tx.proto @@ -39,6 +39,7 @@ message MsgCreateVestingAccount { repeated cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // end of vesting as unix time (in seconds). int64 end_time = 4; bool delayed = 5; } @@ -75,6 +76,7 @@ message MsgCreatePeriodicVestingAccount { string from_address = 1; string to_address = 2; + // start of vesting as unix time (in seconds). int64 start_time = 3; repeated Period vesting_periods = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/vesting/v1beta1/vesting.proto b/proto/cosmos/vesting/v1beta1/vesting.proto index 824cc30d8bb1..d5c1c9e583d7 100644 --- a/proto/cosmos/vesting/v1beta1/vesting.proto +++ b/proto/cosmos/vesting/v1beta1/vesting.proto @@ -20,6 +20,7 @@ message BaseVestingAccount { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + // Vesting end time, as unix timestamp (in seconds). int64 end_time = 5; } @@ -30,6 +31,7 @@ message ContinuousVestingAccount { option (gogoproto.goproto_stringer) = false; BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; + // Vesting start time, as unix timestamp (in seconds). int64 start_time = 2; } @@ -47,6 +49,7 @@ message DelayedVestingAccount { message Period { option (gogoproto.goproto_stringer) = false; + // Period duration in seconds. int64 length = 1; repeated cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index 3e740c8b630a..636479f79ac5 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -38,5 +38,3 @@ cd .. # move proto files to the right places cp -r github.com/cosmos/cosmos-sdk/* ./ rm -rf github.com - -go mod tidy -compat=1.19 diff --git a/x/auth/vesting/types/tx.pb.go b/x/auth/vesting/types/tx.pb.go index 96b06cdb922b..0165ea83312e 100644 --- a/x/auth/vesting/types/tx.pb.go +++ b/x/auth/vesting/types/tx.pb.go @@ -38,8 +38,9 @@ type MsgCreateVestingAccount struct { FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` - EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` - Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"` + // end of vesting as unix time (in seconds). + EndTime int64 `protobuf:"varint,4,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Delayed bool `protobuf:"varint,5,opt,name=delayed,proto3" json:"delayed,omitempty"` } func (m *MsgCreateVestingAccount) Reset() { *m = MsgCreateVestingAccount{} } @@ -257,8 +258,9 @@ var xxx_messageInfo_MsgCreatePermanentLockedAccountResponse proto.InternalMessag // // Since: cosmos-sdk 0.46 type MsgCreatePeriodicVestingAccount struct { - FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` - ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` + ToAddress string `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty"` + // start of vesting as unix time (in seconds). StartTime int64 `protobuf:"varint,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` VestingPeriods []Period `protobuf:"bytes,4,rep,name=vesting_periods,json=vestingPeriods,proto3" json:"vesting_periods"` } diff --git a/x/auth/vesting/types/vesting.pb.go b/x/auth/vesting/types/vesting.pb.go index 1404b5891cc6..9c05fa2dff68 100644 --- a/x/auth/vesting/types/vesting.pb.go +++ b/x/auth/vesting/types/vesting.pb.go @@ -33,7 +33,8 @@ type BaseVestingAccount struct { OriginalVesting github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=original_vesting,json=originalVesting,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"original_vesting"` DelegatedFree github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=delegated_free,json=delegatedFree,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegated_free"` DelegatedVesting github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=delegated_vesting,json=delegatedVesting,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegated_vesting"` - EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + // Vesting end time, as unix timestamp (in seconds). + EndTime int64 `protobuf:"varint,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` } func (m *BaseVestingAccount) Reset() { *m = BaseVestingAccount{} } @@ -72,7 +73,8 @@ var xxx_messageInfo_BaseVestingAccount proto.InternalMessageInfo // continuously vests by unlocking coins linearly with respect to time. type ContinuousVestingAccount struct { *BaseVestingAccount `protobuf:"bytes,1,opt,name=base_vesting_account,json=baseVestingAccount,proto3,embedded=base_vesting_account" json:"base_vesting_account,omitempty"` - StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + // Vesting start time, as unix timestamp (in seconds). + StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` } func (m *ContinuousVestingAccount) Reset() { *m = ContinuousVestingAccount{} } @@ -148,6 +150,7 @@ var xxx_messageInfo_DelayedVestingAccount proto.InternalMessageInfo // Period defines a length of time and amount of coins that will vest. type Period struct { + // Period duration in seconds. Length int64 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` } From cc39456c98482ccc581260db4989fc59e4f2515b Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 22:03:02 +0100 Subject: [PATCH 38/52] feat: add query `groups` in `x/group` (backport #14879) (#15476) Co-authored-by: atheeshp <59333759+atheeshp@users.noreply.github.com> Co-authored-by: marbar3778 --- CHANGELOG.md | 4 + proto/cosmos/group/v1/query.proto | 27 ++ x/group/client/cli/query.go | 35 ++ x/group/client/testutil/query.go | 49 +++ x/group/keeper/grpc_query.go | 23 ++ x/group/query.pb.go | 633 ++++++++++++++++++++++++++---- x/group/query.pb.gw.go | 83 ++++ 7 files changed, 774 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb9cdd92521..b0d64cb7198c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Features + +* (x/groups) [#14879](https://github.com/cosmos/cosmos-sdk/pull/14879) Add `Query/Groups` query to get all the groups. + ### Improvements * (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. diff --git a/proto/cosmos/group/v1/query.proto b/proto/cosmos/group/v1/query.proto index 51a011a9db8f..2ce08855f7b0 100644 --- a/proto/cosmos/group/v1/query.proto +++ b/proto/cosmos/group/v1/query.proto @@ -82,6 +82,13 @@ service Query { rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { option (google.api.http).get = "/cosmos/group/v1/proposals/{proposal_id}/tally"; }; + + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + rpc Groups(QueryGroupsRequest) returns (QueryGroupsResponse) { + option (google.api.http).get = "/cosmos/group/v1/groups"; + }; } // QueryGroupInfoRequest is the Query/GroupInfo request type. @@ -311,3 +318,23 @@ message QueryTallyResultResponse { // tally defines the requested tally. TallyResult tally = 1 [(gogoproto.nullable) = false]; } + +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsRequest { + + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +message QueryGroupsResponse { + // `groups` is all the groups present in state. + repeated GroupInfo groups = 1; + + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/x/group/client/cli/query.go b/x/group/client/cli/query.go index 1535566f525d..e7b866d92508 100644 --- a/x/group/client/cli/query.go +++ b/x/group/client/cli/query.go @@ -33,6 +33,7 @@ func QueryCmd(name string) *cobra.Command { QueryVotesByVoterCmd(), QueryGroupsByMemberCmd(), QueryTallyResultCmd(), + QueryGroupsCmd(), ) return queryCmd @@ -504,3 +505,37 @@ func QueryVotesByVoterCmd() *cobra.Command { return cmd } + +func QueryGroupsCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "groups", + Short: "Query for groups present in the state", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := group.NewQueryClient(clientCtx) + + res, err := queryClient.Groups(cmd.Context(), &group.QueryGroupsRequest{ + Pagination: pageReq, + }) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "groups") + + return cmd +} diff --git a/x/group/client/testutil/query.go b/x/group/client/testutil/query.go index 74c152b50978..28ec0746be81 100644 --- a/x/group/client/testutil/query.go +++ b/x/group/client/testutil/query.go @@ -149,6 +149,55 @@ func (s *IntegrationTestSuite) TestQueryGroupsByMembers() { } } +func (s *IntegrationTestSuite) TestQueryGroups() { + val := s.network.Validators[0] + clientCtx := val.ClientCtx + require := s.Require() + + testCases := []struct { + name string + args []string + expectErr bool + expectErrMsg string + numItems int + expectGroups []*group.GroupInfo + }{ + { + name: "valid req", + args: []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, + expectErr: false, + numItems: 5, + }, + { + name: "valid req with pagination", + args: []string{ + "--limit=2", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + expectErr: false, + numItems: 2, + }, + } + + for _, tc := range testCases { + tc := tc + s.Run(tc.name, func() { + cmd := client.QueryGroupsCmd() + out, err := cli.ExecTestCLICmd(clientCtx, cmd, tc.args) + if tc.expectErr { + require.Contains(out.String(), tc.expectErrMsg) + } else { + require.NoError(err, out.String()) + + var resp group.QueryGroupsResponse + val.ClientCtx.Codec.MustUnmarshalJSON(out.Bytes(), &resp) + + require.Len(resp.Groups, tc.numItems) + } + }) + } +} + func (s *IntegrationTestSuite) TestQueryGroupMembers() { val := s.network.Validators[0] clientCtx := val.ClientCtx diff --git a/x/group/keeper/grpc_query.go b/x/group/keeper/grpc_query.go index ff26844dde56..616f21133847 100644 --- a/x/group/keeper/grpc_query.go +++ b/x/group/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "math" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -346,3 +347,25 @@ func (k Keeper) TallyResult(goCtx context.Context, request *group.QueryTallyResu Tally: tallyResult, }, nil } + +// Groups returns all the groups present in the state. +func (k Keeper) Groups(goCtx context.Context, request *group.QueryGroupsRequest) (*group.QueryGroupsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + it, err := k.groupTable.PrefixScan(ctx.KVStore(k.key), 1, math.MaxUint64) + if err != nil { + return nil, err + } + defer it.Close() + + var groups []*group.GroupInfo + pageRes, err := orm.Paginate(it, request.Pagination, &groups) + if err != nil { + return nil, err + } + + return &group.QueryGroupsResponse{ + Groups: groups, + Pagination: pageRes, + }, nil +} diff --git a/x/group/query.pb.go b/x/group/query.pb.go index 47cfd7fccd98..ec7e0f9a6da0 100644 --- a/x/group/query.pb.go +++ b/x/group/query.pb.go @@ -1380,6 +1380,111 @@ func (m *QueryTallyResultResponse) GetTally() TallyResult { return TallyResult{} } +// QueryGroupsRequest is the Query/Groups request type. +// +// Since: cosmos-sdk 0.47.1 +type QueryGroupsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGroupsRequest) Reset() { *m = QueryGroupsRequest{} } +func (m *QueryGroupsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGroupsRequest) ProtoMessage() {} +func (*QueryGroupsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_0fcf9f1d74302290, []int{26} +} +func (m *QueryGroupsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGroupsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupsRequest.Merge(m, src) +} +func (m *QueryGroupsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupsRequest proto.InternalMessageInfo + +func (m *QueryGroupsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGroupsResponse is the Query/Groups response type. +// +// Since: cosmos-sdk 0.47.1 +type QueryGroupsResponse struct { + // `groups` is all the groups present in state. + Groups []*GroupInfo `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGroupsResponse) Reset() { *m = QueryGroupsResponse{} } +func (m *QueryGroupsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGroupsResponse) ProtoMessage() {} +func (*QueryGroupsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_0fcf9f1d74302290, []int{27} +} +func (m *QueryGroupsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGroupsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGroupsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGroupsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGroupsResponse.Merge(m, src) +} +func (m *QueryGroupsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGroupsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGroupsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGroupsResponse proto.InternalMessageInfo + +func (m *QueryGroupsResponse) GetGroups() []*GroupInfo { + if m != nil { + return m.Groups + } + return nil +} + +func (m *QueryGroupsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryGroupInfoRequest)(nil), "cosmos.group.v1.QueryGroupInfoRequest") proto.RegisterType((*QueryGroupInfoResponse)(nil), "cosmos.group.v1.QueryGroupInfoResponse") @@ -1407,91 +1512,95 @@ func init() { proto.RegisterType((*QueryGroupsByMemberResponse)(nil), "cosmos.group.v1.QueryGroupsByMemberResponse") proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.group.v1.QueryTallyResultRequest") proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.group.v1.QueryTallyResultResponse") + proto.RegisterType((*QueryGroupsRequest)(nil), "cosmos.group.v1.QueryGroupsRequest") + proto.RegisterType((*QueryGroupsResponse)(nil), "cosmos.group.v1.QueryGroupsResponse") } func init() { proto.RegisterFile("cosmos/group/v1/query.proto", fileDescriptor_0fcf9f1d74302290) } var fileDescriptor_0fcf9f1d74302290 = []byte{ - // 1249 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0xc7, 0x33, 0x25, 0x69, 0x92, 0x97, 0xb6, 0x11, 0x43, 0x5a, 0x12, 0x37, 0xda, 0x04, 0x03, - 0xf9, 0x1d, 0x3b, 0xbb, 0x49, 0xd3, 0x8a, 0x9f, 0xea, 0x4a, 0x10, 0x72, 0x28, 0x4a, 0x97, 0x88, - 0x03, 0x97, 0xc8, 0x9b, 0x75, 0x8c, 0xc5, 0xae, 0x67, 0xbb, 0x76, 0x22, 0x56, 0xd1, 0x5e, 0x90, - 0xca, 0x01, 0x71, 0x00, 0x8a, 0x50, 0x89, 0x38, 0xf4, 0x80, 0x04, 0x7f, 0x00, 0x08, 0x89, 0x5b, - 0x6f, 0x3d, 0x56, 0x70, 0xe1, 0x84, 0x50, 0xc2, 0x1f, 0x82, 0x3c, 0xf3, 0xbc, 0xeb, 0xdf, 0xeb, - 0x15, 0x2b, 0xc8, 0xa9, 0x5d, 0xfb, 0xbd, 0x79, 0x9f, 0xf9, 0xbe, 0xe7, 0xf1, 0xd7, 0x81, 0xeb, - 0xfb, 0xcc, 0xae, 0x31, 0x5b, 0x35, 0x1a, 0xec, 0xb0, 0xae, 0x1e, 0xe5, 0xd5, 0x7b, 0x87, 0x7a, - 0xa3, 0xa9, 0xd4, 0x1b, 0xcc, 0x61, 0x74, 0x5c, 0xdc, 0x54, 0xf8, 0x4d, 0xe5, 0x28, 0x2f, 0x4d, - 0x18, 0xcc, 0x60, 0xfc, 0x9e, 0xea, 0xfe, 0x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f5, 0x74, 0x9c, 0x81, 0xb1, 0x3a, 0x5e, 0xea, 0x8c, 0x22, - 0x78, 0x97, 0xb6, 0x2b, 0xf2, 0xbb, 0xf8, 0x12, 0xe9, 0x24, 0xe2, 0x1e, 0x6f, 0xc0, 0x88, 0x17, - 0x86, 0x07, 0xee, 0x54, 0x64, 0x77, 0xed, 0xa4, 0x76, 0xa8, 0xfc, 0x88, 0x80, 0x1c, 0x58, 0xd0, - 0x9b, 0x48, 0x21, 0xc2, 0xbf, 0x78, 0x3d, 0xf4, 0xad, 0xc7, 0x3f, 0x10, 0x78, 0x31, 0x15, 0x11, - 0x15, 0xb8, 0x09, 0xa3, 0xde, 0xb6, 0xbc, 0x06, 0xa7, 0x48, 0xd0, 0x89, 0xed, 0x5f, 0x57, 0x1b, - 0x30, 0xc3, 0x41, 0xdf, 0x67, 0x8e, 0x5e, 0x6c, 0xe3, 0xba, 0xbf, 0x1a, 0x59, 0x1b, 0xec, 0x3e, - 0x49, 0x47, 0x6e, 0x02, 0xe7, 0x48, 0x7d, 0x92, 0x78, 0x98, 0x7c, 0x07, 0x9f, 0xce, 0xd8, 0x9a, - 0xa8, 0xcc, 0x22, 0x0c, 0xba, 0xc1, 0x38, 0x17, 0x57, 0x23, 0xa2, 0xb8, 0xd1, 0x25, 0x1e, 0x22, - 0x7f, 0x4a, 0xd0, 0x27, 0xb8, 0xd7, 0xec, 0x62, 0xcf, 0x03, 0xda, 0xb7, 0xae, 0x7f, 0x4d, 0xd0, - 0x5d, 0x44, 0x40, 0x70, 0x53, 0xcb, 0x42, 0x28, 0xaf, 0xd5, 0x09, 0xbb, 0x12, 0x31, 0xfd, 0x6b, - 0xf1, 0x57, 0x04, 0xed, 0x09, 0x62, 0x05, 0x9a, 0xdb, 0xee, 0x1d, 0xc9, 0xd4, 0xbb, 0xbe, 0x69, - 0xf5, 0xa5, 0x67, 0x0a, 0x82, 0x50, 0xff, 0xab, 0x50, 0x0f, 0xc3, 0x96, 0x00, 0x2d, 0xd1, 0x39, - 0x38, 0x50, 0x4e, 0x88, 0xdf, 0x0b, 0xfb, 0xd0, 0xce, 0x83, 0x5d, 0x79, 0x05, 0x9e, 0xe7, 0x6c, - 0xbb, 0x5a, 0xb5, 0xea, 0x9e, 0x6d, 0x87, 0x55, 0x27, 0xf3, 0xcb, 0x61, 0x17, 0x67, 0x33, 0x90, - 0x8b, 0x9b, 0xba, 0x05, 0x43, 0x8e, 0x7b, 0x19, 0x0f, 0x81, 0xa8, 0x6f, 0xf5, 0x25, 0x15, 0x07, - 0x9f, 0xfc, 0x39, 0x33, 0x50, 0x12, 0x09, 0x85, 0xfb, 0xcf, 0xc2, 0x10, 0x5f, 0x96, 0x7e, 0x4e, - 0x60, 0xb4, 0xbd, 0x75, 0x3a, 0x17, 0x59, 0x22, 0xf6, 0xf3, 0x46, 0x9a, 0xef, 0x1a, 0x27, 0x10, - 0x65, 0xe5, 0x93, 0xdf, 0xff, 0x7e, 0x70, 0x61, 0x81, 0xce, 0xa9, 0xe1, 0xaf, 0x31, 0xf4, 0x66, - 0xd6, 0x01, 0x53, 0x8f, 0x3d, 0x9f, 0xd6, 0xa2, 0xdf, 0x13, 0x18, 0x0f, 0xbd, 0xb0, 0xe9, 0x4a, - 0x4a, 0xb1, 0xc8, 0x57, 0x8f, 0xb4, 0x9a, 0x31, 0x1a, 0x01, 0x37, 0x38, 0xa0, 0x42, 0x57, 0x12, - 0x00, 0xb9, 0xbd, 0x68, 0x22, 0x27, 0x4e, 0x6d, 0x8b, 0x3e, 0x24, 0x70, 0xc9, 0xff, 0x31, 0x41, - 0x17, 0x53, 0xaa, 0x06, 0x3f, 0x78, 0xa4, 0xa5, 0x2c, 0xa1, 0x48, 0x97, 0xe7, 0x74, 0xcb, 0x74, - 0x31, 0x81, 0x0e, 0xbf, 0x45, 0xfc, 0x0a, 0x9e, 0x10, 0xb8, 0x1c, 0xb0, 0xec, 0x34, 0xad, 0x60, - 0xc8, 0xf4, 0x49, 0xcb, 0x99, 0x62, 0x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 0xbf, 0xd8, 0xa2, 0x3f, - 0x12, 0x18, 0x0f, 0x19, 0xb1, 0xa4, 0xa3, 0x36, 0xde, 0x38, 0x26, 0x1d, 0xb5, 0x09, 0xee, 0x2e, - 0x65, 0x7e, 0xb9, 0x4f, 0xf1, 0x83, 0x87, 0x46, 0xe6, 0x1b, 0x02, 0x97, 0xfc, 0x3e, 0x28, 0xe9, - 0xb8, 0x8d, 0x31, 0x70, 0x49, 0xc7, 0x6d, 0x9c, 0xad, 0x4a, 0x99, 0xe5, 0x36, 0x21, 0x2a, 0x8a, - 0x1a, 0x3e, 0x22, 0x70, 0x25, 0xe8, 0x38, 0x68, 0x97, 0x13, 0x34, 0x60, 0x99, 0xa4, 0x95, 0x6c, - 0xc1, 0x88, 0xb7, 0xce, 0xf1, 0x56, 0xe9, 0x72, 0xca, 0x79, 0x2b, 0xde, 0x08, 0xbe, 0x51, 0x3d, - 0x21, 0x30, 0xe6, 0xf3, 0x01, 0x74, 0x21, 0xbe, 0x64, 0xd4, 0x9b, 0x48, 0x8b, 0x19, 0x22, 0x91, - 0x6c, 0x93, 0x93, 0xad, 0x51, 0x25, 0xf9, 0x69, 0x0a, 0x4d, 0x21, 0xf7, 0x21, 0xc5, 0x37, 0x9e, - 0x9c, 0xe6, 0xc8, 0xd3, 0xd3, 0x1c, 0xf9, 0xeb, 0x34, 0x47, 0xbe, 0x38, 0xcb, 0x0d, 0x3c, 0x3d, - 0xcb, 0x0d, 0xfc, 0x71, 0x96, 0x1b, 0xf8, 0xe0, 0x25, 0xc3, 0x74, 0x3e, 0x3c, 0x2c, 0x2b, 0xfb, - 0xac, 0xe6, 0xad, 0x29, 0xfe, 0x59, 0xb5, 0x2b, 0x1f, 0xa9, 0x1f, 0x8b, 0x02, 0xe5, 0x8b, 0xfc, - 0xcf, 0xb0, 0xeb, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x11, 0xfe, 0x04, 0xa9, 0x4e, 0x16, 0x00, - 0x00, + // 1292 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x98, 0x4b, 0x6f, 0x1b, 0x55, + 0x14, 0xc7, 0x73, 0x4b, 0x9e, 0x27, 0x6d, 0x23, 0x6e, 0xd3, 0x36, 0x99, 0x46, 0x4e, 0x98, 0x96, + 0xbc, 0x33, 0x13, 0x3b, 0x69, 0x5a, 0xf1, 0x54, 0x2d, 0x41, 0xc8, 0xa2, 0x28, 0x35, 0x11, 0x0b, + 0x84, 0x14, 0x8d, 0xe3, 0x89, 0x19, 0x61, 0xcf, 0xb8, 0x9e, 0x49, 0x84, 0x15, 0x79, 0x83, 0x04, + 0x0b, 0xc4, 0x02, 0x5a, 0x84, 0x4a, 0xc4, 0xa2, 0x0b, 0x24, 0xf8, 0x00, 0x20, 0x24, 0x76, 0xdd, + 0x75, 0x59, 0xc1, 0x86, 0x15, 0x42, 0x09, 0xdf, 0x82, 0x0d, 0x9a, 0x7b, 0xcf, 0xb5, 0xe7, 0xed, + 0x89, 0xb0, 0xc0, 0xab, 0x76, 0x66, 0xce, 0xb9, 0xe7, 0x37, 0xff, 0x73, 0xe6, 0xfa, 0x7f, 0x03, + 0xd7, 0xf6, 0x2c, 0xbb, 0x6a, 0xd9, 0x6a, 0xb9, 0x6e, 0x1d, 0xd4, 0xd4, 0xc3, 0xac, 0x7a, 0xff, + 0x40, 0xaf, 0x37, 0x94, 0x5a, 0xdd, 0x72, 0x2c, 0x3a, 0xc6, 0x1f, 0x2a, 0xec, 0xa1, 0x72, 0x98, + 0x95, 0xc6, 0xcb, 0x56, 0xd9, 0x62, 0xcf, 0x54, 0xf7, 0x7f, 0x3c, 0x4c, 0x9a, 0x2a, 0x5b, 0x56, + 0xb9, 0xa2, 0xab, 0x5a, 0xcd, 0x50, 0x35, 0xd3, 0xb4, 0x1c, 0xcd, 0x31, 0x2c, 0xd3, 0xc6, 0xa7, + 0xa1, 0x0a, 0x4e, 0xa3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 0x8c, 0x05, 0xbc, 0x67, 0xdc, 0x56, 0x1b, 0xed, 0x95, 0xe3, 0xb6, + 0xda, 0x18, 0x43, 0x9b, 0x30, 0xbf, 0xcc, 0x9a, 0x79, 0xc1, 0x03, 0x23, 0xf3, 0x35, 0x81, 0xf3, + 0x5e, 0xeb, 0x17, 0xb7, 0xdd, 0x46, 0x78, 0xd6, 0xb8, 0xed, 0x36, 0xca, 0x49, 0x26, 0xcc, 0x72, + 0x8b, 0x10, 0x15, 0x45, 0x0d, 0x1f, 0x13, 0xb8, 0xe8, 0x37, 0x59, 0xb4, 0xc3, 0x0e, 0xea, 0x73, + 0x89, 0xd2, 0x72, 0xba, 0x60, 0xc4, 0x5b, 0x63, 0x78, 0x2b, 0x74, 0x29, 0x61, 0xbf, 0xe5, 0xbf, + 0x08, 0x9e, 0x51, 0x3d, 0x26, 0x30, 0xea, 0xb1, 0x3e, 0x74, 0x3e, 0xba, 0x64, 0xd8, 0x8e, 0x49, + 0x0b, 0x29, 0x22, 0x91, 0x6c, 0x83, 0x91, 0xad, 0x52, 0x25, 0xfe, 0x6b, 0x0a, 0x4c, 0x21, 0xb3, + 0x5e, 0xd4, 0x81, 0x41, 0xfe, 0xae, 0xf4, 0x7a, 0x92, 0x12, 0x82, 0xe8, 0x46, 0x72, 0x10, 0xc2, + 0x4c, 0x33, 0x98, 0x49, 0x7a, 0x35, 0x46, 0xa6, 0xfc, 0x6b, 0x4f, 0x4f, 0x32, 0xe4, 0xd9, 0x49, + 0x86, 0xfc, 0x79, 0x92, 0x21, 0x5f, 0x9c, 0x66, 0xfa, 0x9e, 0x9d, 0x66, 0xfa, 0x7e, 0x3f, 0xcd, + 0xf4, 0xbd, 0x77, 0xa3, 0x6c, 0x38, 0x1f, 0x1c, 0x14, 0x95, 0x3d, 0xab, 0x2a, 0x92, 0xf9, 0x3f, + 0x2b, 0x76, 0xe9, 0x43, 0xf5, 0x23, 0xbe, 0x40, 0x71, 0x90, 0xfd, 0xbd, 0x7b, 0xed, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x1c, 0xce, 0x79, 0xa7, 0xb7, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1536,6 +1645,10 @@ type QueryClient interface { // then it simply returns the `final_tally_result` state stored in the // proposal itself. TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + Groups(ctx context.Context, in *QueryGroupsRequest, opts ...grpc.CallOption) (*QueryGroupsResponse, error) } type queryClient struct { @@ -1663,6 +1776,15 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque return out, nil } +func (c *queryClient) Groups(ctx context.Context, in *QueryGroupsRequest, opts ...grpc.CallOption) (*QueryGroupsResponse, error) { + out := new(QueryGroupsResponse) + err := c.cc.Invoke(ctx, "/cosmos.group.v1.Query/Groups", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // GroupInfo queries group info based on group id. @@ -1695,6 +1817,10 @@ type QueryServer interface { // then it simply returns the `final_tally_result` state stored in the // proposal itself. TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) + // Groups queries all groups in state. + // + // Since: cosmos-sdk 0.47.1 + Groups(context.Context, *QueryGroupsRequest) (*QueryGroupsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1740,6 +1866,9 @@ func (*UnimplementedQueryServer) GroupsByMember(ctx context.Context, req *QueryG func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") } +func (*UnimplementedQueryServer) Groups(ctx context.Context, req *QueryGroupsRequest) (*QueryGroupsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Groups not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1979,6 +2108,24 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_Groups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGroupsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Groups(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.group.v1.Query/Groups", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Groups(ctx, req.(*QueryGroupsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.group.v1.Query", HandlerType: (*QueryServer)(nil), @@ -2035,6 +2182,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TallyResult", Handler: _Query_TallyResult_Handler, }, + { + MethodName: "Groups", + Handler: _Query_Groups_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/group/v1/query.proto", @@ -3084,6 +3235,90 @@ func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QueryGroupsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGroupsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} + +func (m *QueryGroupsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGroupsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGroupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Groups) > 0 { + for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -3508,6 +3743,38 @@ func (m *QueryTallyResultResponse) Size() (n int) { return n } +func (m *QueryGroupsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGroupsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Groups) > 0 { + for _, e := range m.Groups { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6196,6 +6463,212 @@ func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGroupsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGroupsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGroupsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGroupsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGroupsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Groups = append(m.Groups, &GroupInfo{}) + if err := m.Groups[len(m.Groups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/group/query.pb.gw.go b/x/group/query.pb.gw.go index d9f8b8c588b0..a0a30e91c3a6 100644 --- a/x/group/query.pb.gw.go +++ b/x/group/query.pb.gw.go @@ -901,6 +901,42 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_Query_Groups_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Groups_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Groups_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Groups(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Groups_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGroupsRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Groups_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Groups(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -1206,6 +1242,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Groups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Groups_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Groups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1507,6 +1566,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Groups_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Groups_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Groups_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1536,6 +1615,8 @@ var ( pattern_Query_GroupsByMember_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "group", "v1", "groups_by_member", "address"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "group", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Groups_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "group", "v1", "groups"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1564,4 +1645,6 @@ var ( forward_Query_GroupsByMember_0 = runtime.ForwardResponseMessage forward_Query_TallyResult_0 = runtime.ForwardResponseMessage + + forward_Query_Groups_0 = runtime.ForwardResponseMessage ) From cb26943776e945a16667a7dcbb016d982958ba73 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 12:07:48 +0100 Subject: [PATCH 39/52] fix: Makefile rocksdb (backport #15422) (#15525) Co-authored-by: Robert Zaremba --- Makefile | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 8de4eb33af80..88ad979ffad0 100644 --- a/Makefile +++ b/Makefile @@ -15,9 +15,6 @@ DOCKER := $(shell which docker) DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.0.0-rc8 PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git) DOCS_DOMAIN=docs.cosmos.network -# RocksDB is a native dependency, so we don't assume the library is installed. -# Instead, it must be explicitly enabled and we warn when it is not. -ENABLE_ROCKSDB ?= false export GO111MODULE = on @@ -63,33 +60,23 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=sim \ -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \ - -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TMVERSION) - -ifeq ($(ENABLE_ROCKSDB),true) - BUILD_TAGS += rocksdb_build - test_tags += rocksdb_build -else - $(warning RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true) -endif + -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TMVERSION) # DB backend selection ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS))) build_tags += gcc endif ifeq (badgerdb,$(findstring badgerdb,$(COSMOS_BUILD_OPTIONS))) - BUILD_TAGS += badgerdb + build_tags += badgerdb endif # handle rocksdb ifeq (rocksdb,$(findstring rocksdb,$(COSMOS_BUILD_OPTIONS))) - ifneq ($(ENABLE_ROCKSDB),true) - $(error Cannot use RocksDB backend unless ENABLE_ROCKSDB=true) - endif CGO_ENABLED=1 - BUILD_TAGS += rocksdb + build_tags += rocksdb endif # handle boltdb ifeq (boltdb,$(findstring boltdb,$(COSMOS_BUILD_OPTIONS))) - BUILD_TAGS += boltdb + build_tags += boltdb endif ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) From f89d955e03e2143c6f985f692f87da0557e0654b Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 3 Apr 2023 16:42:36 +0800 Subject: [PATCH 40/52] fix(x/gov): Return ErrInvalidProposalContent in SubmitProposal when legacy handler returns an error. (backport #13051) (#15667) Co-authored-by: Daniel Wedul Co-authored-by: Aleksandr Bezobchuk --- CHANGELOG.md | 1 + x/gov/keeper/proposal.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0d64cb7198c..3148998fb271 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (x/auth/vesting) [#15383](https://github.com/cosmos/cosmos-sdk/pull/15383) Add extra checks when creating a periodic vesting account. +* (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists). ## [v0.46.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.11) - 2022-03-03 diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 64088859c684..b49cd8335042 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -1,6 +1,7 @@ package keeper import ( + "errors" "fmt" "github.com/cosmos/cosmos-sdk/client" @@ -54,7 +55,10 @@ func (keeper Keeper) SubmitProposal(ctx sdk.Context, messages []sdk.Msg, metadat if msg, ok := msg.(*v1.MsgExecLegacyContent); ok { cacheCtx, _ := ctx.CacheContext() if _, err := handler(cacheCtx, msg); err != nil { - return v1.Proposal{}, sdkerrors.Wrap(types.ErrNoProposalHandlerExists, err.Error()) + if errors.Is(types.ErrNoProposalHandlerExists, err) { + return v1.Proposal{}, err + } + return v1.Proposal{}, sdkerrors.Wrap(types.ErrInvalidProposalContent, err.Error()) } } From 152465bd0ca726e59a688fbb006c84760627c7e4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 11:23:11 +0200 Subject: [PATCH 41/52] fix: remove unnecessary cms typecasting (backport #14054) (#15669) Co-authored-by: Javier Su Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + baseapp/baseapp.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3148998fb271..00830c058496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simapp) [#15305](https://github.com/cosmos/cosmos-sdk/pull/15305) Add `AppStateFnWithExtendedCb` with callback function to extend rawState and `AppStateRandomizedFnWithState` with extra genesisState argument which is the genesis state of the app. * (x/distribution) [#15462](https://github.com/cosmos/cosmos-sdk/pull/15462) Add delegator address to the event for withdrawing delegation rewards +* [#14019](https://github.com/cosmos/cosmos-sdk/issues/14019) Remove the interface casting to allow other implementations of a `CommitMultiStore`. ### Bug Fixes diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 78d57763726e..98c2f226a059 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -1,6 +1,7 @@ package baseapp import ( + "errors" "fmt" "strings" @@ -14,7 +15,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" - "github.com/cosmos/cosmos-sdk/store/rootmulti" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -352,11 +352,11 @@ func (app *BaseApp) Init() error { app.setCheckState(tmproto.Header{}) app.Seal() - rms, ok := app.cms.(*rootmulti.Store) - if !ok { - return fmt.Errorf("invalid commit multi-store; expected %T, got: %T", &rootmulti.Store{}, app.cms) + if app.cms == nil { + return errors.New("commit multi-store must not be nil") } - return rms.GetPruning().Validate() + + return app.cms.GetPruning().Validate() } func (app *BaseApp) setMinGasPrices(gasPrices sdk.DecCoins) { From 5cd0b2316a7103468af38eab5d886f9f069c9cd7 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 4 Apr 2023 14:57:44 +0200 Subject: [PATCH 42/52] chore: prepare v0.46.12 release notes (#15685) --- CHANGELOG.md | 2 ++ RELEASE_NOTES.md | 14 +++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00830c058496..778a592cd08a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.46.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.12) - 2022-04-04 + ### Features * (x/groups) [#14879](https://github.com/cosmos/cosmos-sdk/pull/14879) Add `Query/Groups` query to get all the groups. diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 381bb7ca8b0f..524ad6e1f087 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,18 +1,14 @@ -# Cosmos SDK v0.46.11 Release Notes +# Cosmos SDK v0.46.12 Release Notes -This release includes the migration to [CometBFT v0.34.27](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). -This migration should be not be breaking for chains. -From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: +This release introduces a number of improvements and bug fixes, notably a new query for the `x/group` module, for querying all groups on a chain. + +Note, from `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: ```go // use cometbft replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ``` -Additionally, the SDK sets its minimum version to Go 1.19. This is not because the SDK uses new Go 1.19 functionalities, but to signal that we recommend chains to upgrade to Go 1.19 — Go 1.18 is not supported by the Go Team anymore. -Note, that SDK recommends chains to use the same Go version across all of their network. -We recommend, as well, chains to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. - Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.10...v0.46.11 +**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.11...v0.46.12 From 1a47cb26d24a44844524cd3c2d3a0c08db1ef6f3 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 09:55:02 +0200 Subject: [PATCH 43/52] fix: upstream error on empty version (backport #13355) (#15717) Co-authored-by: Marko Co-authored-by: Julien Robert --- CHANGELOG.md | 4 ++++ store/iavl/store.go | 2 +- store/iavl/store_test.go | 2 +- store/rootmulti/store_test.go | 12 ++++++------ 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 778a592cd08a..f3d21706382e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Bug Fixes + +* (store/iavl) [#15717](https://github.com/cosmos/cosmos-sdk/pull/15717) Upstream error on empty version (this change was present on all version but v0.46). + ## [v0.46.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.12) - 2022-04-04 ### Features diff --git a/store/iavl/store.go b/store/iavl/store.go index 3cf6c1dedbf2..7517f934f4de 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -111,7 +111,7 @@ func UnsafeNewStore(tree *iavl.MutableTree) *Store { // Any mutable operations executed will result in a panic. func (st *Store) GetImmutable(version int64) (*Store, error) { if !st.VersionExists(version) { - return &Store{tree: &immutableTree{&iavl.ImmutableTree{}}}, nil + return nil, fmt.Errorf("version mismatch on immutable IAVL tree; version does not exist. Version has either been pruned, or is for a future block height") } iTree, err := st.tree.GetImmutable(version) diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index dabe1e37f630..8379779c158b 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -127,7 +127,7 @@ func TestGetImmutable(t *testing.T) { require.Nil(t, err) _, err = store.GetImmutable(cID.Version + 1) - require.NoError(t, err) + require.Error(t, err) newStore, err := store.GetImmutable(cID.Version - 1) require.NoError(t, err) diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 0e78e0f95bed..fe773b51d6e6 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -88,7 +88,7 @@ func TestCacheMultiStoreWithVersion(t *testing.T) { // require no failure when given an invalid or pruned version _, err = ms.CacheMultiStoreWithVersion(cID.Version + 1) - require.NoError(t, err) + require.Error(t, err) // require a valid version can be cache-loaded cms, err := ms.CacheMultiStoreWithVersion(cID.Version) @@ -482,9 +482,9 @@ func TestMultiStore_Pruning(t *testing.T) { saved []int64 }{ {"prune nothing", 10, pruningtypes.NewPruningOptions(pruningtypes.PruningNothing), nil, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}, - {"prune everything", 10, pruningtypes.NewPruningOptions(pruningtypes.PruningEverything), []int64{1, 2, 3, 4, 5, 6, 7, 8, 9}, []int64{10}}, - {"prune some; no batch", 10, pruningtypes.NewCustomPruningOptions(2, 1), []int64{1, 2, 4, 5, 7}, []int64{3, 6, 8, 9, 10}}, - {"prune some; small batch", 10, pruningtypes.NewCustomPruningOptions(2, 3), []int64{1, 2, 4, 5}, []int64{3, 6, 7, 8, 9, 10}}, + {"prune everything", 12, pruningtypes.NewPruningOptions(pruningtypes.PruningEverything), []int64{1, 2, 3, 4, 5, 6, 7}, []int64{8, 9, 10, 11, 12}}, + {"prune some; no batch", 10, pruningtypes.NewCustomPruningOptions(2, 1), []int64{1, 2, 3, 4, 6, 5, 7}, []int64{8, 9, 10}}, + {"prune some; small batch", 10, pruningtypes.NewCustomPruningOptions(2, 3), []int64{1, 2, 3, 4, 5, 6}, []int64{7, 8, 9, 10}}, {"prune some; large batch", 10, pruningtypes.NewCustomPruningOptions(2, 11), nil, []int64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}, } @@ -502,12 +502,12 @@ func TestMultiStore_Pruning(t *testing.T) { for _, v := range tc.saved { _, err := ms.CacheMultiStoreWithVersion(v) - require.NoError(t, err, "expected error when loading height: %d", v) + require.NoError(t, err, "expected no error when loading height: %d", v) } for _, v := range tc.deleted { _, err := ms.CacheMultiStoreWithVersion(v) - require.NoError(t, err, "expected error when loading height: %d", v) + require.Error(t, err, "expected error when loading height: %d", v) } }) } From 95f529ee4380b4e91a4bcbf124fe0f110adeb984 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 11:31:13 +0200 Subject: [PATCH 44/52] feat: More flexibility for `CacheMultiStoreWithVersion` (backport #15683) (#15775) Co-authored-by: khanh-notional <50263489+catShaark@users.noreply.github.com> Co-authored-by: Julien Robert --- CHANGELOG.md | 4 ++++ store/rootmulti/store.go | 25 ++++++++++++++++++++++++- store/rootmulti/store_test.go | 11 +++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d21706382e..f656130c3784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. + ### Bug Fixes * (store/iavl) [#15717](https://github.com/cosmos/cosmos-sdk/pull/15717) Upstream error on empty version (this change was present on all version but v0.46). diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 74915695ab40..7397abd0424e 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -481,6 +481,8 @@ func (rs *Store) CacheMultiStore() types.CacheMultiStore { // iterating at past heights. func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error) { cachedStores := make(map[types.StoreKey]types.CacheWrapper) + var commitInfo *types.CommitInfo + storeInfos := map[string]bool{} for key, store := range rs.stores { var cacheStore types.KVStore switch store.GetStoreType() { @@ -493,9 +495,30 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor // version does not exist or is pruned, an error should be returned. var err error cacheStore, err = store.(*iavl.Store).GetImmutable(version) + // if we got error from loading a module store + // we fetch commit info of this version + // we use commit info to check if the store existed at this version or not if err != nil { - return nil, err + if commitInfo == nil { + var errCommitInfo error + commitInfo, errCommitInfo = getCommitInfo(rs.db, version) + + if errCommitInfo != nil { + return nil, errCommitInfo + } + + for _, storeInfo := range commitInfo.StoreInfos { + storeInfos[storeInfo.Name] = true + } + } + + // If the store existed at this version, it means there's actually an error + // getting the root store at this version. + if storeInfos[key.Name()] { + return nil, err + } } + default: cacheStore = store } diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index fe773b51d6e6..69e773be1a80 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -99,6 +99,17 @@ func TestCacheMultiStoreWithVersion(t *testing.T) { require.NotNil(t, kvStore) require.Equal(t, kvStore.Get(k), v) + // add new module stores (store4 and store5) to multi stores and commit + ms.MountStoreWithDB(types.NewKVStoreKey("store4"), types.StoreTypeIAVL, nil) + ms.MountStoreWithDB(types.NewKVStoreKey("store5"), types.StoreTypeIAVL, nil) + err = ms.LoadLatestVersionAndUpgrade(&types.StoreUpgrades{Added: []string{"store4", "store5"}}) + require.NoError(t, err) + ms.Commit() + + // cache multistore of version before adding store4 should works + _, err = ms.CacheMultiStoreWithVersion(1) + require.NoError(t, err) + // require we cannot commit (write) to a cache-versioned multi-store require.Panics(t, func() { kvStore.Set(k, []byte("newValue")) From 742856fc1c3dee8e17ae73bfe294269000ef1da9 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 18:00:42 +0200 Subject: [PATCH 45/52] feat: add moduleStateCb to allow access moduleState in sim test (backport #15903) (#15925) Co-authored-by: mmsqe Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + simapp/state.go | 37 +++++++++++++++++++++++++++++-------- types/simulation/types.go | 5 ++--- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f656130c3784..abf4bd83a231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. +* (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`. ### Bug Fixes diff --git a/simapp/state.go b/simapp/state.go index 836891cda88d..f491e098dd34 100644 --- a/simapp/state.go +++ b/simapp/state.go @@ -8,6 +8,7 @@ import ( "os" "time" + "github.com/gogo/protobuf/proto" tmjson "github.com/tendermint/tendermint/libs/json" tmtypes "github.com/tendermint/tendermint/types" @@ -32,15 +33,28 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty } // AppStateFnWithExtendedCb returns the initial application state using a genesis or the simulation parameters. +// It calls AppStateFnWithExtendedCbs with nil moduleStateCb. +func AppStateFnWithExtendedCb( + cdc codec.JSONCodec, + simManager *module.SimulationManager, + genesisState map[string]json.RawMessage, + rawStateCb func(rawState map[string]json.RawMessage), +) simtypes.AppStateFn { + return AppStateFnWithExtendedCbs(cdc, simManager, genesisState, nil, rawStateCb) +} + +// AppStateFnWithExtendedCbs returns the initial application state using a genesis or the simulation parameters. // It panics if the user provides files for both of them. // If a file is not given for the genesis or the sim params, it creates a randomized one. -// genesisState is the genesis state of the app. -// cb is the callback function to extend rawState. -func AppStateFnWithExtendedCb( +// genesisState is the default genesis state of the whole app. +// moduleStateCb is the callback function to access moduleState. +// rawStateCb is the callback function to extend rawState. +func AppStateFnWithExtendedCbs( cdc codec.JSONCodec, simManager *module.SimulationManager, genesisState map[string]json.RawMessage, - cb func(rawState map[string]json.RawMessage), + moduleStateCb func(moduleName string, genesisState interface{}), + rawStateCb func(rawState map[string]json.RawMessage), ) simtypes.AppStateFn { return func(r *rand.Rand, accs []simtypes.Account, config simtypes.Config, ) (appState json.RawMessage, simAccs []simtypes.Account, chainID string, genesisTimestamp time.Time) { @@ -139,12 +153,19 @@ func AppStateFnWithExtendedCb( } // change appState back - rawState[stakingtypes.ModuleName] = cdc.MustMarshalJSON(stakingState) - rawState[banktypes.ModuleName] = cdc.MustMarshalJSON(bankState) + for name, state := range map[string]proto.Message{ + stakingtypes.ModuleName: stakingState, + banktypes.ModuleName: bankState, + } { + if moduleStateCb != nil { + moduleStateCb(name, state) + } + rawState[name] = cdc.MustMarshalJSON(state) + } // extend state from callback function - if cb != nil { - cb(rawState) + if rawStateCb != nil { + rawStateCb(rawState) } // replace appstate diff --git a/types/simulation/types.go b/types/simulation/types.go index bdc0b59659d0..a152413f3c07 100644 --- a/types/simulation/types.go +++ b/types/simulation/types.go @@ -162,9 +162,8 @@ type AppStateFn func(r *rand.Rand, accs []Account, config Config) ( ) // AppStateFnWithExtendedCb returns the app state json bytes and the genesis accounts -type AppStateFnWithExtendedCb func(r *rand.Rand, accs []Account, config Config) ( - appState json.RawMessage, accounts []Account, chainId string, genesisTimestamp time.Time, -) +// Deprecated: Use AppStateFn instead. This will be removed in a future relase. +type AppStateFnWithExtendedCb AppStateFn // RandomAccountFn returns a slice of n random simulation accounts type RandomAccountFn func(r *rand.Rand, n int) []Account From 83eef6bcc79b95ee9c07b42e7174e66de39e7560 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 28 Apr 2023 11:11:47 +0200 Subject: [PATCH 46/52] build(deps): bump cometbft to v0.34.28 (#15973) --- CHANGELOG.md | 1 + Makefile | 2 +- RELEASE_NOTES.md | 8 ++++---- go.mod | 6 +++--- go.sum | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abf4bd83a231..54a5ecf770ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (deps) [#15973](https://github.com/cosmos/cosmos-sdk/pull/15973) Bump CometBFT to [v0.34.28](https://github.com/cometbft/cometbft/blob/v0.34.28/CHANGELOG.md#v03428). * (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. * (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`. diff --git a/Makefile b/Makefile index 88ad979ffad0..464ed932482f 100644 --- a/Makefile +++ b/Makefile @@ -417,7 +417,7 @@ proto-lint: proto-check-breaking: @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main -TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.27/proto/tendermint +TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.28/proto/tendermint TM_CRYPTO_TYPES = proto/tendermint/crypto TM_ABCI_TYPES = proto/tendermint/abci diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 524ad6e1f087..65aad49293f0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,14 +1,14 @@ -# Cosmos SDK v0.46.12 Release Notes +# Cosmos SDK v0.46.13 Release Notes -This release introduces a number of improvements and bug fixes, notably a new query for the `x/group` module, for querying all groups on a chain. + Note, from `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: ```go // use cometbft -replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 +replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 ``` Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. -**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.11...v0.46.12 +**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.12...v0.46.13 diff --git a/go.mod b/go.mod index d45aad66ba4e..e4b19279164c 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/spf13/viper v1.13.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.27 + github.com/tendermint/tendermint v0.34.28 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 golang.org/x/crypto v0.5.0 @@ -68,7 +68,7 @@ require ( cloud.google.com/go/storage v1.27.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect + github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/aws/aws-sdk-go v1.40.45 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -170,7 +170,7 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 // use cometbft - github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 ) retract ( diff --git a/go.sum b/go.sum index 12ad00eae55b..1651603d0926 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,8 @@ github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= +github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= +github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -194,8 +194,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.34.27 h1:ri6BvmwjWR0gurYjywcBqRe4bbwc3QVs9KRcCzgh/J0= -github.com/cometbft/cometbft v0.34.27/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= +github.com/cometbft/cometbft v0.34.28 h1:gwryf55P1SWMUP4nOXpRVI2D0yPoYEzN+IBqmRBOsDc= +github.com/cometbft/cometbft v0.34.28/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= From 5e199ca08d1393b3a734d180665d8d032eb821ea Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 09:27:01 +0000 Subject: [PATCH 47/52] chore(gov): improve proposal conversion error message (backport #15979) (#15981) Co-authored-by: Julien Robert Co-authored-by: marbar3778 --- CHANGELOG.md | 1 + x/gov/migrations/v046/convert.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54a5ecf770ec..52bff96d01e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (deps) [#15973](https://github.com/cosmos/cosmos-sdk/pull/15973) Bump CometBFT to [v0.34.28](https://github.com/cometbft/cometbft/blob/v0.34.28/CHANGELOG.md#v03428). * (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. * (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`. +* (gov) [#15979](https://github.com/cosmos/cosmos-sdk/pull/15979) Improve gov error message when failing to convert v1 proposal to v1beta1. ### Bug Fixes diff --git a/x/gov/migrations/v046/convert.go b/x/gov/migrations/v046/convert.go index e368a0b2b2b6..2c632a4124a6 100644 --- a/x/gov/migrations/v046/convert.go +++ b/x/gov/migrations/v046/convert.go @@ -49,7 +49,7 @@ func ConvertToLegacyProposal(proposal v1.Proposal) (v1beta1.Proposal, error) { return v1beta1.Proposal{}, err } if len(msgs) != 1 { - return v1beta1.Proposal{}, sdkerrors.ErrInvalidType.Wrap("can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of proposal messages is more than one") + return v1beta1.Proposal{}, sdkerrors.ErrInvalidType.Wrap("can't convert a gov/v1 Proposal to gov/v1beta1 Proposal when amount of proposal messages not exactly one") } if legacyMsg, ok := msgs[0].(*v1.MsgExecLegacyContent); ok { // check that the content struct can be unmarshalled From 738220aa18cd5248adcd41f1d8357bc92245c514 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 11:16:28 +0000 Subject: [PATCH 48/52] feat!: bootstrap comet cmd for local state sync (backport #16061) (#16080) Co-authored-by: Marko --- CHANGELOG.md | 1 + docs/run-node/run-node.md | 11 +++++ server/tm_cmds.go | 97 +++++++++++++++++++++++++++++++++++++++ server/util.go | 1 + 4 files changed, 110 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52bff96d01e4..bd533d44f0ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (store) [#15683](https://github.com/cosmos/cosmos-sdk/pull/15683) `rootmulti.Store.CacheMultiStoreWithVersion` now can handle loading archival states that don't persist any of the module stores the current state has. * (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`. * (gov) [#15979](https://github.com/cosmos/cosmos-sdk/pull/15979) Improve gov error message when failing to convert v1 proposal to v1beta1. +* (server) [#16061](https://github.com/cosmos/cosmos-sdk/pull/16061) add comet bootstrap command ### Bug Fixes diff --git a/docs/run-node/run-node.md b/docs/run-node/run-node.md index 2233f63aa128..502207761d9c 100644 --- a/docs/run-node/run-node.md +++ b/docs/run-node/run-node.md @@ -125,6 +125,17 @@ The previous command allow you to run a single node. This is enough for the next The naive way would be to run the same commands again in separate terminal windows. This is possible, however in the Cosmos SDK, we leverage the power of [Docker Compose](https://docs.docker.com/compose/) to run a localnet. If you need inspiration on how to set up your own localnet with Docker Compose, you can have a look at the Cosmos SDK's [`docker-compose.yml`](https://github.com/cosmos/cosmos-sdk/blob/v0.46.0-rc1/docker-compose.yml). +## State Sync + +State sync is the act in which a node syncs the latest or close to the latest state of a blockchain. This is useful for users who don't want to sync all the blocks in history. You can read more here: https://docs.cometbft.com/v0.37/core/state-sync + +### Local State Sync + +Local state sync work similar to normal state sync except that it works off a local snapshot of state instead of one provided via the p2p network. The steps to start local state sync are similar to normal state sync with a few different designs. + +1. As mentioned in https://docs.cometbft.com/v0.37/core/state-sync, one must set a height and hash in the config.toml along with a few rpc servers (the afromentioned link has instructions on how to do this). +2. Bootsrapping Comet state in order to start the node after the snapshot has been ingested. This can be done with the bootstrap command ` comet bootstrap-state` + ## Next {hide} Read about the [Interacting with your Node](./interact-node.md) {hide} diff --git a/server/tm_cmds.go b/server/tm_cmds.go index 2dc1ddc57336..3eae9fa43087 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -5,14 +5,23 @@ package server import ( "fmt" + "github.com/tendermint/tendermint/light" + "github.com/tendermint/tendermint/node" + cmtstore "github.com/tendermint/tendermint/proto/tendermint/store" + sm "github.com/tendermint/tendermint/state" + "github.com/tendermint/tendermint/statesync" + "github.com/spf13/cobra" "github.com/tendermint/tendermint/p2p" pvm "github.com/tendermint/tendermint/privval" + "github.com/tendermint/tendermint/store" tversion "github.com/tendermint/tendermint/version" "sigs.k8s.io/yaml" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -117,3 +126,91 @@ func VersionCmd() *cobra.Command { }, } } + +func BootstrapStateCmd(appCreator types.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "bootstrap-state", + Short: "Bootstrap CometBFT state at an arbitrary block height using a light client", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + serverCtx := GetServerContextFromCmd(cmd) + cfg := serverCtx.Config + + height, err := cmd.Flags().GetInt64("height") + if err != nil { + return err + } + if height == 0 { + home := serverCtx.Viper.GetString(flags.FlagHome) + db, err := openDB(home, GetAppDBBackend(serverCtx.Viper)) + if err != nil { + return err + } + + app := appCreator(serverCtx.Logger, db, nil, serverCtx.Viper) + height = app.CommitMultiStore().LastCommitID().Version + } + + blockStoreDB, err := node.DefaultDBProvider(&node.DBContext{ID: "blockstore", Config: cfg}) + if err != nil { + return err + } + blockStore := store.NewBlockStore(blockStoreDB) + + stateDB, err := node.DefaultDBProvider(&node.DBContext{ID: "state", Config: cfg}) + if err != nil { + return err + } + stateStore := sm.NewStore(stateDB, sm.StoreOptions{ + DiscardABCIResponses: cfg.Storage.DiscardABCIResponses, + }) + + genState, _, err := node.LoadStateFromDBOrGenesisDocProvider(stateDB, node.DefaultGenesisDocProviderFunc(cfg)) + if err != nil { + return err + } + + stateProvider, err := statesync.NewLightClientStateProvider( + cmd.Context(), + genState.ChainID, genState.Version, genState.InitialHeight, + cfg.StateSync.RPCServers, light.TrustOptions{ + Period: cfg.StateSync.TrustPeriod, + Height: cfg.StateSync.TrustHeight, + Hash: cfg.StateSync.TrustHashBytes(), + }, serverCtx.Logger.With("module", "light")) + if err != nil { + return fmt.Errorf("failed to set up light client state provider: %w", err) + } + + state, err := stateProvider.State(cmd.Context(), uint64(height)) + if err != nil { + return fmt.Errorf("failed to get state: %w", err) + } + + commit, err := stateProvider.Commit(cmd.Context(), uint64(height)) + if err != nil { + return fmt.Errorf("failed to get commit: %w", err) + } + + if err := stateStore.Bootstrap(state); err != nil { + return fmt.Errorf("failed to bootstrap state: %w", err) + } + + if err := blockStore.SaveSeenCommit(state.LastBlockHeight, commit); err != nil { + return fmt.Errorf("failed to save seen commit: %w", err) + } + + store.SaveBlockStoreState(&cmtstore.BlockStoreState{ + // it breaks the invariant that blocks in range [Base, Height] must exists, but it do works in practice. + Base: state.LastBlockHeight, + Height: state.LastBlockHeight, + }, blockStoreDB) + + return nil + }, + } + + cmd.Flags().Int64("height", 0, "Block height to bootstrap state at, if not provided will use the latest block height in app state") + + return cmd +} diff --git a/server/util.go b/server/util.go index 98e82be44b03..52caa5967794 100644 --- a/server/util.go +++ b/server/util.go @@ -284,6 +284,7 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type VersionCmd(), tmcmd.ResetAllCmd, tmcmd.ResetStateCmd, + BootstrapStateCmd(appCreator), ) startCmd := StartCmd(appCreator, defaultNodeHome) From dcf04afc4a69c7c90d1614ec767ead15320f3779 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 14:51:26 +0000 Subject: [PATCH 49/52] chore(auth/vesting): fix typo in `create-period-vesting-account` cmd example (backport #16085) (#16087) Co-authored-by: Julien Robert --- x/auth/vesting/client/cli/tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/vesting/client/cli/tx.go b/x/auth/vesting/client/cli/tx.go index 3c88d04500fa..f2ef3ba67fe7 100644 --- a/x/auth/vesting/client/cli/tx.go +++ b/x/auth/vesting/client/cli/tx.go @@ -142,7 +142,7 @@ func NewMsgCreatePeriodicVestingAccountCmd() *cobra.Command { An array of coin strings and unix epoch times for coins to vest { "start_time": 1625204910, -"period":[ +"periods":[ { "coins": "10test", "length_seconds":2592000 //30 days From 10cc30f36e1c293423c4e30d4f0d09a3015bdaea Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 10:22:44 +0000 Subject: [PATCH 50/52] feat: add local snapshots management commands (backport #16067) (#16103) Co-authored-by: yihuang Co-authored-by: marbar3778 Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + client/snapshot/cmd.go | 24 +++ client/snapshot/delete.go | 35 ++++ client/snapshot/dump.go | 120 +++++++++++++ client/snapshot/export.go | 53 ++++++ client/snapshot/list.go | 30 ++++ client/snapshot/load.go | 113 ++++++++++++ client/snapshot/restore.go | 50 ++++++ contrib/rosetta/rosetta-ci/data.tar.gz | Bin 44165 -> 47219 bytes go.mod | 82 ++++----- go.sum | 233 ++++++++++++++----------- server/types/app.go | 4 + server/util.go | 19 ++ simapp/simd/cmd/root.go | 2 + snapshots/manager.go | 19 ++ snapshots/store.go | 67 ++++--- 16 files changed, 685 insertions(+), 167 deletions(-) create mode 100644 client/snapshot/cmd.go create mode 100644 client/snapshot/delete.go create mode 100644 client/snapshot/dump.go create mode 100644 client/snapshot/export.go create mode 100644 client/snapshot/list.go create mode 100644 client/snapshot/load.go create mode 100644 client/snapshot/restore.go diff --git a/CHANGELOG.md b/CHANGELOG.md index bd533d44f0ae..3ca726fd72a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simapp) [#15903](https://github.com/cosmos/cosmos-sdk/pull/15903) Add `AppStateFnWithExtendedCbs` with moduleStateCb callback function to allow access moduleState. Note, this function is present in simtestutil from `v0.47.2+`. * (gov) [#15979](https://github.com/cosmos/cosmos-sdk/pull/15979) Improve gov error message when failing to convert v1 proposal to v1beta1. * (server) [#16061](https://github.com/cosmos/cosmos-sdk/pull/16061) add comet bootstrap command +* (store) [#16067](https://github.com/cosmos/cosmos-sdk/pull/16067) Add local snapshots management commands. ### Bug Fixes diff --git a/client/snapshot/cmd.go b/client/snapshot/cmd.go new file mode 100644 index 000000000000..f49f2b51c2b4 --- /dev/null +++ b/client/snapshot/cmd.go @@ -0,0 +1,24 @@ +package snapshot + +import ( + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/spf13/cobra" +) + +// Cmd returns the snapshots group command +func Cmd(appCreator servertypes.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "snapshots", + Short: "Manage local snapshots", + Long: "Manage local snapshots", + } + cmd.AddCommand( + ListSnapshotsCmd, + RestoreSnapshotCmd(appCreator), + ExportSnapshotCmd(appCreator), + DumpArchiveCmd(), + LoadArchiveCmd(), + DeleteSnapshotCmd(), + ) + return cmd +} diff --git a/client/snapshot/delete.go b/client/snapshot/delete.go new file mode 100644 index 000000000000..0259032e1134 --- /dev/null +++ b/client/snapshot/delete.go @@ -0,0 +1,35 @@ +package snapshot + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" +) + +func DeleteSnapshotCmd() *cobra.Command { + return &cobra.Command{ + Use: "delete ", + Short: "Delete a local snapshot", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + + height, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + format, err := strconv.ParseUint(args[1], 10, 32) + if err != nil { + return err + } + + snapshotStore, err := server.GetSnapshotStore(ctx.Viper) + if err != nil { + return err + } + + return snapshotStore.Delete(height, uint32(format)) + }, + } +} diff --git a/client/snapshot/dump.go b/client/snapshot/dump.go new file mode 100644 index 000000000000..917dca071512 --- /dev/null +++ b/client/snapshot/dump.go @@ -0,0 +1,120 @@ +package snapshot + +import ( + "archive/tar" + "compress/gzip" + "fmt" + "io" + "os" + "strconv" + + "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" +) + +// DumpArchiveCmd returns a command to dump the snapshot as portable archive format +func DumpArchiveCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "dump ", + Short: "Dump the snapshot as portable archive format", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + snapshotStore, err := server.GetSnapshotStore(ctx.Viper) + if err != nil { + return err + } + + output, err := cmd.Flags().GetString("output") + if err != nil { + return err + } + + height, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + format, err := strconv.ParseUint(args[1], 10, 32) + if err != nil { + return err + } + + if output == "" { + output = fmt.Sprintf("%d-%d.tar.gz", height, format) + } + + snapshot, err := snapshotStore.Get(height, uint32(format)) + if err != nil { + return err + } + + bz, err := snapshot.Marshal() + if err != nil { + return err + } + + fp, err := os.Create(output) + if err != nil { + return err + } + defer fp.Close() + + // since the chunk files are already compressed, we just use fastest compression here + gzipWriter, err := gzip.NewWriterLevel(fp, gzip.BestSpeed) + if err != nil { + return err + } + tarWriter := tar.NewWriter(gzipWriter) + if err := tarWriter.WriteHeader(&tar.Header{ + Name: SnapshotFileName, + Mode: 0o644, + Size: int64(len(bz)), + }); err != nil { + return fmt.Errorf("failed to write snapshot header to tar: %w", err) + } + if _, err := tarWriter.Write(bz); err != nil { + return fmt.Errorf("failed to write snapshot to tar: %w", err) + } + + for i := uint32(0); i < snapshot.Chunks; i++ { + path := snapshotStore.PathChunk(height, uint32(format), i) + file, err := os.Open(path) + if err != nil { + return fmt.Errorf("failed to open chunk file %s: %w", path, err) + } + defer file.Close() + + st, err := file.Stat() + if err != nil { + return fmt.Errorf("failed to stat chunk file %s: %w", path, err) + } + + if err := tarWriter.WriteHeader(&tar.Header{ + Name: strconv.FormatUint(uint64(i), 10), + Mode: 0o644, + Size: st.Size(), + }); err != nil { + return fmt.Errorf("failed to write chunk header to tar: %w", err) + } + + if _, err := io.Copy(tarWriter, file); err != nil { + return fmt.Errorf("failed to write chunk to tar: %w", err) + } + } + + if err := tarWriter.Close(); err != nil { + return fmt.Errorf("failed to close tar writer: %w", err) + } + + if err := gzipWriter.Close(); err != nil { + return fmt.Errorf("failed to close gzip writer: %w", err) + } + + return fp.Close() + }, + } + + cmd.Flags().StringP("output", "o", "", "output file") + + return cmd +} diff --git a/client/snapshot/export.go b/client/snapshot/export.go new file mode 100644 index 000000000000..cc39209a08f8 --- /dev/null +++ b/client/snapshot/export.go @@ -0,0 +1,53 @@ +package snapshot + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/server" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + "github.com/spf13/cobra" +) + +// ExportSnapshotCmd returns a command to take a snapshot of the application state +func ExportSnapshotCmd(appCreator servertypes.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "export", + Short: "Export app state to snapshot store", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + + height, err := cmd.Flags().GetInt64("height") + if err != nil { + return err + } + + home := ctx.Config.RootDir + db, err := openDB(home, server.GetAppDBBackend(ctx.Viper)) + if err != nil { + return err + } + + app := appCreator(ctx.Logger, db, nil, ctx.Viper) + + if height == 0 { + height = app.CommitMultiStore().LastCommitID().Version + } + + fmt.Printf("Exporting snapshot for height %d\n", height) + + sm := app.SnapshotManager() + snapshot, err := sm.Create(uint64(height)) + if err != nil { + return err + } + + fmt.Printf("Snapshot created at height %d, format %d, chunks %d\n", snapshot.Height, snapshot.Format, snapshot.Chunks) + return nil + }, + } + + cmd.Flags().Int64("height", 0, "Height to export, default to latest state height") + + return cmd +} diff --git a/client/snapshot/list.go b/client/snapshot/list.go new file mode 100644 index 000000000000..6ff6391d4211 --- /dev/null +++ b/client/snapshot/list.go @@ -0,0 +1,30 @@ +package snapshot + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" +) + +// ListSnapshotsCmd returns the command to list local snapshots +var ListSnapshotsCmd = &cobra.Command{ + Use: "list", + Short: "List local snapshots", + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + snapshotStore, err := server.GetSnapshotStore(ctx.Viper) + if err != nil { + return err + } + snapshots, err := snapshotStore.List() + if err != nil { + return fmt.Errorf("failed to list snapshots: %w", err) + } + for _, snapshot := range snapshots { + fmt.Println("height:", snapshot.Height, "format:", snapshot.Format, "chunks:", snapshot.Chunks) + } + + return nil + }, +} diff --git a/client/snapshot/load.go b/client/snapshot/load.go new file mode 100644 index 000000000000..6797d58bafec --- /dev/null +++ b/client/snapshot/load.go @@ -0,0 +1,113 @@ +package snapshot + +import ( + "archive/tar" + "bytes" + "compress/gzip" + "fmt" + "io" + "os" + "reflect" + "strconv" + + "github.com/cosmos/cosmos-sdk/server" + "github.com/spf13/cobra" + + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" +) + +const SnapshotFileName = "_snapshot" + +// LoadArchiveCmd load a portable archive format snapshot into snapshot store +func LoadArchiveCmd() *cobra.Command { + return &cobra.Command{ + Use: "load ", + Short: "Load a snapshot archive file into snapshot store", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + snapshotStore, err := server.GetSnapshotStore(ctx.Viper) + if err != nil { + return err + } + + path := args[0] + fp, err := os.Open(path) + if err != nil { + return fmt.Errorf("failed to open archive file: %w", err) + } + reader, err := gzip.NewReader(fp) + if err != nil { + return fmt.Errorf("failed to create gzip reader: %w", err) + } + + var snapshot snapshottypes.Snapshot + tr := tar.NewReader(reader) + if err != nil { + return fmt.Errorf("failed to create tar reader: %w", err) + } + + hdr, err := tr.Next() + if err != nil { + return fmt.Errorf("failed to read snapshot file header: %w", err) + } + if hdr.Name != SnapshotFileName { + return fmt.Errorf("invalid archive, expect file: snapshot, got: %s", hdr.Name) + } + bz, err := io.ReadAll(tr) + if err != nil { + return fmt.Errorf("failed to read snapshot file: %w", err) + } + if err := snapshot.Unmarshal(bz); err != nil { + return fmt.Errorf("failed to unmarshal snapshot: %w", err) + } + + // make sure the channel is unbuffered, because the tar reader can't do concurrency + chunks := make(chan io.ReadCloser) + quitChan := make(chan *snapshottypes.Snapshot) + go func() { + defer close(quitChan) + + savedSnapshot, err := snapshotStore.Save(snapshot.Height, snapshot.Format, chunks) + if err != nil { + fmt.Println("failed to save snapshot", err) + return + } + quitChan <- savedSnapshot + }() + + for i := uint32(0); i < snapshot.Chunks; i++ { + hdr, err = tr.Next() + if err != nil { + if err == io.EOF { + break + } + return err + } + + if hdr.Name != strconv.FormatInt(int64(i), 10) { + return fmt.Errorf("invalid archive, expect file: %d, got: %s", i, hdr.Name) + } + + bz, err := io.ReadAll(tr) + if err != nil { + return fmt.Errorf("failed to read chunk file: %w", err) + } + chunks <- io.NopCloser(bytes.NewReader(bz)) + } + close(chunks) + + savedSnapshot := <-quitChan + if savedSnapshot == nil { + return fmt.Errorf("failed to save snapshot") + } + + if !reflect.DeepEqual(&snapshot, savedSnapshot) { + _ = snapshotStore.Delete(snapshot.Height, snapshot.Format) + return fmt.Errorf("invalid archive, the saved snapshot is not equal to the original one") + } + + return nil + }, + } +} diff --git a/client/snapshot/restore.go b/client/snapshot/restore.go new file mode 100644 index 000000000000..7ab46dfe6b9e --- /dev/null +++ b/client/snapshot/restore.go @@ -0,0 +1,50 @@ +package snapshot + +import ( + "path/filepath" + "strconv" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/server" + servertypes "github.com/cosmos/cosmos-sdk/server/types" + dbm "github.com/tendermint/tm-db" +) + +// RestoreSnapshotCmd returns a command to restore a snapshot +func RestoreSnapshotCmd(appCreator servertypes.AppCreator) *cobra.Command { + cmd := &cobra.Command{ + Use: "restore ", + Short: "Restore app state from local snapshot", + Long: "Restore app state from local snapshot", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx := server.GetServerContextFromCmd(cmd) + + height, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + format, err := strconv.ParseUint(args[1], 10, 32) + if err != nil { + return err + } + + home := ctx.Config.RootDir + db, err := openDB(home, server.GetAppDBBackend(ctx.Viper)) + if err != nil { + return err + } + app := appCreator(ctx.Logger, db, nil, ctx.Viper) + + sm := app.SnapshotManager() + return sm.RestoreLocalSnapshot(height, uint32(format)) + }, + } + return cmd +} + +func openDB(rootDir string, backendType dbm.BackendType) (dbm.DB, error) { + dataDir := filepath.Join(rootDir, "data") + return dbm.NewDB("application", backendType, dataDir) +} diff --git a/contrib/rosetta/rosetta-ci/data.tar.gz b/contrib/rosetta/rosetta-ci/data.tar.gz index 7ed3114345923c870cd7cc0b73a347088af7a4c6..ad152760a2e7a086ad8ec4404303001a738d710d 100644 GIT binary patch literal 47219 zcmV($K;yq3iwFP!000001MEC&chg9+eD<%<5g&k^Sds16PO{6M%@YEFFiDsJa&mmy zQri~MD{9G(1N`@`s_vF0`4MI}ggbXfyJuo|S65fpyQ*c9C`#8Y;RP&?*B||u$A+id zZqr|Qs(& z18;cmYVgP9-)gnHf64zLo<;I^e2<5zl}3SoFMFVXJM(hae;dtiry~D$yJbHz?0eb$ zj^}?|{*R6GktYoJKQqox-W(fJ2aJK|bF22)IE)e_h!Spi;UG!^mU>aRW(dxWQJThL zdwqTArK7BGIZ?2V8dLXKIHXUt+T;6u5TCL9*(0?z_UHgvLZq$$Hx$NurLczl?l8yidfe-qq)qw4={0RPMXKfv?<$p7y$ z!T(QqfAElAkOjt&2_sHCha+>x%=cUdUL1Kn@q8cs9XM6yI6Nkg46qTv3Y=hoDxG;r z%h)M?g;+7*fHeT+H3H64iWPd>Xkf5#YPdX%V2Bt2*hI`7Z{R@;fruoXwUqQzZVfHN zwwmoUf`HNZyKP}oMqirGteQewhtt&6X~6&5U^Z9W#3Q?Wz%oDGCL(-r(nhP(+}yMw zX0epZ@O1@eT!RBPh0Q+5#d-u4b)DgBpfSUot;^$-Uty zMde8$)}v;JQCPp_Nu*dck^sQH$;fj?1OPFccsxuXT^MA*7r-_GY(%mcWvLrYP%UAV z!$M?WCXi)dA7Bt5sVs)IE@~4jP#F}+0?@pTQoap#9|T?+;3+`=Nv^qAS(@@7M&*b? z;)@d{2^Vn`y2u?O+o~Zsbw&Jh!`A0L_X57~wA$R{sZ#`d3a0fw^lrdE!U|VB%eer^ z7W3gh;{u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@ module github.com/cosmos/cosmos-sdk require ( cosmossdk.io/errors v1.0.0-beta.7 - cosmossdk.io/math v1.0.0-beta.3 + cosmossdk.io/math v1.0.0-rc.0 github.com/99designs/keyring v1.2.1 github.com/armon/go-metrics v0.4.1 github.com/bgentry/speakeasy v0.1.0 @@ -22,7 +22,7 @@ require ( github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.2 + github.com/golang/protobuf v1.5.3 github.com/google/uuid v1.3.0 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 @@ -32,40 +32,40 @@ require ( github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 github.com/improbable-eng/grpc-web v0.15.0 - github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b + github.com/jhump/protoreflect v1.15.1 github.com/magiconair/properties v1.8.6 github.com/manifoldco/promptui v0.9.0 - github.com/mattn/go-isatty v0.0.16 + github.com/mattn/go-isatty v0.0.18 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 - github.com/prometheus/common v0.37.0 + github.com/prometheus/common v0.42.0 github.com/rakyll/statik v0.1.7 github.com/regen-network/cosmos-proto v0.3.1 - github.com/rs/zerolog v1.27.0 + github.com/rs/zerolog v1.29.1 github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.13.0 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.2 github.com/tendermint/go-amino v0.16.0 github.com/tendermint/tendermint v0.34.28 github.com/tendermint/tm-db v0.6.7 github.com/tidwall/btree v1.5.0 - golang.org/x/crypto v0.5.0 - golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e - google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 - google.golang.org/grpc v1.52.0 - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 + golang.org/x/crypto v0.7.0 + golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 + google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 + google.golang.org/grpc v1.54.0 + google.golang.org/protobuf v1.30.0 pgregory.net/rapid v0.4.7 sigs.k8s.io/yaml v1.3.0 ) require ( - cloud.google.com/go v0.105.0 // indirect - cloud.google.com/go/compute v1.12.1 // indirect - cloud.google.com/go/compute/metadata v0.2.1 // indirect - cloud.google.com/go/iam v0.7.0 // indirect - cloud.google.com/go/storage v1.27.0 // indirect + cloud.google.com/go v0.110.0 // indirect + cloud.google.com/go/compute v1.18.0 // indirect + cloud.google.com/go/compute/metadata v0.2.3 // indirect + cloud.google.com/go/iam v0.12.0 // indirect + cloud.google.com/go/storage v1.28.1 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect @@ -75,13 +75,13 @@ require ( github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cosmos/gorocksdb v1.2.0 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect @@ -89,7 +89,7 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.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 @@ -100,8 +100,8 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/orderedcode v0.0.1 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.6.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/googleapis/gax-go/v2 v2.7.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect @@ -114,43 +114,45 @@ require ( github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.15.11 // indirect - github.com/lib/pq v1.10.6 // indirect + github.com/klauspost/compress v1.16.0 // indirect + github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/go-testing-interface v1.0.0 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/onsi/gomega v1.20.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/pelletier/go-toml/v2 v2.0.7 // indirect + github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/rs/cors v1.8.2 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/afero v1.8.2 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/subosito/gotenv v1.4.1 // indirect - github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.6 // indirect - go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/oauth2 v0.5.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.102.0 // indirect + google.golang.org/api v0.110.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -164,11 +166,13 @@ replace ( // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 - // Fix upstream GHSA-h395-qcrw-5vmq vulnerability. + // Fix upstream GHSA-h395-qcrw-5vmq and GHSA-3vp4-m3rf-835h vulnerabilities. // TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409 - github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0 + github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.9.0 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 + // Downgraded to avoid bugs in following commits which caused simulations to fail. + github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // use cometbft github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 ) diff --git a/go.sum b/go.sum index 1651603d0926..e190a029afe7 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= +cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= +cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -28,15 +28,15 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/bigtable v1.2.0/go.mod h1:JcVAOl45lrTmQfLj7T6TxyMzIN/3FGGcFm+2xVAli2o= -cloud.google.com/go/compute v1.12.1 h1:gKVJMEyqV5c/UnpzjjQbo3Rjvvqpr9B1DFSbJC4OXr0= -cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= -cloud.google.com/go/compute/metadata v0.2.1 h1:efOwf5ymceDhK6PKMnnrTHP4pppY5L22mle96M1yP48= -cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= +cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY= +cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/iam v0.7.0 h1:k4MuwOsS7zGJJ+QfZ5vBK8SgHBAvYN/23BWsiihJ1vs= -cloud.google.com/go/iam v0.7.0/go.mod h1:H5Br8wRaDGNc8XP3keLc4unfUUZeyH3Sfl9XpQEYOeg= -cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs= +cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE= +cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY= +cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -47,13 +47,13 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= -cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= +cloud.google.com/go/storage v1.28.1 h1:F5QDG5ChchaAVQhINh24U99OWHURqrW8OmQcGKXcbgI= +cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= -cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= -cosmossdk.io/math v1.0.0-beta.3/go.mod h1:3LYasri3Zna4XpbrTNdKsWmD5fHHkaNAod/mNT9XdE4= +cosmossdk.io/math v1.0.0-rc.0 h1:ml46ukocrAAoBpYKMidF0R2tQJ1Uxfns0yH8wqgMAFc= +cosmossdk.io/math v1.0.0-rc.0/go.mod h1:Ygz4wBHrgc7g0N+8+MrnTfS9LLn9aaTGa9hKopuym5k= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -158,6 +158,9 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.8.0 h1:ea0Xadu+sHlu7x5O3gKhRpQ1IKiMrSiHttPF0ybECuA= +github.com/bytedance/sonic v1.8.0/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -170,9 +173,12 @@ github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= @@ -209,7 +215,7 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= @@ -246,8 +252,9 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M= github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRktEqrX88CvjIw= @@ -305,16 +312,16 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= -github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= +github.com/gin-gonic/gin v1.9.0 h1:OjyFBKICoexlu99ctXNR2gg+c5pKrKMuyjgARg9qeY8= +github.com/gin-gonic/gin v1.9.0/go.mod h1:W1Me9+hsUSyj3CePGrd1/QrKJMSJ1Tu/0hFEH89961k= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= @@ -326,8 +333,6 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= github.com/go-kit/kit v0.12.0/go.mod h1:lHd+EkCZPIwYItmGDDRdhinkzX2A1sj+M9biaEaizzs= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= @@ -338,13 +343,13 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -355,6 +360,8 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.10.0 h1:mXKd9Qw4NuzShiRlOXKews24ufknHO7gx30lsDyokKA= +github.com/goccy/go-json v0.10.0/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -400,8 +407,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -434,7 +441,7 @@ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPg github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1 h1:d8MncMlErDFTwQGBK1xhv026j9kqhvw1Qv9IbWT1VLQ= +github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -454,12 +461,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= +github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= +github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= +github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ= +github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= @@ -580,7 +587,6 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -600,9 +606,12 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5 h1:2U0HzY8BJ8hVwDKIzp7y4voR9CX/nvcfymLmg2UiOio= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -611,7 +620,8 @@ github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -620,11 +630,11 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= +github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= @@ -653,8 +663,10 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -662,8 +674,8 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= @@ -674,8 +686,9 @@ github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceT github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -727,8 +740,9 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= @@ -752,17 +766,20 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= +github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterh/liner v1.0.1-0.20180619022028-8c1271fcf47f/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU= +github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -779,8 +796,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -799,20 +814,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= @@ -828,13 +839,16 @@ github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRr github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= +github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= +github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -899,8 +913,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= @@ -925,13 +940,13 @@ github.com/tklauser/numcpus v0.2.2/go.mod h1:x3qojaO3uyYt0i56EW/VUYs7uBvdl2fkfZF github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -952,6 +967,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= @@ -968,8 +984,8 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -979,6 +995,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670 h1:18EFjUmQOcUvxNYSkA6jO9VAiXCnxFY6NyDX0bHDmkU= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1000,9 +1018,11 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1017,8 +1037,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= -golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA= +golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 h1:LGJsf5LRplCck6jUCH3dBL2dmycNruWNF5xugkSlfXw= +golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1044,7 +1064,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1093,15 +1114,15 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1111,10 +1132,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 h1:nt+Q6cXKz4MosCSpnbMtqiQ8Oz0pxTef2B4Vca2lvfk= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1126,6 +1145,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1195,7 +1215,6 @@ golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1203,18 +1222,23 @@ golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220517195934-5e4e11fc645e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1224,8 +1248,11 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1294,7 +1321,8 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.4.0 h1:7mTAgkunk3fr4GAloyyCasadO6h9zSsQZbwvcaIciV4= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1327,8 +1355,8 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513 google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= -google.golang.org/api v0.102.0/go.mod h1:3VFl6/fzoA+qNuS1N1/VfXY4LjoXN/wzeIp7TweWwGo= +google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU= +google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1382,8 +1410,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= -google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 h1:DdoeryqhaXp1LtT/emMP1BRJPHHKFi5akj/nbx/zNTA= +google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4/go.mod h1:NWraEVixdDnqcqQ30jipen1STv2r/n24Wb7twVTGR4s= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1408,8 +1436,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk= -google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY= +google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag= +google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1424,8 +1452,9 @@ google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX7 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/server/types/app.go b/server/types/app.go index abc4c739e5bb..124dcf4c25ad 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -15,6 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/server/api" "github.com/cosmos/cosmos-sdk/server/config" + "github.com/cosmos/cosmos-sdk/snapshots" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -55,6 +56,9 @@ type ( // Return the multistore instance CommitMultiStore() sdk.CommitMultiStore + + // Return the snapshot manager + SnapshotManager() *snapshots.Manager } // ApplicationQueryService defines an extension of the Application interface diff --git a/server/util.go b/server/util.go index 52caa5967794..019d0132085c 100644 --- a/server/util.go +++ b/server/util.go @@ -465,3 +465,22 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) { baseapp.SetIAVLLazyLoading(cast.ToBool(appOpts.Get(FlagIAVLLazyLoading))), } } + +func GetSnapshotStore(appOpts types.AppOptions) (*snapshots.Store, error) { + homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) + snapshotDir := filepath.Join(homeDir, "data", "snapshots") + if err := os.MkdirAll(snapshotDir, os.ModePerm); err != nil { + return nil, fmt.Errorf("failed to create snapshots directory: %w", err) + } + + snapshotDB, err := dbm.NewDB("metadata", GetAppDBBackend(appOpts), snapshotDir) + if err != nil { + return nil, err + } + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) + if err != nil { + return nil, err + } + + return snapshotStore, nil +} diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index d8b71c6df53a..03261d516ca1 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -20,6 +20,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/keys" "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" + "github.com/cosmos/cosmos-sdk/client/snapshot" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -169,6 +170,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { debug.Cmd(), config.Cmd(), pruning.PruningCmd(a.newApp), + snapshot.Cmd(a.newApp), ) server.AddCommands(rootCmd, simapp.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags) diff --git a/snapshots/manager.go b/snapshots/manager.go index 05cbad3f5b30..4e46116a9199 100644 --- a/snapshots/manager.go +++ b/snapshots/manager.go @@ -391,6 +391,25 @@ func (m *Manager) RestoreChunk(chunk []byte) (bool, error) { return false, nil } +// RestoreLocalSnapshot restores app state from a local snapshot. +func (m *Manager) RestoreLocalSnapshot(height uint64, format uint32) error { + snapshot, ch, err := m.store.Load(height, format) + if err != nil { + return err + } + + m.mtx.Lock() + defer m.mtx.Unlock() + + err = m.beginLocked(opRestore) + if err != nil { + return err + } + defer m.endLocked() + + return m.restoreSnapshot(*snapshot, ch) +} + // sortedExtensionNames sort extension names for deterministic iteration. func (m *Manager) sortedExtensionNames() []string { names := make([]string, 0, len(m.extensions)) diff --git a/snapshots/store.go b/snapshots/store.go index 8105938b80f1..6a663e701641 100644 --- a/snapshots/store.go +++ b/snapshots/store.go @@ -3,6 +3,7 @@ package snapshots import ( "crypto/sha256" "encoding/binary" + "hash" "io" "math" "os" @@ -14,6 +15,7 @@ import ( db "github.com/tendermint/tm-db" "github.com/cosmos/cosmos-sdk/snapshots/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -164,8 +166,8 @@ func (s *Store) Load(height uint64, format uint32) (*types.Snapshot, <-chan io.R // LoadChunk loads a chunk from disk, or returns nil if it does not exist. The caller must call // Close() on it when done. -func (s *Store) LoadChunk(height uint64, format uint32, chunk uint32) (io.ReadCloser, error) { - path := s.pathChunk(height, format, chunk) +func (s *Store) LoadChunk(height uint64, format, chunk uint32) (io.ReadCloser, error) { + path := s.PathChunk(height, format, chunk) file, err := os.Open(path) if os.IsNotExist(err) { return nil, nil @@ -174,8 +176,8 @@ func (s *Store) LoadChunk(height uint64, format uint32, chunk uint32) (io.ReadCl } // loadChunkFile loads a chunk from disk, and errors if it does not exist. -func (s *Store) loadChunkFile(height uint64, format uint32, chunk uint32) (io.ReadCloser, error) { - path := s.pathChunk(height, format, chunk) +func (s *Store) loadChunkFile(height uint64, format, chunk uint32) (io.ReadCloser, error) { + path := s.PathChunk(height, format, chunk) return os.Open(path) } @@ -259,33 +261,16 @@ func (s *Store) Save( snapshotHasher := sha256.New() chunkHasher := sha256.New() for chunkBody := range chunks { - defer chunkBody.Close() // nolint: staticcheck + defer chunkBody.Close() //nolint:staticcheck dir := s.pathSnapshot(height, format) err = os.MkdirAll(dir, 0o755) if err != nil { return nil, sdkerrors.Wrapf(err, "failed to create snapshot directory %q", dir) } - path := s.pathChunk(height, format, index) - file, err := os.Create(path) - if err != nil { - return nil, sdkerrors.Wrapf(err, "failed to create snapshot chunk file %q", path) - } - defer file.Close() // nolint: staticcheck - chunkHasher.Reset() - _, err = io.Copy(io.MultiWriter(file, chunkHasher, snapshotHasher), chunkBody) - if err != nil { - return nil, sdkerrors.Wrapf(err, "failed to generate snapshot chunk %v", index) - } - err = file.Close() - if err != nil { - return nil, sdkerrors.Wrapf(err, "failed to close snapshot chunk %v", index) - } - err = chunkBody.Close() - if err != nil { - return nil, sdkerrors.Wrapf(err, "failed to close snapshot chunk %v", index) + if err := s.saveChunk(chunkBody, index, snapshot, chunkHasher, snapshotHasher); err != nil { + return nil, err } - snapshot.Metadata.ChunkHashes = append(snapshot.Metadata.ChunkHashes, chunkHasher.Sum(nil)) index++ } snapshot.Chunks = index @@ -293,6 +278,36 @@ func (s *Store) Save( return snapshot, s.saveSnapshot(snapshot) } +// saveChunk saves the given chunkBody with the given index to its appropriate path on disk. +// The hash of the chunk is appended to the snapshot's metadata, +// and the overall snapshot hash is updated with the chunk content too. +func (s *Store) saveChunk(chunkBody io.ReadCloser, index uint32, snapshot *types.Snapshot, chunkHasher, snapshotHasher hash.Hash) error { + defer chunkBody.Close() + + path := s.PathChunk(snapshot.Height, snapshot.Format, index) + chunkFile, err := os.Create(path) + if err != nil { + return sdkerrors.Wrapf(err, "failed to create snapshot chunk file %q", path) + } + defer chunkFile.Close() + + chunkHasher.Reset() + if _, err := io.Copy(io.MultiWriter(chunkFile, chunkHasher, snapshotHasher), chunkBody); err != nil { + return sdkerrors.Wrapf(err, "failed to generate snapshot chunk %d", index) + } + + if err := chunkFile.Close(); err != nil { + return sdkerrors.Wrapf(err, "failed to close snapshot chunk file %d", index) + } + + if err := chunkBody.Close(); err != nil { + return sdkerrors.Wrapf(err, "failed to close snapshot chunk body %d", index) + } + + snapshot.Metadata.ChunkHashes = append(snapshot.Metadata.ChunkHashes, chunkHasher.Sum(nil)) + return nil +} + // saveSnapshot saves snapshot metadata to the database. func (s *Store) saveSnapshot(snapshot *types.Snapshot) error { value, err := proto.Marshal(snapshot) @@ -313,8 +328,8 @@ func (s *Store) pathSnapshot(height uint64, format uint32) string { return filepath.Join(s.pathHeight(height), strconv.FormatUint(uint64(format), 10)) } -// pathChunk generates a snapshot chunk path. -func (s *Store) pathChunk(height uint64, format uint32, chunk uint32) string { +// PathChunk generates a snapshot chunk path. +func (s *Store) PathChunk(height uint64, format, chunk uint32) string { return filepath.Join(s.pathSnapshot(height, format), strconv.FormatUint(uint64(chunk), 10)) } From 5472fb5995a0464207f60df5cfab5c6323acbc78 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 13 May 2023 09:10:01 +0000 Subject: [PATCH 51/52] fix: snapshot commands panic if snapshot don't exists (backport #16138) (#16140) Co-authored-by: yihuang Co-authored-by: marbar3778 Co-authored-by: Julien Robert --- .gitignore | 1 + client/snapshot/dump.go | 5 +++++ snapshots/manager.go | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 1ce4f5cfa123..1adf64472c42 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ dist tools-stamp buf-stamp artifacts +tools/ # Data - ideally these don't exist baseapp/data/* diff --git a/client/snapshot/dump.go b/client/snapshot/dump.go index 917dca071512..72dadbc57254 100644 --- a/client/snapshot/dump.go +++ b/client/snapshot/dump.go @@ -3,6 +3,7 @@ package snapshot import ( "archive/tar" "compress/gzip" + "errors" "fmt" "io" "os" @@ -48,6 +49,10 @@ func DumpArchiveCmd() *cobra.Command { return err } + if snapshot == nil { + return errors.New("snapshot doesn't exist") + } + bz, err := snapshot.Marshal() if err != nil { return err diff --git a/snapshots/manager.go b/snapshots/manager.go index 4e46116a9199..7bb5cd8abf5f 100644 --- a/snapshots/manager.go +++ b/snapshots/manager.go @@ -398,6 +398,10 @@ func (m *Manager) RestoreLocalSnapshot(height uint64, format uint32) error { return err } + if snapshot == nil { + return fmt.Errorf("snapshot doesn't exist, height: %d, format: %d", height, format) + } + m.mtx.Lock() defer m.mtx.Unlock() From 557da6ebd121c2117d9d15f6925888ca202923f4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 10:03:44 +0000 Subject: [PATCH 52/52] feat: add Close method for resource cleanup in graceful shutdown (backport #16193) (#16205) Co-authored-by: yihuang Co-authored-by: Julien Robert --- CHANGELOG.md | 1 + baseapp/baseapp.go | 5 +++++ server/start.go | 5 +++++ server/types/app.go | 3 +++ 4 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ca726fd72a6..27d224d77100 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (gov) [#15979](https://github.com/cosmos/cosmos-sdk/pull/15979) Improve gov error message when failing to convert v1 proposal to v1beta1. * (server) [#16061](https://github.com/cosmos/cosmos-sdk/pull/16061) add comet bootstrap command * (store) [#16067](https://github.com/cosmos/cosmos-sdk/pull/16067) Add local snapshots management commands. +* (baseapp) [#16193](https://github.com/cosmos/cosmos-sdk/pull/16193) Add `Close` method to `BaseApp` for custom app to cleanup resource in graceful shutdown. ### Bug Fixes diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 98c2f226a059..ca2fe852af6e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -844,3 +844,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s func makeABCIData(msgResponses []*codectypes.Any) ([]byte, error) { return proto.Marshal(&sdk.TxMsgData{MsgResponses: msgResponses}) } + +// Close is called in start cmd to gracefully cleanup resources. +func (app *BaseApp) Close() error { + return nil +} diff --git a/server/start.go b/server/start.go index 208bfb8db674..2ea63c5fe1a9 100644 --- a/server/start.go +++ b/server/start.go @@ -244,6 +244,10 @@ func startStandAlone(ctx *Context, appCreator types.AppCreator) error { if err = svr.Stop(); err != nil { tmos.Exit(err.Error()) } + + if err = app.Close(); err != nil { + tmos.Exit(err.Error()) + } }() // Wait for SIGINT or SIGTERM signal @@ -485,6 +489,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App defer func() { if tmNode != nil && tmNode.IsRunning() { _ = tmNode.Stop() + _ = app.Close() } if apiSrv != nil { diff --git a/server/types/app.go b/server/types/app.go index 124dcf4c25ad..d886936f75c5 100644 --- a/server/types/app.go +++ b/server/types/app.go @@ -59,6 +59,9 @@ type ( // Return the snapshot manager SnapshotManager() *snapshots.Manager + + // Close is called in start cmd to gracefully cleanup resources. + Close() error } // ApplicationQueryService defines an extension of the Application interface