From fb9efdf875db29dd9654b9ce606c9cb6632704cf Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 1 Aug 2024 16:19:21 +0200 Subject: [PATCH 01/15] docs: Fix cli usage examples (#21150) --- server/cmt_cmds.go | 2 +- server/v2/cometbft/commands.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index abbc4a9f5da3..6e13230e5260 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -183,7 +183,7 @@ Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'xx_events.md'. `, Example: fmt.Sprintf( - "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order-by ASC", + "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order_by asc", version.AppName, ), RunE: func(cmd *cobra.Command, args []string) error { diff --git a/server/v2/cometbft/commands.go b/server/v2/cometbft/commands.go index 26d13058952a..802d04a26851 100644 --- a/server/v2/cometbft/commands.go +++ b/server/v2/cometbft/commands.go @@ -192,7 +192,7 @@ Please refer to each module's documentation for the full set of events to query for. Each module documents its respective events under 'xx_events.md'. `, Example: fmt.Sprintf( - "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order-by ASC", + "$ %s query blocks --query \"message.sender='cosmos1...' AND block.height > 7\" --page 1 --limit 30 --order_by asc", version.AppName, ), RunE: func(cmd *cobra.Command, args []string) error { From 23fac2f1b8ab40997ebf2dba3d4641c9aeda12e5 Mon Sep 17 00:00:00 2001 From: Alexander Peters Date: Fri, 2 Aug 2024 08:40:46 +0200 Subject: [PATCH 02/15] fix(systemtests): Fix account creation test to wait for TX committed (#21149) --- tests/systemtests/account_test.go | 21 +++++++++++++------- tests/systemtests/cli.go | 32 ++++++++++++++++++++++++++----- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/tests/systemtests/account_test.go b/tests/systemtests/account_test.go index c3940579e2c3..42580862e608 100644 --- a/tests/systemtests/account_test.go +++ b/tests/systemtests/account_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/tidwall/gjson" ) @@ -21,6 +22,7 @@ func TestAccountCreation(t *testing.T) { // add genesis account with some tokens account1Addr := cli.AddKey("account1") account2Addr := cli.AddKey("account2") + require.NotEqual(t, account1Addr, account2Addr) sut.ModifyGenesisCLI(t, []string{"genesis", "add-genesis-account", account1Addr, "10000000stake"}, ) @@ -32,15 +34,20 @@ func TestAccountCreation(t *testing.T) { assert.Equal(t, account1Addr, gjson.Get(rsp, "account.value.address").String(), rsp) rsp1 := cli.Run("tx", "bank", "send", account1Addr, account2Addr, "5000stake", "--from="+account1Addr, "--fees=1stake") - RequireTxSuccess(t, rsp1) + txResult, found := cli.AwaitTxCommitted(rsp1) + require.True(t, found) + RequireTxSuccess(t, txResult) // query account2 - - rsp2 := cli.WithRunErrorsIgnored().CustomQuery("q", "auth", "account", account2Addr) - assert.True(t, strings.Contains(rsp2, "not found: key not found")) - - rsp3 := cli.Run("tx", "bank", "send", account2Addr, account1Addr, "1000stake", "--from="+account1Addr, "--fees=1stake") - RequireTxSuccess(t, rsp3) + assertNotFound := func(t assert.TestingT, err error, msgAndArgs ...interface{}) (ok bool) { + return strings.Contains(err.Error(), "not found: key not found") + } + _ = cli.WithRunErrorMatcher(assertNotFound).CustomQuery("q", "auth", "account", account2Addr) + + rsp3 := cli.Run("tx", "bank", "send", account2Addr, account1Addr, "1000stake", "--from="+account2Addr, "--fees=1stake") + txResult, found = cli.AwaitTxCommitted(rsp3) + require.True(t, found) + RequireTxSuccess(t, txResult) // query account2 to make sure its created rsp4 := cli.CustomQuery("q", "auth", "account", account2Addr) diff --git a/tests/systemtests/cli.go b/tests/systemtests/cli.go index ae0ee0e9ac8d..404b7849fb36 100644 --- a/tests/systemtests/cli.go +++ b/tests/systemtests/cli.go @@ -1,6 +1,8 @@ package systemtests import ( + "bufio" + "bytes" "fmt" "io" "os" @@ -150,6 +152,7 @@ func (c CLIWrapper) WithAssertTXUncommitted() CLIWrapper { // Run main entry for executing cli commands. // When configured, method blocks until tx is committed. func (c CLIWrapper) Run(args ...string) string { + c.t.Helper() if c.fees != "" && !slices.ContainsFunc(args, func(s string) bool { return strings.HasPrefix(s, "--fees") }) { @@ -160,14 +163,15 @@ func (c CLIWrapper) Run(args ...string) string { if !ok { return execOutput } - rsp, committed := c.awaitTxCommitted(execOutput, DefaultWaitTime) + rsp, committed := c.AwaitTxCommitted(execOutput, DefaultWaitTime) c.t.Logf("tx committed: %v", committed) require.Equal(c.t, c.expTXCommitted, committed, "expected tx committed: %v", c.expTXCommitted) return rsp } -// wait for tx committed on chain -func (c CLIWrapper) awaitTxCommitted(submitResp string, timeout ...time.Duration) (string, bool) { +// AwaitTxCommitted wait for tx committed on chain +func (c CLIWrapper) AwaitTxCommitted(submitResp string, timeout ...time.Duration) (string, bool) { + c.t.Helper() RequireTxSuccess(c.t, submitResp) txHash := gjson.Get(submitResp, "txhash") require.True(c.t, txHash.Exists()) @@ -201,10 +205,12 @@ func (c CLIWrapper) CustomQuery(args ...string) string { // execute shell command func (c CLIWrapper) run(args []string) (output string, ok bool) { + c.t.Helper() return c.runWithInput(args, nil) } func (c CLIWrapper) runWithInput(args []string, input io.Reader) (output string, ok bool) { + c.t.Helper() if c.Debug { c.t.Logf("+++ running `%s %s`", c.execBinary, strings.Join(args, " ")) } @@ -219,10 +225,26 @@ func (c CLIWrapper) runWithInput(args []string, input io.Reader) (output string, cmd.Stdin = input return cmd.CombinedOutput() }() + gotOut = filterProtoNoise(gotOut) ok = c.assertErrorFn(c.t, gotErr, string(gotOut)) return strings.TrimSpace(string(gotOut)), ok } +func filterProtoNoise(in []byte) []byte { + // temporary hack to get rid of all the noise on the stderr + var out bytes.Buffer + scanner := bufio.NewScanner(bytes.NewReader(in)) + for scanner.Scan() { + if !strings.Contains(scanner.Text(), " proto: duplicate proto type registered") { + _, _ = out.Write(scanner.Bytes()) + } + } + if err := scanner.Err(); err != nil { + panic(err) + } + return out.Bytes() +} + func (c CLIWrapper) withQueryFlags(args ...string) []string { args = append(args, "--output", "json") return c.withChainFlags(args...) @@ -392,10 +414,10 @@ func RequireTxFailure(t *testing.T, got string, containsMsgs ...string) { func parseResultCode(t *testing.T, got string) (int64, string) { t.Helper() code := gjson.Get(got, "code") - require.True(t, code.Exists(), "got response: %s", got) + require.True(t, code.Exists(), "got response: %q", got) details := got - if log := gjson.Get(got, "raw_log"); log.Exists() { + if log := gjson.Get(got, "raw_log"); log.Exists() && len(log.String()) != 0 { details = log.String() } return code.Int(), details From e507900e4570a9aeaeaed7e6e8fd1029c6ff0a69 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 2 Aug 2024 09:19:44 +0200 Subject: [PATCH 03/15] chore: check err before logging (#21133) --- server/v2/api/grpc/server.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/v2/api/grpc/server.go b/server/v2/api/grpc/server.go index 5bce26508b02..006a970e09b9 100644 --- a/server/v2/api/grpc/server.go +++ b/server/v2/api/grpc/server.go @@ -184,7 +184,10 @@ func (s *Server[T]) Start(ctx context.Context) error { // Start a blocking select to wait for an indication to stop the server or that // the server failed to start properly. err = <-errCh - s.logger.Error("failed to start gRPC server", "err", err) + if err != nil { + s.logger.Error("failed to start gRPC server", "err", err) + } + return err } From bc72e34d559bfdc12319a3b1b141f1b735cdd69e Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Fri, 2 Aug 2024 16:49:01 +0700 Subject: [PATCH 04/15] fix(storev2/snapshots): Close `StateChanges` channel in `doRestoreSnapshot` (#21106) --- store/v2/snapshots/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/v2/snapshots/manager.go b/store/v2/snapshots/manager.go index 9380b3021b4d..7e12e4503de8 100644 --- a/store/v2/snapshots/manager.go +++ b/store/v2/snapshots/manager.go @@ -400,7 +400,6 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. // chStorage is the channel to pass the KV pairs to the storage snapshotter. chStorage := make(chan *corestore.StateChanges, defaultStorageChannelBufferSize) - defer close(chStorage) storageErrs := make(chan error, 1) go func() { @@ -415,6 +414,7 @@ func (m *Manager) doRestoreSnapshot(snapshot types.Snapshot, chChunks <-chan io. if err != nil { return errorsmod.Wrap(err, "multistore restore") } + close(chStorage) for { if nextItem.Item == nil { From 04bedcd32b513fc52800f27217dcaf0c0c56bc61 Mon Sep 17 00:00:00 2001 From: Alexander Peters Date: Fri, 2 Aug 2024 12:16:03 +0200 Subject: [PATCH 05/15] chore(systemtests): better support for app v2 (#21128) Co-authored-by: Julien Robert Co-authored-by: Marko --- scripts/build/testing.mk | 2 +- tests/systemtests/Makefile | 2 +- tests/systemtests/cli.go | 2 +- tests/systemtests/fraud_test.go | 9 ++++- tests/systemtests/system.go | 67 +++++++++++++++++-------------- tests/systemtests/testnet_init.go | 4 +- tests/systemtests/upgrade_test.go | 6 +-- 7 files changed, 53 insertions(+), 39 deletions(-) diff --git a/scripts/build/testing.mk b/scripts/build/testing.mk index 98f1afe2a634..8fcdcb7a61f6 100644 --- a/scripts/build/testing.mk +++ b/scripts/build/testing.mk @@ -29,7 +29,7 @@ test-all: test-unit test-e2e test-integration test-ledger-mock test-race .PHONY: test-system test-system: build mkdir -p ./tests/systemtests/binaries/ - cp $(BUILDDIR)/simd ./tests/systemtests/binaries/ + cp $(BUILDDIR)/simd$(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),v2) ./tests/systemtests/binaries/ $(MAKE) -C tests/systemtests test diff --git a/tests/systemtests/Makefile b/tests/systemtests/Makefile index 1a384b81661a..948d43bf8161 100644 --- a/tests/systemtests/Makefile +++ b/tests/systemtests/Makefile @@ -5,7 +5,7 @@ WAIT_TIME ?= 45s all: test test: - go test -mod=readonly -failfast -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose + go test -mod=readonly -failfast -tags='system_test' ./... --wait-time=$(WAIT_TIME) --verbose $(if $(findstring v2,$(COSMOS_BUILD_OPTIONS)),--binary=simdv2) format: find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w diff --git a/tests/systemtests/cli.go b/tests/systemtests/cli.go index 404b7849fb36..bae6c55eaf73 100644 --- a/tests/systemtests/cli.go +++ b/tests/systemtests/cli.go @@ -223,7 +223,7 @@ func (c CLIWrapper) runWithInput(args []string, input io.Reader) (output string, cmd := exec.Command(locateExecutable(c.execBinary), args...) //nolint:gosec // test code only cmd.Dir = WorkDir cmd.Stdin = input - return cmd.CombinedOutput() + return cmd.Output() }() gotOut = filterProtoNoise(gotOut) ok = c.assertErrorFn(c.t, gotErr, string(gotOut)) diff --git a/tests/systemtests/fraud_test.go b/tests/systemtests/fraud_test.go index 675f3969e40c..a383669eeff6 100644 --- a/tests/systemtests/fraud_test.go +++ b/tests/systemtests/fraud_test.go @@ -29,9 +29,10 @@ func TestValidatorDoubleSign(t *testing.T) { t.Log(rsp) nodePowerBefore := QueryCometValidatorPowerForNode(t, sut, 0) require.NotEmpty(t, nodePowerBefore) + t.Logf("nodePowerBefore: %v", nodePowerBefore) var validatorPubKey cryptotypes.PubKey - newNode := sut.AddFullnode(t, "0.001stake", func(nodeNumber int, nodePath string) { + newNode := sut.AddFullnode(t, func(nodeNumber int, nodePath string) { valKeyFile := filepath.Join(WorkDir, nodePath, "config", "priv_validator_key.json") _ = os.Remove(valKeyFile) _, err := copyFile(filepath.Join(WorkDir, sut.nodePath(0), "config", "priv_validator_key.json"), valKeyFile) @@ -54,9 +55,15 @@ func TestValidatorDoubleSign(t *testing.T) { // then comet status updated nodePowerAfter := QueryCometValidatorPowerForNode(t, sut, 0) require.Empty(t, nodePowerAfter) + t.Logf("nodePowerAfter: %v", nodePowerAfter) // and sdk status updated byzantineOperatorAddr := cli.GetKeyAddrPrefix("node0", "val") rsp = cli.CustomQuery("q", "staking", "validator", byzantineOperatorAddr) assert.True(t, gjson.Get(rsp, "validator.jailed").Bool(), rsp) + + t.Log("let's run for some blocks to confirm all good") + for i := 0; i < 10; i++ { + sut.AwaitNextBlock(t) + } } diff --git a/tests/systemtests/system.go b/tests/systemtests/system.go index 355854cfddc1..bc8f4351b33d 100644 --- a/tests/systemtests/system.go +++ b/tests/systemtests/system.go @@ -23,6 +23,7 @@ import ( tmtypes "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/require" "github.com/tidwall/sjson" + "golang.org/x/exp/maps" "github.com/cosmos/cosmos-sdk/server" sdk "github.com/cosmos/cosmos-sdk/types" @@ -154,7 +155,7 @@ func (s *SystemUnderTest) StartChain(t *testing.T, xargs ...string) { t.Helper() s.Log("Start chain\n") s.ChainStarted = true - s.startNodesAsync(t, append([]string{"start", "--trace", "--log_level=info", "--log_no_color"}, xargs...)...) + s.startNodesAsync(t, append([]string{"start", "--log_level=info", "--log_no_color"}, xargs...)...) s.AwaitNodeUp(t, s.rpcAddr) @@ -332,10 +333,10 @@ func (s *SystemUnderTest) StopChain() { func (s *SystemUnderTest) withEachPid(cb func(p *os.Process)) { s.pidsLock.RLock() - pids := s.pids + pids := maps.Keys(s.pids) s.pidsLock.RUnlock() - for pid := range pids { + for _, pid := range pids { p, err := os.FindProcess(pid) if err != nil { continue @@ -528,7 +529,7 @@ func (s *SystemUnderTest) ForEachNodeExecAndWait(t *testing.T, cmds ...[]string) for j, xargs := range cmds { xargs = append(xargs, "--home", home) s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(xargs, " ")) - out := runShellCmd(t, s.execBinary, xargs...) + out := MustRunShellCmd(t, s.execBinary, xargs...) s.Logf("Result: %s\n", out) result[i][j] = out } @@ -536,20 +537,20 @@ func (s *SystemUnderTest) ForEachNodeExecAndWait(t *testing.T, cmds ...[]string) return result } -func runShellCmd(t *testing.T, cmd string, args ...string) string { +func MustRunShellCmd(t *testing.T, cmd string, args ...string) string { t.Helper() - out, err := runShellCmdX(cmd, args...) + out, err := RunShellCmd(cmd, args...) require.NoError(t, err) return out } -func runShellCmdX(cmd string, args ...string) (string, error) { +func RunShellCmd(cmd string, args ...string) (string, error) { c := exec.Command( //nolint:gosec // used by tests only locateExecutable(cmd), args..., ) c.Dir = WorkDir - out, err := c.CombinedOutput() + out, err := c.Output() if err != nil { return string(out), fmt.Errorf("run `%s %s`: out: %s: %w", cmd, strings.Join(args, " "), string(out), err) } @@ -560,7 +561,7 @@ func runShellCmdX(cmd string, args ...string) (string, error) { func (s *SystemUnderTest) startNodesAsync(t *testing.T, xargs ...string) { t.Helper() s.withEachNodeHome(func(i int, home string) { - args := append(xargs, "--home", home) + args := append(xargs, "--home="+home) s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(args, " ")) cmd := exec.Command( //nolint:gosec // used by tests only locateExecutable(s.execBinary), @@ -569,24 +570,27 @@ func (s *SystemUnderTest) startNodesAsync(t *testing.T, xargs ...string) { cmd.Dir = WorkDir s.watchLogs(i, cmd) require.NoError(t, cmd.Start(), "node %d", i) - - pid := cmd.Process.Pid - s.pidsLock.Lock() - s.pids[pid] = struct{}{} - s.pidsLock.Unlock() - s.Logf("Node started: %d\n", pid) + s.Logf("Node started: %d\n", cmd.Process.Pid) // cleanup when stopped - go func(pid int) { - _ = cmd.Wait() // blocks until shutdown - s.pidsLock.Lock() - delete(s.pids, pid) - s.pidsLock.Unlock() - s.Logf("Node stopped: %d\n", pid) - }(pid) + s.awaitProcessCleanup(cmd) }) } +func (s *SystemUnderTest) awaitProcessCleanup(cmd *exec.Cmd) { + pid := cmd.Process.Pid + s.pidsLock.Lock() + s.pids[pid] = struct{}{} + s.pidsLock.Unlock() + go func() { + _ = cmd.Wait() // blocks until shutdown + s.Logf("Node stopped: %d\n", pid) + s.pidsLock.Lock() + delete(s.pids, pid) + s.pidsLock.Unlock() + }() +} + func (s *SystemUnderTest) withEachNodeHome(cb func(i int, home string)) { for i := 0; i < s.nodesCount; i++ { cb(i, s.nodePath(i)) @@ -658,7 +662,7 @@ func (s *SystemUnderTest) resetBuffers() { } // AddFullnode starts a new fullnode that connects to the existing chain but is not a validator. -func (s *SystemUnderTest) AddFullnode(t *testing.T, minGasPrices string, beforeStart ...func(nodeNumber int, nodePath string)) Node { +func (s *SystemUnderTest) AddFullnode(t *testing.T, beforeStart ...func(nodeNumber int, nodePath string)) Node { t.Helper() s.MarkDirty() s.nodesCount++ @@ -668,7 +672,7 @@ func (s *SystemUnderTest) AddFullnode(t *testing.T, minGasPrices string, beforeS // prepare new node moniker := fmt.Sprintf("node%d", nodeNumber) - args := []string{"init", moniker, "--home", nodePath, "--overwrite"} + args := []string{"init", moniker, "--home=" + nodePath, "--overwrite"} s.Logf("Execute `%s %s`\n", s.execBinary, strings.Join(args, " ")) cmd := exec.Command( //nolint:gosec // used by tests only locateExecutable(s.execBinary), @@ -679,12 +683,15 @@ func (s *SystemUnderTest) AddFullnode(t *testing.T, minGasPrices string, beforeS require.NoError(t, cmd.Run(), "failed to start node with id %d", nodeNumber) require.NoError(t, saveGenesis(nodePath, []byte(s.ReadGenesisJSON(t)))) - // quick hack: copy config and overwrite by start params - configFile := filepath.Join(WorkDir, nodePath, "config", "config.toml") - _ = os.Remove(configFile) - _, err := copyFile(filepath.Join(WorkDir, s.nodePath(0), "config", "config.toml"), configFile) - require.NoError(t, err) + configPath := filepath.Join(WorkDir, nodePath, "config") + // quick hack: copy config and overwrite by start params + for _, tomlFile := range []string{"config.toml", "app.toml"} { + configFile := filepath.Join(configPath, tomlFile) + _ = os.Remove(configFile) + _, err := copyFile(filepath.Join(WorkDir, s.nodePath(0), "config", tomlFile), configFile) + require.NoError(t, err) + } // start node allNodes := s.AllNodes(t) node := allNodes[len(allNodes)-1] @@ -701,7 +708,6 @@ func (s *SystemUnderTest) AddFullnode(t *testing.T, minGasPrices string, beforeS fmt.Sprintf("--p2p.laddr=tcp://localhost:%d", node.P2PPort), fmt.Sprintf("--rpc.laddr=tcp://localhost:%d", node.RPCPort), fmt.Sprintf("--grpc.address=localhost:%d", 9090+nodeNumber), - fmt.Sprintf("--minimum-gas-prices=%s", minGasPrices), "--p2p.pex=false", "--moniker=" + moniker, "--log_level=info", @@ -716,6 +722,7 @@ func (s *SystemUnderTest) AddFullnode(t *testing.T, minGasPrices string, beforeS cmd.Dir = WorkDir s.watchLogs(nodeNumber, cmd) require.NoError(t, cmd.Start(), "node %d", nodeNumber) + s.awaitProcessCleanup(cmd) return node } diff --git a/tests/systemtests/testnet_init.go b/tests/systemtests/testnet_init.go index 28a957d63166..c3cd9c0f73e7 100644 --- a/tests/systemtests/testnet_init.go +++ b/tests/systemtests/testnet_init.go @@ -58,7 +58,7 @@ func (s SingleHostTestnetCmdInitializer) Initialize() { "--single-host", } s.log(fmt.Sprintf("+++ %s %s\n", s.execBinary, strings.Join(args, " "))) - out, err := runShellCmdX(s.execBinary, args...) + out, err := RunShellCmd(s.execBinary, args...) if err != nil { panic(err) } @@ -112,7 +112,7 @@ func (s ModifyConfigYamlInitializer) Initialize() { } s.log(fmt.Sprintf("+++ %s %s\n", s.execBinary, strings.Join(args, " "))) - out, err := runShellCmdX(s.execBinary, args...) + out, err := RunShellCmd(s.execBinary, args...) if err != nil { panic(err) } diff --git a/tests/systemtests/upgrade_test.go b/tests/systemtests/upgrade_test.go index 15d759079b16..a9a990ef2819 100644 --- a/tests/systemtests/upgrade_test.go +++ b/tests/systemtests/upgrade_test.go @@ -106,8 +106,8 @@ func FetchExecutable(t *testing.T, version string) string { } destFile := cacheFile t.Log("+++ version not in cache, downloading from docker image") - runShellCmd(t, "docker", "pull", "ghcr.io/cosmos/simapp:"+version) - runShellCmd(t, "docker", "create", "--name=ci_temp", "ghcr.io/cosmos/simapp:"+version) - runShellCmd(t, "docker", "cp", "ci_temp:/usr/bin/simd", destFile) + MustRunShellCmd(t, "docker", "pull", "ghcr.io/cosmos/simapp:"+version) + MustRunShellCmd(t, "docker", "create", "--name=ci_temp", "ghcr.io/cosmos/simapp:"+version) + MustRunShellCmd(t, "docker", "cp", "ci_temp:/usr/bin/simd", destFile) return destFile } From c312d99ea0b8402ed74bf302b2da8b103cdb3b15 Mon Sep 17 00:00:00 2001 From: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Date: Fri, 2 Aug 2024 12:50:19 +0200 Subject: [PATCH 06/15] fix(baseapp): return events from preblocker in FinalizeBlockResponse (#21159) --- CHANGELOG.md | 1 + baseapp/abci.go | 1 + baseapp/abci_test.go | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5489bf2690eb..92305f048128 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Bug Fixes +* (baseapp) [#21159](https://github.com/cosmos/cosmos-sdk/pull/21159) Return PreBlocker events in FinalizeBlockResponse. * (baseapp) [#18727](https://github.com/cosmos/cosmos-sdk/pull/18727) Ensure that `BaseApp.Init` firstly returns any errors from a nil commit multistore instead of panicking on nil dereferencing and before sealing the app. * (client) [#18622](https://github.com/cosmos/cosmos-sdk/pull/18622) Fixed a potential under/overflow from `uint64->int64` when computing gas fees as a LegacyDec. * (client/keys) [#18562](https://github.com/cosmos/cosmos-sdk/pull/18562) `keys delete` won't terminate when a key is not found. diff --git a/baseapp/abci.go b/baseapp/abci.go index 513d8667fc76..e7724182e0e4 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -789,6 +789,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Finaliz if err := app.preBlock(req); err != nil { return nil, err } + events = append(events, app.finalizeBlockState.ctx.EventManager().ABCIEvents()...) beginBlock, err := app.beginBlock(req) if err != nil { diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index f455fd5692a0..b7fb67fad216 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -2298,13 +2298,16 @@ func TestBaseApp_PreBlocker(t *testing.T) { wasHookCalled := false app.SetPreBlocker(func(ctx sdk.Context, req *abci.FinalizeBlockRequest) error { wasHookCalled = true + ctx.EventManager().EmitEvent(sdk.NewEvent("preblockertest", sdk.NewAttribute("height", fmt.Sprintf("%d", req.Height)))) return nil }) app.Seal() - _, err = app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1}) + res, err := app.FinalizeBlock(&abci.FinalizeBlockRequest{Height: 1}) require.NoError(t, err) require.Equal(t, true, wasHookCalled) + require.Len(t, res.Events, 1) + require.Equal(t, "preblockertest", res.Events[0].Type) // Now try erroring app = baseapp.NewBaseApp(name, logger, db, nil) From cffeedff643d1a2623e63bd2cbf2089b0be75a61 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 2 Aug 2024 13:08:23 +0200 Subject: [PATCH 07/15] test(client/v2): update golden file (#21139) --- client/v2/autocli/testdata/msg-output.golden | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/v2/autocli/testdata/msg-output.golden b/client/v2/autocli/testdata/msg-output.golden index 8e075ccb1470..b08520d20038 100644 --- a/client/v2/autocli/testdata/msg-output.golden +++ b/client/v2/autocli/testdata/msg-output.golden @@ -1 +1 @@ -{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","to_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","amount":[{"denom":"foo","amount":"1"}]}],"timeout_timestamp":"1970-01-01T00:00:00Z"},"auth_info":{"fee":{"gas_limit":"200000"}}} \ No newline at end of file +{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","to_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","amount":[{"denom":"foo","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"timeout_timestamp":"1970-01-01T00:00:00Z","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":[]} \ No newline at end of file From a26970e547ab7dba1b84a5e0383c9501e53b81b6 Mon Sep 17 00:00:00 2001 From: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:21:26 +0700 Subject: [PATCH 08/15] refactor(server/v2/cometbft): Consensus get `chain-id` from viper (#21116) --- server/v2/cometbft/abci.go | 3 ++- server/v2/cometbft/go.sum | 2 ++ server/v2/cometbft/server.go | 17 +++++++++++++++++ server/v2/config.go | 4 ++-- server/v2/config_test.go | 7 +++++++ server/v2/store/server.go | 2 +- server/v2/testdata/app.toml | 30 ++++++++++++++++++++++++++++++ 7 files changed, 61 insertions(+), 4 deletions(-) diff --git a/server/v2/cometbft/abci.go b/server/v2/cometbft/abci.go index 372886792ee7..7519b3d8c732 100644 --- a/server/v2/cometbft/abci.go +++ b/server/v2/cometbft/abci.go @@ -74,6 +74,7 @@ func NewConsensus[T transaction.Tx]( store types.Store, cfg Config, txCodec transaction.Codec[T], + chainId string, ) *Consensus[T] { return &Consensus[T]{ appName: appName, @@ -93,7 +94,7 @@ func NewConsensus[T transaction.Tx]( processProposalHandler: nil, verifyVoteExt: nil, extendVote: nil, - chainID: "", + chainID: chainId, indexedEvents: indexedEvents, initialHeight: 0, } diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 99756515738a..66182dd031fe 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -321,6 +321,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= diff --git a/server/v2/cometbft/server.go b/server/v2/cometbft/server.go index c85a241566e2..c06c56c9be9e 100644 --- a/server/v2/cometbft/server.go +++ b/server/v2/cometbft/server.go @@ -5,6 +5,7 @@ import ( "crypto/sha256" "encoding/json" "fmt" + "os" "path/filepath" abciserver "github.com/cometbft/cometbft/abci/server" @@ -68,6 +69,21 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], v *viper.Viper, logger l AppTomlConfig: appTomlConfig, } + chainID := v.GetString(FlagChainID) + if chainID == "" { + // fallback to genesis chain-id + reader, err := os.Open(filepath.Join(v.GetString(serverv2.FlagHome), "config", "genesis.json")) + if err != nil { + panic(err) + } + defer reader.Close() + + chainID, err = genutiltypes.ParseChainIDFromGenesis(reader) + if err != nil { + panic(fmt.Errorf("failed to parse chain-id from genesis file: %w", err)) + } + } + indexEvents := make(map[string]struct{}, len(s.config.AppTomlConfig.IndexEvents)) for _, e := range s.config.AppTomlConfig.IndexEvents { indexEvents[e] = struct{}{} @@ -86,6 +102,7 @@ func (s *CometBFTServer[T]) Init(appI serverv2.AppI[T], v *viper.Viper, logger l store, s.config, s.initTxCodec, + chainID, ) consensus.prepareProposalHandler = s.serverOptions.PrepareProposalHandler consensus.processProposalHandler = s.serverOptions.ProcessProposalHandler diff --git a/server/v2/config.go b/server/v2/config.go index 57cce302bd74..7ce73fe88a9a 100644 --- a/server/v2/config.go +++ b/server/v2/config.go @@ -2,7 +2,6 @@ package serverv2 import ( "fmt" - "strings" "github.com/mitchellh/mapstructure" "github.com/spf13/viper" @@ -34,8 +33,9 @@ func ReadConfig(configPath string) (*viper.Viper, error) { func UnmarshalSubConfig(v *viper.Viper, subName string, target any) error { var sub any for k, val := range v.AllSettings() { - if strings.HasPrefix(k, subName) { + if k == subName { sub = val + break } } diff --git a/server/v2/config_test.go b/server/v2/config_test.go index 24eb28bb7522..a24cd4cf3d2e 100644 --- a/server/v2/config_test.go +++ b/server/v2/config_test.go @@ -9,6 +9,7 @@ import ( serverv2 "cosmossdk.io/server/v2" grpc "cosmossdk.io/server/v2/api/grpc" + store "cosmossdk.io/server/v2/store" ) func TestReadConfig(t *testing.T) { @@ -20,6 +21,7 @@ func TestReadConfig(t *testing.T) { require.NoError(t, err) require.Equal(t, v.GetString("grpc.address"), grpc.DefaultConfig().Address) + require.Equal(t, v.GetString("store.app-db-backend"), store.DefaultConfig().AppDBBackend) } func TestUnmarshalSubConfig(t *testing.T) { @@ -36,4 +38,9 @@ func TestUnmarshalSubConfig(t *testing.T) { require.True(t, grpc.DefaultConfig().Enable) require.False(t, grpcConfig.Enable) + + storeConfig := store.Config{} + err = serverv2.UnmarshalSubConfig(v, "store", &storeConfig) + require.NoError(t, err) + require.Equal(t, *store.DefaultConfig(), storeConfig) } diff --git a/server/v2/store/server.go b/server/v2/store/server.go index c7a1f9035d10..78c4cd759cd9 100644 --- a/server/v2/store/server.go +++ b/server/v2/store/server.go @@ -25,7 +25,7 @@ func New[T transaction.Tx]() *StoreComponent[T] { func (s *StoreComponent[T]) Init(appI serverv2.AppI[T], v *viper.Viper, logger log.Logger) error { cfg := DefaultConfig() if v != nil { - if err := v.Sub(s.Name()).Unmarshal(&cfg); err != nil { + if err := serverv2.UnmarshalSubConfig(v, s.Name(), &cfg); err != nil { return fmt.Errorf("failed to unmarshal config: %w", err) } } diff --git a/server/v2/testdata/app.toml b/server/v2/testdata/app.toml index 20482ac44282..ec7d77995d41 100644 --- a/server/v2/testdata/app.toml +++ b/server/v2/testdata/app.toml @@ -10,6 +10,36 @@ max-recv-msg-size = 10485760 # The default value is math.MaxInt32. max-send-msg-size = 2147483647 +[store] +# The type of database for application and snapshots databases. +app-db-backend = 'goleveldb' + +[store.options] +# State storage database type. Currently we support: 0 for SQLite, 1 for Pebble +ss-type = 0 +# State commitment database type. Currently we support:0 for iavl, 1 for iavl v2 +sc-type = 0 + +# Pruning options for state storage +[store.options.ss-pruning-option] +# Number of recent heights to keep on disk. +keep-recent = 2 +# Height interval at which pruned heights are removed from disk. +interval = 1 + +# Pruning options for state commitment +[store.options.sc-pruning-option] +# Number of recent heights to keep on disk. +keep-recent = 2 +# Height interval at which pruned heights are removed from disk. +interval = 1 + +[store.options.iavl-config] +# CacheSize set the size of the iavl tree cache. +cache-size = 100000 +# If true, the tree will work like no fast storage and always not upgrade fast storage. +skip-fast-storage-upgrade = true + [mock-server-1] # Mock field mock_field = 'default' From bc0731cb49e95b4168946244f634910ea5c1493b Mon Sep 17 00:00:00 2001 From: "neeel.eth" Date: Fri, 2 Aug 2024 21:42:00 +0100 Subject: [PATCH 09/15] docs: fixes collections intValue reference (#21165) --- collections/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collections/README.md b/collections/README.md index 09c6870ba21d..298f684e6691 100644 --- a/collections/README.md +++ b/collections/README.md @@ -677,7 +677,7 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { Balances: collections.NewMap( sb, BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), - math.IntValue, + sdk.IntValue, ), } } @@ -720,7 +720,7 @@ func NewKeeper(storeKey *storetypes.KVStoreKey) Keeper { Balances: collections.NewMap( sb, BalancesPrefix, "balances", collections.PairKeyCodec(sdk.AccAddressKey, collections.StringKey), - math.IntValue, + sdk.IntValue, ), } } From ccd3d992eab0b92dbd55aa8dff2bcfd390928f84 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Sat, 3 Aug 2024 13:53:01 +0200 Subject: [PATCH 10/15] docs: update branching strategy (#21141) --- RELEASE_PROCESS.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 23f52d0381e9..9bbb8817f862 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -35,6 +35,9 @@ v1.0.0-beta1 → v1.0.0-beta2 → ... → v1.0.0-rc1 → v1.0.0-rc2 → ... → * Tooling is tracked and tested directly on main. * This does not apply for tooling depending on the SDK (e.g. `confix`) * Update `Dockerfile` to not use latest go.mod and go.sum files. +* Remove all other components that do not depend on the SDK from the release branch (See [Go Monorepo Branching Strategy](#go-monorepo-branching-strategy)). + * Delete `log`, `core`, `errors`, ... packages + * Update all the remaining `go.mod` files to use the latest released versions (the ones tagged from main) or latest commits from the main branch. * Create a new annotated git tag for a release candidate (eg: `git tag -a v1.1.0-rc1`) in the release branch. * from this point we unfreeze main. * the SDK teams collaborate and do their best to run testnets in order to validate the release. @@ -212,7 +215,7 @@ Currently residing Stable Release Managers: * @tac0turtle - Marko Baricevic * @julienrbrt - Julien Robert -## Cosmos SDK Modules +## Cosmos SDK Modules Tagging Strategy The Cosmos SDK repository is a mono-repo where its Go modules have a different release process and cadence than the Cosmos SDK itself. There are two types of modules: @@ -236,3 +239,28 @@ Those modules can be considered as part of the Cosmos SDK, but features and impr ### Modules that do not depend on the Cosmos SDK Modules that do not depend on the Cosmos SDK can be released at any time from the `main` branch of the Cosmos SDK repository. + +## Go Monorepo Branching Strategy + +The Cosmos SDK uses a monorepo structure with multiple Go modules. Some components are tagged from the main branch, while others are tagged from release branches, as described above. + +Here's the strategy for managing this structure: + +All modules that do not depend on the Cosmos SDK and tagged from main in a release branch must be removed from the release branch. + +### Rationale + +This strategy provides several benefits: + +1. Clean separation: Release branches only contain components that are actually released from those branches. +2. Avoid confusion: Prevents having outdated versions of standalone go modules in release branches. +3. Accurate representation: The release branch accurately represents what's being released from that branch. +4. Consistency: Aligns with the tagging strategy - components tagged from main aren't in release branches, and vice versa. + +### Additional Considerations + +* When backporting changes, be aware that standalone go modules changes will not be present in release branches. +* To reference the full state of the SDK at the time of branching, consider creating a separate tag on main at the point where each release branch is created. +* Ensure thorough testing of the release branch structure to avoid any integration issues. + +This branching strategy helps maintain a clear separation between components tagged from main and those tagged from release branches, while ensuring that release branches accurately represent the state of components that depend on the SDK. From 3128b08cfc15a99abc7035c4802078472e3a8fe2 Mon Sep 17 00:00:00 2001 From: pengbanban Date: Mon, 5 Aug 2024 17:50:49 +0900 Subject: [PATCH 11/15] chore: fix function names (#21168) Signed-off-by: pengbanban --- store/cachekv/benchmark_test.go | 2 +- x/auth/ante/setup_test.go | 2 +- x/gov/simulation/genesis.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/store/cachekv/benchmark_test.go b/store/cachekv/benchmark_test.go index 158549b4bd3b..c29b51643d11 100644 --- a/store/cachekv/benchmark_test.go +++ b/store/cachekv/benchmark_test.go @@ -72,7 +72,7 @@ type CacheStack struct { cacheStores []types.CacheKVStore } -// CurrentContext returns the top context of cached stack, +// CurrentStore returns the top context of cached stack, // if the stack is empty, returns the initial context. func (cs *CacheStack) CurrentStore() types.CacheKVStore { l := len(cs.cacheStores) diff --git a/x/auth/ante/setup_test.go b/x/auth/ante/setup_test.go index c63fb02be858..1e10cafa9ed0 100644 --- a/x/auth/ante/setup_test.go +++ b/x/auth/ante/setup_test.go @@ -117,7 +117,7 @@ func TestRecoverPanic(t *testing.T) { type OutOfGasDecorator struct{} -// AnteDecorator that will throw OutOfGas panic +// AnteHandle that will throw OutOfGas panic func (ogd OutOfGasDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { overLimit := ctx.GasMeter().Limit() + 1 diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 6363a3a5548d..a522593a2b96 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -59,7 +59,7 @@ func GenExpeditedMinDeposit(r *rand.Rand, bondDenom string) sdk.Coins { return sdk.NewCoins(sdk.NewInt64Coin(bondDenom, int64(simulation.RandIntBetween(r, 1e3/2, 1e3)))) } -// GenDepositMinInitialRatio returns randomized DepositMinInitialRatio +// GenDepositMinInitialDepositRatio returns randomized DepositMinInitialRatio func GenDepositMinInitialDepositRatio(r *rand.Rand) sdkmath.LegacyDec { return sdkmath.LegacyNewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdkmath.LegacyNewDec(100)) } From 892a3e355d6eda0debad72a7caabe6269e44d124 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 5 Aug 2024 12:20:24 +0200 Subject: [PATCH 12/15] fix: proto gen (#21172) --- api/cosmos/app/runtime/v2/module.pulsar.go | 5 +- proto/cosmos/app/runtime/v2/module.proto | 7 +- .../cosmos/store/snapshots/v2/snapshot.proto | 2 +- store/v2/go.mod | 1 + store/v2/go.sum | 2 + store/v2/snapshots/types/snapshot.pb.go | 71 ++++++++++--------- 6 files changed, 49 insertions(+), 39 deletions(-) diff --git a/api/cosmos/app/runtime/v2/module.pulsar.go b/api/cosmos/app/runtime/v2/module.pulsar.go index 8c90f1df8917..46cd2bbc42fc 100644 --- a/api/cosmos/app/runtime/v2/module.pulsar.go +++ b/api/cosmos/app/runtime/v2/module.pulsar.go @@ -2787,8 +2787,11 @@ type GasConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // validate_tx_gas_limit is the gas limit for validating a tx. ValidateTxGasLimit uint64 `protobuf:"varint,1,opt,name=validate_tx_gas_limit,json=validateTxGasLimit,proto3" json:"validate_tx_gas_limit,omitempty"` - QueryGasLimit uint64 `protobuf:"varint,2,opt,name=query_gas_limit,json=queryGasLimit,proto3" json:"query_gas_limit,omitempty"` + // query_gas_limit is the gas limit for querying. + QueryGasLimit uint64 `protobuf:"varint,2,opt,name=query_gas_limit,json=queryGasLimit,proto3" json:"query_gas_limit,omitempty"` + // simulation_gas_limit is the gas limit for simulation. SimulationGasLimit uint64 `protobuf:"varint,3,opt,name=simulation_gas_limit,json=simulationGasLimit,proto3" json:"simulation_gas_limit,omitempty"` } diff --git a/proto/cosmos/app/runtime/v2/module.proto b/proto/cosmos/app/runtime/v2/module.proto index dbc087e3b5cc..482493087d6e 100644 --- a/proto/cosmos/app/runtime/v2/module.proto +++ b/proto/cosmos/app/runtime/v2/module.proto @@ -62,9 +62,12 @@ message Module { // GasConfig is the config object for gas limits. message GasConfig { + // validate_tx_gas_limit is the gas limit for validating a tx. uint64 validate_tx_gas_limit = 1; - uint64 query_gas_limit = 2; - uint64 simulation_gas_limit = 3; + // query_gas_limit is the gas limit for querying. + uint64 query_gas_limit = 2; + // simulation_gas_limit is the gas limit for simulation. + uint64 simulation_gas_limit = 3; } // StoreKeyConfig may be supplied to override the default module store key, which diff --git a/proto/cosmos/store/snapshots/v2/snapshot.proto b/proto/cosmos/store/snapshots/v2/snapshot.proto index 675a22c1cd6d..cc75ed73ef0f 100644 --- a/proto/cosmos/store/snapshots/v2/snapshot.proto +++ b/proto/cosmos/store/snapshots/v2/snapshot.proto @@ -3,7 +3,7 @@ package cosmos.store.snapshots.v2; import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; -option go_package = "cosmossdk.io/store/snapshots/types"; +option go_package = "cosmossdk.io/store/v2/snapshots/types"; // Snapshot contains Tendermint state sync snapshot info. message Snapshot { diff --git a/store/v2/go.mod b/store/v2/go.mod index 8c8ec3843456..7b257ddc19c8 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -8,6 +8,7 @@ require ( cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 cosmossdk.io/log v1.3.1 github.com/cockroachdb/pebble v1.1.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 github.com/cosmos/ics23/go v0.10.0 diff --git a/store/v2/go.sum b/store/v2/go.sum index 425eb1d56e9e..5cc47dc77dd4 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -36,6 +36,8 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1: github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= diff --git a/store/v2/snapshots/types/snapshot.pb.go b/store/v2/snapshots/types/snapshot.pb.go index 224c826846e9..1d4e3a3bf6c2 100644 --- a/store/v2/snapshots/types/snapshot.pb.go +++ b/store/v2/snapshots/types/snapshot.pb.go @@ -5,6 +5,7 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -489,41 +490,41 @@ func init() { } var fileDescriptor_6851f1463fcbb80c = []byte{ - // 535 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xc1, 0x6e, 0xd3, 0x30, - 0x18, 0x8e, 0xd7, 0xb4, 0x74, 0x4e, 0x10, 0x9d, 0x19, 0x28, 0xec, 0x90, 0x85, 0x70, 0x89, 0x04, - 0x4d, 0xa7, 0x0c, 0x71, 0x40, 0xbb, 0x50, 0x31, 0xa9, 0x15, 0x20, 0x4d, 0x9e, 0x84, 0x10, 0x97, - 0xca, 0x5b, 0x4d, 0x53, 0xb5, 0x89, 0xab, 0xda, 0x8b, 0xe8, 0x91, 0x37, 0xe0, 0x45, 0xb8, 0xf1, - 0x10, 0x3b, 0x4e, 0x9c, 0x38, 0x4d, 0xa8, 0x7d, 0x05, 0x1e, 0x00, 0xd9, 0x4e, 0x02, 0xda, 0x52, - 0xb4, 0xdd, 0xfe, 0xef, 0xf7, 0xf7, 0x7d, 0xf6, 0xff, 0xd9, 0x09, 0x0c, 0x4e, 0x19, 0x4f, 0x18, - 0xef, 0x70, 0xc1, 0xe6, 0xb4, 0xc3, 0x53, 0x32, 0xe3, 0x31, 0x13, 0xbc, 0x93, 0x45, 0x25, 0x08, - 0x67, 0x73, 0x26, 0x18, 0x7a, 0xa4, 0x99, 0xa1, 0x62, 0x86, 0x25, 0x33, 0xcc, 0xa2, 0x9d, 0xed, - 0x11, 0x1b, 0x31, 0xc5, 0xea, 0xc8, 0x4a, 0x0b, 0x76, 0x72, 0xc1, 0x40, 0x2f, 0xe4, 0x6a, 0x05, - 0xfc, 0x6f, 0x00, 0x36, 0x8f, 0x73, 0x07, 0xf4, 0x10, 0x36, 0x62, 0x3a, 0x1e, 0xc5, 0xc2, 0x01, - 0x1e, 0x08, 0x4c, 0x9c, 0x23, 0xd9, 0xff, 0xc4, 0xe6, 0x09, 0x11, 0xce, 0x86, 0x07, 0x82, 0xbb, - 0x38, 0x47, 0xb2, 0x7f, 0x1a, 0x9f, 0xa5, 0x13, 0xee, 0xd4, 0x74, 0x5f, 0x23, 0x84, 0xa0, 0x19, - 0x13, 0x1e, 0x3b, 0xa6, 0x07, 0x02, 0x1b, 0xab, 0x1a, 0x1d, 0xc2, 0x66, 0x42, 0x05, 0x19, 0x12, - 0x41, 0x9c, 0xba, 0x07, 0x02, 0x2b, 0x7a, 0x12, 0xae, 0x9d, 0x23, 0x7c, 0x97, 0x53, 0xbb, 0xe6, - 0xf9, 0xe5, 0xae, 0x81, 0x4b, 0xa9, 0xdf, 0x86, 0xcd, 0x62, 0x0d, 0x3d, 0x86, 0xb6, 0xda, 0x70, - 0x20, 0x37, 0xa0, 0xdc, 0x01, 0x5e, 0x2d, 0xb0, 0xb1, 0xa5, 0x7a, 0x3d, 0xd5, 0xf2, 0x7f, 0x6f, - 0x40, 0xbb, 0x18, 0xaf, 0x2f, 0x68, 0x82, 0x5e, 0xc3, 0xba, 0xda, 0x4e, 0x4d, 0x68, 0x45, 0xcf, - 0xfe, 0x73, 0x86, 0x42, 0x77, 0x2c, 0x97, 0xa4, 0xb8, 0x67, 0x60, 0x2d, 0x46, 0x6f, 0xa0, 0x39, - 0x26, 0xd9, 0x54, 0xc5, 0x61, 0x45, 0x4f, 0x6f, 0x60, 0xd2, 0x7f, 0xf5, 0xfe, 0xad, 0xf4, 0xe8, - 0x36, 0x97, 0x97, 0xbb, 0xa6, 0x44, 0x3d, 0x03, 0x2b, 0x13, 0x74, 0x04, 0x37, 0xe9, 0x67, 0x41, - 0x53, 0x3e, 0x66, 0xa9, 0x0a, 0xd2, 0x8a, 0xf6, 0x6e, 0xe0, 0x78, 0x58, 0x68, 0x64, 0x1e, 0x3d, - 0x03, 0xff, 0x35, 0x41, 0x27, 0x70, 0xab, 0x04, 0x83, 0x19, 0x59, 0x4c, 0x19, 0x19, 0xaa, 0xcb, - 0xb0, 0xa2, 0xfd, 0xdb, 0x38, 0x1f, 0x69, 0x69, 0xcf, 0xc0, 0x2d, 0x7a, 0xa5, 0xf7, 0xf2, 0xfe, - 0x8f, 0xef, 0xed, 0x7b, 0xda, 0xab, 0xcd, 0x87, 0x13, 0x6f, 0x2f, 0x7c, 0xfe, 0xa2, 0xdb, 0x80, - 0xe6, 0x58, 0xd0, 0xc4, 0x3f, 0x80, 0x5b, 0xd7, 0xd2, 0x93, 0xaf, 0x22, 0x25, 0x89, 0x4e, 0x7e, - 0x13, 0xab, 0xba, 0xd2, 0xc5, 0xff, 0x02, 0x60, 0xeb, 0x6a, 0x6e, 0xa8, 0x05, 0x6b, 0x13, 0xba, - 0x50, 0x62, 0x1b, 0xcb, 0x12, 0x6d, 0xc3, 0x7a, 0x46, 0xa6, 0x67, 0x54, 0xdd, 0x82, 0x8d, 0x35, - 0x40, 0x0e, 0xbc, 0x93, 0xd1, 0x79, 0x99, 0x65, 0x0d, 0x17, 0xf0, 0x9f, 0xd7, 0x2d, 0xa3, 0xa8, - 0x17, 0xaf, 0xbb, 0xfa, 0x0c, 0x1f, 0xe0, 0x83, 0xca, 0xa0, 0xab, 0xa6, 0x58, 0xf7, 0x7d, 0x54, - 0x3b, 0xf7, 0xa1, 0xb3, 0x2e, 0x68, 0x79, 0xf8, 0xe2, 0xba, 0xf4, 0xa0, 0x05, 0xac, 0x8e, 0xfb, - 0xe0, 0x7c, 0xe9, 0x82, 0x8b, 0xa5, 0x0b, 0x7e, 0x2d, 0x5d, 0xf0, 0x75, 0xe5, 0x1a, 0x17, 0x2b, - 0xd7, 0xf8, 0xb9, 0x72, 0x8d, 0x8f, 0xbe, 0xa6, 0xf2, 0xe1, 0x24, 0x1c, 0xb3, 0x6b, 0xbf, 0x14, - 0xb1, 0x98, 0x51, 0x7e, 0xd2, 0x50, 0x7f, 0x80, 0xfd, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa0, - 0xee, 0x29, 0xf5, 0x79, 0x04, 0x00, 0x00, + // 541 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x6b, 0x13, 0x41, + 0x14, 0xde, 0x69, 0x36, 0x31, 0x7d, 0xbb, 0x62, 0x3a, 0x56, 0x59, 0x7b, 0xd8, 0xae, 0x11, 0x61, + 0x41, 0xb3, 0x29, 0x5b, 0xf1, 0x20, 0x82, 0x18, 0x2c, 0x24, 0xa8, 0x50, 0xa6, 0x20, 0xe2, 0x25, + 0x4c, 0x9b, 0x31, 0x1b, 0x92, 0xcd, 0x84, 0xcc, 0x34, 0x98, 0xa3, 0xff, 0xc0, 0x3f, 0xe2, 0xcd, + 0x1f, 0xd1, 0x63, 0xf1, 0xe4, 0xa9, 0x48, 0xf2, 0x17, 0xfc, 0x01, 0x32, 0x33, 0xbb, 0xb1, 0xd4, + 0x8d, 0xd4, 0xdb, 0xfb, 0xde, 0xbc, 0xef, 0x9b, 0x79, 0xdf, 0xcc, 0x3c, 0x08, 0x4f, 0xb8, 0x48, + 0xb9, 0x68, 0x0a, 0xc9, 0xa7, 0xac, 0x29, 0xc6, 0x74, 0x22, 0x12, 0x2e, 0x45, 0x73, 0x16, 0xaf, + 0x40, 0x34, 0x99, 0x72, 0xc9, 0xf1, 0x3d, 0x53, 0x19, 0xe9, 0xca, 0x68, 0x55, 0x19, 0xcd, 0xe2, + 0x9d, 0xed, 0x3e, 0xef, 0x73, 0x5d, 0xd5, 0x54, 0x91, 0x21, 0xec, 0x64, 0x84, 0xae, 0x59, 0xc8, + 0xd8, 0x1a, 0xd4, 0xbf, 0x22, 0xa8, 0x1e, 0x65, 0x0a, 0xf8, 0x2e, 0x54, 0x12, 0x36, 0xe8, 0x27, + 0xd2, 0x43, 0x01, 0x0a, 0x6d, 0x92, 0x21, 0x95, 0xff, 0xc8, 0xa7, 0x29, 0x95, 0xde, 0x46, 0x80, + 0xc2, 0x9b, 0x24, 0x43, 0x2a, 0x7f, 0x92, 0x9c, 0x8e, 0x87, 0xc2, 0x2b, 0x99, 0xbc, 0x41, 0x18, + 0x83, 0x9d, 0x50, 0x91, 0x78, 0x76, 0x80, 0x42, 0x97, 0xe8, 0x18, 0x1f, 0x40, 0x35, 0x65, 0x92, + 0xf6, 0xa8, 0xa4, 0x5e, 0x39, 0x40, 0xa1, 0x13, 0x3f, 0x88, 0xd6, 0xf6, 0x11, 0xbd, 0xcd, 0x4a, + 0x5b, 0xf6, 0xd9, 0xc5, 0xae, 0x45, 0x56, 0xd4, 0x7a, 0x03, 0xaa, 0xf9, 0x1a, 0xbe, 0x0f, 0xae, + 0xde, 0xb0, 0xab, 0x36, 0x60, 0xc2, 0x43, 0x41, 0x29, 0x74, 0x89, 0xa3, 0x73, 0x6d, 0x9d, 0xaa, + 0xff, 0xda, 0x00, 0x37, 0x6f, 0xaf, 0x23, 0x59, 0x8a, 0x5f, 0x41, 0x59, 0x6f, 0xa7, 0x3b, 0x74, + 0xe2, 0xc7, 0xff, 0x38, 0x43, 0xce, 0x3b, 0x52, 0x4b, 0x8a, 0xdc, 0xb6, 0x88, 0x21, 0xe3, 0xd7, + 0x60, 0x0f, 0xe8, 0x6c, 0xa4, 0xed, 0x70, 0xe2, 0x47, 0xd7, 0x10, 0xe9, 0xbc, 0x7c, 0xf7, 0x46, + 0x69, 0xb4, 0xaa, 0x8b, 0x8b, 0x5d, 0x5b, 0xa1, 0xb6, 0x45, 0xb4, 0x08, 0x3e, 0x84, 0x4d, 0xf6, + 0x49, 0xb2, 0xb1, 0x18, 0xf0, 0xb1, 0x36, 0xd2, 0x89, 0xf7, 0xae, 0xa1, 0x78, 0x90, 0x73, 0x94, + 0x1f, 0x6d, 0x8b, 0xfc, 0x11, 0xc1, 0xc7, 0xb0, 0xb5, 0x02, 0xdd, 0x09, 0x9d, 0x8f, 0x38, 0xed, + 0xe9, 0xcb, 0x70, 0xe2, 0xfd, 0xff, 0x51, 0x3e, 0x34, 0xd4, 0xb6, 0x45, 0x6a, 0xec, 0x4a, 0xee, + 0xd9, 0xed, 0xef, 0xdf, 0x1a, 0xb7, 0x8c, 0x56, 0x43, 0xf4, 0x86, 0xc1, 0x5e, 0xf4, 0xe4, 0x69, + 0xab, 0x02, 0xf6, 0x40, 0xb2, 0xb4, 0xfe, 0x1c, 0xb6, 0xfe, 0x72, 0x4f, 0xbd, 0x8a, 0x31, 0x4d, + 0x8d, 0xf3, 0x9b, 0x44, 0xc7, 0x85, 0x2a, 0xf5, 0xcf, 0x08, 0x6a, 0x57, 0x7d, 0xc3, 0x35, 0x28, + 0x0d, 0xd9, 0x5c, 0x93, 0x5d, 0xa2, 0x42, 0xbc, 0x0d, 0xe5, 0x19, 0x1d, 0x9d, 0x32, 0x7d, 0x0b, + 0x2e, 0x31, 0x00, 0x7b, 0x70, 0x63, 0xc6, 0xa6, 0x2b, 0x2f, 0x4b, 0x24, 0x87, 0x97, 0x5e, 0xb7, + 0xb2, 0xa2, 0x9c, 0xbf, 0xee, 0xe2, 0x33, 0xbc, 0x87, 0x3b, 0x85, 0x46, 0x17, 0x75, 0xb1, 0xee, + 0x7f, 0x14, 0x2b, 0x77, 0xc0, 0x5b, 0x67, 0xb4, 0x3a, 0x7c, 0x7e, 0x5d, 0xa6, 0xd1, 0x1c, 0x16, + 0xdb, 0xfd, 0xe2, 0x6c, 0xe1, 0xa3, 0xf3, 0x85, 0x8f, 0x7e, 0x2e, 0x7c, 0xf4, 0x65, 0xe9, 0x5b, + 0xe7, 0x4b, 0xdf, 0xfa, 0xb1, 0xf4, 0xad, 0x0f, 0x0f, 0x4d, 0xa9, 0xe8, 0x0d, 0xa3, 0x01, 0xcf, + 0x46, 0xca, 0xa5, 0x41, 0x22, 0x9a, 0x72, 0x3e, 0x61, 0xe2, 0xb8, 0xa2, 0x87, 0xc0, 0xfe, 0xef, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x23, 0x48, 0xd5, 0x7c, 0x04, 0x00, 0x00, } func (m *Snapshot) Marshal() (dAtA []byte, err error) { From 984afb59e627ed9fd7f744fb09b9200fd5e8597b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:38:50 +0000 Subject: [PATCH 13/15] build(deps): Bump github.com/fergusstrange/embedded-postgres from 1.27.0 to 1.28.0 in /indexer/postgres/tests (#21121) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: marbar3778 --- indexer/postgres/create_table_test.go | 2 +- indexer/postgres/tests/go.mod | 4 ++-- indexer/postgres/tests/go.sum | 8 ++++---- indexer/postgres/tests/testdata/init_schema.txt | 2 +- .../tests/testdata/init_schema_no_retain_delete.txt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/indexer/postgres/create_table_test.go b/indexer/postgres/create_table_test.go index dec09d7aed7a..2538338319e7 100644 --- a/indexer/postgres/create_table_test.go +++ b/indexer/postgres/create_table_test.go @@ -32,7 +32,7 @@ func ExampleObjectIndexer_CreateTableSql_allKinds() { // "duration" BIGINT NOT NULL, // "float32" REAL NOT NULL, // "float64" DOUBLE PRECISION NOT NULL, - // "bech32address" TEXT NOT NULL, + // "address" TEXT NOT NULL, // "enum" "test_my_enum" NOT NULL, // "json" JSONB NOT NULL, // PRIMARY KEY ("id", "ts_nanos") diff --git a/indexer/postgres/tests/go.mod b/indexer/postgres/tests/go.mod index 0353ba6091b5..5a5721dfdc3e 100644 --- a/indexer/postgres/tests/go.mod +++ b/indexer/postgres/tests/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/indexer/postgres/testing require ( cosmossdk.io/indexer/postgres v0.0.0-00010101000000-000000000000 cosmossdk.io/schema v0.1.1 - github.com/fergusstrange/embedded-postgres v1.27.0 + github.com/fergusstrange/embedded-postgres v1.28.0 github.com/hashicorp/consul/sdk v0.16.1 github.com/jackc/pgx/v5 v5.6.0 github.com/stretchr/testify v1.9.0 @@ -17,7 +17,7 @@ require ( github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lib/pq v1.10.4 // indirect + github.com/lib/pq v1.10.9 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect diff --git a/indexer/postgres/tests/go.sum b/indexer/postgres/tests/go.sum index de3d49d74702..79b5c0cf03c0 100644 --- a/indexer/postgres/tests/go.sum +++ b/indexer/postgres/tests/go.sum @@ -2,8 +2,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fergusstrange/embedded-postgres v1.27.0 h1:RAlpWL194IhEpPgeJceTM0ifMJKhiSVxBVIDYB1Jee8= -github.com/fergusstrange/embedded-postgres v1.27.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= +github.com/fergusstrange/embedded-postgres v1.28.0 h1:Atixd24HCuBHBavnG4eiZAjRizOViwUahKGSjJdz1SU= +github.com/fergusstrange/embedded-postgres v1.28.0/go.mod h1:t/MLs0h9ukYM6FSt99R7InCHs1nW0ordoVCcnzmpTYw= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= @@ -20,8 +20,8 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/indexer/postgres/tests/testdata/init_schema.txt b/indexer/postgres/tests/testdata/init_schema.txt index e2a0a1730e35..ce807a8f7d17 100644 --- a/indexer/postgres/tests/testdata/init_schema.txt +++ b/indexer/postgres/tests/testdata/init_schema.txt @@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS "test_all_kinds" ( "duration" BIGINT NOT NULL, "float32" REAL NOT NULL, "float64" DOUBLE PRECISION NOT NULL, - "bech32address" TEXT NOT NULL, + "address" TEXT NOT NULL, "enum" "test_my_enum" NOT NULL, "json" JSONB NOT NULL, PRIMARY KEY ("id", "ts_nanos") diff --git a/indexer/postgres/tests/testdata/init_schema_no_retain_delete.txt b/indexer/postgres/tests/testdata/init_schema_no_retain_delete.txt index 0d8cdad2cd24..0dbfbddb4e0e 100644 --- a/indexer/postgres/tests/testdata/init_schema_no_retain_delete.txt +++ b/indexer/postgres/tests/testdata/init_schema_no_retain_delete.txt @@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS "test_all_kinds" ( "duration" BIGINT NOT NULL, "float32" REAL NOT NULL, "float64" DOUBLE PRECISION NOT NULL, - "bech32address" TEXT NOT NULL, + "address" TEXT NOT NULL, "enum" "test_my_enum" NOT NULL, "json" JSONB NOT NULL, PRIMARY KEY ("id", "ts_nanos") From 0ddf5c0bfaf970b2352bd028d7666975eeff7acc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:01:41 +0000 Subject: [PATCH 14/15] build(deps): Bump golang.org/x/sync from 0.7.0 to 0.8.0 (#21169) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com> Co-authored-by: Marko --- client/v2/go.mod | 2 +- client/v2/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- indexer/postgres/tests/go.mod | 2 +- indexer/postgres/tests/go.sum | 4 ++-- runtime/v2/go.mod | 2 +- runtime/v2/go.sum | 4 ++-- server/v2/cometbft/go.mod | 2 +- server/v2/cometbft/go.sum | 4 ++-- server/v2/go.mod | 2 +- server/v2/go.sum | 4 ++-- simapp/go.mod | 2 +- simapp/go.sum | 4 ++-- simapp/v2/go.mod | 2 +- simapp/v2/go.sum | 4 ++-- store/v2/go.mod | 2 +- store/v2/go.sum | 4 ++-- tests/go.mod | 2 +- tests/go.sum | 4 ++-- tests/systemtests/go.mod | 2 +- tests/systemtests/go.sum | 4 ++-- tools/confix/go.mod | 2 +- tools/confix/go.sum | 4 ++-- tools/cosmovisor/go.mod | 2 +- tools/cosmovisor/go.sum | 4 ++-- tools/hubl/go.mod | 2 +- tools/hubl/go.sum | 4 ++-- x/accounts/defaults/lockup/go.mod | 2 +- x/accounts/defaults/lockup/go.sum | 4 ++-- x/accounts/defaults/multisig/go.mod | 2 +- x/accounts/defaults/multisig/go.sum | 4 ++-- x/accounts/go.mod | 2 +- x/accounts/go.sum | 4 ++-- x/auth/go.mod | 2 +- x/auth/go.sum | 4 ++-- x/authz/go.mod | 2 +- x/authz/go.sum | 4 ++-- x/bank/go.mod | 2 +- x/bank/go.sum | 4 ++-- x/circuit/go.mod | 2 +- x/circuit/go.sum | 4 ++-- x/consensus/go.mod | 2 +- x/consensus/go.sum | 4 ++-- x/distribution/go.mod | 2 +- x/distribution/go.sum | 4 ++-- x/epochs/go.mod | 2 +- x/epochs/go.sum | 4 ++-- x/evidence/go.mod | 2 +- x/evidence/go.sum | 4 ++-- x/feegrant/go.mod | 2 +- x/feegrant/go.sum | 4 ++-- x/gov/go.mod | 2 +- x/gov/go.sum | 4 ++-- x/group/go.mod | 2 +- x/group/go.sum | 4 ++-- x/mint/go.mod | 2 +- x/mint/go.sum | 4 ++-- x/nft/go.mod | 2 +- x/nft/go.sum | 4 ++-- x/params/go.mod | 2 +- x/params/go.sum | 4 ++-- x/protocolpool/go.mod | 2 +- x/protocolpool/go.sum | 4 ++-- x/slashing/go.mod | 2 +- x/slashing/go.sum | 4 ++-- x/staking/go.mod | 2 +- x/staking/go.sum | 4 ++-- x/upgrade/go.mod | 2 +- x/upgrade/go.sum | 4 ++-- 70 files changed, 105 insertions(+), 105 deletions(-) diff --git a/client/v2/go.mod b/client/v2/go.mod index f68895543ab3..e76f76c053a2 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -157,7 +157,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index dc867c180288..ba4b7b465a44 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -564,8 +564,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/go.mod b/go.mod index 217ad6e2ee99..5fc4771ef564 100644 --- a/go.mod +++ b/go.mod @@ -58,7 +58,7 @@ require ( gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b golang.org/x/crypto v0.25.0 golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 google.golang.org/grpc v1.64.1 google.golang.org/protobuf v1.34.2 diff --git a/go.sum b/go.sum index c63d7cbaf794..6b25f8ab31e1 100644 --- a/go.sum +++ b/go.sum @@ -554,8 +554,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/indexer/postgres/tests/go.mod b/indexer/postgres/tests/go.mod index 5a5721dfdc3e..aa8e6869fd01 100644 --- a/indexer/postgres/tests/go.mod +++ b/indexer/postgres/tests/go.mod @@ -22,7 +22,7 @@ require ( github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect golang.org/x/crypto v0.23.0 // indirect - golang.org/x/sync v0.1.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/indexer/postgres/tests/go.sum b/indexer/postgres/tests/go.sum index 79b5c0cf03c0..c48c0061f681 100644 --- a/indexer/postgres/tests/go.sum +++ b/indexer/postgres/tests/go.sum @@ -38,8 +38,8 @@ go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index c7dd259104e7..931884323c37 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -92,7 +92,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index b6c5110af8e1..9221f19acb5e 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -293,8 +293,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index ef9c06a6c679..257f70c116c2 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -165,7 +165,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 66182dd031fe..133cea6f52bf 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -529,8 +529,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/server/v2/go.mod b/server/v2/go.mod index 97fd086bf82f..a5b65a1ed4f1 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -39,7 +39,7 @@ require ( github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 google.golang.org/grpc v1.64.1 google.golang.org/protobuf v1.34.2 ) diff --git a/server/v2/go.sum b/server/v2/go.sum index 466845865b15..7431c6950e32 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -367,8 +367,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/simapp/go.mod b/simapp/go.mod index 1545f860cec2..ac92ab99f816 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -212,7 +212,7 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 53269104f8f7..1d18e2c3774a 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -999,8 +999,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index 82f48388a049..a310e740891a 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -221,7 +221,7 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 6e9aa3b16e96..8a8821e689f7 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -1005,8 +1005,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/store/v2/go.mod b/store/v2/go.mod index 7b257ddc19c8..a305cc49e8d0 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -19,7 +19,7 @@ require ( github.com/spf13/cast v1.6.0 github.com/stretchr/testify v1.9.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 ) require ( diff --git a/store/v2/go.sum b/store/v2/go.sum index 5cc47dc77dd4..7e13cab09725 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -249,8 +249,8 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/tests/go.mod b/tests/go.mod index 1dd30f25688f..6db3e2ef37b4 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -213,7 +213,7 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index 581fde544509..86a971273af6 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -988,8 +988,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/tests/systemtests/go.mod b/tests/systemtests/go.mod index e7c9ac0f2c4e..1921771838c2 100644 --- a/tests/systemtests/go.mod +++ b/tests/systemtests/go.mod @@ -148,7 +148,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/tests/systemtests/go.sum b/tests/systemtests/go.sum index a0aa43940f9e..5702bf7b8217 100644 --- a/tests/systemtests/go.sum +++ b/tests/systemtests/go.sum @@ -831,8 +831,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= diff --git a/tools/confix/go.mod b/tools/confix/go.mod index d7c74d44b60b..2defc6a1042f 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -142,7 +142,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.25.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index bdb33226732d..aba183bdde14 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -829,8 +829,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 21a5fea45e52..8b9c9e2a27ac 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -168,7 +168,7 @@ require ( golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index a36072f7b7b1..0796fd0b256e 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -1159,8 +1159,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index ac8fa90b1dc1..802878772af5 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -143,7 +143,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index 954afa4073f5..667e324e4ddf 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -826,8 +826,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= diff --git a/x/accounts/defaults/lockup/go.mod b/x/accounts/defaults/lockup/go.mod index 35267bb203ef..dcf9fadd0381 100644 --- a/x/accounts/defaults/lockup/go.mod +++ b/x/accounts/defaults/lockup/go.mod @@ -135,7 +135,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/accounts/defaults/lockup/go.sum b/x/accounts/defaults/lockup/go.sum index 50f921c26d80..a63a1dffd914 100644 --- a/x/accounts/defaults/lockup/go.sum +++ b/x/accounts/defaults/lockup/go.sum @@ -494,8 +494,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/accounts/defaults/multisig/go.mod b/x/accounts/defaults/multisig/go.mod index 482921159b70..af7c978196ea 100644 --- a/x/accounts/defaults/multisig/go.mod +++ b/x/accounts/defaults/multisig/go.mod @@ -154,7 +154,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/accounts/defaults/multisig/go.sum b/x/accounts/defaults/multisig/go.sum index b56674a06af2..29a36e2ff120 100644 --- a/x/accounts/defaults/multisig/go.sum +++ b/x/accounts/defaults/multisig/go.sum @@ -553,8 +553,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/accounts/go.mod b/x/accounts/go.mod index a91192d1984d..88370fecb5a2 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -161,7 +161,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index e4d12d7e10b9..15bd680079da 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/auth/go.mod b/x/auth/go.mod index bcfb743e0ec1..0b997a5b1d63 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -158,7 +158,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/auth/go.sum b/x/auth/go.sum index 4e269960625f..84f2ba8a885f 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -556,8 +556,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/authz/go.mod b/x/authz/go.mod index 648be6a3102c..09de1558fce0 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -152,7 +152,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 8d4b41eff915..aa67a6e865f2 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -554,8 +554,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/bank/go.mod b/x/bank/go.mod index ff9bb6ebbcb0..dfae7c1fc130 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -152,7 +152,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/bank/go.sum b/x/bank/go.sum index 4e269960625f..84f2ba8a885f 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -556,8 +556,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 17b772ed428e..6499dec59897 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -155,7 +155,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 81d16c68890c..9ffbaf907836 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/consensus/go.mod b/x/consensus/go.mod index b638d69e19aa..5c3663cde4f7 100644 --- a/x/consensus/go.mod +++ b/x/consensus/go.mod @@ -153,7 +153,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/consensus/go.sum b/x/consensus/go.sum index d2a9b023b854..e3e82e575a8e 100644 --- a/x/consensus/go.sum +++ b/x/consensus/go.sum @@ -555,8 +555,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index bc58aea63171..d167b1612b03 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -160,7 +160,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/distribution/go.sum b/x/distribution/go.sum index 4e269960625f..84f2ba8a885f 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -556,8 +556,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/epochs/go.mod b/x/epochs/go.mod index 9ff57f6eff80..7d1bd69332d5 100644 --- a/x/epochs/go.mod +++ b/x/epochs/go.mod @@ -149,7 +149,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/epochs/go.sum b/x/epochs/go.sum index d2a9b023b854..e3e82e575a8e 100644 --- a/x/epochs/go.sum +++ b/x/epochs/go.sum @@ -555,8 +555,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/evidence/go.mod b/x/evidence/go.mod index 6e69b3e184cb..63fb820d3ba5 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -156,7 +156,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 81d16c68890c..9ffbaf907836 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 48f76e69f4b3..53f54dad7173 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -161,7 +161,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 8413c200c45e..8793258b4f68 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -566,8 +566,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/gov/go.mod b/x/gov/go.mod index 18ca83213bd5..c31adce5b889 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -160,7 +160,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 + golang.org/x/sync v0.8.0 golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index e1b34dbc8d81..62209359f267 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -564,8 +564,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/group/go.mod b/x/group/go.mod index 8f229dfbbc9f..fcd57c0ca696 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -167,7 +167,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 34b225a6d09e..8da6cf226d15 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -570,8 +570,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/mint/go.mod b/x/mint/go.mod index f97f79aa0727..e39187b08573 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -144,7 +144,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/mint/go.sum b/x/mint/go.sum index 079d8d65f322..daf39c2aabb2 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -560,8 +560,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/nft/go.mod b/x/nft/go.mod index e4884dbfa329..13b50a264058 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -154,7 +154,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 81d16c68890c..9ffbaf907836 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/params/go.mod b/x/params/go.mod index 05f1c5dd0cdd..51290be65899 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -155,7 +155,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/params/go.sum b/x/params/go.sum index 81d16c68890c..9ffbaf907836 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index a02f7312608a..31eb3888d006 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -157,7 +157,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 81d16c68890c..9ffbaf907836 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -558,8 +558,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/slashing/go.mod b/x/slashing/go.mod index 011b2cf84175..6e9330374577 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -158,7 +158,7 @@ require ( golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index 6a7a5c664517..ac9ed8562f63 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -560,8 +560,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/staking/go.mod b/x/staking/go.mod index 8d3086240a89..875d7f9722d7 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -143,7 +143,7 @@ require ( golang.org/x/crypto v0.25.0 // indirect golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 4e269960625f..84f2ba8a885f 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -556,8 +556,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index cae69857a633..b08ccdc40265 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -186,7 +186,7 @@ require ( golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect + golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/term v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 5e1769636979..32c6f6026192 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -988,8 +988,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 6d4097bfb7286aeffbe218099ffbe67cfe82eac1 Mon Sep 17 00:00:00 2001 From: cool-developer <51834436+cool-develope@users.noreply.github.com> Date: Mon, 5 Aug 2024 08:34:36 -0400 Subject: [PATCH 15/15] feat(store/v2): implement the feature to upgrade the store keys (#20453) Co-authored-by: Matt Kocubinski --- core/store/upgrade.go | 27 +-- runtime/v2/go.mod | 4 +- runtime/v2/go.sum | 4 +- server/v2/cometbft/go.mod | 4 +- server/v2/cometbft/go.sum | 4 +- server/v2/go.mod | 6 +- server/v2/go.sum | 8 +- simapp/v2/go.mod | 4 +- simapp/v2/go.sum | 4 +- store/v2/README.md | 52 ++++- store/v2/commitment/iavl/tree.go | 5 +- store/v2/commitment/iavl/tree_test.go | 31 ++- store/v2/commitment/mem/tree.go | 4 +- store/v2/commitment/metadata.go | 81 +++++++- store/v2/commitment/store.go | 126 ++++++++++-- store/v2/commitment/store_bench_test.go | 2 +- store/v2/commitment/store_test_suite.go | 232 +++++++++++++++++++++- store/v2/commitment/tree.go | 2 +- store/v2/database.go | 10 +- store/v2/go.mod | 10 +- store/v2/go.sum | 16 +- store/v2/internal/encoding/prefix.go | 16 ++ store/v2/internal/encoding/prefix_test.go | 27 +++ store/v2/migration/manager_test.go | 4 +- store/v2/proof/commit_info.go | 14 +- store/v2/pruning/manager.go | 4 +- store/v2/pruning/manager_test.go | 2 +- store/v2/root/factory.go | 44 +++- store/v2/root/migrate_test.go | 4 +- store/v2/root/store.go | 62 +++++- store/v2/root/store_test.go | 14 +- store/v2/root/upgrade_test.go | 157 +++++++++++++++ store/v2/storage/pebbledb/comparator.go | 2 +- store/v2/storage/pebbledb/db.go | 124 +++++++++++- store/v2/storage/rocksdb/db.go | 13 +- store/v2/storage/rocksdb/db_test.go | 1 + store/v2/storage/rocksdb/iterator.go | 4 + store/v2/storage/sqlite/db.go | 73 ++++++- store/v2/storage/storage_test_suite.go | 189 ++++++++++++++++-- store/v2/storage/store.go | 13 ++ store/v2/store.go | 9 +- 41 files changed, 1219 insertions(+), 193 deletions(-) create mode 100644 store/v2/internal/encoding/prefix.go create mode 100644 store/v2/internal/encoding/prefix_test.go create mode 100644 store/v2/root/upgrade_test.go diff --git a/core/store/upgrade.go b/core/store/upgrade.go index 5a943a949235..dbbf599973b1 100644 --- a/core/store/upgrade.go +++ b/core/store/upgrade.go @@ -2,17 +2,8 @@ package store // StoreUpgrades defines a series of transformations to apply the multistore db upon load type StoreUpgrades struct { - Added []string `json:"added"` - Renamed []StoreRename `json:"renamed"` - Deleted []string `json:"deleted"` -} - -// StoreRename defines a name change of a sub-store. -// All data previously under a PrefixStore with OldKey will be copied -// to a PrefixStore with NewKey, then deleted from OldKey store. -type StoreRename struct { - OldKey string `json:"old_key"` - NewKey string `json:"new_key"` + Added []string `json:"added"` + Deleted []string `json:"deleted"` } // IsAdded returns true if the given key should be added @@ -40,17 +31,3 @@ func (s *StoreUpgrades) IsDeleted(key string) bool { } return false } - -// RenamedFrom returns the oldKey if it was renamed -// Returns "" if it was not renamed -func (s *StoreUpgrades) RenamedFrom(key string) string { - if s == nil { - return "" - } - for _, re := range s.Renamed { - if re.NewKey == key { - return re.OldKey - } - } - return "" -} diff --git a/runtime/v2/go.mod b/runtime/v2/go.mod index 931884323c37..dab569cde4e7 100644 --- a/runtime/v2/go.mod +++ b/runtime/v2/go.mod @@ -15,7 +15,7 @@ replace ( require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 + cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/depinject v1.0.0 cosmossdk.io/log v1.3.1 cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 @@ -44,7 +44,7 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect - github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 // indirect + github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/dot v1.6.2 // indirect diff --git a/runtime/v2/go.sum b/runtime/v2/go.sum index 9221f19acb5e..e12620290a0d 100644 --- a/runtime/v2/go.sum +++ b/runtime/v2/go.sum @@ -46,8 +46,8 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+R github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= diff --git a/server/v2/cometbft/go.mod b/server/v2/cometbft/go.mod index 257f70c116c2..7968bfd4175b 100644 --- a/server/v2/cometbft/go.mod +++ b/server/v2/cometbft/go.mod @@ -22,7 +22,7 @@ replace ( require ( buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.34.2-20240701160653-fedbb9acfd2f.2 cosmossdk.io/api v0.7.5 - cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 + cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/server/v2 v2.0.0-00010101000000-000000000000 @@ -74,7 +74,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/crypto v0.1.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 // indirect + github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.2.1 // indirect diff --git a/server/v2/cometbft/go.sum b/server/v2/cometbft/go.sum index 133cea6f52bf..1a3add076dda 100644 --- a/server/v2/cometbft/go.sum +++ b/server/v2/cometbft/go.sum @@ -107,8 +107,8 @@ github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiK github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= diff --git a/server/v2/go.mod b/server/v2/go.mod index a5b65a1ed4f1..7c577fca5d8b 100644 --- a/server/v2/go.mod +++ b/server/v2/go.mod @@ -15,7 +15,7 @@ replace ( require ( cosmossdk.io/api v0.7.5 - cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 + cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 cosmossdk.io/log v1.3.1 cosmossdk.io/server/v2/appmanager v0.0.0-00010101000000-000000000000 @@ -56,10 +56,10 @@ require ( github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect - github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 // indirect + github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/dot v1.6.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect diff --git a/server/v2/go.sum b/server/v2/go.sum index 7431c6950e32..1a2c148bff40 100644 --- a/server/v2/go.sum +++ b/server/v2/go.sum @@ -59,8 +59,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -69,8 +69,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= -github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= diff --git a/simapp/v2/go.mod b/simapp/v2/go.mod index a310e740891a..5311aa87d950 100644 --- a/simapp/v2/go.mod +++ b/simapp/v2/go.mod @@ -5,7 +5,7 @@ go 1.22.2 require ( cosmossdk.io/api v0.7.5 cosmossdk.io/client/v2 v2.0.0-00010101000000-000000000000 - cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7 + cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/depinject v1.0.0 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 @@ -93,7 +93,7 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect github.com/cosmos/gogoproto v1.5.0 // indirect - github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 // indirect + github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.4 // indirect diff --git a/simapp/v2/go.sum b/simapp/v2/go.sum index 8a8821e689f7..84efb04e8b12 100644 --- a/simapp/v2/go.sum +++ b/simapp/v2/go.sum @@ -325,8 +325,8 @@ github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= diff --git a/store/v2/README.md b/store/v2/README.md index 70f8dfb9a6e5..213f55d05aeb 100644 --- a/store/v2/README.md +++ b/store/v2/README.md @@ -4,16 +4,6 @@ The `store` package contains the implementation of store/v2, which is the SDK's abstraction around managing historical and committed state. See [ADR-065](../docs/architecture/adr-065-store-v2.md) and [Store v2 Design](https://docs.google.com/document/d/1l6uXIjTPHOOWM5N4sUUmUfCZvePoa5SNfIEtmgvgQSU/edit#heading=h.nz8dqy6wa4g1) for a high-level overview of the design and rationale. -## Migration - - - -## Pruning - -The `root.Store` is NOT responsible for pruning. Rather, pruning is the responsibility -of the underlying SS and SC layers. This means pruning can be implementation specific, -such as being synchronous or asynchronous. - ## Usage The `store` package contains a `root.Store` type which is intended to act as an @@ -29,3 +19,45 @@ from the perspective of `root.Store`, there is no notion of multi or single tree rather these are implementation details of SS and SC. For SS, we utilize store keys to namespace raw key/value pairs. For SC, we utilize an abstraction, `commitment.CommitStore`, to map store keys to a commitment trees. + +## Upgrades + +The `LoadVersionAndUpgrade` API of the `root.store` allows for adding or removing +store keys. This is useful for upgrading the chain with new modules or removing +old ones. The `Rename` feature is not supported in store/v2. + +```mermaid +sequenceDiagram + participant S as Store + participant SS as StateStorage + participant SC as StateCommitment + alt SC is a UpgradeableStore + S->>SC: LoadVersionAndUpgrade + SC->>SC: Mount new store keys + SC->>SC: Prune removed store keys + end + SC->>S: LoadVersion Result + alt SS is a UpgradableDatabase + S->>SS: PruneStoreKeys + end +``` + +`Prune store keys` does not remove the data from the SC and SS instantly. It only +marks the store keys as pruned. The actual data removal is done by the pruning +process of the underlying SS and SC. + +## Migration + + + +## Pruning + +The `root.Store` is NOT responsible for pruning. Rather, pruning is the responsibility +of the underlying SS and SC layers. This means pruning can be implementation specific, +such as being synchronous or asynchronous. + + + +## Test Coverage + +The test coverage of the following logical components should be over 60%: \ No newline at end of file diff --git a/store/v2/commitment/iavl/tree.go b/store/v2/commitment/iavl/tree.go index 5de6a4c86842..5fbff6e32931 100644 --- a/store/v2/commitment/iavl/tree.go +++ b/store/v2/commitment/iavl/tree.go @@ -87,8 +87,9 @@ func (t *IavlTree) Get(version uint64, key []byte) ([]byte, error) { } // GetLatestVersion returns the latest version of the tree. -func (t *IavlTree) GetLatestVersion() uint64 { - return uint64(t.tree.Version()) +func (t *IavlTree) GetLatestVersion() (uint64, error) { + v, err := t.tree.GetLatestVersion() + return uint64(v), err } // SetInitialVersion sets the initial version of the database. diff --git a/store/v2/commitment/iavl/tree_test.go b/store/v2/commitment/iavl/tree_test.go index 7435b4e58dd2..4ea8f0f93ff1 100644 --- a/store/v2/commitment/iavl/tree_test.go +++ b/store/v2/commitment/iavl/tree_test.go @@ -16,14 +16,22 @@ import ( func TestCommitterSuite(t *testing.T) { s := &commitment.CommitStoreTestSuite{ - NewStore: func(db corestore.KVStoreWithBatch, storeKeys []string, logger corelog.Logger) (*commitment.CommitStore, error) { + NewStore: func(db corestore.KVStoreWithBatch, storeKeys, oldStoreKeys []string, logger corelog.Logger) (*commitment.CommitStore, error) { multiTrees := make(map[string]commitment.Tree) cfg := DefaultConfig() - for _, storeKey := range storeKeys { + mountTreeFn := func(storeKey string) (commitment.Tree, error) { prefixDB := dbm.NewPrefixDB(db, []byte(storeKey)) - multiTrees[storeKey] = NewIavlTree(prefixDB, logger, cfg) + return NewIavlTree(prefixDB, logger, cfg), nil + } + for _, storeKey := range storeKeys { + multiTrees[storeKey], _ = mountTreeFn(storeKey) } - return commitment.NewCommitStore(multiTrees, db, logger) + oldTrees := make(map[string]commitment.Tree) + for _, storeKey := range oldStoreKeys { + oldTrees[storeKey], _ = mountTreeFn(storeKey) + } + + return commitment.NewCommitStore(multiTrees, oldTrees, db, logger) }, } @@ -41,7 +49,8 @@ func TestIavlTree(t *testing.T) { tree := generateTree() require.NotNil(t, tree) - initVersion := tree.GetLatestVersion() + initVersion, err := tree.GetLatestVersion() + require.NoError(t, err) require.Equal(t, uint64(0), initVersion) // write a batch of version 1 @@ -51,14 +60,18 @@ func TestIavlTree(t *testing.T) { workingHash := tree.WorkingHash() require.NotNil(t, workingHash) - require.Equal(t, uint64(0), tree.GetLatestVersion()) + v, err := tree.GetLatestVersion() + require.NoError(t, err) + require.Equal(t, uint64(0), v) // commit the batch commitHash, version, err := tree.Commit() require.NoError(t, err) require.Equal(t, version, uint64(1)) require.Equal(t, workingHash, commitHash) - require.Equal(t, uint64(1), tree.GetLatestVersion()) + v, err = tree.GetLatestVersion() + require.NoError(t, err) + require.Equal(t, uint64(1), v) // ensure we can get expected values bz, err := tree.Get(1, []byte("key1")) @@ -100,7 +113,9 @@ func TestIavlTree(t *testing.T) { // prune version 1 err = tree.Prune(1) require.NoError(t, err) - require.Equal(t, uint64(3), tree.GetLatestVersion()) + v, err = tree.GetLatestVersion() + require.NoError(t, err) + require.Equal(t, uint64(3), v) // async pruning check checkErr := func() bool { if _, err := tree.tree.LoadVersion(1); err != nil { diff --git a/store/v2/commitment/mem/tree.go b/store/v2/commitment/mem/tree.go index 34f26e6a289d..7610ab3bf62d 100644 --- a/store/v2/commitment/mem/tree.go +++ b/store/v2/commitment/mem/tree.go @@ -18,8 +18,8 @@ func (t *Tree) Remove(key []byte) error { return t.MemDB.Delete(key) } -func (t *Tree) GetLatestVersion() uint64 { - return 0 +func (t *Tree) GetLatestVersion() (uint64, error) { + return 0, nil } func (t *Tree) Hash() []byte { diff --git a/store/v2/commitment/metadata.go b/store/v2/commitment/metadata.go index 6b98ef22577d..7462252e962b 100644 --- a/store/v2/commitment/metadata.go +++ b/store/v2/commitment/metadata.go @@ -10,20 +10,24 @@ import ( ) const ( - commitInfoKeyFmt = "c/%d" // c/ - latestVersionKey = "c/latest" + commitInfoKeyFmt = "c/%d" // c/ + latestVersionKey = "c/latest" + removedStoreKeyPrefix = "c/removed/" // c/removed// ) +// MetadataStore is a store for metadata related to the commitment store. type MetadataStore struct { kv corestore.KVStoreWithBatch } +// NewMetadataStore creates a new MetadataStore. func NewMetadataStore(kv corestore.KVStoreWithBatch) *MetadataStore { return &MetadataStore{ kv: kv, } } +// GetLatestVersion returns the latest committed version. func (m *MetadataStore) GetLatestVersion() (uint64, error) { value, err := m.kv.Get([]byte(latestVersionKey)) if err != nil { @@ -41,6 +45,16 @@ func (m *MetadataStore) GetLatestVersion() (uint64, error) { return version, nil } +func (m *MetadataStore) setLatestVersion(version uint64) error { + var buf bytes.Buffer + buf.Grow(encoding.EncodeUvarintSize(version)) + if err := encoding.EncodeUvarint(&buf, version); err != nil { + return err + } + return m.kv.Set([]byte(latestVersionKey), buf.Bytes()) +} + +// GetCommitInfo returns the commit info for the given version. func (m *MetadataStore) GetCommitInfo(version uint64) (*proof.CommitInfo, error) { key := []byte(fmt.Sprintf(commitInfoKeyFmt, version)) value, err := m.kv.Get(key) @@ -90,12 +104,73 @@ func (m *MetadataStore) flushCommitInfo(version uint64, cInfo *proof.CommitInfo) return err } - if err := batch.WriteSync(); err != nil { + if err := batch.Write(); err != nil { return err } return nil } +func (m *MetadataStore) flushRemovedStoreKeys(version uint64, storeKeys []string) (err error) { + batch := m.kv.NewBatch() + defer func() { + err = batch.Close() + }() + + for _, storeKey := range storeKeys { + key := []byte(fmt.Sprintf("%s%s", encoding.BuildPrefixWithVersion(removedStoreKeyPrefix, version), storeKey)) + if err := batch.Set(key, []byte{}); err != nil { + return err + } + } + return batch.Write() +} + +func (m *MetadataStore) GetRemovedStoreKeys(version uint64) (storeKeys [][]byte, err error) { + end := encoding.BuildPrefixWithVersion(removedStoreKeyPrefix, version+1) + iter, err := m.kv.Iterator([]byte(removedStoreKeyPrefix), end) + if err != nil { + return nil, err + } + defer func() { + if ierr := iter.Close(); ierr != nil { + err = ierr + } + }() + + for ; iter.Valid(); iter.Next() { + storeKey := iter.Key()[len(end):] + storeKeys = append(storeKeys, storeKey) + } + return storeKeys, nil +} + +func (m *MetadataStore) deleteRemovedStoreKeys(version uint64, removeStore func(storeKey []byte, version uint64) error) (err error) { + removedStoreKeys, err := m.GetRemovedStoreKeys(version) + if err != nil { + return err + } + if len(removedStoreKeys) == 0 { + return nil + } + + batch := m.kv.NewBatch() + defer func() { + if berr := batch.Close(); berr != nil { + err = berr + } + }() + for _, storeKey := range removedStoreKeys { + if err := removeStore(storeKey, version); err != nil { + return err + } + if err := batch.Delete(storeKey); err != nil { + return err + } + } + + return batch.Write() +} + func (m *MetadataStore) deleteCommitInfo(version uint64) error { cInfoKey := []byte(fmt.Sprintf(commitInfoKeyFmt, version)) return m.kv.Delete(cInfoKey) diff --git a/store/v2/commitment/store.go b/store/v2/commitment/store.go index c814dec70be1..68c83e1c3de1 100644 --- a/store/v2/commitment/store.go +++ b/store/v2/commitment/store.go @@ -5,8 +5,10 @@ import ( "fmt" "io" "math" + "sort" protoio "github.com/cosmos/gogoproto/io" + "golang.org/x/exp/maps" corelog "cosmossdk.io/core/log" corestore "cosmossdk.io/core/store" @@ -20,10 +22,15 @@ import ( var ( _ store.Committer = (*CommitStore)(nil) + _ store.UpgradeableStore = (*CommitStore)(nil) _ snapshots.CommitSnapshotter = (*CommitStore)(nil) _ store.PausablePruner = (*CommitStore)(nil) ) +// MountTreeFn is a function that mounts a tree given a store key. +// It is used to lazily mount trees when needed (e.g. during upgrade or proof generation). +type MountTreeFn func(storeKey string) (Tree, error) + // CommitStore is a wrapper around multiple Tree objects mapped by a unique store // key. Each store key reflects dedicated and unique usage within a module. A caller // can construct a CommitStore with one or more store keys. It is expected that a @@ -33,20 +40,23 @@ type CommitStore struct { logger corelog.Logger metadata *MetadataStore multiTrees map[string]Tree + // oldTrees is a map of store keys to old trees that have been deleted or renamed. + // It is used to get the proof for the old store keys. + oldTrees map[string]Tree } // NewCommitStore creates a new CommitStore instance. -func NewCommitStore(trees map[string]Tree, db corestore.KVStoreWithBatch, logger corelog.Logger) (*CommitStore, error) { +func NewCommitStore(trees, oldTrees map[string]Tree, db corestore.KVStoreWithBatch, logger corelog.Logger) (*CommitStore, error) { return &CommitStore{ logger: logger, multiTrees: trees, + oldTrees: oldTrees, metadata: NewMetadataStore(db), }, nil } func (c *CommitStore) WriteChangeset(cs *corestore.Changeset) error { for _, pairs := range cs.Changes { - key := conv.UnsafeBytesToStr(pairs.Actor) tree, ok := c.multiTrees[key] @@ -90,6 +100,62 @@ func (c *CommitStore) WorkingCommitInfo(version uint64) *proof.CommitInfo { } func (c *CommitStore) LoadVersion(targetVersion uint64) error { + storeKeys := make([]string, 0, len(c.multiTrees)) + for storeKey := range c.multiTrees { + storeKeys = append(storeKeys, storeKey) + } + return c.loadVersion(targetVersion, storeKeys) +} + +// LoadVersionAndUpgrade implements store.UpgradeableStore. +func (c *CommitStore) LoadVersionAndUpgrade(targetVersion uint64, upgrades *corestore.StoreUpgrades) error { + // deterministic iteration order for upgrades (as the underlying store may change and + // upgrades make store changes where the execution order may matter) + storeKeys := maps.Keys(c.multiTrees) + sort.Strings(storeKeys) + + removeTree := func(storeKey string) error { + if oldTree, ok := c.multiTrees[storeKey]; ok { + if err := oldTree.Close(); err != nil { + return err + } + delete(c.multiTrees, storeKey) + } + return nil + } + + newStoreKeys := make([]string, 0, len(c.multiTrees)) + removedStoreKeys := make([]string, 0) + for _, storeKey := range storeKeys { + // If it has been deleted, remove the tree. + if upgrades.IsDeleted(storeKey) { + if err := removeTree(storeKey); err != nil { + return err + } + removedStoreKeys = append(removedStoreKeys, storeKey) + continue + } + + // If it has been added, set the initial version. + if upgrades.IsAdded(storeKey) { + if err := c.multiTrees[storeKey].SetInitialVersion(targetVersion + 1); err != nil { + return err + } + // This is the empty tree, no need to load the version. + continue + } + + newStoreKeys = append(newStoreKeys, storeKey) + } + + if err := c.metadata.flushRemovedStoreKeys(targetVersion, removedStoreKeys); err != nil { + return err + } + + return c.loadVersion(targetVersion, newStoreKeys) +} + +func (c *CommitStore) loadVersion(targetVersion uint64, storeKeys []string) error { // Rollback the metadata to the target version. latestVersion, err := c.GetLatestVersion() if err != nil { @@ -101,22 +167,25 @@ func (c *CommitStore) LoadVersion(targetVersion uint64) error { return err } } + if err := c.metadata.setLatestVersion(targetVersion); err != nil { + return err + } } - for _, tree := range c.multiTrees { - if err := tree.LoadVersion(targetVersion); err != nil { + for _, storeKey := range storeKeys { + if err := c.multiTrees[storeKey].LoadVersion(targetVersion); err != nil { return err } } // If the target version is greater than the latest version, it is the snapshot // restore case, we should create a new commit info for the target version. - var cInfo *proof.CommitInfo if targetVersion > latestVersion { - cInfo = c.WorkingCommitInfo(targetVersion) + cInfo := c.WorkingCommitInfo(targetVersion) + return c.metadata.flushCommitInfo(targetVersion, cInfo) } - return c.metadata.flushCommitInfo(targetVersion, cInfo) + return nil } func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { @@ -130,7 +199,11 @@ func (c *CommitStore) Commit(version uint64) (*proof.CommitInfo, error) { // will be larger than the RMS's metadata, when the block is replayed, we // should avoid committing that iavl store again. var commitID proof.CommitID - if tree.GetLatestVersion() >= version { + v, err := tree.GetLatestVersion() + if err != nil { + return nil, err + } + if v >= version { commitID.Version = version commitID.Hash = tree.Hash() } else { @@ -175,9 +248,13 @@ func (c *CommitStore) SetInitialVersion(version uint64) error { } func (c *CommitStore) GetProof(storeKey []byte, version uint64, key []byte) ([]proof.CommitmentOp, error) { - tree, ok := c.multiTrees[conv.UnsafeBytesToStr(storeKey)] + rawStoreKey := conv.UnsafeBytesToStr(storeKey) + tree, ok := c.multiTrees[rawStoreKey] if !ok { - return nil, fmt.Errorf("store %s not found", storeKey) + tree, ok = c.oldTrees[rawStoreKey] + if !ok { + return nil, fmt.Errorf("store %s not found", rawStoreKey) + } } iProof, err := tree.GetProof(version, key) @@ -215,21 +292,36 @@ func (c *CommitStore) Get(storeKey []byte, version uint64, key []byte) ([]byte, } // Prune implements store.Pruner. -func (c *CommitStore) Prune(version uint64) (ferr error) { +func (c *CommitStore) Prune(version uint64) error { // prune the metadata for v := version; v > 0; v-- { if err := c.metadata.deleteCommitInfo(v); err != nil { return err } } - + // prune the trees for _, tree := range c.multiTrees { if err := tree.Prune(version); err != nil { - ferr = errors.Join(ferr, err) + return err } } + // prune the removed store keys + if err := c.pruneRemovedStoreKeys(version); err != nil { + return err + } + + return nil +} - return ferr +func (c *CommitStore) pruneRemovedStoreKeys(version uint64) error { + clearKVStore := func(storeKey []byte, version uint64) (err error) { + tree, ok := c.oldTrees[string(storeKey)] + if !ok { + return fmt.Errorf("store %s not found in oldTrees", storeKey) + } + return tree.Prune(version) + } + return c.metadata.deleteRemovedStoreKeys(version, clearKVStore) } // PausePruning implements store.PausablePruner. @@ -402,12 +494,12 @@ func (c *CommitStore) GetLatestVersion() (uint64, error) { return c.metadata.GetLatestVersion() } -func (c *CommitStore) Close() (ferr error) { +func (c *CommitStore) Close() error { for _, tree := range c.multiTrees { if err := tree.Close(); err != nil { - ferr = errors.Join(ferr, err) + return err } } - return ferr + return nil } diff --git a/store/v2/commitment/store_bench_test.go b/store/v2/commitment/store_bench_test.go index 037d211ee719..49513e27bda2 100644 --- a/store/v2/commitment/store_bench_test.go +++ b/store/v2/commitment/store_bench_test.go @@ -66,7 +66,7 @@ func getCommitStore(b *testing.B, db corestore.KVStoreWithBatch) *commitment.Com multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, coretesting.NewNopLogger(), iavl.DefaultConfig()) } - sc, err := commitment.NewCommitStore(multiTrees, db, coretesting.NewNopLogger()) + sc, err := commitment.NewCommitStore(multiTrees, nil, db, coretesting.NewNopLogger()) require.NoError(b, err) return sc diff --git a/store/v2/commitment/store_test_suite.go b/store/v2/commitment/store_test_suite.go index 7e8c3587d34e..edbce27116c9 100644 --- a/store/v2/commitment/store_test_suite.go +++ b/store/v2/commitment/store_test_suite.go @@ -20,18 +20,19 @@ import ( const ( storeKey1 = "store1" storeKey2 = "store2" + storeKey3 = "store3" ) // CommitStoreTestSuite is a test suite to be used for all tree backends. type CommitStoreTestSuite struct { suite.Suite - NewStore func(db corestore.KVStoreWithBatch, storeKeys []string, logger corelog.Logger) (*CommitStore, error) + NewStore func(db corestore.KVStoreWithBatch, storeKeys, oldStoreKeys []string, logger corelog.Logger) (*CommitStore, error) } func (s *CommitStoreTestSuite) TestStore_Snapshotter() { storeKeys := []string{storeKey1, storeKey2} - commitStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, coretesting.NewNopLogger()) + commitStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, nil, coretesting.NewNopLogger()) s.Require().NoError(err) latestVersion := uint64(10) @@ -65,7 +66,7 @@ func (s *CommitStoreTestSuite) TestStore_Snapshotter() { }, } - targetStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, coretesting.NewNopLogger()) + targetStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, nil, coretesting.NewNopLogger()) s.Require().NoError(err) chunks := make(chan io.ReadCloser, kvCount*int(latestVersion)) @@ -124,10 +125,65 @@ func (s *CommitStoreTestSuite) TestStore_Snapshotter() { } } +func (s *CommitStoreTestSuite) TestStore_LoadVersion() { + storeKeys := []string{storeKey1, storeKey2} + mdb := dbm.NewMemDB() + commitStore, err := s.NewStore(mdb, storeKeys, nil, coretesting.NewNopLogger()) + s.Require().NoError(err) + + latestVersion := uint64(10) + kvCount := 10 + for i := uint64(1); i <= latestVersion; i++ { + kvPairs := make(map[string]corestore.KVPairs) + for _, storeKey := range storeKeys { + kvPairs[storeKey] = corestore.KVPairs{} + for j := 0; j < kvCount; j++ { + key := []byte(fmt.Sprintf("key-%d-%d", i, j)) + value := []byte(fmt.Sprintf("value-%d-%d", i, j)) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) + } + } + s.Require().NoError(commitStore.WriteChangeset(corestore.NewChangesetWithPairs(kvPairs))) + _, err = commitStore.Commit(i) + s.Require().NoError(err) + } + + // load the store with the latest version + targetStore, err := s.NewStore(mdb, storeKeys, nil, coretesting.NewNopLogger()) + s.Require().NoError(err) + err = targetStore.LoadVersion(latestVersion) + s.Require().NoError(err) + // check the store + for i := uint64(1); i <= latestVersion; i++ { + commitInfo, _ := targetStore.GetCommitInfo(i) + s.Require().NotNil(commitInfo) + s.Require().Equal(i, commitInfo.Version) + } + + // rollback to a previous version + rollbackVersion := uint64(5) + rollbackStore, err := s.NewStore(mdb, storeKeys, nil, coretesting.NewNopLogger()) + s.Require().NoError(err) + err = rollbackStore.LoadVersion(rollbackVersion) + s.Require().NoError(err) + // check the store + v, err := rollbackStore.GetLatestVersion() + s.Require().NoError(err) + s.Require().Equal(rollbackVersion, v) + for i := uint64(1); i <= latestVersion; i++ { + commitInfo, _ := rollbackStore.GetCommitInfo(i) + if i > rollbackVersion { + s.Require().Nil(commitInfo) + } else { + s.Require().NotNil(commitInfo) + } + } +} + func (s *CommitStoreTestSuite) TestStore_Pruning() { storeKeys := []string{storeKey1, storeKey2} pruneOpts := store.NewPruningOptionWithCustom(10, 5) - commitStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, coretesting.NewNopLogger()) + commitStore, err := s.NewStore(dbm.NewMemDB(), storeKeys, nil, coretesting.NewNopLogger()) s.Require().NoError(err) latestVersion := uint64(100) @@ -164,3 +220,171 @@ func (s *CommitStoreTestSuite) TestStore_Pruning() { } } } + +func (s *CommitStoreTestSuite) TestStore_Upgrades() { + storeKeys := []string{storeKey1, storeKey2, storeKey3} + commitDB := dbm.NewMemDB() + commitStore, err := s.NewStore(commitDB, storeKeys, nil, coretesting.NewNopLogger()) + s.Require().NoError(err) + + latestVersion := uint64(10) + kvCount := 10 + for i := uint64(1); i <= latestVersion; i++ { + kvPairs := make(map[string]corestore.KVPairs) + for _, storeKey := range storeKeys { + kvPairs[storeKey] = corestore.KVPairs{} + for j := 0; j < kvCount; j++ { + key := []byte(fmt.Sprintf("key-%d-%d", i, j)) + value := []byte(fmt.Sprintf("value-%d-%d", i, j)) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) + } + } + s.Require().NoError(commitStore.WriteChangeset(corestore.NewChangesetWithPairs(kvPairs))) + _, err = commitStore.Commit(i) + s.Require().NoError(err) + } + + // create a new commitment store with upgrades + upgrades := &corestore.StoreUpgrades{ + Added: []string{"newStore1", "newStore2"}, + Deleted: []string{storeKey3}, + } + newStoreKeys := []string{storeKey1, storeKey2, storeKey3, "newStore1", "newStore2"} + realStoreKeys := []string{storeKey1, storeKey2, "newStore1", "newStore2"} + oldStoreKeys := []string{storeKey1, storeKey3} + commitStore, err = s.NewStore(commitDB, newStoreKeys, oldStoreKeys, coretesting.NewNopLogger()) + s.Require().NoError(err) + err = commitStore.LoadVersionAndUpgrade(latestVersion, upgrades) + s.Require().NoError(err) + + // GetProof should work for the old stores + for _, storeKey := range []string{storeKey1, storeKey3} { + for i := uint64(1); i <= latestVersion; i++ { + for j := 0; j < kvCount; j++ { + proof, err := commitStore.GetProof([]byte(storeKey), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } + } + // GetProof should fail for the new stores against the old versions + for _, storeKey := range []string{"newStore1", "newStore2"} { + for i := uint64(1); i <= latestVersion; i++ { + for j := 0; j < kvCount; j++ { + _, err := commitStore.GetProof([]byte(storeKey), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().Error(err) + } + } + } + + // apply the changeset again + for i := latestVersion + 1; i < latestVersion*2; i++ { + kvPairs := make(map[string]corestore.KVPairs) + for _, storeKey := range realStoreKeys { + kvPairs[storeKey] = corestore.KVPairs{} + for j := 0; j < kvCount; j++ { + key := []byte(fmt.Sprintf("key-%d-%d", i, j)) + value := []byte(fmt.Sprintf("value-%d-%d", i, j)) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) + } + } + s.Require().NoError(commitStore.WriteChangeset(corestore.NewChangesetWithPairs(kvPairs))) + commitInfo, err := commitStore.Commit(i) + s.Require().NoError(err) + s.Require().NotNil(commitInfo) + s.Require().Equal(len(realStoreKeys), len(commitInfo.StoreInfos)) + for _, storeKey := range realStoreKeys { + s.Require().NotNil(commitInfo.GetStoreCommitID([]byte(storeKey))) + } + } + + // verify new stores + for _, storeKey := range []string{"newStore1", "newStore2"} { + for i := latestVersion + 1; i < latestVersion*2; i++ { + for j := 0; j < kvCount; j++ { + proof, err := commitStore.GetProof([]byte(storeKey), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } + } + + // verify existing store + for i := uint64(1); i < latestVersion*2; i++ { + for j := 0; j < kvCount; j++ { + proof, err := commitStore.GetProof([]byte(storeKey2), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } + + // create a new commitment store with one more upgrades + upgrades = &corestore.StoreUpgrades{ + Added: []string{storeKey3}, + Deleted: []string{storeKey2}, + } + newRealStoreKeys := []string{storeKey1, storeKey3, "newStore1", "newStore2"} + oldStoreKeys = []string{storeKey2, storeKey3} + commitStore, err = s.NewStore(commitDB, newStoreKeys, oldStoreKeys, coretesting.NewNopLogger()) + s.Require().NoError(err) + err = commitStore.LoadVersionAndUpgrade(2*latestVersion-1, upgrades) + s.Require().NoError(err) + + // apply the changeset again + for i := latestVersion * 2; i < latestVersion*3; i++ { + kvPairs := make(map[string]corestore.KVPairs) + for _, storeKey := range newRealStoreKeys { + kvPairs[storeKey] = corestore.KVPairs{} + for j := 0; j < kvCount; j++ { + key := []byte(fmt.Sprintf("key-%d-%d", i, j)) + value := []byte(fmt.Sprintf("value-%d-%d", i, j)) + kvPairs[storeKey] = append(kvPairs[storeKey], corestore.KVPair{Key: key, Value: value}) + } + } + s.Require().NoError(commitStore.WriteChangeset(corestore.NewChangesetWithPairs(kvPairs))) + commitInfo, err := commitStore.Commit(i) + s.Require().NoError(err) + s.Require().NotNil(commitInfo) + s.Require().Equal(len(newRealStoreKeys), len(commitInfo.StoreInfos)) + for _, storeKey := range newRealStoreKeys { + s.Require().NotNil(commitInfo.GetStoreCommitID([]byte(storeKey))) + } + } + + // prune the old stores + s.Require().NoError(commitStore.Prune(latestVersion)) + // GetProof should fail for the old stores + for _, storeKey := range []string{storeKey1, storeKey3} { + for i := uint64(1); i <= latestVersion; i++ { + for j := 0; j < kvCount; j++ { + _, err := commitStore.GetProof([]byte(storeKey), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().Error(err) + } + } + } + // GetProof should not fail for the newly removed store + for i := latestVersion + 1; i < latestVersion*2; i++ { + for j := 0; j < kvCount; j++ { + proof, err := commitStore.GetProof([]byte(storeKey2), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } + + s.Require().NoError(commitStore.Prune(latestVersion * 2)) + // GetProof should fail for the newly deleted stores + for i := uint64(1); i < latestVersion*2; i++ { + for j := 0; j < kvCount; j++ { + _, err := commitStore.GetProof([]byte(storeKey2), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().Error(err) + } + } + // GetProof should work for the new added store + for i := latestVersion*2 + 1; i < latestVersion*3; i++ { + for j := 0; j < kvCount; j++ { + proof, err := commitStore.GetProof([]byte(storeKey3), i, []byte(fmt.Sprintf("key-%d-%d", i, j))) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } +} diff --git a/store/v2/commitment/tree.go b/store/v2/commitment/tree.go index 54fe2d60f00e..19b76b34c937 100644 --- a/store/v2/commitment/tree.go +++ b/store/v2/commitment/tree.go @@ -16,7 +16,7 @@ var ErrorExportDone = errors.New("export is complete") type Tree interface { Set(key, value []byte) error Remove(key []byte) error - GetLatestVersion() uint64 + GetLatestVersion() (uint64, error) // Hash returns the hash of the latest saved version of the tree. Hash() []byte diff --git a/store/v2/database.go b/store/v2/database.go index a0466de18dea..58a3ee7ef65c 100644 --- a/store/v2/database.go +++ b/store/v2/database.go @@ -25,6 +25,14 @@ type VersionedDatabase interface { io.Closer } +// UpgradableDatabase defines an API for a versioned database that allows pruning +// deleted storeKeys +type UpgradableDatabase interface { + // PruneStoreKeys prunes all data associated with the given storeKeys whenever + // the given version is pruned. + PruneStoreKeys(storeKeys []string, version uint64) error +} + // Committer defines an API for committing state. type Committer interface { // WriteChangeset writes the changeset to the commitment state. @@ -51,7 +59,7 @@ type Committer interface { // Once migration is complete, this method should be removed and/or not used. Get(storeKey []byte, version uint64, key []byte) ([]byte, error) - // SetInitialVersion sets the initial version of the tree. + // SetInitialVersion sets the initial version of the committer. SetInitialVersion(version uint64) error // GetCommitInfo returns the CommitInfo for the given version. diff --git a/store/v2/go.mod b/store/v2/go.mod index a305cc49e8d0..fc5870aa7836 100644 --- a/store/v2/go.mod +++ b/store/v2/go.mod @@ -3,14 +3,14 @@ module cosmossdk.io/store/v2 go 1.21 require ( - cosmossdk.io/core v0.12.0 + cosmossdk.io/core v0.12.1-0.20240725072823-6a2d039e1212 cosmossdk.io/core/testing v0.0.0-00010101000000-000000000000 cosmossdk.io/errors/v2 v2.0.0-20240731132947-df72853b3ca5 cosmossdk.io/log v1.3.1 github.com/cockroachdb/pebble v1.1.0 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/gogoproto v1.5.0 - github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 + github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e github.com/cosmos/ics23/go v0.10.0 github.com/google/btree v1.1.2 github.com/hashicorp/go-metrics v0.5.3 @@ -19,6 +19,7 @@ require ( github.com/spf13/cast v1.6.0 github.com/stretchr/testify v1.9.0 github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d + golang.org/x/exp v0.0.0-20231006140011-7918f672742d golang.org/x/sync v0.8.0 ) @@ -30,9 +31,9 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/cosmos-db v1.0.2 // indirect + github.com/cosmos/cosmos-db v1.0.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/dot v1.6.1 // indirect + github.com/emicklei/dot v1.6.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -58,7 +59,6 @@ require ( github.com/rs/zerolog v1.33.0 // indirect github.com/tidwall/btree v1.7.0 // indirect golang.org/x/crypto v0.25.0 // indirect - golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/sys v0.22.0 // indirect golang.org/x/text v0.16.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/store/v2/go.sum b/store/v2/go.sum index 7e13cab09725..296393501fc9 100644 --- a/store/v2/go.sum +++ b/store/v2/go.sum @@ -34,14 +34,14 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= -github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= +github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179 h1:wmwDn7V3RodN9auB3FooSQxs46nHVE3u0mb87TJkZFE= -github.com/cosmos/iavl v1.2.1-0.20240725141113-7adc688cf179/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e h1:5bxw1E0peLMrr8ZO9mYT0d9sxy0WgR1ZEWb92yjKnnk= +github.com/cosmos/iavl v1.2.1-0.20240731145221-594b181f427e/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -49,8 +49,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/dot v1.6.1 h1:ujpDlBkkwgWUY+qPId5IwapRW/xEoligRSYjioR6DFI= -github.com/emicklei/dot v1.6.1/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= +github.com/emicklei/dot v1.6.2 h1:08GN+DD79cy/tzN6uLCT84+2Wk9u+wvqP+Hkx/dIR8A= +github.com/emicklei/dot v1.6.2/go.mod h1:DeV7GvQtIw4h2u73RKBkkFdvVAz0D9fzeJrgPW6gy/s= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -226,8 +226,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= diff --git a/store/v2/internal/encoding/prefix.go b/store/v2/internal/encoding/prefix.go new file mode 100644 index 000000000000..f93d7bc5996f --- /dev/null +++ b/store/v2/internal/encoding/prefix.go @@ -0,0 +1,16 @@ +package encoding + +import "encoding/binary" + +const separator = '/' + +// BuildPrefixWithVersion returns a byte slice with the given prefix and BigEndian encoded version. +// It is mainly used to represent the removed store key at the metadata store. +func BuildPrefixWithVersion(prefix string, version uint64) []byte { + n := len(prefix) + buf := make([]byte, n+8+1) + copy(buf, prefix) + binary.BigEndian.PutUint64(buf[n:], version) + buf[n+8] = separator + return buf +} diff --git a/store/v2/internal/encoding/prefix_test.go b/store/v2/internal/encoding/prefix_test.go new file mode 100644 index 000000000000..bcdd74dd781e --- /dev/null +++ b/store/v2/internal/encoding/prefix_test.go @@ -0,0 +1,27 @@ +package encoding + +import ( + "bytes" + "testing" +) + +func TestBuildPrefixWithVersion(t *testing.T) { + testcases := []struct { + prefix string + version uint64 + want []byte + }{ + {"", 0, []byte{0, 0, 0, 0, 0, 0, 0, 0, '/'}}, + {"a", 0, []byte{'a', 0, 0, 0, 0, 0, 0, 0, 0, '/'}}, + {"b", 1, []byte{'b', 0, 0, 0, 0, 0, 0, 0, 1, '/'}}, + {"s/k/removed/", 2, []byte{'s', '/', 'k', '/', 'r', 'e', 'm', 'o', 'v', 'e', 'd', '/', 0, 0, 0, 0, 0, 0, 0, 2, '/'}}, + {"s/k/", 1234567890, []byte{'s', '/', 'k', '/', 0, 0, 0, 0, 73, 150, 2, 210, '/'}}, + } + + for _, tc := range testcases { + got := BuildPrefixWithVersion(tc.prefix, tc.version) + if !bytes.Equal(got, tc.want) { + t.Fatalf("BuildPrefixWithVersion(%q, %d) = %v, want %v", tc.prefix, tc.version, got, tc.want) + } + } +} diff --git a/store/v2/migration/manager_test.go b/store/v2/migration/manager_test.go index d8365ce07579..ae00d5c08bbb 100644 --- a/store/v2/migration/manager_test.go +++ b/store/v2/migration/manager_test.go @@ -28,7 +28,7 @@ func setupMigrationManager(t *testing.T, noCommitStore bool) (*Manager, *commitm multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, coretesting.NewNopLogger(), iavl.DefaultConfig()) } - commitStore, err := commitment.NewCommitStore(multiTrees, db, coretesting.NewNopLogger()) + commitStore, err := commitment.NewCommitStore(multiTrees, nil, db, coretesting.NewNopLogger()) require.NoError(t, err) snapshotsStore, err := snapshots.NewStore(t.TempDir()) @@ -47,7 +47,7 @@ func setupMigrationManager(t *testing.T, noCommitStore bool) (*Manager, *commitm multiTrees1[storeKey] = iavl.NewIavlTree(prefixDB, coretesting.NewNopLogger(), iavl.DefaultConfig()) } - newCommitStore, err := commitment.NewCommitStore(multiTrees1, db1, coretesting.NewNopLogger()) // for store/v2 + newCommitStore, err := commitment.NewCommitStore(multiTrees1, nil, db1, coretesting.NewNopLogger()) // for store/v2 require.NoError(t, err) if noCommitStore { newCommitStore = nil diff --git a/store/v2/proof/commit_info.go b/store/v2/proof/commit_info.go index d95c152b4665..b784676a8d34 100644 --- a/store/v2/proof/commit_info.go +++ b/store/v2/proof/commit_info.go @@ -72,7 +72,8 @@ func (ci *CommitInfo) GetStoreProof(storeKey []byte) ([]byte, *CommitmentOp, err return bytes.Compare(ci.StoreInfos[i].Name, ci.StoreInfos[j].Name) < 0 }) - index := 0 + isEmpty := len(storeKey) == 0 + index := -1 leaves := make([][]byte, len(ci.StoreInfos)) for i, si := range ci.StoreInfos { var err error @@ -80,14 +81,21 @@ func (ci *CommitInfo) GetStoreProof(storeKey []byte) ([]byte, *CommitmentOp, err if err != nil { return nil, nil, err } - if bytes.Equal(si.Name, storeKey) { + if !isEmpty && bytes.Equal(si.Name, storeKey) { index = i } } + if index == -1 { + if isEmpty { + index = 0 + } else { + return nil, nil, fmt.Errorf("store key %s not found", storeKey) + } + } + rootHash, inners := ProofFromByteSlices(leaves, index) commitmentOp := ConvertCommitmentOp(inners, storeKey, ci.StoreInfos[index].GetHash()) - return rootHash, &commitmentOp, nil } diff --git a/store/v2/pruning/manager.go b/store/v2/pruning/manager.go index 424805bde70b..1e36abe7a6ed 100644 --- a/store/v2/pruning/manager.go +++ b/store/v2/pruning/manager.go @@ -1,6 +1,8 @@ package pruning -import "cosmossdk.io/store/v2" +import ( + "cosmossdk.io/store/v2" +) // Manager is a struct that manages the pruning of old versions of the SC and SS. type Manager struct { diff --git a/store/v2/pruning/manager_test.go b/store/v2/pruning/manager_test.go index 607af22bc722..9f96b2a48360 100644 --- a/store/v2/pruning/manager_test.go +++ b/store/v2/pruning/manager_test.go @@ -42,7 +42,7 @@ func (s *PruningManagerTestSuite) SetupTest() { prefixDB := dbm.NewPrefixDB(mdb, []byte(storeKey)) multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, nopLog, iavl.DefaultConfig()) } - s.sc, err = commitment.NewCommitStore(multiTrees, mdb, nopLog) + s.sc, err = commitment.NewCommitStore(multiTrees, nil, mdb, nopLog) s.Require().NoError(err) sqliteDB, err := sqlite.New(s.T().TempDir()) diff --git a/store/v2/root/factory.go b/store/v2/root/factory.go index 563e439815bc..886eafb70bc2 100644 --- a/store/v2/root/factory.go +++ b/store/v2/root/factory.go @@ -109,12 +109,12 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { } ss = storage.NewStorageStore(ssDb, opts.Logger) + metadata := commitment.NewMetadataStore(opts.SCRawDB) + latestVersion, err := metadata.GetLatestVersion() + if err != nil { + return nil, err + } if len(opts.StoreKeys) == 0 { - metadata := commitment.NewMetadataStore(opts.SCRawDB) - latestVersion, err := metadata.GetLatestVersion() - if err != nil { - return nil, err - } lastCommitInfo, err := metadata.GetCommitInfo(latestVersion) if err != nil { return nil, err @@ -126,21 +126,43 @@ func CreateRootStore(opts *FactoryOptions) (store.RootStore, error) { opts.StoreKeys = append(opts.StoreKeys, string(si.Name)) } } + removedStoreKeys, err := metadata.GetRemovedStoreKeys(latestVersion) + if err != nil { + return nil, err + } - trees := make(map[string]commitment.Tree) - for _, key := range opts.StoreKeys { + newTreeFn := func(key string) (commitment.Tree, error) { if internal.IsMemoryStoreKey(key) { - trees[key] = mem.New() + return mem.New(), nil } else { switch storeOpts.SCType { case SCTypeIavl: - trees[key] = iavl.NewIavlTree(db.NewPrefixDB(opts.SCRawDB, []byte(key)), opts.Logger, storeOpts.IavlConfig) + return iavl.NewIavlTree(db.NewPrefixDB(opts.SCRawDB, []byte(key)), opts.Logger, storeOpts.IavlConfig), nil case SCTypeIavlV2: - return nil, errors.New("iavl v2 not supported") + return nil, fmt.Errorf("iavl v2 not supported") + default: + return nil, fmt.Errorf("unsupported commitment store type") } } } - sc, err = commitment.NewCommitStore(trees, opts.SCRawDB, opts.Logger) + + trees := make(map[string]commitment.Tree, len(opts.StoreKeys)) + for _, key := range opts.StoreKeys { + tree, err := newTreeFn(key) + if err != nil { + return nil, err + } + trees[key] = tree + } + oldTrees := make(map[string]commitment.Tree, len(opts.StoreKeys)) + for _, key := range removedStoreKeys { + tree, err := newTreeFn(string(key)) + if err != nil { + return nil, err + } + oldTrees[string(key)] = tree + } + sc, err = commitment.NewCommitStore(trees, oldTrees, opts.SCRawDB, opts.Logger) if err != nil { return nil, err } diff --git a/store/v2/root/migrate_test.go b/store/v2/root/migrate_test.go index 4d1b62b878a5..0cc20ae940d9 100644 --- a/store/v2/root/migrate_test.go +++ b/store/v2/root/migrate_test.go @@ -43,7 +43,7 @@ func (s *MigrateStoreTestSuite) SetupTest() { prefixDB := dbm.NewPrefixDB(mdb, []byte(storeKey)) multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, nopLog, iavl.DefaultConfig()) } - orgSC, err := commitment.NewCommitStore(multiTrees, mdb, testLog) + orgSC, err := commitment.NewCommitStore(multiTrees, nil, mdb, testLog) s.Require().NoError(err) // apply changeset against the original store @@ -70,7 +70,7 @@ func (s *MigrateStoreTestSuite) SetupTest() { for _, storeKey := range storeKeys { multiTrees1[storeKey] = iavl.NewIavlTree(dbm.NewMemDB(), nopLog, iavl.DefaultConfig()) } - sc, err := commitment.NewCommitStore(multiTrees1, dbm.NewMemDB(), testLog) + sc, err := commitment.NewCommitStore(multiTrees1, nil, dbm.NewMemDB(), testLog) s.Require().NoError(err) snapshotsStore, err := snapshots.NewStore(s.T().TempDir()) diff --git a/store/v2/root/store.go b/store/v2/root/store.go index 56f722282f45..218af42b6f89 100644 --- a/store/v2/root/store.go +++ b/store/v2/root/store.go @@ -20,7 +20,10 @@ import ( "cosmossdk.io/store/v2/pruning" ) -var _ store.RootStore = (*Store)(nil) +var ( + _ store.RootStore = (*Store)(nil) + _ store.UpgradeableStore = (*Store)(nil) +) // Store defines the SDK's default RootStore implementation. It contains a single // State Storage (SS) backend and a single State Commitment (SC) backend. The SC @@ -225,7 +228,7 @@ func (s *Store) LoadLatestVersion() error { return err } - return s.loadVersion(lv) + return s.loadVersion(lv, nil) } func (s *Store) LoadVersion(version uint64) error { @@ -234,14 +237,57 @@ func (s *Store) LoadVersion(version uint64) error { defer s.telemetry.MeasureSince(now, "root_store", "load_version") } - return s.loadVersion(version) + return s.loadVersion(version, nil) } -func (s *Store) loadVersion(v uint64) error { +// LoadVersionAndUpgrade implements the UpgradeableStore interface. +// +// NOTE: It cannot be called while the store is migrating. +func (s *Store) LoadVersionAndUpgrade(version uint64, upgrades *corestore.StoreUpgrades) error { + if upgrades == nil { + return fmt.Errorf("upgrades cannot be nil") + } + + if s.telemetry != nil { + defer s.telemetry.MeasureSince(time.Now(), "root_store", "load_version_and_upgrade") + } + + if s.isMigrating { + return fmt.Errorf("cannot upgrade while migrating") + } + + if err := s.loadVersion(version, upgrades); err != nil { + return err + } + + // if the state storage implements the UpgradableDatabase interface, prune the + // deleted store keys + upgradableDatabase, ok := s.stateStorage.(store.UpgradableDatabase) + if ok { + if err := upgradableDatabase.PruneStoreKeys(upgrades.Deleted, version); err != nil { + return fmt.Errorf("failed to prune store keys %v: %w", upgrades.Deleted, err) + } + } + + return nil +} + +func (s *Store) loadVersion(v uint64, upgrades *corestore.StoreUpgrades) error { s.logger.Debug("loading version", "version", v) - if err := s.stateCommitment.LoadVersion(v); err != nil { - return fmt.Errorf("failed to load SC version %d: %w", v, err) + if upgrades == nil { + if err := s.stateCommitment.LoadVersion(v); err != nil { + return fmt.Errorf("failed to load SC version %d: %w", v, err) + } + } else { + // if upgrades are provided, we need to load the version and apply the upgrades + upgradeableStore, ok := s.stateCommitment.(store.UpgradeableStore) + if !ok { + return fmt.Errorf("SC store does not support upgrades") + } + if err := upgradeableStore.LoadVersionAndUpgrade(v, upgrades); err != nil { + return fmt.Errorf("failed to load SS version with upgrades %d: %w", v, err) + } } s.commitHeader = nil @@ -301,8 +347,8 @@ func (s *Store) WorkingHash(cs *corestore.Changeset) ([]byte, error) { // Commit commits all state changes to the underlying SS and SC backends. It // writes a batch of the changeset to the SC tree, and retrieves the CommitInfo -// from the SC tree. Finally, it commits the SC tree and returns the hash of the -// CommitInfo. +// from the SC tree. Finally, it commits the SC tree and returns the hash of +// the CommitInfo. func (s *Store) Commit(cs *corestore.Changeset) ([]byte, error) { if s.telemetry != nil { now := time.Now() diff --git a/store/v2/root/store_test.go b/store/v2/root/store_test.go index b2b640feb974..fe7552ee6bd2 100644 --- a/store/v2/root/store_test.go +++ b/store/v2/root/store_test.go @@ -55,7 +55,7 @@ func (s *RootStoreTestSuite) SetupTest() { tree := iavl.NewIavlTree(dbm.NewMemDB(), noopLog, iavl.DefaultConfig()) tree2 := iavl.NewIavlTree(dbm.NewMemDB(), noopLog, iavl.DefaultConfig()) tree3 := iavl.NewIavlTree(dbm.NewMemDB(), noopLog, iavl.DefaultConfig()) - sc, err := commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree, testStoreKey2: tree2, testStoreKey3: tree3}, dbm.NewMemDB(), noopLog) + sc, err := commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree, testStoreKey2: tree2, testStoreKey3: tree3}, nil, dbm.NewMemDB(), noopLog) s.Require().NoError(err) pm := pruning.NewManager(sc, ss, nil, nil) @@ -79,7 +79,7 @@ func (s *RootStoreTestSuite) newStoreWithPruneConfig(config *store.PruningOption multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, noopLog, iavl.DefaultConfig()) } - sc, err := commitment.NewCommitStore(multiTrees, dbm.NewMemDB(), noopLog) + sc, err := commitment.NewCommitStore(multiTrees, nil, dbm.NewMemDB(), noopLog) s.Require().NoError(err) pm := pruning.NewManager(sc, ss, config, config) @@ -563,7 +563,7 @@ func (s *RootStoreTestSuite) TestMultiStore_PruningRestart() { ss := storage.NewStorageStore(sqliteDB, noopLog) tree := iavl.NewIavlTree(mdb1, noopLog, iavl.DefaultConfig()) - sc, err := commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree}, mdb2, noopLog) + sc, err := commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree}, nil, mdb2, noopLog) s.Require().NoError(err) pm := pruning.NewManager(sc, ss, pruneOpt, pruneOpt) @@ -593,7 +593,7 @@ func (s *RootStoreTestSuite) TestMultiStore_PruningRestart() { ss = storage.NewStorageStore(sqliteDB, noopLog) tree = iavl.NewIavlTree(mdb1, noopLog, iavl.DefaultConfig()) - sc, err = commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree}, mdb2, noopLog) + sc, err = commitment.NewCommitStore(map[string]commitment.Tree{testStoreKey: tree}, nil, mdb2, noopLog) s.Require().NoError(err) pm = pruning.NewManager(sc, ss, pruneOpt, pruneOpt) @@ -624,7 +624,7 @@ func (s *RootStoreTestSuite) TestMultiStore_PruningRestart() { for v := uint64(1); v <= actualHeightToPrune; v++ { checkErr := func() bool { - if err = s.rootStore.LoadVersion(v); err != nil { + if _, err = s.rootStore.StateAt(v); err != nil { return true } return false @@ -650,7 +650,7 @@ func (s *RootStoreTestSuite) TestMultiStoreRestart() { multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, noopLog, iavl.DefaultConfig()) } - sc, err := commitment.NewCommitStore(multiTrees, mdb2, noopLog) + sc, err := commitment.NewCommitStore(multiTrees, nil, mdb2, noopLog) s.Require().NoError(err) pm := pruning.NewManager(sc, ss, nil, nil) @@ -737,7 +737,7 @@ func (s *RootStoreTestSuite) TestMultiStoreRestart() { multiTrees[storeKey] = iavl.NewIavlTree(prefixDB, noopLog, iavl.DefaultConfig()) } - sc, err = commitment.NewCommitStore(multiTrees, mdb2, noopLog) + sc, err = commitment.NewCommitStore(multiTrees, nil, mdb2, noopLog) s.Require().NoError(err) pm = pruning.NewManager(sc, ss, nil, nil) diff --git a/store/v2/root/upgrade_test.go b/store/v2/root/upgrade_test.go new file mode 100644 index 000000000000..a4aee1d5bcfa --- /dev/null +++ b/store/v2/root/upgrade_test.go @@ -0,0 +1,157 @@ +package root + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/suite" + + corestore "cosmossdk.io/core/store" + coretesting "cosmossdk.io/core/testing" + "cosmossdk.io/log" + "cosmossdk.io/store/v2" + "cosmossdk.io/store/v2/commitment" + "cosmossdk.io/store/v2/commitment/iavl" + dbm "cosmossdk.io/store/v2/db" + "cosmossdk.io/store/v2/pruning" + "cosmossdk.io/store/v2/storage" + "cosmossdk.io/store/v2/storage/sqlite" +) + +type UpgradeStoreTestSuite struct { + suite.Suite + + commitDB corestore.KVStoreWithBatch + rootStore store.RootStore +} + +func TestUpgradeStoreTestSuite(t *testing.T) { + suite.Run(t, &UpgradeStoreTestSuite{}) +} + +func (s *UpgradeStoreTestSuite) SetupTest() { + testLog := log.NewTestLogger(s.T()) + nopLog := coretesting.NewNopLogger() + + s.commitDB = dbm.NewMemDB() + multiTrees := make(map[string]commitment.Tree) + newTreeFn := func(storeKey string) (commitment.Tree, error) { + prefixDB := dbm.NewPrefixDB(s.commitDB, []byte(storeKey)) + return iavl.NewIavlTree(prefixDB, nopLog, iavl.DefaultConfig()), nil + } + for _, storeKey := range storeKeys { + multiTrees[storeKey], _ = newTreeFn(storeKey) + } + + // create storage and commitment stores + sqliteDB, err := sqlite.New(s.T().TempDir()) + s.Require().NoError(err) + ss := storage.NewStorageStore(sqliteDB, testLog) + sc, err := commitment.NewCommitStore(multiTrees, nil, s.commitDB, testLog) + s.Require().NoError(err) + pm := pruning.NewManager(sc, ss, nil, nil) + s.rootStore, err = New(testLog, ss, sc, pm, nil, nil) + s.Require().NoError(err) + + // commit changeset + toVersion := uint64(20) + keyCount := 10 + for version := uint64(1); version <= toVersion; version++ { + cs := corestore.NewChangeset() + for _, storeKey := range storeKeys { + for i := 0; i < keyCount; i++ { + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i)), false) + } + } + _, err = s.rootStore.Commit(cs) + s.Require().NoError(err) + } +} + +func (s *UpgradeStoreTestSuite) loadWithUpgrades(upgrades *corestore.StoreUpgrades) { + testLog := log.NewTestLogger(s.T()) + nopLog := coretesting.NewNopLogger() + + // create a new commitment store + multiTrees := make(map[string]commitment.Tree) + oldTrees := make(map[string]commitment.Tree) + newTreeFn := func(storeKey string) (commitment.Tree, error) { + prefixDB := dbm.NewPrefixDB(s.commitDB, []byte(storeKey)) + return iavl.NewIavlTree(prefixDB, nopLog, iavl.DefaultConfig()), nil + } + for _, storeKey := range storeKeys { + multiTrees[storeKey], _ = newTreeFn(storeKey) + } + for _, added := range upgrades.Added { + multiTrees[added], _ = newTreeFn(added) + } + for _, deleted := range upgrades.Deleted { + oldTrees[deleted], _ = newTreeFn(deleted) + } + + sc, err := commitment.NewCommitStore(multiTrees, oldTrees, s.commitDB, testLog) + s.Require().NoError(err) + pm := pruning.NewManager(sc, s.rootStore.GetStateStorage().(store.Pruner), nil, nil) + s.rootStore, err = New(testLog, s.rootStore.GetStateStorage(), sc, pm, nil, nil) + s.Require().NoError(err) +} + +func (s *UpgradeStoreTestSuite) TestLoadVersionAndUpgrade() { + // upgrade store keys + upgrades := &corestore.StoreUpgrades{ + Added: []string{"newStore1", "newStore2"}, + Deleted: []string{"store3"}, + } + s.loadWithUpgrades(upgrades) + + // load the store with the upgrades + v, err := s.rootStore.GetLatestVersion() + s.Require().NoError(err) + err = s.rootStore.(store.UpgradeableStore).LoadVersionAndUpgrade(v, upgrades) + s.Require().NoError(err) + + keyCount := 10 + // check old store keys are queryable + oldStoreKeys := []string{"store1", "store3"} + for _, storeKey := range oldStoreKeys { + for version := uint64(1); version <= v; version++ { + for i := 0; i < keyCount; i++ { + proof, err := s.rootStore.Query([]byte(storeKey), version, []byte(fmt.Sprintf("key-%d-%d", version, i)), true) + s.Require().NoError(err) + s.Require().NotNil(proof) + } + } + } + + // commit changeset + newStoreKeys := []string{"newStore1", "newStore2"} + toVersion := uint64(40) + for version := v + 1; version <= toVersion; version++ { + cs := corestore.NewChangeset() + for _, storeKey := range newStoreKeys { + for i := 0; i < keyCount; i++ { + cs.Add([]byte(storeKey), []byte(fmt.Sprintf("key-%d-%d", version, i)), []byte(fmt.Sprintf("value-%d-%d", version, i)), false) + } + } + _, err = s.rootStore.Commit(cs) + s.Require().NoError(err) + } + + // check new store keys are queryable + for _, storeKey := range newStoreKeys { + for version := v + 1; version <= toVersion; version++ { + for i := 0; i < keyCount; i++ { + _, err := s.rootStore.Query([]byte(storeKey), version, []byte(fmt.Sprintf("key-%d-%d", version, i)), true) + s.Require().NoError(err) + } + } + } + + // check the original store key is queryable + for version := uint64(1); version <= toVersion; version++ { + for i := 0; i < keyCount; i++ { + _, err := s.rootStore.Query([]byte("store2"), version, []byte(fmt.Sprintf("key-%d-%d", version, i)), true) + s.Require().NoError(err) + } + } +} diff --git a/store/v2/storage/pebbledb/comparator.go b/store/v2/storage/pebbledb/comparator.go index 337ff7698d84..24f5e05a6214 100644 --- a/store/v2/storage/pebbledb/comparator.go +++ b/store/v2/storage/pebbledb/comparator.go @@ -155,7 +155,7 @@ func SplitMVCCKey(mvccKey []byte) (key, version []byte, ok bool) { key = mvccKeyCopy[:n-tsLen] if tsLen > 0 { - version = mvccKeyCopy[n-tsLen+1 : len(mvccKeyCopy)-1] + version = mvccKeyCopy[n-tsLen+1 : n] } return key, version, true diff --git a/store/v2/storage/pebbledb/db.go b/store/v2/storage/pebbledb/db.go index 4e9df737b57e..ebcd242af243 100644 --- a/store/v2/storage/pebbledb/db.go +++ b/store/v2/storage/pebbledb/db.go @@ -13,7 +13,9 @@ import ( corestore "cosmossdk.io/core/store" "cosmossdk.io/store/v2" storeerrors "cosmossdk.io/store/v2/errors" + "cosmossdk.io/store/v2/internal/encoding" "cosmossdk.io/store/v2/storage" + "cosmossdk.io/store/v2/storage/util" ) const ( @@ -21,14 +23,20 @@ const ( // PruneCommitBatchSize defines the size, in number of key/value pairs, to prune // in a single batch. PruneCommitBatchSize = 50 - - StorePrefixTpl = "s/k:%s/" // s/k: - latestVersionKey = "s/_latest" // NB: latestVersionKey key must be lexically smaller than StorePrefixTpl - pruneHeightKey = "s/_prune_height" // NB: pruneHeightKey key must be lexically smaller than StorePrefixTpl - tombstoneVal = "TOMBSTONE" + // batchBufferSize defines the maximum size of a batch before it is committed. + batchBufferSize = 100_000 + + StorePrefixTpl = "s/k:%s/" // s/k: + removedStoreKeyPrefix = "s/_removed_key" // NB: removedStoreKeys key must be lexically smaller than StorePrefixTpl + latestVersionKey = "s/_latest" // NB: latestVersionKey key must be lexically smaller than StorePrefixTpl + pruneHeightKey = "s/_prune_height" // NB: pruneHeightKey key must be lexically smaller than StorePrefixTpl + tombstoneVal = "TOMBSTONE" ) -var _ storage.Database = (*Database)(nil) +var ( + _ storage.Database = (*Database)(nil) + _ store.UpgradableDatabase = (*Database)(nil) +) type Database struct { storage *pebble.DB @@ -252,7 +260,11 @@ func (db *Database) Prune(version uint64) error { prevKey = keyBz prevKeyVersion = keyVersion prevKeyPrefixed = prefixedKey - prevPrefixedVal = slices.Clone(itr.Value()) + value, err := itr.ValueAndErr() + if err != nil { + return err + } + prevPrefixedVal = slices.Clone(value) itr.Next() } @@ -264,6 +276,10 @@ func (db *Database) Prune(version uint64) error { } } + if err := db.deleteRemovedStoreKeys(version); err != nil { + return err + } + return db.setPruneHeight(version) } @@ -315,12 +331,25 @@ func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end return newPebbleDBIterator(itr, storePrefix(storeKey), start, end, version, db.earliestVersion, true), nil } +func (db *Database) PruneStoreKeys(storeKeys []string, version uint64) error { + batch := db.storage.NewBatch() + defer batch.Close() + + for _, storeKey := range storeKeys { + if err := batch.Set([]byte(fmt.Sprintf("%s%s", encoding.BuildPrefixWithVersion(removedStoreKeyPrefix, version), storeKey)), []byte{}, nil); err != nil { + return err + } + } + + return batch.Commit(&pebble.WriteOptions{Sync: db.sync}) +} + func storePrefix(storeKey []byte) []byte { - return append([]byte(StorePrefixTpl), storeKey...) + return []byte(fmt.Sprintf(StorePrefixTpl, storeKey)) } func prependStoreKey(storeKey, key []byte) []byte { - return append(storePrefix(storeKey), key...) + return []byte(fmt.Sprintf("%s%s", storePrefix(storeKey), key)) } func getPruneHeight(storage *pebble.DB) (uint64, error) { @@ -395,5 +424,80 @@ func getMVCCSlice(db *pebble.DB, storeKey, key []byte, version uint64) ([]byte, return nil, fmt.Errorf("key version too large: %d", keyVersion) } - return slices.Clone(itr.Value()), nil + value, err := itr.ValueAndErr() + return slices.Clone(value), err +} + +func (db *Database) deleteRemovedStoreKeys(version uint64) error { + batch := db.storage.NewBatch() + defer batch.Close() + + end := encoding.BuildPrefixWithVersion(removedStoreKeyPrefix, version+1) + storeKeyIter, err := db.storage.NewIter(&pebble.IterOptions{LowerBound: []byte(removedStoreKeyPrefix), UpperBound: end}) + if err != nil { + return err + } + defer storeKeyIter.Close() + + storeKeys := make(map[string]uint64) + prefixLen := len(end) + for storeKeyIter.First(); storeKeyIter.Valid(); storeKeyIter.Next() { + verBz := storeKeyIter.Key()[len(removedStoreKeyPrefix):prefixLen] + v, err := decodeUint64Ascending(verBz) + if err != nil { + return err + } + storeKey := string(storeKeyIter.Key()[prefixLen:]) + if ev, ok := storeKeys[storeKey]; ok { + if ev < v { + storeKeys[storeKey] = v + } + } else { + storeKeys[storeKey] = v + } + if err := batch.Delete(storeKeyIter.Key(), nil); err != nil { + return err + } + } + + for storeKey, v := range storeKeys { + if err := func() error { + storeKey := []byte(storeKey) + itr, err := db.storage.NewIter(&pebble.IterOptions{LowerBound: storePrefix(storeKey), UpperBound: storePrefix(util.CopyIncr(storeKey))}) + if err != nil { + return err + } + defer itr.Close() + + for itr.First(); itr.Valid(); itr.Next() { + itrKey := itr.Key() + _, verBz, ok := SplitMVCCKey(itrKey) + if !ok { + return fmt.Errorf("invalid PebbleDB MVCC key: %s", itrKey) + } + keyVersion, err := decodeUint64Ascending(verBz) + if err != nil { + return err + } + if keyVersion > v { + // skip keys that are newer than the version + continue + } + if err := batch.Delete(itr.Key(), nil); err != nil { + return err + } + if batch.Len() >= batchBufferSize { + if err := batch.Commit(&pebble.WriteOptions{Sync: db.sync}); err != nil { + return err + } + batch.Reset() + } + } + return nil + }(); err != nil { + return err + } + } + + return batch.Commit(&pebble.WriteOptions{Sync: true}) } diff --git a/store/v2/storage/rocksdb/db.go b/store/v2/storage/rocksdb/db.go index 480aeb2cff2f..afac4cc9ff22 100644 --- a/store/v2/storage/rocksdb/db.go +++ b/store/v2/storage/rocksdb/db.go @@ -26,7 +26,8 @@ const ( ) var ( - _ storage.Database = (*Database)(nil) + _ storage.Database = (*Database)(nil) + _ store.UpgradableDatabase = (*Database)(nil) defaultWriteOpts = grocksdb.NewDefaultWriteOptions() defaultReadOpts = grocksdb.NewDefaultReadOptions() @@ -196,6 +197,12 @@ func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end return newRocksDBIterator(itr, prefix, start, end, true), nil } +// PruneStoreKeys will do nothing for RocksDB, it will be pruned by compaction +// when the version is pruned +func (db *Database) PruneStoreKeys(_ []string, _ uint64) error { + return nil +} + // newTSReadOptions returns ReadOptions used in the RocksDB column family read. func newTSReadOptions(version uint64) *grocksdb.ReadOptions { var ts [TimestampSize]byte @@ -208,11 +215,11 @@ func newTSReadOptions(version uint64) *grocksdb.ReadOptions { } func storePrefix(storeKey []byte) []byte { - return append([]byte(StorePrefixTpl), storeKey...) + return []byte(fmt.Sprintf(StorePrefixTpl, storeKey)) } func prependStoreKey(storeKey, key []byte) []byte { - return append(storePrefix(storeKey), key...) + return []byte(fmt.Sprintf("%s%s", storePrefix(storeKey), key)) } // copyAndFreeSlice will copy a given RocksDB slice and free it. If the slice does diff --git a/store/v2/storage/rocksdb/db_test.go b/store/v2/storage/rocksdb/db_test.go index b807f07259d7..a77afbb3a8fd 100644 --- a/store/v2/storage/rocksdb/db_test.go +++ b/store/v2/storage/rocksdb/db_test.go @@ -23,6 +23,7 @@ func TestStorageTestSuite(t *testing.T) { return storage.NewStorageStore(db, coretesting.NewNopLogger()), err }, EmptyBatchSize: 12, + SkipTests: []string{"TestUpgradable_Prune"}, } suite.Run(t, s) } diff --git a/store/v2/storage/rocksdb/iterator.go b/store/v2/storage/rocksdb/iterator.go index 7427e90406f7..9a09dc92c5c8 100644 --- a/store/v2/storage/rocksdb/iterator.go +++ b/store/v2/storage/rocksdb/iterator.go @@ -124,6 +124,10 @@ func (itr *iterator) Value() []byte { return copyAndFreeSlice(itr.source.Value()) } +func (itr *iterator) Timestamp() []byte { + return itr.source.Timestamp().Data() +} + func (itr iterator) Next() { if itr.invalid { return diff --git a/store/v2/storage/sqlite/db.go b/store/v2/storage/sqlite/db.go index 1ee52583aec4..38750a0ac9a5 100644 --- a/store/v2/storage/sqlite/db.go +++ b/store/v2/storage/sqlite/db.go @@ -17,11 +17,12 @@ import ( ) const ( - driverName = "sqlite3" - dbName = "ss.db?cache=shared&mode=rwc&_journal_mode=WAL" - reservedStoreKey = "_RESERVED_" - keyLatestHeight = "latest_height" - keyPruneHeight = "prune_height" + driverName = "sqlite3" + dbName = "ss.db?cache=shared&mode=rwc&_journal_mode=WAL" + reservedStoreKey = "_RESERVED_" + keyLatestHeight = "latest_height" + keyPruneHeight = "prune_height" + valueRemovedStore = "removed_store" reservedUpsertStmt = ` INSERT INTO state_storage(store_key, key, value, version) @@ -43,7 +44,10 @@ const ( ` ) -var _ storage.Database = (*Database)(nil) +var ( + _ storage.Database = (*Database)(nil) + _ store.UpgradableDatabase = (*Database)(nil) +) type Database struct { storage *sql.DB @@ -186,7 +190,13 @@ func (db *Database) Prune(version uint64) error { if err != nil { return fmt.Errorf("failed to create SQL transaction: %w", err) } + defer func() { + if err != nil { + err = tx.Rollback() + } + }() + // prune all keys of old versions pruneStmt := `DELETE FROM state_storage WHERE version < ( SELECT max(version) FROM state_storage t2 WHERE @@ -195,15 +205,34 @@ func (db *Database) Prune(version uint64) error { t2.version <= ? ) AND store_key != ?; ` + if _, err := tx.Exec(pruneStmt, version, reservedStoreKey); err != nil { + return fmt.Errorf("failed to exec SQL statement: %w", err) + } - _, err = tx.Exec(pruneStmt, version, reservedStoreKey) - if err != nil { + // prune removed stores + pruneRemovedStoreKeysStmt := `DELETE FROM state_storage AS s + WHERE EXISTS ( + SELECT 1 FROM + ( + SELECT key, MAX(version) AS max_version + FROM state_storage + WHERE store_key = ? AND value = ? AND version <= ? + GROUP BY key + ) AS t + WHERE s.store_key = t.key AND s.version <= t.max_version LIMIT 1 + ); + ` + if _, err := tx.Exec(pruneRemovedStoreKeysStmt, reservedStoreKey, valueRemovedStore, version, version); err != nil { + return fmt.Errorf("failed to exec SQL statement: %w", err) + } + + // delete the removedKeys + if _, err := tx.Exec("DELETE FROM state_storage WHERE store_key = ? AND value = ? AND version <= ?", reservedStoreKey, valueRemovedStore, version); err != nil { return fmt.Errorf("failed to exec SQL statement: %w", err) } // set the prune height so we can return for queries below this height - _, err = tx.Exec(reservedUpsertStmt, reservedStoreKey, keyPruneHeight, version, 0, version) - if err != nil { + if _, err := tx.Exec(reservedUpsertStmt, reservedStoreKey, keyPruneHeight, version, 0, version); err != nil { return fmt.Errorf("failed to exec SQL statement: %w", err) } @@ -212,7 +241,6 @@ func (db *Database) Prune(version uint64) error { } db.earliestVersion = version + 1 - return nil } @@ -240,6 +268,29 @@ func (db *Database) ReverseIterator(storeKey []byte, version uint64, start, end return newIterator(db, storeKey, version, start, end, true) } +func (db *Database) PruneStoreKeys(storeKeys []string, version uint64) (err error) { + tx, err := db.storage.Begin() + if err != nil { + return fmt.Errorf("failed to create SQL transaction: %w", err) + } + defer func() { + if err != nil { + err = tx.Rollback() + } + }() + + // flush removed store keys + flushRemovedStoreKeyStmt := `INSERT INTO state_storage(store_key, key, value, version) + VALUES (?, ?, ?, ?)` + for _, storeKey := range storeKeys { + if _, err := tx.Exec(flushRemovedStoreKeyStmt, reservedStoreKey, []byte(storeKey), valueRemovedStore, version); err != nil { + return fmt.Errorf("failed to exec SQL statement: %w", err) + } + } + + return tx.Commit() +} + func (db *Database) PrintRowsDebug() { stmt, err := db.storage.Prepare("SELECT store_key, key, value, version, tombstone FROM state_storage") if err != nil { diff --git a/store/v2/storage/storage_test_suite.go b/store/v2/storage/storage_test_suite.go index 475c529b624f..2bc745221d75 100644 --- a/store/v2/storage/storage_test_suite.go +++ b/store/v2/storage/storage_test_suite.go @@ -411,11 +411,11 @@ func (s *StorageTestSuite) TestDatabaseIterator_SkipVersion() { defer db.Close() - DBApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) - DBApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value000")}) - DBApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value000")}) - DBApplyChangeset(s.T(), db, 58833605, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value004")}) - DBApplyChangeset(s.T(), db, 58833606, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value006")}) + dbApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) + dbApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value000")}) + dbApplyChangeset(s.T(), db, 58827506, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value000")}) + dbApplyChangeset(s.T(), db, 58833605, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value004")}) + dbApplyChangeset(s.T(), db, 58833606, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value006")}) itr, err := db.Iterator(storeKey1Bytes, 58831525, []byte("key"), nil) s.Require().NoError(err) @@ -435,15 +435,15 @@ func (s *StorageTestSuite) TestDatabaseIterator_ForwardIteration() { s.Require().NoError(err) defer db.Close() - DBApplyChangeset(s.T(), db, 8, storeKey1, [][]byte{[]byte("keyA")}, [][]byte{[]byte("value001")}) - DBApplyChangeset(s.T(), db, 9, storeKey1, [][]byte{[]byte("keyB")}, [][]byte{[]byte("value002")}) - DBApplyChangeset(s.T(), db, 10, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) - DBApplyChangeset(s.T(), db, 11, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value004")}) + dbApplyChangeset(s.T(), db, 8, storeKey1, [][]byte{[]byte("keyA")}, [][]byte{[]byte("value001")}) + dbApplyChangeset(s.T(), db, 9, storeKey1, [][]byte{[]byte("keyB")}, [][]byte{[]byte("value002")}) + dbApplyChangeset(s.T(), db, 10, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) + dbApplyChangeset(s.T(), db, 11, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value004")}) - DBApplyChangeset(s.T(), db, 2, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value007")}) - DBApplyChangeset(s.T(), db, 3, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value008")}) - DBApplyChangeset(s.T(), db, 4, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) - DBApplyChangeset(s.T(), db, 5, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) + dbApplyChangeset(s.T(), db, 2, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value007")}) + dbApplyChangeset(s.T(), db, 3, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value008")}) + dbApplyChangeset(s.T(), db, 4, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) + dbApplyChangeset(s.T(), db, 5, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) itr, err := db.Iterator(storeKey1Bytes, 6, nil, []byte("keyZ")) s.Require().NoError(err) @@ -463,14 +463,14 @@ func (s *StorageTestSuite) TestDatabaseIterator_ForwardIterationHigher() { s.Require().NoError(err) defer db.Close() - DBApplyChangeset(s.T(), db, 9, storeKey1, [][]byte{[]byte("keyB")}, [][]byte{[]byte("value002")}) - DBApplyChangeset(s.T(), db, 10, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) - DBApplyChangeset(s.T(), db, 11, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value004")}) + dbApplyChangeset(s.T(), db, 9, storeKey1, [][]byte{[]byte("keyB")}, [][]byte{[]byte("value002")}) + dbApplyChangeset(s.T(), db, 10, storeKey1, [][]byte{[]byte("keyC")}, [][]byte{[]byte("value003")}) + dbApplyChangeset(s.T(), db, 11, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value004")}) - DBApplyChangeset(s.T(), db, 12, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value007")}) - DBApplyChangeset(s.T(), db, 13, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value008")}) - DBApplyChangeset(s.T(), db, 14, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) - DBApplyChangeset(s.T(), db, 15, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) + dbApplyChangeset(s.T(), db, 12, storeKey1, [][]byte{[]byte("keyD")}, [][]byte{[]byte("value007")}) + dbApplyChangeset(s.T(), db, 13, storeKey1, [][]byte{[]byte("keyE")}, [][]byte{[]byte("value008")}) + dbApplyChangeset(s.T(), db, 14, storeKey1, [][]byte{[]byte("keyF")}, [][]byte{[]byte("value009")}) + dbApplyChangeset(s.T(), db, 15, storeKey1, [][]byte{[]byte("keyH")}, [][]byte{[]byte("value010")}) itr, err := db.Iterator(storeKey1Bytes, 6, nil, []byte("keyZ")) s.Require().NoError(err) @@ -640,7 +640,154 @@ func (s *StorageTestSuite) TestDatabase_Prune_KeepRecent() { s.Require().Equal([]byte("val200"), bz) } -func DBApplyChangeset( +func (s *StorageTestSuite) TestUpgradable() { + ss, err := s.NewDB(s.T().TempDir()) + s.Require().NoError(err) + defer ss.Close() + + // Ensure the database is upgradable. + if _, ok := ss.db.(store.UpgradableDatabase); !ok { + s.T().Skip("database is not upgradable") + } + + storeKeys := []string{"store1", "store2", "store3"} + uptoVersion := uint64(50) + keyCount := 10 + for _, storeKey := range storeKeys { + for v := uint64(1); v <= uptoVersion; v++ { + keys := make([][]byte, keyCount) + vals := make([][]byte, keyCount) + for i := 0; i < keyCount; i++ { + keys[i] = []byte(fmt.Sprintf("key%03d", i)) + vals[i] = []byte(fmt.Sprintf("val%03d-%03d", i, v)) + } + dbApplyChangeset(s.T(), ss, v, storeKey, keys, vals) + } + } + + // prune storekeys (`store2`, `store3`) + removedStoreKeys := []string{storeKeys[1], storeKeys[2]} + err = ss.PruneStoreKeys(removedStoreKeys, uptoVersion) + s.Require().NoError(err) + // should be able to query before Prune for removed storeKeys + for _, storeKey := range removedStoreKeys { + for v := uint64(1); v <= uptoVersion; v++ { + for i := 0; i < keyCount; i++ { + bz, err := ss.Get([]byte(storeKey), v, []byte(fmt.Sprintf("key%03d", i))) + s.Require().NoError(err) + s.Require().Equal([]byte(fmt.Sprintf("val%03d-%03d", i, v)), bz) + } + } + } + s.Require().NoError(ss.Prune(uptoVersion)) + // should not be able to query after Prune + // skip the test of RocksDB + if !slices.Contains(s.SkipTests, "TestUpgradable_Prune") { + for _, storeKey := range removedStoreKeys { + // it will return error ErrVersionPruned + for v := uint64(1); v <= uptoVersion; v++ { + for i := 0; i < keyCount; i++ { + _, err := ss.Get([]byte(storeKey), v, []byte(fmt.Sprintf("key%03d", i))) + s.Require().Error(err) + } + } + v := uptoVersion + 1 + for i := 0; i < keyCount; i++ { + val, err := ss.Get([]byte(storeKey), v, []byte(fmt.Sprintf("key%03d", i))) + s.Require().NoError(err) + s.Require().Nil(val) + } + } + } +} + +func (s *StorageTestSuite) TestRemovingOldStoreKey() { + ss, err := s.NewDB(s.T().TempDir()) + s.Require().NoError(err) + defer ss.Close() + + // Ensure the database is upgradable. + if _, ok := ss.db.(store.UpgradableDatabase); !ok { + s.T().Skip("database is not upgradable") + } + + storeKeys := []string{"store1", "store2", "store3"} + uptoVersion := uint64(50) + keyCount := 10 + for _, storeKey := range storeKeys { + for v := uint64(1); v <= uptoVersion; v++ { + keys := make([][]byte, keyCount) + vals := make([][]byte, keyCount) + for i := 0; i < keyCount; i++ { + keys[i] = []byte(fmt.Sprintf("key%03d-%03d", i, v)) + vals[i] = []byte(fmt.Sprintf("val%03d-%03d", i, v)) + } + dbApplyChangeset(s.T(), ss, v, storeKey, keys, vals) + } + } + + // remove `store1` and `store3` + removedStoreKeys := []string{storeKeys[0], storeKeys[2]} + err = ss.PruneStoreKeys(removedStoreKeys, uptoVersion) + s.Require().NoError(err) + // should be able to query before Prune for removed storeKeys + for _, storeKey := range removedStoreKeys { + for v := uint64(1); v <= uptoVersion; v++ { + for i := 0; i < keyCount; i++ { + bz, err := ss.Get([]byte(storeKey), v, []byte(fmt.Sprintf("key%03d-%03d", i, v))) + s.Require().NoError(err) + s.Require().Equal([]byte(fmt.Sprintf("val%03d-%03d", i, v)), bz) + } + } + } + // add `store1` back + newStoreKeys := []string{storeKeys[0], storeKeys[1]} + newVersion := uptoVersion + 10 + for _, storeKey := range newStoreKeys { + for v := uptoVersion + 1; v <= newVersion; v++ { + keys := make([][]byte, keyCount) + vals := make([][]byte, keyCount) + for i := 0; i < keyCount; i++ { + keys[i] = []byte(fmt.Sprintf("key%03d-%03d", i, v)) + vals[i] = []byte(fmt.Sprintf("val%03d-%03d", i, v)) + } + dbApplyChangeset(s.T(), ss, v, storeKey, keys, vals) + } + } + + s.Require().NoError(ss.Prune(newVersion)) + // skip the test of RocksDB + if !slices.Contains(s.SkipTests, "TestUpgradable_Prune") { + for _, storeKey := range removedStoreKeys { + queryVersion := newVersion + 1 + // should not be able to query after Prune during 1 ~ uptoVersion + for v := uint64(1); v <= uptoVersion; v++ { + for i := 0; i < keyCount; i++ { + val, err := ss.Get([]byte(storeKey), queryVersion, []byte(fmt.Sprintf("key%03d", i))) + s.Require().NoError(err) + s.Require().Nil(val) + } + } + // should be able to query after Prune during uptoVersion + 1 ~ newVersion + // for `store1` added back + for v := uptoVersion + 1; v <= newVersion; v++ { + for i := 0; i < keyCount; i++ { + val, err := ss.Get([]byte(storeKey), queryVersion, []byte(fmt.Sprintf("key%03d-%03d", i, v))) + s.Require().NoError(err) + if storeKey == storeKeys[0] { + // `store1` is added back + s.Require().Equal([]byte(fmt.Sprintf("val%03d-%03d", i, v)), val) + } else { + // `store3` is removed + s.Require().Nil(val) + } + } + } + } + } +} + +func dbApplyChangeset( t *testing.T, db store.VersionedDatabase, version uint64, diff --git a/store/v2/storage/store.go b/store/v2/storage/store.go index 25381ee18582..9ea839562847 100644 --- a/store/v2/storage/store.go +++ b/store/v2/storage/store.go @@ -1,6 +1,7 @@ package storage import ( + "errors" "fmt" "cosmossdk.io/core/log" @@ -18,6 +19,7 @@ var ( _ store.VersionedDatabase = (*StorageStore)(nil) _ snapshots.StorageSnapshotter = (*StorageStore)(nil) _ store.Pruner = (*StorageStore)(nil) + _ store.UpgradableDatabase = (*StorageStore)(nil) ) // StorageStore is a wrapper around the store.VersionedDatabase interface. @@ -137,6 +139,17 @@ func (ss *StorageStore) Restore(version uint64, chStorage <-chan *corestore.Stat return nil } +// PruneStoreKeys prunes the store keys which implements the store.UpgradableDatabase +// interface. +func (ss *StorageStore) PruneStoreKeys(storeKeys []string, version uint64) error { + gdb, ok := ss.db.(store.UpgradableDatabase) + if !ok { + return errors.New("db does not implement UpgradableDatabase interface") + } + + return gdb.PruneStoreKeys(storeKeys, version) +} + // Close closes the store. func (ss *StorageStore) Close() error { return ss.db.Close() diff --git a/store/v2/store.go b/store/v2/store.go index 71a3cc48bcad..fee3ad39dbf2 100644 --- a/store/v2/store.go +++ b/store/v2/store.go @@ -72,16 +72,13 @@ type RootStore interface { io.Closer } -// UpgradeableRootStore extends the RootStore interface to support loading versions -// with upgrades. -type UpgradeableRootStore interface { - RootStore - +// UpgradeableStore defines the interface for upgrading store keys. +type UpgradeableStore interface { // LoadVersionAndUpgrade behaves identically to LoadVersion except it also // accepts a StoreUpgrades object that defines a series of transformations to // apply to store keys (if any). // - // Note, handling StoreUpgrades is optional depending on the underlying RootStore + // Note, handling StoreUpgrades is optional depending on the underlying store // implementation. LoadVersionAndUpgrade(version uint64, upgrades *corestore.StoreUpgrades) error }