Skip to content

Commit

Permalink
Merge pull request #1784 from mesg-foundation/dev
Browse files Browse the repository at this point in the history
Release v0.21.0
  • Loading branch information
Nicolas Mahé authored Apr 19, 2020
2 parents de1889d + 81eeb6e commit e545e6c
Show file tree
Hide file tree
Showing 213 changed files with 9,542 additions and 9,407 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ schema1.svg
**/*.test
**/debug
**/node_modules
/docker-images
/test
/vendor
coverage.txt
Expand Down
12 changes: 2 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@ linters-settings:
misspell:
locale: US

issues:
exclude:
- "ineffective break statement. Did you mean to break out of the outer loop"

exclude-rules:
- path: ext/xvalidator/validator.go
linters:
- golint
text: "exported var Translator should have its own declaration"

linters:
disable-all: true
enable:
Expand All @@ -51,3 +41,5 @@ linters:
- unused
- varcheck
- whitespace
- depguard
- goconst
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Changelog

## [v0.21.0](https://github.com/mesg-foundation/engine/releases/tag/v0.21.0)

#### Breaking Changes

- ([#1737](https://github.com/mesg-foundation/engine/pull/1737)) Add support for any type of data to filter.
- ([#1739](https://github.com/mesg-foundation/engine/pull/1739)) Add reference system to filter.
- ([#1774](https://github.com/mesg-foundation/engine/pull/1774)) Remove deprecated gRPC API.
- ([#1783](https://github.com/mesg-foundation/engine/pull/1783)) Calculate the instance env hash with only the customized env.

#### Added

- ([#1737](https://github.com/mesg-foundation/engine/pull/1737)) Add support for any type of data to filter.
- ([#1739](https://github.com/mesg-foundation/engine/pull/1739)) Add reference system to filter.
- ([#1749](https://github.com/mesg-foundation/engine/pull/1749)) Add more validation on resources.
- ([#1758](https://github.com/mesg-foundation/engine/pull/1758)) Introduce a simple LCD client.
- ([#1759](https://github.com/mesg-foundation/engine/pull/1759)) add 2 more linters and remove useless exclusion.
- ([#1767](https://github.com/mesg-foundation/engine/pull/1767)) New Runner gRPC API.
- ([#1768](https://github.com/mesg-foundation/engine/pull/1768)) Add lcd endpoints and commands exists to runner and process.
- ([#1771](https://github.com/mesg-foundation/engine/pull/1771)) Add Orchestrator gRPC API.
- ([#1780](https://github.com/mesg-foundation/engine/pull/1780)) Add info to cosmos version on build.

#### Changed

- ([#1751](https://github.com/mesg-foundation/engine/pull/1751)) Replace gRPC by LCD as much as possible from e2e tests.
- ([#1754](https://github.com/mesg-foundation/engine/pull/1754)) Update lcd service hash endpoint to use a dedicated request structure.
- ([#1755](https://github.com/mesg-foundation/engine/pull/1755)) Update lcd process hash endpoint to use a dedicated request structure.
- ([#1756](https://github.com/mesg-foundation/engine/pull/1756)) Change gogoproto's customtype to casttype.
- ([#1757](https://github.com/mesg-foundation/engine/pull/1757)) Replace runner gRPC by LCD in e2e tests.
- ([#1761](https://github.com/mesg-foundation/engine/pull/1761)) Remove module suffix from lot of places.
- ([#1769](https://github.com/mesg-foundation/engine/pull/1769)) Update cosmos events.
- ([#1773](https://github.com/mesg-foundation/engine/pull/1773)) Use new event API in e2e tests.
- ([#1775](https://github.com/mesg-foundation/engine/pull/1775)) Simplify container.
- ([#1781](https://github.com/mesg-foundation/engine/pull/1781)) Switch back to default staking coins of cosmos.

#### Fixed

- ([#1746](https://github.com/mesg-foundation/engine/pull/1746)) Add "dive" validation to all repeated message in the proto files.
- ([#1762](https://github.com/mesg-foundation/engine/pull/1762)) Fix account sequence desynchronisation when error.

#### Dependencies

- ([#1752](https://github.com/mesg-foundation/engine/pull/1752)) Update to cosmos-sdk v0.38.2 and tendermint v0.33.2.

## [v0.20.0](https://github.com/mesg-foundation/engine/releases/tag/v0.20.0)

#### Added
Expand Down
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/supply"
"github.com/mesg-foundation/engine/protobuf/api"
"github.com/mesg-foundation/engine/protobuf/types"
"github.com/mesg-foundation/engine/x/execution"
"github.com/mesg-foundation/engine/x/instance"
Expand Down Expand Up @@ -85,7 +84,6 @@ func MakeCodec() *codec.Codec {
sdk.RegisterCodec(cdc)
codec.RegisterCrypto(cdc)
types.RegisterCodec(cdc)
api.RegisterCodec(cdc)

return cdc.Seal()
}
Expand Down
24 changes: 7 additions & 17 deletions cmd/mesg-cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/cosmos/cosmos-sdk/x/bank"
bankcmd "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
"github.com/mesg-foundation/engine/app"
"github.com/mesg-foundation/engine/config"
"github.com/mesg-foundation/engine/cosmos"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -32,22 +31,12 @@ func main() {
// Instantiate the codec for the command line application
cdc := app.MakeCodec()

// Read in the configuration file for the sdk
// TODO: change back when more refactor is done
// config := sdk.GetConfig()
// config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub)
// config.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub)
// config.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub)
// config.Seal()
cfg, err := config.New()
if err != nil {
panic(err)
}
cosmos.CustomizeConfig(cfg)
// init the config of cosmos
cosmos.InitConfig()

rootCmd := &cobra.Command{
Use: "mesg-cli",
Short: "Command line interface for interacting with appd",
Use: version.ClientName,
Short: "Command line interface for interacting with " + version.Name,
}

// Add --chain-id to persistent flags and mark it required
Expand All @@ -66,6 +55,8 @@ func main() {
lcd.ServeCommand(cdc, registerRoutes),
flags.LineBreak,
keys.Commands(),
signCommand(),
verifySignCommand(),
flags.LineBreak,
version.Cmd,
flags.NewCompletionCmd(rootCmd, true),
Expand All @@ -74,8 +65,7 @@ func main() {
// Add flags and prefix all env exposed with MESG
executor := cli.PrepareMainCmd(rootCmd, "MESG", app.DefaultCLIHome)

err = executor.Execute()
if err != nil {
if err := executor.Execute(); err != nil {
fmt.Printf("Failed executing CLI command: %s, exiting...\n", err)
os.Exit(1)
}
Expand Down
76 changes: 76 additions & 0 deletions cmd/mesg-cli/sign.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package main

import (
"bufio"
"encoding/base64"
"fmt"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)

func signCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "sign <name> <message>",
Short: "Sign the given message",
Args: cobra.MinimumNArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) != 2 {
return fmt.Errorf("must have exactly 2 args: name of the account to use and the message to sign")
}
buf := bufio.NewReader(cmd.InOrStdin())
kb, err := keys.NewKeyring(sdk.KeyringServiceName(), viper.GetString(flags.FlagKeyringBackend), viper.GetString(flags.FlagHome), buf)
if err != nil {
return err
}
signature, _, err := kb.Sign(args[0], "", []byte(args[1]))
if err != nil {
return err
}
fmt.Println(base64.StdEncoding.EncodeToString(signature))
return nil
},
}
cmd.PersistentFlags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend))
return cmd
}

func verifySignCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "verifySign <name> <message> <signature>",
Short: "Verify the signature of the given message",
Args: cobra.MinimumNArgs(3),
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) != 3 {
return fmt.Errorf("must have exactly 2 args: name of the account to use and the message used to sign, and the signature")
}
buf := bufio.NewReader(cmd.InOrStdin())
kb, err := keys.NewKeyring(sdk.KeyringServiceName(), viper.GetString(flags.FlagKeyringBackend), viper.GetString(flags.FlagHome), buf)
if err != nil {
return err
}
acc, err := kb.Get(args[0])
if err != nil {
return err
}
signature, err := base64.StdEncoding.DecodeString(args[2])
if err != nil {
return err
}
verify := acc.GetPubKey().VerifyBytes([]byte(args[1]), signature)
if verify {
fmt.Println("verification succeed")
} else {
fmt.Println("verification failed")
}
return nil
},
}
cmd.PersistentFlags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|test)")
viper.BindPFlag(flags.FlagKeyringBackend, cmd.Flags().Lookup(flags.FlagKeyringBackend))
return cmd
}
22 changes: 6 additions & 16 deletions cmd/mesg-daemon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/mesg-foundation/engine/app"
"github.com/mesg-foundation/engine/config"
"github.com/mesg-foundation/engine/cosmos"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -32,23 +32,14 @@ var invCheckPeriod uint
func main() {
cdc := app.MakeCodec()

// TODO: put back when more refactor is done
// config := sdk.GetConfig()
// config.SetBech32PrefixForAccount(sdk.Bech32PrefixAccAddr, sdk.Bech32PrefixAccPub)
// config.SetBech32PrefixForValidator(sdk.Bech32PrefixValAddr, sdk.Bech32PrefixValPub)
// config.SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub)
// config.Seal()
cfg, err := config.New()
if err != nil {
panic(err)
}
cosmos.CustomizeConfig(cfg)
// init the config of cosmos
cosmos.InitConfig()

ctx := server.NewDefaultContext()
cobra.EnableCommandSorting = false
rootCmd := &cobra.Command{
Use: "mesg-daemon",
Short: "app Daemon (server)",
Use: version.ServerName,
Short: "Engine Daemon (server)",
PersistentPreRunE: server.PersistentPreRunEFn(ctx),
}

Expand All @@ -72,8 +63,7 @@ func main() {
executor := cli.PrepareBaseCmd(rootCmd, "AU", app.DefaultNodeHome)
rootCmd.PersistentFlags().UintVar(&invCheckPeriod, flagInvCheckPeriod,
0, "Assert registered invariants every N blocks")
err = executor.Execute()
if err != nil {
if err := executor.Execute(); err != nil {
panic(err)
}
}
Expand Down
Loading

0 comments on commit e545e6c

Please sign in to comment.