Skip to content

Commit

Permalink
Merge branch 'main' into robert/ux-token
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Feb 8, 2024
2 parents 964d8a2 + 02ddb58 commit 2c67224
Show file tree
Hide file tree
Showing 39 changed files with 964 additions and 435 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependencies-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4
- name: "Dependency Review"
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
with:
fetch-depth: 0
# lint only changed files
- uses: tj-actions/changed-files@v41
- uses: tj-actions/changed-files@v42
id: changed-files
with:
files: "**/*.md"
separator: ","
- uses: DavidAnson/markdownlint-cli2-action@v14
- uses: DavidAnson/markdownlint-cli2-action@v15
if: steps.changed-files.outputs.any_changed == 'true'
with:
globs: ${{ steps.changed-files.outputs.all_changed_files }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/simulations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install runsim
run: export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
with:
go-version: "1.21"
cache: true
- uses: actions/cache@v3
- uses: actions/cache@v4
if: env.GIT_DIFF
with:
path: ~/go/bin
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
with:
go-version: "1.21"
cache: true
- uses: actions/cache@v3
- uses: actions/cache@v4
if: env.GIT_DIFF
with:
path: ~/go/bin
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
with:
go-version: "1.21"
cache: true
- uses: actions/cache@v3
- uses: actions/cache@v4
if: env.GIT_DIFF
with:
path: ~/go/bin
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-go-tparse
with:
path: ~/go/bin
Expand All @@ -37,7 +37,7 @@ jobs:
- uses: actions/checkout@v4
- name: Cache binaries
id: cache-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./cmd/umeed/umeed
key: umeed-${{ matrix.targetos }}-${{ matrix.arch }}
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
if: env.GIT_DIFF
run: |
EXPERIMENTAL=true make test-unit-cover
- uses: codecov/codecov-action@v3.1.4
- uses: codecov/codecov-action@v4.0.1
if: env.GIT_DIFF
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Cache updated version binary
id: cache-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./cmd/umeed/umeed
key: umeed-linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ linters-settings:
- name: unreachable-code
- name: unused-parameter
- name: var-declaration
- name: var-naming
- name: var-naming
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

- [2408](https://github.com/umee-network/umee/pull/2408) New `converter` helper app.

### Improvements

- [2328](https://github.com/umee-network/umee/pull/2328) Add UX and `uux` denom aliases for UMEE.
- [2388](https://github.com/umee-network/umee/pull/2388) Adjust interest rate algorithm and associated token parameter validation rules.

### Bug Fixes

- [2417](https://github.com/umee-network/umee/pull/2417) Fix the ibc inflows storing of registered tokens when sender chain is source chain.

## v6.3.0 - 2024-01-03

### Improvements
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Umee will allow a multitude of decentralized debt products.
- [Recommended Database Backend](#recommended-database-backend)
- [Swagger](#swagger)
- [Cosmovisor](#cosmovisor)
- [Validators](#validators)
- [Liquidators](#liquidators)

## Releases
Expand Down Expand Up @@ -83,7 +84,7 @@ You don't need to do anything if you are using our Docker image.
Public:

- [umee-1](networks/umee-1) (mainnet)
- canon-3 (testnet)
- canon-4 (testnet)

## Build

Expand Down Expand Up @@ -192,6 +193,10 @@ $ wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.5.0/internal/api/lib

- To use `cosmovisor` for starting `umeed` process, instead of calling `umeed start`, use `cosmovisor run start [umeed flags]`

## Validators

Please follow [Validator Instructions](./VALIDATOR.md) for setting up a validator node.

## Liquidators

A guide to running liquidations on Umee can be found [here](./x/leverage/LIQUIDATION.md)
85 changes: 85 additions & 0 deletions VALIDATOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Validator Notes

This document describes a process of joining a testnet or a mainnet as a validator.

## Umeeversity

Full documentation is hosted at [learning.ux.xyz](https://learning.ux.xyz). However it may not be up to date.

## Getting a Binary

To run a validator you need 2 binaries: `umeed` and `price-feeder`.

### Umeed

You can get a binary by:

1. [Build](./README.md#build) yourself and follow the latest [Release Notes](./RELEASE_NOTES.md).
If you build the binary on a different OS than your validator OS, then you need to copy `libwasmvm`:

```sh
scp $GOPATH/pkg/mod/github.com/!cosm!wasm/wasmvm@<version>/internal/api/libwasmvm.$(uname -m).so running_os:/<lib/path>
```

NOTE: use the correct `wasmvm` version, according to the latest [Release Notes](./RELEASE_NOTES.md) or the [compatibility matrix](./README.md#release-compatibility-matrix).

2. Download latest [binary build](https://github.com/umee-network/umee/releases). The build is compatible with the latest Ubuntu LTS x86-64. You MUST also copy the `libwasmvm` (see note in 1. about libwasmvm version):

```sh
wget https://raw.githubusercontent.com/CosmWasm/wasmvm/<version>/internal/api/libwasmvm.$(uname -m).so -O /lib/libwasmvm.$(uname -m).so
```

3. Use our released docker [umeed container](https://github.com/umee-network/umee/pkgs/container/umeed).

To test if the `libwasm` is linked correctly, run `umeed version`.

### Price Feeder

We are using Ojo Price Feeder. Please follow the [instructions](https://github.com/ojo-network/price-feeder/blob/umee/README.md). Make sure you use the latest release with the `umee/` prefix (eg: `umee/v2.4.0`).
NOTE: for self building and configuration examples you MUST use the [umee branch](https://github.com/ojo-network/price-feeder/tree/umee).

- Copy the [`price-feeder.toml`](https://github.com/ojo-network/price-feeder/blob/umee/price-feeder.example.toml).
- For the provider config you can use our latest [umee-provider-config directory](https://github.com/ojo-network/price-feeder/tree/umee/umee-provider-config) as is.

## Running a node

1. Update the `app.toml` , `client.toml` and `config.toml` based on your preference. You MUST set non zero min gas prices in `app.toml`. Query `umeed q ugov min-gas-price` to see the what is the minimum acceptable value:

```toml
# your app.toml file
minimum-gas-prices = "0.1uumee"
```

## Joining the network

Before joining the mainnet you should join a testnet!

### Testnet

1. Make sure your are able to run `umeed` and price feeder locally.
2. Join the [Discord server](https://discord.gg/4ZJAFvg9). Make sure you are in the Testnet group.
3. Follow the state sync [canon-4 instructions](https://mzonder.notion.site/UMEE-Start-from-STATE-SYNC-canon-4-f485563a089a436d9d1fe98f54af8737). Make sure you use the [latest](https://github.com/umee-network/umee/releases/) version.
4. You can use the following peers in your `config.toml`:

```toml
persistent_peers = "ee7d691781717cbd1bf6f965dc45aad19c7af05f@canon-4.network.umee.cc:10000,dfd1d83b668ff2e59dc1d601a4990d1bd95044ba@canon-4.network.umee.cc:10001"
```

5. Using discord, ping one of the UX Team members to send you testnet `uumee`.
6. Once your validator is setup (and you did self delegation), ping again UX Team members and send your validator address. We will do a delegation.
7. Make sure your Price Feeder is running correctly. If your [testnet window misses](https://canon.price-feeder.com/) are above 50% then something is wrong. Look for a help on Discord.

Here are our testnet public endpoints:

- [Explorer](https://explorer.network.umee.cc/canon-4)
- [Web GRPC](https://canon-4.api.network.umee.cc)
- [RPC](https://canon-4.rpc.network.umee.cc)

### Mainnet

1. Make sure you firstly tested your setup on Testnet.
2. Use one of the community [snapshots & instructions](https://github.com/obajay/StateSync-snapshots/tree/main/Projects/Umee).
3. Buy `uumee` to self delegate.
4. Make sure your Price Feeder is running correctly. If your [mainnet window misses](https://price-feeder.com/) are above 50% then something is wrong. Look for a help on Discord.

We recommend to use [Cosmovisor](./README.md#cosmovisor) for mainnet nodes.
57 changes: 46 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

packetforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper"
Expand Down Expand Up @@ -203,6 +206,7 @@ func init() {
wasm.AppModuleBasic{},
incentivemodule.AppModuleBasic{},
metokenmodule.AppModuleBasic{},
packetforward.AppModuleBasic{},
}
// if Experimental {}

Expand Down Expand Up @@ -269,15 +273,16 @@ type UmeeApp struct {
NFTKeeper nftkeeper.Keeper
WasmKeeper wasmkeeper.Keeper

IBCTransferKeeper ibctransferkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
ICAHostKeeper icahostkeeper.Keeper
LeverageKeeper leveragekeeper.Keeper
IncentiveKeeper incentivekeeper.Keeper
OracleKeeper oraclekeeper.Keeper
UIbcQuotaKeeperB uibcquota.KeeperBuilder
UGovKeeperB ugovkeeper.Builder
MetokenKeeperB metokenkeeper.Builder
IBCTransferKeeper ibctransferkeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
PacketForwardKeeper *packetforwardkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
LeverageKeeper leveragekeeper.Keeper
IncentiveKeeper incentivekeeper.Keeper
OracleKeeper oraclekeeper.Keeper
UIbcQuotaKeeperB uibcquota.KeeperBuilder
UGovKeeperB ugovkeeper.Builder
MetokenKeeperB metokenkeeper.Builder

// make scoped keepers public for testing purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
Expand Down Expand Up @@ -338,7 +343,7 @@ func New(
evidencetypes.StoreKey, capabilitytypes.StoreKey,
authzkeeper.StoreKey, nftkeeper.StoreKey, group.StoreKey,
ibcexported.StoreKey, ibctransfertypes.StoreKey, icahosttypes.StoreKey,
leveragetypes.StoreKey, oracletypes.StoreKey,
leveragetypes.StoreKey, oracletypes.StoreKey, packetforwardtypes.StoreKey,
uibc.StoreKey, ugov.StoreKey,
wasmtypes.StoreKey,
incentive.StoreKey,
Expand Down Expand Up @@ -559,11 +564,15 @@ func New(
* SendPacket, originates from the application to an IBC channel:
transferKeeper.SendPacket -> uibcquota.SendPacket -> channel.SendPacket
* RecvPacket, message that originates from an IBC channel and goes down to app, the flow is the other way
channel.RecvPacket -> uibcquota.OnRecvPacket -> transfer.OnRecvPacket
channel.RecvPacket -> uibcquota.OnRecvPacket -> forward.OnRecvPacket -> transfer.OnRecvPacket
* Note that the forward middleware is only integrated on the "receive" direction.
It can be safely skipped when sending.
* transfer stack contains (from top to bottom):
- Umee IBC Transfer
- IBC Rate Limit Middleware
- Packet Forward Middleware
**********/

quotaICS4 := uics20.NewICS4(app.IBCKeeper.ChannelKeeper, app.UIbcQuotaKeeperB)
Expand All @@ -577,10 +586,30 @@ func New(
app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper,
)

// Packet Forward Middleware
// Initialize packet forward middleware router
app.PacketForwardKeeper = packetforwardkeeper.NewKeeper(
appCodec,
keys[packetforwardtypes.StoreKey],
app.IBCTransferKeeper,
app.IBCKeeper.ChannelKeeper,
app.DistrKeeper,
app.BankKeeper,
quotaICS4, // ISC4 Wrapper: fee IBC middleware
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)

// create IBC module from bottom to top of stack
var transferStack ibcporttypes.IBCModule
transferStack = ibctransfer.NewIBCModule(app.IBCTransferKeeper)
// transferStack = ibcfee.NewIBCMiddleware(transferStack, app.IBCFeeKeeper)
transferStack = packetforward.NewIBCMiddleware(
transferStack,
app.PacketForwardKeeper,
0, // retries on timeout
packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout
packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout
)
transferStack = uics20.NewICS20Module(transferStack, appCodec,
app.UIbcQuotaKeeperB,
leveragekeeper.NewMsgServerImpl(app.LeverageKeeper))
Expand Down Expand Up @@ -712,6 +741,7 @@ func New(
leverage.NewAppModule(appCodec, app.LeverageKeeper, app.AccountKeeper, app.BankKeeper),
oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper),
uibcmodule.NewAppModule(appCodec, app.UIbcQuotaKeeperB),
packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
ugovmodule.NewAppModule(appCodec, app.UGovKeeperB),
wasm.NewAppModule(app.appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)), //nolint: lll
incentivemodule.NewAppModule(appCodec, app.IncentiveKeeper, app.BankKeeper, app.LeverageKeeper),
Expand Down Expand Up @@ -752,6 +782,7 @@ func New(
metoken.ModuleName,
oracletypes.ModuleName,
uibc.ModuleName,
packetforwardtypes.ModuleName,
ugov.ModuleName,
wasmtypes.ModuleName,
incentive.ModuleName,
Expand All @@ -770,6 +801,7 @@ func New(
icatypes.ModuleName, // ibcfeetypes.ModuleName,
leveragetypes.ModuleName,
uibc.ModuleName,
packetforwardtypes.ModuleName,
ugov.ModuleName,
wasmtypes.ModuleName,
incentive.ModuleName,
Expand All @@ -793,6 +825,7 @@ func New(
oracletypes.ModuleName,
leveragetypes.ModuleName,
uibc.ModuleName,
packetforwardtypes.ModuleName,
ugov.ModuleName,
wasmtypes.ModuleName,
incentive.ModuleName,
Expand All @@ -809,6 +842,7 @@ func New(
oracletypes.ModuleName,
leveragetypes.ModuleName,
uibc.ModuleName,
packetforwardtypes.ModuleName,
ugov.ModuleName,
wasmtypes.ModuleName,
incentive.ModuleName,
Expand Down Expand Up @@ -1138,6 +1172,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibcexported.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable())
paramsKeeper.Subspace(leveragetypes.ModuleName)
paramsKeeper.Subspace(oracletypes.ModuleName)
paramsKeeper.Subspace(wasmtypes.ModuleName)
Expand Down
Loading

0 comments on commit 2c67224

Please # to comment.