Skip to content

Commit

Permalink
Merge branch 'main' into mergify/bp/release/price-feeder/v1.x.x/pr-1442
Browse files Browse the repository at this point in the history
  • Loading branch information
rbajollari committed Oct 4, 2022
2 parents 17faad1 + f805484 commit dbc5f6c
Show file tree
Hide file tree
Showing 41 changed files with 377 additions and 218 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ jobs:
name: umee ${{ matrix.arch }} for ${{ matrix.targetos }}
steps:
- uses: actions/checkout@v3
- name: Cache binaries
id: cache-binaries
uses: actions/cache@v3
with:
path: ./cmd/umeed/umeed
key: umeed-${{ matrix.targetos }}-${{ matrix.arch }}
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Setup go
if: env.GIT_DIFF
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
uses: actions/setup-go@v3
with:
go-version: 1.19
Expand All @@ -34,14 +40,8 @@ jobs:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
- name: Compile
if: env.GIT_DIFF
if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF
run: |
go mod download
cd cmd/umeed
go build .
- uses: actions/upload-artifact@v3
if: env.GIT_DIFF
with:
name: umeed-${{ matrix.targetos }}-${{ matrix.arch }}
path: cmd/umeed/umeed
retention-days: 1
68 changes: 14 additions & 54 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,66 +124,26 @@ jobs:
go.mod
go.sum
- name: gets umeed bin
if: env.GIT_DIFF
uses: actions/download-artifact@v3
- name: Cache updated version binary
id: cache-binaries
uses: actions/cache@v3
with:
name: umeed-linux-amd64
path: ./build
path: ./cmd/umeed/umeed
key: umeed-linux-amd64

- name: Start single node chain
if: env.GIT_DIFF
- name: Move new version binary to build folder
if: steps.cache-binaries.outputs.cache-hit == 'true'
run: |
mkdir -p build
cp ./cmd/umeed/umeed ./build/umeed
chmod +x ./build/umeed
- name: Start single node chain
if: env.GIT_DIFF && steps.cache-binaries.outputs.cache-hit == 'true'
run: |
./contrib/scripts/single-node.sh
- name: Test Local Network Liveness
if: env.GIT_DIFF
if: env.GIT_DIFF && steps.cache-binaries.outputs.cache-hit == 'true'
run: |
sleep 1m
./contrib/scripts/test_localnet_liveness.sh 50 5 50 localhost:26657
mainnet-upgrade-v1-v3:
needs: build-umeed
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: gets umeed bin
if: env.GIT_DIFF
uses: actions/download-artifact@v3
with:
name: umeed-linux-amd64
path: ./build

- name: cache umeed mainnet
uses: actions/cache@v3
id: umeed-v112
with:
path: ./contrib/scripts/umeed-releases/umeed-v1.1.2-linux-amd64/umeed
key: umeed-v112
- name: download mainnet binary
if: steps.umeed-v112.outputs.cache-hit != 'true'
run: |
./contrib/scripts/download-mainnet-umeed.sh
- name: cache mainnet tinkered genesis
uses: actions/cache@v3
id: tinkered-genesis-sep-15
with:
path: ./contrib/scripts/mainnet_tinkered_genesis.json
key: tinkered-genesis-sep-15
- name: tinkerer mainnet genesis
if: steps.tinkered-genesis-sep-15.outputs.cache-hit != 'true'
run: |
./contrib/scripts/tinker-mainnet-genesis.sh
- name: Fork mainnet and upgrade from v1.1.2 to v.3.x.x
if: env.GIT_DIFF
run: |
chmod +x ./build/umeed
./contrib/scripts/umeemainnet_fork.sh
6 changes: 3 additions & 3 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ pull_request_rules:
branches:
- release/v3.x.x

- name: Backport patches to the release/price-feeder/v0.3.x branch
- name: Backport patches to the release/price-feeder/v1.x.x branch
conditions:
- base=main
- label=S:backport/price-feeder/v0.3.x
- label=S:backport/price-feeder/v1.x.x
actions:
backport:
branches:
- release/price-feeder/v0.3.x
- release/price-feeder/v1.x.x
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

## [v3.0.2](https://github.com/umee-network/umee/releases/tag/v3.0.2) - 2022-09-29

### Fixes

- [1460](https://github.com/umee-network/umee/pull/1460) Bump Gravity Bridge.

## [v3.0.1](https://github.com/umee-network/umee/releases/tag/v3.0.1) - 2022-09-28

### Fixes

- [1450](https://github.com/umee-network/umee/pull/1450) fix: token registry cache which caused v3.0.0 halt.

## [v3.0.0](https://github.com/umee-network/umee/releases/tag/v3.0.0) - 2022-09-22

### State Machine Breaking

- [1326](https://github.com/umee-network/umee/pull/1326) Setting protocol controlled min gas price.
Expand Down Expand Up @@ -175,6 +189,22 @@ Ref: https://keepachangelog.com/en/1.0.0/

- Convexity upgrade!!!

## [v1.1.0](https://github.com/umee-network/umee/releases/tag/v1.1.0) - 2022-09-08

### State Machine Breaking

- [1358](https://github.com/umee-network/umee/pull/1358/files) Disable Gravity Bridge bridge messages.

### Improvements

- [#1355](https://github.com/umee-network/umee/pull/1355) Update tooling to go1.19 and CI to the latest setup (based on v3).

## [v1.0.4](https://github.com/umee-network/umee/releases/tag/v1.0.4) - - 2022-09-08

### Improvements

- [#1353](https://github.com/umee-network/umee/pull/1353) Gravity Bridge update

## [v1.0.3](https://github.com/umee-network/umee/releases/tag/v1.0.3) - 2022-02-17

### State Machine Breaking
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Umee will allow a multitude of decentralized debt products.
- [Public](#public)
- [Private](#private)
- [Install](#install)
- [Swagger](#swagger)

## Releases

Expand All @@ -42,7 +43,7 @@ See [Release procedure](CONTRIBUTING.md#release-procedure) for more information
| v0.8.x ||| v0.45.x | v2.0.x | v0.2.x | v0.1.x | |
| v1.x.x ||| v0.45.x | v2.0.x | v0.2.x | N/A | umee/v1 module/v1.4.x-umee |
| v2.x.x ||| v0.45.x | v2.3.x | v0.2.x | v0.2.x | umee/v2 module/v1.4.x |
| v3.x.x ||| v0.46.x | v5.0.x | v1.0.x | v0.3.x | umee/v3 module/v1.5.x-umee |
| v3.x.x ||| v0.46.x | v5.0.x | v1.0.x | v1.0.x | umee/v3 module/v1.5.x-umee |

## Active Networks

Expand Down
92 changes: 92 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!-- markdownlint-disable MD013 -->
<!-- markdownlint-disable MD024 -->
<!-- markdownlint-disable MD040 -->

# Release Notes

Release Procedure is defined in the [CONTRIBUTING](CONTRIBUTING.md#release-procedure) document.

## v3.0.2

Gravity Bridge update. In v3.0.0 we enabled Gravity Bridge, but there was an error in the way how the
`ValsetUpdate` attestation is handled, causing the chain to halt in EndBlocker.
The bug didn't involved any security issue and the bridge is safe.

Update instructions:

- stop the chain
- swap the binary
- restart (no additional coordination is required)

## v3.0.1

Fix v3.0.0 `Block.Header.LastResultsHash` problem.
During inspections we found that `tx.GasUsage` didn't match across some nodes, causing chain halt:

```
ERR prevote step: ProposalBlock is invalid err="wrong Block.Header.LastResultsHash. Expected EDEE3056AA71C73EC8B7089AAA5414D1298EF78ADC4D510498DB834E499E42C2, got 5ADF2EA7E0B31BA21E802071E1A9E4C4803259FE3AFFF17AAA53F93DA1D6264F" height=3216273 module=consensus round=68
```

## v3.0.0

v3.0.0 improves upon the _umeemania_ testnet release (v2.0.x) which introduced our **lending** and **oracle** functionality.

### Highlights since v1.x

- `x/leverage` module, which allows anyone to:
- supply liquidity (and earn interest)
- collateralize the supplied assets to enable borrowing
- borrow (and pay interest)
- participate in governance of `x/leverage` [parameters](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/leverage.proto) file.
- `x/oracle` module - a decentralized price oracle for the `x/leverage` module, as well as any app built in the Umee blockchain. UMEE holders set `x/oracle` [parameters](https://github.com/umee-network/umee/blob/main/proto/umee/oracle/v1/oracle.proto) by governance.
- Cosmos v0.46 upgrade, which features:
- [`x/group`](https://tutorials.cosmos.network/tutorials/understanding-group/) module
- [`x/nft`](https://github.com/cosmos/cosmos-sdk/tree/v0.46.1/x/nft/spec) module
- [Transaction Tips](https://github.com/cosmos/cosmos-sdk/blob/v0.46.0/RELEASE_NOTES.md#transaction-tips-and-sign_mode_direct_aux)
- [SIGN_MODE_DIRECT_AUX](https://github.com/cosmos/cosmos-sdk/blob/v0.46.0/RELEASE_NOTES.md#transaction-tips-and-sign_mode_direct_aux)
- transaction prioritization
- IBC v5.0
- Minimum validator commission rate is set to 5% per [prop 16](https://www.mintscan.io/umee/proposals/16). Validators with smaller commission rate will be automatically updated.

#### x/leverage settings

The leverage module is by default compiled without support for the `liquidation_targets` query.

Validators should NOT enable this query on their nodes - it is inefficient due to iterating over all borrower accounts, and can delay time-sensitive consensus operations when a sufficient number of addresses must be checked.

To run a node capable of supporting a liquidator, enable the query at compile time using `LIQUIDATOR=true make install`.

### Gravity Bridge

In `v1.1.x` (current mainnet) we disabled Gravity Bridge (GB) module due to Ethereum PoS migration (_the merge_).
This release is the first step to re-enable GB. We start by enabling validators update and evidence messages (`MsgValsetConfirm` and `MsgValsetUpdatedClaim`), but the bridge messages: batch creation, claims (both ways: Ethereum->Cosmos and Cosmos->Ethereum) remain disabled.

Validators are expected to run Peggo and update the valiator set in Gravity smart contract.

See [Gravity Bridge](https://github.com/umee-network/Gravity-Bridge/blob/module/v1.5.3-umee-1/module/RELEASE_NOTES.md) Release Notes.

### Update notes

Each validator MUST:

- Run Peggo (Gravity Bridge Orchestrator) v1.0.x
- Run [Price Feeder](https://github.com/umee-network/umee/tree/main/price-feeder) v1.0.x
- Update `app.toml` file by setting `minimum-gas-prices = "0uumee"`:

```toml
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1;0.0001token2).
minimum-gas-prices = "0uumee"
```

- Update `config.toml` file by setting `mempool.version="v1"`. Ideally you should do it before the upgrade time, then at the upgrade switch binaries and start with the upgraded config:

```toml
[mempool]
version = "v1"
```

Instructions: [umeeversity/validator](https://umeeversity.umee.cc/validators/mainnet-validator.html)

Failure to run Peggo and Price Feeder results in being slashed, as do certain types of misbehavior such as consistently submitting incorrect prices.
4 changes: 4 additions & 0 deletions ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ import (
cosmosante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
"github.com/cosmos/cosmos-sdk/x/auth/types"
ibcante "github.com/cosmos/ibc-go/v5/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v5/modules/core/keeper"
)

type HandlerOptions struct {
AccountKeeper cosmosante.AccountKeeper
BankKeeper types.BankKeeper
FeegrantKeeper cosmosante.FeegrantKeeper
OracleKeeper OracleKeeper
IBCKeeper *ibckeeper.Keeper
SignModeHandler signing.SignModeHandler
SigGasConsumer cosmosante.SignatureVerificationGasConsumer
}
Expand Down Expand Up @@ -49,5 +52,6 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
cosmosante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
cosmosante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
cosmosante.NewIncrementSequenceDecorator(options.AccountKeeper),
ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
), nil
}
6 changes: 3 additions & 3 deletions ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func checkFees(minGasPrices sdk.DecCoins, fees sdk.Coins, gasLimit uint64) error
}
} else {
// in deliverTx = use protocol min gas price
minGasPrices = sdk.DecCoins{appparams.MinMinGasPrice}
minGasPrices = sdk.DecCoins{appparams.ProtocolMinGasPrice}
}

requiredFees := sdk.NewCoins()
Expand Down Expand Up @@ -109,9 +109,9 @@ func IsOracleOrGravityTx(msgs []sdk.Msg) bool {
// AssertMinProtocolGasPrice returns an error if the provided gasPrices are lower then
// the required by protocol.
func AssertMinProtocolGasPrice(gasPrices sdk.DecCoins) error {
if gasPrices.AmountOf(appparams.MinMinGasPrice.Denom).LT(appparams.MinMinGasPrice.Amount) {
if gasPrices.AmountOf(appparams.ProtocolMinGasPrice.Denom).LT(appparams.ProtocolMinGasPrice.Amount) {
return sdkerrors.ErrInsufficientFee.Wrapf(
"gas price too small; got: %v required min: %v", gasPrices, appparams.MinMinGasPrice)
"gas price too small; got: %v required min: %v", gasPrices, appparams.ProtocolMinGasPrice)
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion ante/fee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (suite *IntegrationTestSuite) TestFeeAndPriority() {

msgs := testdata.NewTestMsg(addr1)
require.NoError(suite.txBuilder.SetMsgs(msgs))
minGas := appparams.MinMinGasPrice
minGas := appparams.ProtocolMinGasPrice
mkFee := func(factor string) sdk.Coins {
return coin.NewDecBld(minGas).Scale(int64(appparams.DefaultGasLimit)).ScaleStr(factor).ToCoins()
}
Expand Down
9 changes: 6 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,9 @@ func New(
)

app.mm.SetOrderEndBlockers(
crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName,
crisistypes.ModuleName,
oracletypes.ModuleName, // must be before gov and staking
govtypes.ModuleName, stakingtypes.ModuleName,
ibchost.ModuleName, ibctransfertypes.ModuleName,
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName,
slashingtypes.ModuleName, minttypes.ModuleName,
Expand All @@ -585,7 +587,6 @@ func New(
paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName,
// icatypes.ModuleName,
leveragetypes.ModuleName,
oracletypes.ModuleName,
gravitytypes.ModuleName,
bech32ibctypes.ModuleName,
)
Expand Down Expand Up @@ -690,10 +691,11 @@ func (app *UmeeApp) setAnteHandler(txConfig client.TxConfig) {
customante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper,
OracleKeeper: app.OracleKeeper,
IBCKeeper: app.IBCKeeper,
SignModeHandler: txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
OracleKeeper: app.OracleKeeper,
},
)
if err != nil {
Expand Down Expand Up @@ -808,6 +810,7 @@ func (app *UmeeApp) SimulationManager() *module.SimulationManager {
}

// RegisterAPIRoutes registers all application module routes with the provided
//
// API server.
func (app *UmeeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx
Expand Down
8 changes: 6 additions & 2 deletions app/params/app_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ const (
DefaultGasLimit = 200000
)

// MinMinGasPrice is the minimum value a validator can set for `minimum-gas-prices` his app.toml config
var MinMinGasPrice = sdk.NewDecCoinFromDec(BondDenom, sdk.MustNewDecFromStr("0.00"))
var (
// ProtocolMinGasPrice is a consensus controlled gas price. Each validator must set his
// `minimum-gas-prices` in app.toml config to value above ProtocolMinGasPrice.
// Transactions with gas-price smaller than ProtocolMinGasPrice will fail during DeliverTx.
ProtocolMinGasPrice = sdk.NewDecCoinFromDec(BondDenom, sdk.MustNewDecFromStr("0.00"))
)

func init() {
// XXX: If other upstream or external application's depend on any of Umee's
Expand Down
Loading

0 comments on commit dbc5f6c

Please sign in to comment.