Skip to content

Commit

Permalink
Port telemetry (cosmos#41)
Browse files Browse the repository at this point in the history
* v0.38.4-RC1

* add release date

* client/keys/parse: honor config changes (cosmos#6340)

`keys parse` uses the global configuration before
before client applications have had a chance to
apply their settings.

This change adds a `GetSealedConfig()` helper
that waits for the config to be sealed before
returning it.

Fixes: cosmos#5091
Origin: cosmos@4e328d7
Author: Adam Bozanich <[email protected]>
Reviewed-by: Alessio Treglia <[email protected]>

* Merge PR cosmos#6505: Backport v0.38.5: IAVL Bump (RC) & Pruning Refactor

* Fix cl

* Fix cl

* Merge PR cosmos#6551: Ethanfrey/fix trace flag

* Merge PR cosmos#6552: Add sender info to bank transfer event

* Merge PR cosmos#6581: v0.38.5-RC1

* Add release date

* deps: bump IAVL to 0.14

* cl++

* Merge PR cosmos#6618: backport 0.39.0 (launchpad): cherry pick cosmos#5839

* launchpad: bump tendermint to v0.33.6 (cosmos#6673)

* launchpad: bump tendermint to v0.33.6

* cha-cha-cha

* fix types.ChainAnteDecorators() panic (cosmos#5742) (cosmos#6669)

ChainAnteDecorators() panics when no arguments are supplied.
This change its behaviour and the function now returns a nil
AnteHandler in case no AnteDecorator instances are supplied.

Closes: cosmos#5741

* launchpad: register MsgFundCommunityPool to distribution codec (cosmos#6675)

Closes: cosmos#6210

* client: backport IBC additions (cosmos#6682)

* launchpad: backport cliCtx.QueryABCI

* add prove flag

* Save account for multi sending (cosmos#6674)

Include changes from PR cosmos#6283

Co-authored-by: Federico Kunze <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>

* baseapp: fix sender events accumulation (cosmos#6683)

closes: cosmos#6306
original PR: cosmos#6307

* run go mod tidy

* add changelog line re: issue that was not included in v0.38.5

* Fix changelog

* add release notes

* update CODEOWNERS as per STABLE_RELEASES.md

Launchpad's Stable Release Managers team's current composition as
approved by @okwme (ICF):

* @alessio
* @clevinson
* @ethanfrey

* Add milestone's URL

* Revert "update CODEOWNERS as per STABLE_RELEASES.md"

This reverts commit f384592.

* fix typo

* add example patch

* launchpad: backport account sequence stuck (cosmos#6721)

Launchpad fix for cosmos#6287

* update release notes

* make explicit that the regression is fixed in 0.39

* update release notes

* Update CHANGELOG.md

* update release notes

@ethanfrey

* remove pruning info from changelog

They have been moved to NEWS.md

* Update NEWS.md

Co-authored-by: Alexander Bezobchuk <[email protected]>

* Mege PR cosmos#6749: auth: remove custom JSON marshaling

* mv NEWS.md -> RELEASE_NOTES.md

Self-explanatory naming convention.

* Update changelog

* add reference to gaia software upgrade

* x/staking: add call to iterator Close() method (cosmos#6794)

Original pull request: cosmos#6791

* [ci] fix linter (cosmos#6795)

* Merge PR cosmos#6842: Remove custom acc JSON marshl

* Backport cosmos#5671: Add a Flag for CORS (cosmos#6853)

This adds the --unsafe-cors flag functionality.

From: cosmos#5671
Co-authored-by: Marko <[email protected]>

* Merge PR cosmos#6855: Allow passing through Content-Type (needed for POST)

* Merge PR cosmos#6861: Revert "Backport 0.39.1: Remove Custom JSON Marshaling for Accounts"

* Merge PR cosmos#6869: Backport 0.39.1: Launchpad Migration cosmos#6829

* Update changelog and release notes

* Update x/auth/legacy/v0_39/types.go

* Update x/auth/legacy/v0_38/types.go

* Merge PR cosmos#6938: Fix v0.39 migrate test

* Merge PR cosmos#6937: Bump Tendermint to v0.33.7

* Update x/auth/legacy/v0_39/types.go

Co-authored-by: Alexander Bezobchuk <[email protected]>

* update RELEASE_NOTES.md

* update changelog

* test case with real genesis data (cosmos#6995)

* incorporate Ethan Frey's suggestion

* make format

* Update go mod

* Remove some ci files

* Modify data for test

* API server

* Port telemetry

* Initial metrics

* Fix measure

* Merge PR cosmos#6761: telemetry: use UTC() in wrappers

* Remove file

* Make format

* Revert changes to client

* Revert changes to client/lcd/root

* Revert renames in client

* Fix int64 panics

* Revert "Revert renames in client"

This reverts commit cc0a95d14c3212fa1c49f93789dd94e167427a57.

* Revert "Revert changes to client/lcd/root"

This reverts commit e3bb87bbacae13676c3a1f86f8d441d576b1f2ba.

* Revert "Revert changes to client"

This reverts commit 332cacba3242e503bcc4bffc3f6b25c1906efca4.

Co-authored-by: Alexander Bezobchuk <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Alessio Treglia <[email protected]>
Co-authored-by: Ethan Frey <[email protected]>
Co-authored-by: Federico Kunze <[email protected]>
Co-authored-by: Jonathan Gimeno <[email protected]>
Co-authored-by: Marko <[email protected]>
Co-authored-by: Adam Bozanich <[email protected]>
  • Loading branch information
9 people authored Sep 1, 2020
1 parent c2c8529 commit 938d376
Show file tree
Hide file tree
Showing 47 changed files with 1,272 additions and 207 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
client/lcd/swagger-ui/* linguist-vendored
client/docs/swagger-ui/* linguist-vendored
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,66 @@ respectively, and the latter defines the height interval in which versions are d

* (x/auth) [\#5950](https://github.com/cosmos/cosmos-sdk/pull/5950) Fix `IncrementSequenceDecorator` to use is `IsReCheckTx` instead of `IsCheckTx` to allow account sequence incrementing.

### Client Breaking

* (api) [\#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options.

## [v0.39.1]

* (x/auth) [\#6861](https://github.com/cosmos/cosmos-sdk/pull/6861) Remove public key Bech32 encoding for all account types for JSON serialization, instead relying on direct Amino encoding. In addition, JSON serialization utilizes Amino instead of the Go stdlib, so integers are treated as strings.
* (client) [\#6853](https://github.com/cosmos/cosmos-sdk/pull/6853) Add --unsafe-cors flag.

## [v0.39.0]

### Improvements

* (deps) Bump Tendermint version to [v0.33.6](https://github.com/tendermint/tendermint/releases/tag/v0.33.6)
* (deps) Bump IAVL version to [v0.14.0](https://github.com/cosmos/iavl/releases/tag/v0.14.0)
* (client) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) `CLIContext` additions:
* Introduce `QueryABCI` that returns the full `abci.ResponseQuery` with inclusion Merkle proofs.
* Added `prove` flag for Merkle proof verification.
* (x/staking) [\#6791)](https://github.com/cosmos/cosmos-sdk/pull/6791) Close {UBDQueue,RedelegationQueu}Iterator once used.

### API Breaking Changes

* (baseapp) [\#5837](https://github.com/cosmos/cosmos-sdk/issues/5837) Transaction simulation now returns a `SimulationResponse` which contains the `GasInfo` and `Result` from the execution.

### Client Breaking Changes

* (x/auth) [\#6745](https://github.com/cosmos/cosmos-sdk/issues/6745) Remove BaseAccount's custom JSON {,un}marshalling.

### Bug Fixes

* (store) [\#6475](https://github.com/cosmos/cosmos-sdk/pull/6475) Revert IAVL pruning functionality introduced in
[v0.13.0](https://github.com/cosmos/iavl/releases/tag/v0.13.0),
where the IAVL no longer keeps states in-memory in which it flushes periodically. IAVL now commits and
flushes every state to disk as it did pre-v0.13.0. The SDK's multi-store will track and ensure the proper
heights are pruned. The operator can set the pruning options via a `pruning` config via the CLI or
through `app.toml`. The `pruning` flag exposes `default|everything|nothing|custom` as options --
see docs for further details. If the operator chooses `custom`, they may provide granular pruning
options `pruning-keep-recent`, `pruning-keep-every`, and `pruning-interval`. The former two options
dictate how many recent versions are kept on disk and the offset of what versions are kept after that
respectively, and the latter defines the height interval in which versions are deleted in a batch.
**Note, there are some client-facing API breaking changes with regard to IAVL, stores, and pruning settings.**
* (x/distribution) [\#6210](https://github.com/cosmos/cosmos-sdk/pull/6210) Register `MsgFundCommunityPool` in distribution amino codec.
* (types) [\#5741](https://github.com/cosmos/cosmos-sdk/issues/5741) Prevent `ChainAnteDecorators()` from panicking when empty `AnteDecorator` slice is supplied.
* (baseapp) [\#6306](https://github.com/cosmos/cosmos-sdk/issues/6306) Prevent events emitted by the antehandler from being persisted between transactions.
* (client/keys) [\#5091](https://github.com/cosmos/cosmos-sdk/issues/5091) `keys parse` does not honor client app's configuration.
* (x/bank) [\#6674](https://github.com/cosmos/cosmos-sdk/pull/6674) Create account if recipient does not exist on handing `MsgMultiSend`.
* (x/auth) [\#6287](https://github.com/cosmos/cosmos-sdk/pull/6287) Fix nonce stuck when sending multiple transactions from an account in a same block.

## [v0.38.5] - 2020-07-02

### Improvements

* (tendermint) Bump Tendermint version to [v0.33.6](https://github.com/tendermint/tendermint/releases/tag/v0.33.6).

## [v0.38.4] - 2020-05-21

### Bug Fixes

* (x/auth) [\#5950](https://github.com/cosmos/cosmos-sdk/pull/5950) Fix `IncrementSequenceDecorator` to use is `IsReCheckTx` instead of `IsCheckTx` to allow account sequence incrementing.

## [v0.38.3] - 2020-04-09

* (tendermint) Bump Tendermint version to [v0.33.3](https://github.com/tendermint/tendermint/releases/tag/v0.33.3).
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,10 @@ lint: golangci-lint
go mod verify
.PHONY: lint

format: tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/cosmos/cosmos-sdk
format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -path "./tests/mocks/*" -not -name '*.pb.go' | xargs goimports -w -local github.com/cosmos/cosmos-sdk
.PHONY: format

benchmark:
Expand Down
25 changes: 25 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"sort"
"strings"
"syscall"
"time"

abci "github.com/tendermint/tendermint/abci/types"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
Expand Down Expand Up @@ -99,6 +101,8 @@ func (app *BaseApp) FilterPeerByID(info string) abci.ResponseQuery {

// BeginBlock implements the ABCI application interface.
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
defer telemetry.MeasureSince(time.Now(), "abci", "begin_block")

if app.cms.TracingEnabled() {
app.cms.SetTracingContext(sdk.TraceContext(
map[string]interface{}{"blockHeight": req.Header.Height},
Expand Down Expand Up @@ -143,6 +147,8 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg

// EndBlock implements the ABCI interface.
func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
defer telemetry.MeasureSince(time.Now(), "abci", "end_block")

if app.deliverState.ms.TracingEnabled() {
app.deliverState.ms = app.deliverState.ms.SetTracingContext(nil).(sdk.CacheMultiStore)
}
Expand All @@ -161,6 +167,8 @@ func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBloc
// will contain releveant error information. Regardless of tx execution outcome,
// the ResponseCheckTx will contain relevant gas execution context.
func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
defer telemetry.MeasureSince(time.Now(), "abci", "check_tx")

tx, err := app.txDecoder(req.Tx)
if err != nil {
return sdkerrors.ResponseCheckTx(err, 0, 0, app.trace)
Expand Down Expand Up @@ -199,13 +207,26 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
// Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant
// gas execution context.
func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx {
defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx")

tx, err := app.txDecoder(req.Tx)
if err != nil {
return sdkerrors.ResponseDeliverTx(err, 0, 0, app.trace)
}

gInfo := sdk.GasInfo{}
resultStr := "successful"

defer func() {
telemetry.IncrCounter(1, "tx", "count")
telemetry.IncrCounter(1, "tx", resultStr)
telemetry.SetGauge(float32(gInfo.GasUsed), "tx", "gas", "used")
telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted")
}()

gInfo, result, err := app.runTx(runTxModeDeliver, req.Tx, tx)
if err != nil {
resultStr = "failed"
return sdkerrors.ResponseDeliverTx(err, gInfo.GasWanted, gInfo.GasUsed, app.trace)
}

Expand All @@ -226,6 +247,8 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx
// against that height and gracefully halt if it matches the latest committed
// height.
func (app *BaseApp) Commit() (res abci.ResponseCommit) {
defer telemetry.MeasureSince(time.Now(), "abci", "commit")

header := app.deliverState.ctx.BlockHeader()

// Write the DeliverTx state which is cache-wrapped and commit the MultiStore.
Expand Down Expand Up @@ -292,6 +315,8 @@ func (app *BaseApp) halt() {
// Query implements the ABCI interface. It delegates to CommitMultiStore if it
// implements Queryable.
func (app *BaseApp) Query(req abci.RequestQuery) abci.ResponseQuery {
defer telemetry.MeasureSince(time.Now(), "abci", "query")

path := splitPath(req.Path)
if len(path) == 0 {
sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "no query path provided"))
Expand Down
2 changes: 1 addition & 1 deletion client/lcd/statik/init.go → client/docs/statik/init.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package statik

//This just for fixing the error in importing empty github.com/cosmos/cosmos-sdk/client/lcd/statik
//This just for fixing the error in importing empty github.com/cosmos/cosmos-sdk/client/docs/statik
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
66 changes: 25 additions & 41 deletions client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,31 @@ const (

// List of CLI flags
const (
FlagHome = tmcli.HomeFlag
FlagUseLedger = "ledger"
FlagChainID = "chain-id"
FlagNode = "node"
FlagHeight = "height"
FlagGasAdjustment = "gas-adjustment"
FlagTrustNode = "trust-node"
FlagFrom = "from"
FlagName = "name"
FlagAccountNumber = "account-number"
FlagSequence = "sequence"
FlagMemo = "memo"
FlagFees = "fees"
FlagGasPrices = "gas-prices"
FlagBroadcastMode = "broadcast-mode"
FlagDryRun = "dry-run"
FlagGenerateOnly = "generate-only"
FlagIndentResponse = "indent"
FlagListenAddr = "laddr"
FlagMaxOpenConnections = "max-open"
FlagRPCReadTimeout = "read-timeout"
FlagRPCWriteTimeout = "write-timeout"
FlagOutputDocument = "output-document" // inspired by wget -O
FlagSkipConfirmation = "yes"
FlagProve = "prove"
FlagKeyringBackend = "keyring-backend"
FlagPage = "page"
FlagLimit = "limit"
FlagUnsafeCORS = "unsafe-cors"
FlagHome = tmcli.HomeFlag
FlagUseLedger = "ledger"
FlagChainID = "chain-id"
FlagNode = "node"
FlagHeight = "height"
FlagGasAdjustment = "gas-adjustment"
FlagTrustNode = "trust-node"
FlagFrom = "from"
FlagName = "name"
FlagAccountNumber = "account-number"
FlagSequence = "sequence"
FlagMemo = "memo"
FlagFees = "fees"
FlagGasPrices = "gas-prices"
FlagBroadcastMode = "broadcast-mode"
FlagDryRun = "dry-run"
FlagGenerateOnly = "generate-only"
FlagOffline = "offline"
FlagIndentResponse = "indent"
FlagOutputDocument = "output-document" // inspired by wget -O
FlagSkipConfirmation = "yes"
FlagProve = "prove"
FlagKeyringBackend = "keyring-backend"
FlagPage = "page"
FlagLimit = "limit"
)

// LineBreak can be included in a command list to provide a blank line
Expand Down Expand Up @@ -135,18 +131,6 @@ func PostCommands(cmds ...*cobra.Command) []*cobra.Command {
return cmds
}

// RegisterRestServerFlags registers the flags required for rest server
func RegisterRestServerFlags(cmd *cobra.Command) *cobra.Command {
cmd = GetCommands(cmd)[0]
cmd.Flags().String(FlagListenAddr, "tcp://localhost:1317", "The address for the server to listen on")
cmd.Flags().Uint(FlagMaxOpenConnections, 1000, "The number of maximum open connections")
cmd.Flags().Uint(FlagRPCReadTimeout, 10, "The RPC read timeout (in seconds)")
cmd.Flags().Uint(FlagRPCWriteTimeout, 10, "The RPC write timeout (in seconds)")
cmd.Flags().Bool(FlagUnsafeCORS, false, "Allows CORS requests from all domains. For development purposes only, use it at your own risk.")

return cmd
}

// Gas flag parsing functions

// GasSetting encapsulates the possible values passed through the --gas flag.
Expand Down
120 changes: 0 additions & 120 deletions client/lcd/root.go

This file was deleted.

Loading

0 comments on commit 938d376

Please sign in to comment.