forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream changes from v0.46.x (cosmos#40)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Robert Zaremba <[email protected]> Co-authored-by: Marko <[email protected]> Co-authored-by: Julien Robert <[email protected]> Co-authored-by: atheeshp <[email protected]> Co-authored-by: yihuang <[email protected]> Co-authored-by: Daniel Wedul <[email protected]> Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: Javier Su <[email protected]> Co-authored-by: khanh-notional <[email protected]> Co-authored-by: mmsqe <[email protected]> Co-authored-by: Jeancarlo Barrios <[email protected]> Co-authored-by: Facundo Medica <[email protected]>
- Loading branch information
1 parent
a23e71c
commit e925a63
Showing
61 changed files
with
2,417 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ dist | |
tools-stamp | ||
buf-stamp | ||
artifacts | ||
tools/ | ||
|
||
# Data - ideally these don't exist | ||
baseapp/data/* | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
# Cosmos SDK v0.46.11 Release Notes | ||
# Cosmos SDK v0.46.13 Release Notes | ||
|
||
This release includes the migration to [CometBFT v0.34.27](https://github.com/cometbft/cometbft/blob/v0.34.27/CHANGELOG.md#v03427). | ||
This migration should be not be breaking for chains. | ||
From `v0.46.11`+, the following replace is *mandatory* in the `go.mod` of your application: | ||
This release includes few improvements and bug fixes. | ||
Notably, the [barberry security fix](https://forum.cosmos.network/t/cosmos-sdk-security-advisory-barberry/10825). All chains using Cosmos SDK v0.46.0 and above must upgrade to `v0.46.13` **immediately**. A chain is safe as soon as **33%+1** of the voting power has upgraded. Coordinate with your validators to upgrade as soon as possible. | ||
|
||
Additionally, it includes new commands for snapshots management and bootstrapping from a local snapshot (add `snapshot.Cmd(appCreator)` to the chain root command for using it). | ||
|
||
Did you know Cosmos SDK Twilight (a.k.a v0.47) has been released? Upgrade easily by reading the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.47.x/UPGRADING.md#v047x). | ||
|
||
Ensure you have the following replaces in the `go.mod` of your application: | ||
|
||
```go | ||
// use cometbft | ||
replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 | ||
replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 | ||
// replace broken goleveldb | ||
replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 | ||
``` | ||
|
||
Additionally, the SDK sets its minimum version to Go 1.19. This is not because the SDK uses new Go 1.19 functionalities, but to signal that we recommend chains to upgrade to Go 1.19 — Go 1.18 is not supported by the Go Team anymore. | ||
Note, that SDK recommends chains to use the same Go version across all of their network. | ||
We recommend, as well, chains to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. | ||
|
||
Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md) for an exhaustive list of changes. | ||
|
||
**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.10...v0.46.11 | ||
**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.46.12...v0.46.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package baseapp | ||
|
||
import "context" | ||
|
||
// CircuitBreaker is an interface that defines the methods for a circuit breaker. | ||
type CircuitBreaker interface { | ||
IsAllowed(ctx context.Context, typeURL string) (bool, error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package client_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestValidatePromptNotEmpty(t *testing.T) { | ||
require := require.New(t) | ||
|
||
require.NoError(client.ValidatePromptNotEmpty("foo")) | ||
require.ErrorContains(client.ValidatePromptNotEmpty(""), "input cannot be empty") | ||
} | ||
|
||
func TestValidatePromptURL(t *testing.T) { | ||
require := require.New(t) | ||
|
||
require.NoError(client.ValidatePromptURL("https://example.com")) | ||
require.ErrorContains(client.ValidatePromptURL("foo"), "invalid URL") | ||
} | ||
|
||
func TestValidatePromptAddress(t *testing.T) { | ||
require := require.New(t) | ||
|
||
require.NoError(client.ValidatePromptAddress("cosmos1huydeevpz37sd9snkgul6070mstupukw00xkw9")) | ||
require.NoError(client.ValidatePromptAddress("cosmosvaloper1sjllsnramtg3ewxqwwrwjxfgc4n4ef9u2lcnj0")) | ||
require.NoError(client.ValidatePromptAddress("cosmosvalcons1ntk8eualewuprz0gamh8hnvcem2nrcdsgz563h")) | ||
require.ErrorContains(client.ValidatePromptAddress("foo"), "invalid address") | ||
} | ||
|
||
func TestValidatePromptCoins(t *testing.T) { | ||
require := require.New(t) | ||
|
||
require.NoError(client.ValidatePromptCoins("100stake")) | ||
require.ErrorContains(client.ValidatePromptCoins("foo"), "invalid coins") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package snapshot | ||
|
||
import ( | ||
servertypes "github.com/cosmos/cosmos-sdk/server/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// Cmd returns the snapshots group command | ||
func Cmd(appCreator servertypes.AppCreator) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "snapshots", | ||
Short: "Manage local snapshots", | ||
} | ||
cmd.AddCommand( | ||
ListSnapshotsCmd, | ||
RestoreSnapshotCmd(appCreator), | ||
ExportSnapshotCmd(appCreator), | ||
DumpArchiveCmd(), | ||
LoadArchiveCmd(), | ||
DeleteSnapshotCmd(), | ||
) | ||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package snapshot | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/cosmos/cosmos-sdk/server" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func DeleteSnapshotCmd() *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "delete <height> <format>", | ||
Short: "Delete a local snapshot", | ||
Args: cobra.ExactArgs(2), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
ctx := server.GetServerContextFromCmd(cmd) | ||
|
||
height, err := strconv.ParseUint(args[0], 10, 64) | ||
if err != nil { | ||
return err | ||
} | ||
format, err := strconv.ParseUint(args[1], 10, 32) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
snapshotStore, err := server.GetSnapshotStore(ctx.Viper) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return snapshotStore.Delete(height, uint32(format)) | ||
}, | ||
} | ||
} |
Oops, something went wrong.