Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.1 upgrade - Farnesene #159

Merged
merged 9 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
uses: actions/dependency-review-action@v3
1 change: 0 additions & 1 deletion .github/workflows/interchaintest-E2E.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ jobs:
- "ictest-ibc"
# - "ictest-pob"
# - "ictest-drip"
- "ictest-burn"
# - "ictest-cwhooks"
# - "ictest-clock"
fail-fast: false
Expand Down
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,6 @@ ictest-pfm: rm-testcache
ictest-tokenfactory: rm-testcache
cd interchaintest && go test -race -v -run TestTerpTokenFactory .

ictest-burn: rm-testcache
cd interchaintest && go test -race -v -run TestTerpBurnModule .

# ictest-clock: rm-testcache
# cd interchaintest && go test -race -v -run TestTerpClock .

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ This framework is like a craft genetics lineage, one that has been fine tuned wi
If we forgot you in this list, let us know or open a PR ::)


## DISCLAIMER
# Disclaimer
TERP-CORE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. No developer or entity involved in running terp-core software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of Stargaze, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value. Although Discover Decentralization, LLC and it's affiliates developed the initial code for Terp-Core, it does not own or control the Terp Network, which is run by a decentralized validator set.
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ Please assist the Terp Network Security team by following these guidelines:
- Demonstrate good faith by not disrupting the Terp Network's networks, data, services or communities;

_Every effort will be made to handle and address security issues as quickly and efficiently as possible._

5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import (
"github.com/terpnetwork/terp-core/v4/app/openapiconsole"
v2 "github.com/terpnetwork/terp-core/v4/app/upgrades/v2"
v3 "github.com/terpnetwork/terp-core/v4/app/upgrades/v3"
v4 "github.com/terpnetwork/terp-core/v4/app/upgrades/v4"
"github.com/terpnetwork/terp-core/v4/app/upgrades/v4_1"
"github.com/terpnetwork/terp-core/v4/docs"

"github.com/CosmWasm/wasmd/x/wasm"
Expand Down Expand Up @@ -100,7 +100,8 @@ var (
Upgrades = []upgrades.Upgrade{
v2.Upgrade,
v3.Upgrade,
v4.Upgrade,
// v4.Upgrade, patched for v4_1
v4_1.Upgrade,
}
)

Expand Down
56 changes: 39 additions & 17 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,25 +92,27 @@ import (
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"

denomburn "github.com/terpnetwork/terp-core/v4/x/burn"
// clockkeeper "github.com/terpnetwork/terp-core/v4/x/clock/keeper"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
clockkeeper "github.com/terpnetwork/terp-core/v4/x/clock/keeper"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
dripkeeper "github.com/terpnetwork/terp-core/v4/x/drip/keeper"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"
feesharekeeper "github.com/terpnetwork/terp-core/v4/x/feeshare/keeper"
feesharetypes "github.com/terpnetwork/terp-core/v4/x/feeshare/types"

"github.com/terpnetwork/terp-core/v4/x/globalfee"
globalfeekeeper "github.com/terpnetwork/terp-core/v4/x/globalfee/keeper"
globalfeetypes "github.com/terpnetwork/terp-core/v4/x/globalfee/types"

// token factory
// cwhookskeeper "github.com/terpnetwork/terp-core/v4/x/cw-hooks/keeper"
// cwhookstypes "github.com/terpnetwork/terp-core/v4/x/cw-hooks/types"

"github.com/terpnetwork/terp-core/v4/x/tokenfactory/bindings"
tokenfactorykeeper "github.com/terpnetwork/terp-core/v4/x/tokenfactory/keeper"
tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"
)

var (
wasmCapabilities = "iterator,staking,stargate,token_factory,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,tokenfactory"
wasmCapabilities = "iterator,staking,stargate,token_factory,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_1_5,tokenfactory"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 2 token_factory and tokenfactory


tokenFactoryCapabilities = []string{
tokenfactorytypes.EnableBurnFrom,
Expand All @@ -135,7 +137,6 @@ var maccPerms = map[string][]string{
globalfee.ModuleName: nil,
wasmtypes.ModuleName: {authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
denomburn.ModuleName: {authtypes.Burner},
}

type AppKeepers struct {
Expand Down Expand Up @@ -175,9 +176,10 @@ type AppKeepers struct {
PacketForwardKeeper *packetforwardkeeper.Keeper
ICQKeeper icqkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
// ClockKeeper clockkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
ClockKeeper clockkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
// CWHooksKeeper cwhookskeeper.Keeper
WasmKeeper wasmkeeper.Keeper

ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
Expand All @@ -187,6 +189,8 @@ type AppKeepers struct {
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
ScopedICQKeeper capabilitykeeper.ScopedKeeper

DripKeeper dripkeeper.Keeper

// Middleware wrapper
Ics20WasmHooks *ibchooks.WasmHooks
HooksICS4Wrapper ibchooks.ICS4Middleware
Expand Down Expand Up @@ -324,7 +328,10 @@ func NewAppKeepers(
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
stakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(), appKeepers.SlashingKeeper.Hooks()),
stakingtypes.NewMultiStakingHooks(appKeepers.DistrKeeper.Hooks(),
appKeepers.SlashingKeeper.Hooks(),
// appKeepers.CWHooksKeeper.StakingHooks(),
),
)
appKeepers.StakingKeeper = stakingKeeper

Expand Down Expand Up @@ -364,7 +371,7 @@ func NewAppKeepers(
)
appKeepers.GovKeeper = *govKeeper.SetHooks(
govtypes.NewMultiGovHooks(
// register the governance hooks
// appKeepers.CWHooksKeeper.GovHooks(),
),
)

Expand Down Expand Up @@ -530,10 +537,6 @@ func NewAppKeepers(
})
wasmOpts = append(wasmOpts, querierOpts)

denomBurnerPlugin := denomburn.NewBurnerPlugin(appKeepers.BankKeeper, appKeepers.MintKeeper)
burnOverride := wasmkeeper.WithMessageHandler(wasmkeeper.NewBurnCoinMessageHandler(denomBurnerPlugin))
wasmOpts = append(wasmOpts, burnOverride)

appKeepers.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
appKeepers.keys[wasmtypes.StoreKey],
Expand Down Expand Up @@ -574,9 +577,28 @@ func NewAppKeepers(
appKeepers.keys[globalfeetypes.StoreKey],
govModAddress,
)
// appKeepers.ClockKeeper = clockkeeper.NewKeeper(
// appKeepers.keys[clocktypes.StoreKey],

appKeepers.DripKeeper = dripkeeper.NewKeeper(
appKeepers.keys[driptypes.StoreKey],
appCodec,
appKeepers.BankKeeper,
authtypes.FeeCollectorName,
govModAddress,
)

appKeepers.ClockKeeper = clockkeeper.NewKeeper(
appKeepers.keys[clocktypes.StoreKey],
appCodec,
*appKeepers.ContractKeeper,
govModAddress,
)

// appKeepers.CWHooksKeeper = cwhookskeeper.NewKeeper(
// appKeepers.keys[cwhookstypes.StoreKey],
// appCodec,
// stakingKeeper,
// *govKeeper,
// appKeepers.WasmKeeper,
// *appKeepers.ContractKeeper,
// govModAddress,
// )
Expand Down
9 changes: 7 additions & 2 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ import (
icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v7/types"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"

// cwhookstypes "github.com/terpnetwork/terp-core/v4/x/cw-hooks/types"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand Down Expand Up @@ -68,7 +71,9 @@ func (appKeepers *AppKeepers) GenerateKeys() {
ibchookstypes.StoreKey,
feesharetypes.StoreKey,
globalfeetypes.StoreKey,
// clocktypes.StoreKey,
clocktypes.StoreKey,
driptypes.StoreKey,
// cwhookstypes.StoreKey,
tokenfactorytypes.StoreKey,
)

Expand Down
29 changes: 22 additions & 7 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"

// "github.com/terpnetwork/terp-core/v4/x/clock"
// clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"
"github.com/terpnetwork/terp-core/v4/x/clock"
clocktypes "github.com/terpnetwork/terp-core/v4/x/clock/types"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/x/auth"
Expand Down Expand Up @@ -66,10 +66,15 @@ import (
"github.com/terpnetwork/terp-core/v4/x/globalfee"
"github.com/terpnetwork/terp-core/v4/x/tokenfactory"

"github.com/terpnetwork/terp-core/v4/x/drip"
driptypes "github.com/terpnetwork/terp-core/v4/x/drip/types"

"github.com/cosmos/cosmos-sdk/x/group"
ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"

// cwhooks "github.com/terpnetwork/terp-core/v4/x/cw-hooks"

tokenfactorytypes "github.com/terpnetwork/terp-core/v4/x/tokenfactory/types"

groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
Expand Down Expand Up @@ -110,8 +115,10 @@ var ModuleBasics = module.NewBasicManager(
packetforward.AppModuleBasic{},
feeshare.AppModuleBasic{},
globalfee.AppModuleBasic{},
// clock.AppModuleBasic{},
clock.AppModuleBasic{},
drip.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
// cwhooks.AppModuleBasic{},
)

func appModules(
Expand Down Expand Up @@ -157,7 +164,8 @@ func appModules(
ica.NewAppModule(&app.AppKeepers.ICAControllerKeeper, &app.AppKeepers.ICAHostKeeper),
icq.NewAppModule(app.AppKeepers.ICQKeeper),
packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper),
// clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper),
clock.NewAppModule(appCodec, app.AppKeepers.ClockKeeper),
// cwhooks.NewAppModule(appCodec, app.AppKeepers.CWHooksKeeper),
ibchooks.NewAppModule(app.AppKeepers.AccountKeeper),
crisis.NewAppModule(app.AppKeepers.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
}
Expand Down Expand Up @@ -189,6 +197,7 @@ func simulationModules(
ibc.NewAppModule(app.AppKeepers.IBCKeeper),
transfer.NewAppModule(app.AppKeepers.TransferKeeper),
feeshare.NewAppModule(app.AppKeepers.FeeShareKeeper, app.AppKeepers.AccountKeeper, app.GetSubspace(feesharetypes.ModuleName)),
drip.NewAppModule(app.AppKeepers.DripKeeper, app.AppKeepers.AccountKeeper),
ibcfee.NewAppModule(app.AppKeepers.IBCFeeKeeper),
}
}
Expand Down Expand Up @@ -221,11 +230,13 @@ func orderBeginBlockers() []string {
ibcfeetypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Expand Down Expand Up @@ -258,11 +269,13 @@ func orderEndBlockers() []string {
ibcfeetypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Expand All @@ -280,13 +293,15 @@ func orderInitBlockers() []string {
icatypes.ModuleName,
ibcfeetypes.ModuleName,
// wasm after ibc transfer
driptypes.ModuleName,
feesharetypes.ModuleName,
globalfee.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
ibchookstypes.ModuleName,
tokenfactorytypes.ModuleName,
// clocktypes.ModuleName,
clocktypes.ModuleName,
// cwhooks.ModuleName,
wasmtypes.ModuleName,
}
}
Loading
Loading