Skip to content

Commit

Permalink
feat: enhance rosetta support (cosmos#11609)
Browse files Browse the repository at this point in the history
* fee suggestion for construction/metadata

* rename module

* change default gas_limit for fee suggestion

* add rosetta items in template

* type fix for default-suggest-denom

* add default values

* add suggestion-related config

* force set to success for balance operations

* enable offline mode

* Revert "rename module"

This reverts commit ea433e7.

* increase defaultNodeTimeout for rosetta for huge genesis

* use DefaultGasLimit as DefaultSuggestGas

* use default gas limit as default gas suggest for rosetta

* add enable-default-fee-suggest for rosetta

* update config template

* prevent bad gateway due to huge genesis

* Apply suggestions from code review

Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Anil Kumar Kammari <[email protected]>

* add price flag for rosetta standalone

* fix rosetta data/block when block identifier is unset

* add checking mismatched index/hash

* bump rosetta-sdk-go to v0.7.7

* bump dependency

* add changelog

* Apply suggestions from code review

* Apply suggestions from code review

* make gas_prices and gas_limit optional

* Apply suggestions from code review

* add changelog

* revive overwritten by cherrypick

* revive overwritten by cherry-pick

* rename local variable

* rename variables and configs

* Apply suggestions from code review

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

* break validation into two if cases

* fix config toml template

Co-authored-by: yys <[email protected]>
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
Co-authored-by: Anil Kumar Kammari <[email protected]>
  • Loading branch information
4 people authored and haiyizxx committed Jun 5, 2023
1 parent 9abd946 commit 8e49b8e
Show file tree
Hide file tree
Showing 9 changed files with 257 additions and 168 deletions.
167 changes: 38 additions & 129 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,113 +35,29 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

Since **v0.45.15**, the v0.45.x line of the Cosmos SDK has reached end-of-life.
Any release after **v0.45.15** is a security release that contains security fixes.
It is strongly recommended to upgrade to these releases as well.

## [v0.45.16](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.16) - 2023-05-11

### Security Bug Fixes

* (x/feegrant) [#16097](https://github.com/cosmos/cosmos-sdk/pull/16097) Fix infinite feegrant allowance bug.

## [v0.45.15](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.15) - 2023-03-22

### Improvements

* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md).
* (deps) [#15127](https://github.com/cosmos/cosmos-sdk/pull/15127) Bump btcd.
* (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height.

## [v0.45.14](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.14) - 2023-02-16

### Features

* [#14583](https://github.com/cosmos/cosmos-sdk/pull/14583) Add support for Core API.

## [v0.45.13](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.13) - 2023-02-09

### Improvements

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

### Bug Fixes

* (store) [#14798](https://github.com/cosmos/cosmos-sdk/pull/14798) Copy btree to avoid the problem of modify while iteration.

## [v0.45.12](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.12) - 2023-01-23

### Improvements

* [#13881](https://github.com/cosmos/cosmos-sdk/pull/13881) Optimize iteration on nested cached KV stores and other operations in general.
* (store) [#11646](https://github.com/cosmos/cosmos-sdk/pull/11646) Add store name in tracekv-emitted store traces
* (deps) Bump Tendermint version to [v0.34.24](https://github.com/tendermint/tendermint/releases/tag/v0.34.24) and use Informal Systems fork.

### API Breaking Changes

* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Update State Streaming APIs:
* Add method `ListenCommit` to `ABCIListener`
* Move `ListeningEnabled` and `AddListener` methods to `CommitMultiStore`
* Remove `CacheWrapWithListeners` from `CacheWrap` and `CacheWrapper` interfaces
* Remove listening APIs from the caching layer (it should only listen to the `rootmulti.Store`)
* Add three new options to file streaming service constructor.
* Modify `ABCIListener` such that any error from any method will always halt the app via `panic`

### Bug Fixes

* (store) [#13516](https://github.com/cosmos/cosmos-sdk/pull/13516) Fix state listener that was observing writes at wrong time.
* (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache.

## [v0.45.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.11) - 2022-11-09

### Improvements

* [#13896](https://github.com/cosmos/cosmos-sdk/pull/13896) Queries on pruned height returns error instead of empty values.
* (deps) Bump Tendermint version to [v0.34.23](https://github.com/tendermint/tendermint/releases/tag/v0.34.23).
* (deps) Bump IAVL version to [v0.19.4](https://github.com/cosmos/iavl/releases/tag/v0.19.4).

### Bug Fixes

* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) Fix `--dry-run` flag not working when using tx command.

### CLI Breaking Changes

* [#13656](https://github.com/cosmos/cosmos-sdk/pull/13660) Rename `server.FlagIAVLFastNode` to `server.FlagDisableIAVLFastNode` for clarity.

### API Breaking Changes

* [#13673](https://github.com/cosmos/cosmos-sdk/pull/13673) The `GetFromFields` function now takes `Context` as an argument and removes `genOnly`.

## [v0.45.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.10) - 2022-10-24
## [Unreleased]

### Features

* (grpc) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) Implement a new gRPC query, `/cosmos/base/node/v1beta1/config`, which provides operator configuration. Applications that wish to expose operator minimum gas prices via gRPC should have their application implement the `ApplicationQueryService` interface (see `SimApp#RegisterNodeService` as an example).
* [#13557](https://github.com/cosmos/cosmos-sdk/pull/#13557) - Add `GenSignedMockTx`. This can be used as workaround for #12437 revertion. `v0.46+` contains as well a `GenSignedMockTx` that behaves the same way.
* (x/auth) [#13612](https://github.com/cosmos/cosmos-sdk/pull/13612) Add `Query/ModuleAccountByName` endpoint for accessing the module account info by module name.
* (rosetta) [\#11609](https://github.com/cosmos/cosmos-sdk/pull/11609) Add fee suggestion for rosetta and enable offline mode. Also force set events about Fees to Success to pass reconciliation test.

### Improvements

* [#13585](https://github.com/cosmos/cosmos-sdk/pull/13585) Bump Tendermint to `v0.34.22`.

### Bug Fixes

* [#13588](https://github.com/cosmos/cosmos-sdk/pull/13588) Fix regression in distrubtion.WithdrawDelegationRewards when rewards are zero.
* [#13564](https://github.com/cosmos/cosmos-sdk/pull/13564) - Fix `make proto-gen`.
* (server) [#13610](https://github.com/cosmos/cosmos-sdk/pull/13610) Read the pruning-keep-every field again.

## [v0.45.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.9) - 2022-10-14
## v0.45.9 - 2022-10-14

ATTENTION:

This is a security release for the [Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).
This is a security release for the
[Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).

All users should upgrade immediately.

Users *must* add a replace directive in their go.mod for thenew `ics23` package in the SDK:
Users *must* add a replace directive in their go.mod for the
new `ics23` package in the SDK:

```
replace (
github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23
)
```go
replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0
```

### Features
Expand All @@ -154,23 +70,19 @@ replace github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8
* [#13323](https://github.com/cosmos/cosmos-sdk/pull/13323) Ensure `withdraw_rewards` rewards are emitted from all actions that result in rewards being withdrawn.
* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage.
* (store) [#13326](https://github.com/cosmos/cosmos-sdk/pull/13326) Implementation of ADR-038 file StreamingService, backport #8664.
* (store) [#13540](https://github.com/cosmos/cosmos-sdk/pull/13540) Default fastnode migration to false to prevent suprises. Operators must enable it, unless they have it enabled already.
* (store) [#13540](https://github.com/cosmos/cosmos-sdk/pull/13540) Default fastnode migration to false to prevent suprises. Operators must enable it, unless they have it enabled already.

### API Breaking Changes

* (cli) [#13089](https://github.com/cosmos/cosmos-sdk/pull/13089) Fix rollback command don't actually delete multistore versions, added method `RollbackToVersion` to interface `CommitMultiStore` and added method `CommitMultiStore` to `Application` interface.

### Bug Fixes

* Implement dragonberry security patch.
* For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md)
* [#...](https://github.com/cosmos/cosmos-sdk/pull/) Implement dragonberry security patch.
* For applying the patch please refer to the [RELEASE NOTES](./RELEASE_NOTES.md)
* (store) [#13459](https://github.com/cosmos/cosmos-sdk/pull/13459) Don't let state listener observe the uncommitted writes.

### Notes

Reverted #12437 due to API breaking changes.

## [v0.45.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.8) - 2022-08-25
## v0.45.8 - 2022-08-25

### Improvements

Expand All @@ -185,7 +97,7 @@ Reverted #12437 due to API breaking changes.

* [#13046](https://github.com/cosmos/cosmos-sdk/pull/13046) Fix missing return statement in BaseApp.Query.

## [v0.45.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.7) - 2022-08-04
## v0.45.7 - 2022-08-04

### Features

Expand All @@ -204,9 +116,6 @@ Reverted #12437 due to API breaking changes.
### Bug Fixes

* (x/mint) [#12384](https://github.com/cosmos/cosmos-sdk/pull/12384) Ensure `GoalBonded` must be positive when performing `x/mint` parameter validation.
* (simapp) [#12437](https://github.com/cosmos/cosmos-sdk/pull/12437) fix the non-determinstic behavior in simulations caused by `GenTx` and check
empty coins slice before it is used to create `banktype.MsgSend`.
* (x/capability) [#12818](https://github.com/cosmos/cosmos-sdk/pull/12818) Use fixed length hex for pointer at FwdCapabilityKey.

## [v0.45.6](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.6) - 2022-06-28

Expand Down Expand Up @@ -373,7 +282,7 @@ empty coins slice before it is used to create `banktype.MsgSend`.

### Improvements

* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures *all* events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution.
* (types) [\#10630](https://github.com/cosmos/cosmos-sdk/pull/10630) Add an `Events` field to the `TxResponse` type that captures _all_ events emitted by a transaction, unlike `Logs` which only contains events emitted during message execution.
* (x/upgrade) [\#10532](https://github.com/cosmos/cosmos-sdk/pull/10532) Add `keeper.DumpUpgradeInfoWithInfoToDisk` to include `Plan.Info` in the upgrade-info file.
* (store) [\#10544](https://github.com/cosmos/cosmos-sdk/pull/10544) Use the new IAVL iterator structure which significantly improves iterator performance.

Expand Down Expand Up @@ -1383,7 +1292,7 @@ by the new key store:
* `file`: use encrypted file-based store.
* `kwallet`: use [KDE Wallet](https://utils.kde.org/projects/kwalletmanager/) service.
* `pass`: use the [pass](https://www.passwordstore.org/) command line password manager.
* `test`: use password-less key store. *For testing purposes only. Use it at your own risk.*
* `test`: use password-less key store. _For testing purposes only. Use it at your own risk._
* (keys) [\#5097](https://github.com/cosmos/cosmos-sdk/pull/5097) New `keys migrate` command to assist users migrate their keys
to the new keyring.
* (keys) [\#5366](https://github.com/cosmos/cosmos-sdk/pull/5366) `keys list` now accepts a `--list-names` option to list key names only, whilst the `keys delete`
Expand Down Expand Up @@ -2877,7 +2786,7 @@ BUG FIXES

## 0.25.0

*October 24th, 2018*
_October 24th, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3124,7 +3033,7 @@ BUG FIXES

## 0.24.2

*August 22nd, 2018*
_August 22nd, 2018_

BUG FIXES

Expand All @@ -3133,7 +3042,7 @@ BUG FIXES

## 0.24.1

*August 21st, 2018*
_August 21st, 2018_

BUG FIXES

Expand All @@ -3142,7 +3051,7 @@ BUG FIXES

## 0.24.0

*August 13th, 2018*
_August 13th, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3258,7 +3167,7 @@ BUG FIXES

## 0.23.1

*July 27th, 2018*
_July 27th, 2018_

BUG FIXES

Expand All @@ -3268,7 +3177,7 @@ BUG FIXES

## 0.23.0

*July 25th, 2018*
_July 25th, 2018_

BREAKING CHANGES

Expand All @@ -3291,7 +3200,7 @@ BUG FIXES

## 0.22.0

*July 16th, 2018*
_July 16th, 2018_

BREAKING CHANGES

Expand All @@ -3310,7 +3219,7 @@ BUG FIXES

## 0.21.1

*July 14th, 2018*
_July 14th, 2018_

BUG FIXES

Expand All @@ -3319,7 +3228,7 @@ BUG FIXES

## 0.21.0

*July 13th, 2018*
_July 13th, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3350,7 +3259,7 @@ BUG FIXES

## 0.20.0

*July 10th, 2018*
_July 10th, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3493,7 +3402,7 @@ BUG FIXES

## 0.19.0

*June 13, 2018*
_June 13, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3533,7 +3442,7 @@ FEATURES

## 0.18.0

*June 9, 2018*
_June 9, 2018_

BREAKING CHANGES

Expand Down Expand Up @@ -3598,45 +3507,45 @@ BUG FIXES

## 0.17.5

*June 5, 2018*
_June 5, 2018_

Update to Tendermint v0.19.9 (Fix evidence reactor, mempool deadlock, WAL panic,
memory leak)

## 0.17.4

*May 31, 2018*
_May 31, 2018_

Update to Tendermint v0.19.7 (WAL fixes and more)

## 0.17.3

*May 29, 2018*
_May 29, 2018_

Update to Tendermint v0.19.6 (fix fast-sync halt)

## 0.17.5

*June 5, 2018*
_June 5, 2018_

Update to Tendermint v0.19.9 (Fix evidence reactor, mempool deadlock, WAL panic,
memory leak)

## 0.17.4

*May 31, 2018*
_May 31, 2018_

Update to Tendermint v0.19.7 (WAL fixes and more)

## 0.17.3

*May 29, 2018*
_May 29, 2018_

Update to Tendermint v0.19.6 (fix fast-sync halt)

## 0.17.2

*May 20, 2018*
_May 20, 2018_

Update to Tendermint v0.19.5 (reduce WAL use, bound the mempool and some rpcs, improve logging)

Expand Down
25 changes: 19 additions & 6 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/spf13/viper"

clientflags "github.com/cosmos/cosmos-sdk/client/flags"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -129,6 +130,15 @@ type RosettaConfig struct {

// Offline defines if the server must be run in offline mode
Offline bool `mapstructure:"offline"`

// EnableFeeSuggestion defines if the server should suggest fee by default
EnableFeeSuggestion bool `mapstructure:"enable-fee-suggestion"`

// GasToSuggest defines gas limit when calculating the fee
GasToSuggest int `mapstructure:"gas-to-suggest"`

// DenomToSuggest defines the defult denom for fee suggestion
DenomToSuggest string `mapstructure:"denom-to-suggest"`
}

// GRPCConfig defines configuration for the gRPC server.
Expand Down Expand Up @@ -268,12 +278,15 @@ func DefaultConfig() *Config {
Address: DefaultGRPCAddress,
},
Rosetta: RosettaConfig{
Enable: false,
Address: ":8080",
Blockchain: "app",
Network: "network",
Retries: 3,
Offline: false,
Enable: false,
Address: ":8080",
Blockchain: "app",
Network: "network",
Retries: 3,
Offline: false,
EnableFeeSuggestion: false,
GasToSuggest: clientflags.DefaultGasLimit,
DenomToSuggest: "uatom",
},
GRPCWeb: GRPCWebConfig{
Enable: true,
Expand Down
Loading

0 comments on commit 8e49b8e

Please sign in to comment.