From 82200092f760a92d25c4308139d2b6710efeb080 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Sat, 1 Oct 2022 03:36:47 +0200 Subject: [PATCH] Stop returning error logs + stack trace when out of gas in ApplyFuncIfNoErr (#2914) * Stop returning error logs + stack trace when theres an out of gas in ApplyFuncIfNoErr * Fix import * Changelog (cherry picked from commit 1ec86587e464e63cb3634e27b7b3ff42f11c6663) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ osmoutils/cache_ctx.go | 4 ++++ 2 files changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e08313151..8c6627fbff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +<<<<<<< HEAD #### Bug Fixes +======= +### Features + +* [#2739](https://github.com/osmosis-labs/osmosis/pull/2739) Add pool type query + +### Bug fixes + +* [#2803](https://github.com/osmosis-labs/osmosis/pull/2803) Fix total pool liquidity CLI query. +* [#2914](https://github.com/osmosis-labs/osmosis/pull/2914) Remove out of gas panics from node logs + +### Misc Improvements + +* [#2804](https://github.com/osmosis-labs/osmosis/pull/2804) Improve error handling and messages when parsing pool assets. + +## v12.0.0 + +This release includes several cosmwasm-developer and appchain-ecosystem affecting upgrades: + +* TWAP - Time weighted average prices for all AMM pools +* Cosmwasm contract developer facing features + * Enabling select queries for cosmwasm contracts + * Add message responses to gamm messages, to remove the neccessity of bindings + * Allow specifying denom metadata from tokenfactory +* Enabling Interchain accounts (for real this time) +* Upgrading IBC to v3.3.0 +* Consistently makes authz work with ledger for all messages + +The release also contains the following changes affecting Osmosis users and node operators + +* Fixing State Sync +* Enabling expedited proposals + +This upgrade also adds a number of safety and API boundary improving changes to the codebase. +While not state machine breaking, this release also includes the revamped Osmosis simulator, +which acts as a fuzz testing tool tailored for the SDK state machine. + +### Breaking Changes +>>>>>>> 1ec86587 (Stop returning error logs + stack trace when out of gas in ApplyFuncIfNoErr (#2914)) * [#2515](https://github.com/osmosis-labs/osmosis/pull/2515) Fix event emissions from epoch hooks. (Shoutout to @puneet2019 from persistence for the fix) diff --git a/osmoutils/cache_ctx.go b/osmoutils/cache_ctx.go index db93d188902..0802ddd8eec 100644 --- a/osmoutils/cache_ctx.go +++ b/osmoutils/cache_ctx.go @@ -6,6 +6,7 @@ import ( "runtime" "runtime/debug" + "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -38,6 +39,9 @@ func ApplyFuncIfNoError(ctx sdk.Context, f func(ctx sdk.Context) error) (err err func PrintPanicRecoveryError(ctx sdk.Context, recoveryError interface{}) { errStackTrace := string(debug.Stack()) switch e := recoveryError.(type) { + case types.ErrorOutOfGas: + ctx.Logger().Debug("out of gas error inside panic recovery block: " + e.Descriptor) + return case string: ctx.Logger().Error("Recovering from (string) panic: " + e) case runtime.Error: