v8

package
v19.0.0-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

V8 Upgrade

The v8 upgrade is an emergency upgrade coordinated according to osmosis governance proposals 225, 226. And thus by implication of 225, incentive proposals 222, 223, and 224.

Adjusting Incentives for 222, 223, 224

Like the weekly Gauge Weight updates, the implementations for these proposals simply modify the weights of gauges between pools in the Upgrade:

  • ApplyProp222Change
  • ApplyProp223Change
  • ApplyProp224Change

The specification of Minimum and Maximum values will be applied to the spreadsheet that is shared in each Weekly update.

UnPoolWhitelistedPool for 226

The implementation of 226 will introduce a new method for unpooling:

UnPoolWhitelistedPool

Let's review the states a position in a pool may be to be able to understand the unpooling process better. Coins are pooled together to form shares of a GAMM. These may be locked for a period of time, to receive addtional incentives. Finally, locked tokens may enter into Superfluid Delegations.

  ┌─────────────────────────┐   ┌─────────────────────────┐
  │  sdk.Coin               │   │  sdk.Coin               │
  │  Denom:  UST            │   │  Denom:  uOSMO          │
  │  Amount: 5.647          │   │  Amount: 1              │
  └───────────┬─────────────┘   └───────────┬─────────────┘
              │                             │
  ┌───────────▼─────────────────────────────▼─────────────┐
  │                       JoinPool()                      │
  └───────────────────────────┬───────────────────────────┘
                              │
                 ┌────────────▼────────────┐
                 │  sdk.Coin               │
                 │  Denom: GAMM            │
                 │  Amount: 100000         │
                 └────────────┬────────────┘
                              │
  ┌───────────────────────────▼───────────────────────────┐
  │                      LockTokens()                     │
  └───────────────────────────┬───────────────────────────┘
                              │
                 ┌────────────▼────────────┐
                 │  types.PeriodLock       │
                 └────────────┬────────────┘
                              │
  ┌───────────────────────────▼───────────────────────────┐
  │                  SuperfluidDelegate()                 │
  └───────────────────────────┬───────────────────────────┘
                              │
                 ┌────────────▼────────────┐
                 │ types.SuperfluidAsset   │
                 └─────────────────────────┘

Unpooling Steps

To unpool, we'll need to carefully consider each of these concepts above. For instance, a user may have already begun unbonding.

We will start with the most deeply locked assets, and iteratively unroll them until we end up with individual sdk.Coin entities, some of which may be locked.

In the code, the following comment block may be found:

// 0) Check if its for a whitelisted unpooling poolID
// 1) Consistency check that lockID corresponds to sender, and contains correct LP shares. (Should also be validated by caller)
// 2) Get remaining duration on the lock.
// 3) If superfluid delegated, superfluid undelegate
// 4) Break underlying lock. This will clear any metadata if things are superfluid unbonding
// 5) ExitPool with these unlocked LP shares
// 6) Make 1 new lock for every asset in collateral. Many code paths need this assumption to hold
// 7) Make new lock begin unlocking

Documentation

Index

Constants

View Source
const (
	// UpgradeName defines the on-chain upgrade name for the Osmosis v8 upgrade.
	UpgradeName = v8constants.UpgradeName

	// UpgradeHeight defines the block height at which the Osmosis v8 upgrade is
	// triggered.
	UpgradeHeight = v8constants.UpgradeHeight
)

Variables

Functions

func ApplyProp222Change

func ApplyProp222Change(ctx sdk.Context, poolincentiveskeeper *poolincentiveskeeper.Keeper)

Apply prop 222 change

func ApplyProp223Change

func ApplyProp223Change(ctx sdk.Context, poolincentiveskeeper *poolincentiveskeeper.Keeper)

Apply prop 223 change

func ApplyProp224Change

func ApplyProp224Change(ctx sdk.Context, poolincentiveskeeper *poolincentiveskeeper.Keeper)

Apply prop 224 change

func CheckPoolContainsUST

func CheckPoolContainsUST(ctx sdk.Context, gamm *gammkeeper.Keeper, poolID uint64) error

CheckPoolContainsUST looks up the pool from the gammkeeper and returns nil if the pool contains UST's ibc denom returns an error if the pool does not contain UST's ibc denom or on any other error case.

func RegisterWhitelistedDirectUnbondPools

func RegisterWhitelistedDirectUnbondPools(ctx sdk.Context, superfluid *superfluidkeeper.Keeper, gamm *gammkeeper.Keeper)

RegisterWhitelistedDirectUnbondPools registers pools that are allowed to unpool https://www.mintscan.io/osmosis/proposals/226 osmosisd q gov proposal 226

func RunForkLogic

func RunForkLogic(ctx sdk.Context, appKeepers *keepers.AppKeepers)

RunForkLogic executes height-gated on-chain fork logic for the Osmosis v8 upgrade.

Types

type MsgFilterDecorator

type MsgFilterDecorator struct{}

MsgFilterDecorator defines an AnteHandler decorator for the v8 upgrade that provide height-gated message filtering acceptance.

func (MsgFilterDecorator) AnteHandle

func (mfd MsgFilterDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error)

AnteHandle performs an AnteHandler check that returns an error if the current block height is less than the v8 upgrade height and contains messages that are not supported until the upgrade height is reached.

Directories

Path Synopsis
package v8constants contains constants related to the v8 upgrade.
package v8constants contains constants related to the v8 upgrade.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL