Skip to content

Commit

Permalink
Merge branch 'master' into ty/9407-rename_keys_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 authored Jul 19, 2021
2 parents 4edd229 + 48cb9ea commit c21bd5f
Show file tree
Hide file tree
Showing 41 changed files with 166 additions and 2,340 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) `types/rest` package moved to `testutil/rest`.
* [\#9432](https://github.com/cosmos/cosmos-sdk/pull/9432) `ConsensusParamsKeyTable` moved from `params/keeper` to `params/types`
* [\#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to `sdkerrors.QueryResult` when enabled
* [\#9650](https://github.com/cosmos/cosmos-sdk/pull/9650) Removed deprecated message handler implementation from the SDK modules.

### Client Breaking Changes

Expand All @@ -82,6 +83,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/genutil) [\#9574](https://github.com/cosmos/cosmos-sdk/pull/9575) Actually use the `gentx` client tx flags (like `--keyring-dir`)
* (x/distribution) [\#9599](https://github.com/cosmos/cosmos-sdk/pull/9599) Withdraw rewards event now includes a value attribute even if there are 0 rewards (due to situations like 100% commission).
* (x/genutil) [\#9638](https://github.com/cosmos/cosmos-sdk/pull/9638) Added missing validator key save when recovering from mnemonic
* (server) [#9704](https://github.com/cosmos/cosmos-sdk/pull/9704) Start GRPCWebServer in goroutine, avoid blocking other services from starting.

## [v0.43.0-rc0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.43.0-rc0) - 2021-06-25

Expand Down Expand Up @@ -208,7 +210,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/params) [\#9481](https://github.com/cosmos/cosmos-sdk/issues/9481) Speedup simulator for parameter change proposals.
* (x/staking) [\#9423](https://github.com/cosmos/cosmos-sdk/pull/9423) Staking delegations now returns empty list instead of rpc error when no records found.
* (x/auth) [\#9553](https://github.com/cosmos/cosmos-sdk/pull/9553) The `--multisig` flag now accepts both a name and address.
* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces.
* [\#8549](https://github.com/cosmos/cosmos-sdk/pull/8549) Make gRPC requests go through tendermint Query
* [\#8093](https://github.com/cosmos/cosmos-sdk/pull/8093) Limit usage of context.background.
* [\#8460](https://github.com/cosmos/cosmos-sdk/pull/8460) Ensure b.ReportAllocs() in all the benchmarks
Expand All @@ -229,7 +230,6 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#9480](https://github.com/cosmos/cosmos-sdk/pull/9480) Fix added keys when using `--dry-run`.
* (types) [\#9511](https://github.com/cosmos/cosmos-sdk/pull/9511) Change `maxBitLen` of `sdk.Int` and `sdk.Dec` to handle max ERC20 value.
* [\#9454](https://github.com/cosmos/cosmos-sdk/pull/9454) Fix testnet command with --node-dir-prefix accepts `-` and change `node-dir-prefix token` to `testtoken`.
* (keyring) [\#9562](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet.
* (keyring) [\#9583](https://github.com/cosmos/cosmos-sdk/pull/9583) Fix correct population of legacy `Vote.Option` field for votes with 1 VoteOption of weight 1.
* (x/distinction) [\#8918](https://github.com/cosmos/cosmos-sdk/pull/8918) Fix module's parameters validation.
* (x/gov/types) [\#8586](https://github.com/cosmos/cosmos-sdk/pull/8586) Fix bug caused by NewProposal that unnecessarily creates a Proposal object that’s discarded on any error.
Expand All @@ -245,6 +245,20 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (grpc) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `tx` field in `SimulateRequest` has been deprecated, prefer to pass `tx_bytes` instead.
* (sdk types) [\#9498](https://github.com/cosmos/cosmos-sdk/pull/9498) `clientContext.JSONCodec` will be removed in the next version. use `clientContext.Codec` instead.

## [v0.42.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.7) - 2021-07-09

### Improvements

* (baseapp) [\#9578](https://github.com/cosmos/cosmos-sdk/pull/9578) Return `Baseapp`'s `trace` value for logging error stack traces.

### Bug Fixes

* (x/ibc) [\#9640](https://github.com/cosmos/cosmos-sdk/pull/9640) Fix IBC Transfer Ack Success event as it was initially emitting opposite value.
* [\#9645](https://github.com/cosmos/cosmos-sdk/pull/9645) Use correct Prometheus format for metric labels.
* [\#9299](https://github.com/cosmos/cosmos-sdk/pull/9299) Fix `[appd] keys parse cosmos1...` freezing.
* (keyring) [\#9563](https://github.com/cosmos/cosmos-sdk/pull/9563) fix keyring kwallet backend when using with empty wallet.
* (x/capability) [\#9392](https://github.com/cosmos/cosmos-sdk/pull/9392) initialization fix, which fixes the consensus error when using statesync.

## [v0.42.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.42.6) - 2021-06-18

### Improvements
Expand Down
22 changes: 16 additions & 6 deletions server/grpc/grpc_web.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package grpc

import (
"fmt"
"net/http"
"time"

"github.com/improbable-eng/grpc-web/go/grpcweb"
"google.golang.org/grpc"

"github.com/cosmos/cosmos-sdk/server/config"
"github.com/cosmos/cosmos-sdk/server/types"
)

// StartGRPCWeb starts a gRPC-Web server on the given address.
Expand All @@ -21,15 +24,22 @@ func StartGRPCWeb(grpcSrv *grpc.Server, config config.Config) (*http.Server, err
}

wrappedServer := grpcweb.WrapServer(grpcSrv, options...)
handler := func(resp http.ResponseWriter, req *http.Request) {
wrappedServer.ServeHTTP(resp, req)
}
grpcWebSrv := &http.Server{
Addr: config.GRPCWeb.Address,
Handler: http.HandlerFunc(handler),
Handler: wrappedServer,
}
if err := grpcWebSrv.ListenAndServe(); err != nil {

errCh := make(chan error)
go func() {
if err := grpcWebSrv.ListenAndServe(); err != nil {
errCh <- fmt.Errorf("[grpc] failed to serve: %w", err)
}
}()

select {
case err := <-errCh:
return nil, err
case <-time.After(types.ServerStartTime): // assume server started successfully
return grpcWebSrv, nil
}
return grpcWebSrv, nil
}
2 changes: 1 addition & 1 deletion server/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func StartGRPCServer(clientCtx client.Context, app types.Application, address st
select {
case err := <-errCh:
return nil, err
case <-time.After(5 * time.Second): // assume server started successfully
case <-time.After(types.ServerStartTime): // assume server started successfully
return grpcSrv, nil
}
}
4 changes: 2 additions & 2 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
select {
case err := <-errCh:
return err
case <-time.After(5 * time.Second): // assume server started successfully
case <-time.After(types.ServerStartTime): // assume server started successfully
}
}

Expand Down Expand Up @@ -366,7 +366,7 @@ func startInProcess(ctx *Context, clientCtx client.Context, appCreator types.App
select {
case err := <-errCh:
return err
case <-time.After(5 * time.Second): // assume server started successfully
case <-time.After(types.ServerStartTime): // assume server started successfully
}
}

Expand Down
5 changes: 5 additions & 0 deletions server/types/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package types
import (
"encoding/json"
"io"
"time"

"github.com/gogo/protobuf/grpc"
"github.com/spf13/cobra"
Expand All @@ -16,6 +17,10 @@ import (
"github.com/cosmos/cosmos-sdk/server/config"
)

// ServerStartTime defines the time duration that the server need to stay running after startup
// for the startup be considered successful
const ServerStartTime = 5 * time.Second

type (
// AppOptions defines an interface that is passed into an application
// constructor, typically used to set BaseApp options that are either supplied
Expand Down
18 changes: 4 additions & 14 deletions testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/cosmos/cosmos-sdk/server/api"
servergrpc "github.com/cosmos/cosmos-sdk/server/grpc"
srvtypes "github.com/cosmos/cosmos-sdk/server/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/genutil"
Expand Down Expand Up @@ -90,7 +91,7 @@ func startInProcess(cfg Config, val *Validator) error {
select {
case err := <-errCh:
return err
case <-time.After(5 * time.Second): // assume server started successfully
case <-time.After(srvtypes.ServerStartTime): // assume server started successfully
}

val.api = apiSrv
Expand All @@ -105,21 +106,10 @@ func startInProcess(cfg Config, val *Validator) error {
val.grpc = grpcSrv

if val.AppConfig.GRPCWeb.Enable {
errCh1 := make(chan error)
go func() {
grpcWeb, err := servergrpc.StartGRPCWeb(grpcSrv, *val.AppConfig)
if err != nil {
errCh1 <- err
}

val.grpcWeb = grpcWeb
}()
select {
case err := <-errCh1:
val.grpcWeb, err = servergrpc.StartGRPCWeb(grpcSrv, *val.AppConfig)
if err != nil {
return err
case <-time.After(5 * time.Second): // assume server started successfully
}

}
}

Expand Down
6 changes: 4 additions & 2 deletions x/auth/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,10 @@ func (AppModule) Name() string {
// RegisterInvariants performs a no-op.
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the message routing key for the auth module.
func (AppModule) Route() sdk.Route { return sdk.Route{} }
// Deprecated: Route returns the message routing key for the auth module.
func (AppModule) Route() sdk.Route {
return sdk.Route{}
}

// QuerierRoute returns the auth module's querier route name.
func (AppModule) QuerierRoute() string {
Expand Down
26 changes: 0 additions & 26 deletions x/auth/vesting/handler.go

This file was deleted.

97 changes: 0 additions & 97 deletions x/auth/vesting/handler_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions x/auth/vesting/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func NewAppModule(ak keeper.AccountKeeper, bk types.BankKeeper) AppModule {
// RegisterInvariants performs a no-op; there are no invariants to enforce.
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the module's message router and handler.
// Deprecated: Route returns the module's message router and handler.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(types.RouterKey, NewHandler(am.accountKeeper, am.bankKeeper))
return sdk.Route{}
}

// QuerierRoute returns an empty string as the module contains no query
Expand Down
4 changes: 2 additions & 2 deletions x/authz/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ func (AppModule) Name() string {
// RegisterInvariants does nothing, there are no invariants to enforce
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}

// Route returns the message routing key for the staking module.
// Deprecated: Route returns the message routing key for the authz module.
func (am AppModule) Route() sdk.Route {
return sdk.NewRoute(authz.RouterKey, nil)
return sdk.Route{}
}

func (am AppModule) NewHandler() sdk.Handler {
Expand Down
30 changes: 0 additions & 30 deletions x/bank/handler.go

This file was deleted.

Loading

0 comments on commit c21bd5f

Please sign in to comment.