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

skip block sdk, params migration #884

Merged
merged 108 commits into from
Jun 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
2d96f73
common module added
cgsingh33 Dec 14, 2023
44678fc
genesis added for common
cgsingh33 Dec 15, 2023
b23ba4b
params migration
cgsingh33 Dec 15, 2023
dc6872d
codec fix in asset
cgsingh33 Dec 15, 2023
ea11f4f
testnet v14 upgrade
cgsingh33 Dec 17, 2023
4160aaf
tc fixed
cgsingh33 Dec 18, 2023
97d3d43
linting fixed
cgsingh33 Dec 18, 2023
47bd654
modules refactor
cgsingh33 Jan 11, 2024
c967191
script updated
cgsingh33 Feb 7, 2024
0cf5f41
common module restructured
cgsingh33 Feb 8, 2024
93f6a12
go version 1.21
cgsingh33 Feb 13, 2024
bbf4cce
skip-mev block-sdk
cgsingh33 Feb 13, 2024
6009bfd
mev param update
cgsingh33 Feb 14, 2024
35d7488
go version update
cgsingh33 Feb 14, 2024
a7cd99c
block-sdk fork added
cgsingh33 Feb 15, 2024
b31efe0
multiplayer fix
cgsingh33 Feb 15, 2024
4ab7302
test case fixed
vishnukumavat Feb 16, 2024
9f3f720
adding missed consensus app module
cgsingh33 Feb 18, 2024
b7c10ae
moved go to stable version
cgsingh33 Feb 19, 2024
70c805a
minor refactor and error handling
pratikasr Feb 20, 2024
39c98d9
adding upgrade handlers
pratikasr Feb 20, 2024
dbaa0bb
updating upgrade handlers (testnet)
pratikasr Feb 20, 2024
49baec1
updating testcases
pratikasr Feb 20, 2024
d9d11c9
sdk bump
cgsingh33 Feb 20, 2024
c902679
gasless module initialized
vishnukumavat Feb 25, 2024
252b5f2
golang.org/x/exp replace version modified
cgsingh33 Feb 25, 2024
043e5b6
gasless store interfaces added
vishnukumavat Feb 28, 2024
c2dd64a
query interface for implementations and contracts added
vishnukumavat Feb 28, 2024
c381714
query service update for messages and contracts
vishnukumavat Feb 28, 2024
a4366b3
create gas provider added in message service
vishnukumavat Feb 28, 2024
a1c359c
validations in message service added
vishnukumavat Feb 29, 2024
8f01701
provider query added
vishnukumavat Feb 29, 2024
778b0ae
reserve deposits added
vishnukumavat Feb 29, 2024
91f368a
gas tank update message service added
vishnukumavat Feb 29, 2024
f89a838
block unblock added for consumers
vishnukumavat Feb 29, 2024
0d8287e
block unblock added for consumers
vishnukumavat Feb 29, 2024
75b772a
block, unblock consumers
vishnukumavat Feb 29, 2024
7931a0f
consumer consumptions added
vishnukumavat Feb 29, 2024
cd38d77
fee hijack added
vishnukumavat Mar 1, 2024
76cfe0f
gpids modifiers added
vishnukumavat Mar 1, 2024
ee4e350
consumer allowance at provider configs update
vishnukumavat Mar 1, 2024
25f7818
fee deduction from gastank reserves and consumer validations and elig…
vishnukumavat Mar 1, 2024
b66f136
authorized actor limit added
vishnukumavat Mar 1, 2024
80e13ee
event emitters added in fee consumption
vishnukumavat Mar 1, 2024
864f581
attribute modified
vishnukumavat Mar 1, 2024
b7dbe6c
consumption limit pending check added
vishnukumavat Mar 1, 2024
5c82f5c
consumer consumption limit upgrade added
vishnukumavat Mar 2, 2024
919ae53
free lane removed
cgsingh33 Mar 3, 2024
5d9e6f2
name/anology restructuring of the features
vishnukumavat Mar 4, 2024
e177251
reserve address renamed
vishnukumavat Mar 4, 2024
d7351ae
query tanks by provider
vishnukumavat Mar 5, 2024
4dc9d73
gas consumers by tank id
vishnukumavat Mar 6, 2024
d3f009a
proto rebuild
cgsingh33 Mar 6, 2024
95fba03
tokefactory module addition
cgsingh33 Mar 6, 2024
89f74fb
tokenfactory in app wiring
cgsingh33 Mar 6, 2024
1599d22
wasm bindings for tokenfactory
cgsingh33 Mar 6, 2024
f9f4912
default params added
vishnukumavat Mar 6, 2024
ab4625a
typo fix
vishnukumavat Mar 6, 2024
8bfe556
init and export genesis added
vishnukumavat Mar 6, 2024
9eacae1
expected bank interface refactor
vishnukumavat Mar 7, 2024
6e89508
test cases initialized, create gas tank
vishnukumavat Mar 7, 2024
d6dee22
refactor
vishnukumavat Mar 7, 2024
e29ae6f
testcases added
vishnukumavat Mar 9, 2024
8febc8d
consumer block unblock testcases
vishnukumavat Mar 10, 2024
fd51414
update consumer limit test cases
vishnukumavat Mar 10, 2024
a8fb0d5
test cases
vishnukumavat Mar 10, 2024
c74fe9f
Merge branch 'gasless' into v14upgrade
vishnukumavat Mar 11, 2024
8e3d241
binding test fixed
cgsingh33 Mar 11, 2024
34525d6
go mod fix
cgsingh33 Mar 11, 2024
d570339
gasless upgrade params proto build
cgsingh33 Mar 11, 2024
7962661
update params added
cgsingh33 Mar 11, 2024
91ea397
go mod update
cgsingh33 Mar 11, 2024
a965d81
debt auction multiple lot update
pratikasr Mar 13, 2024
e85f946
harbor burn tx
cgsingh33 Mar 14, 2024
a0521e4
minor refactor
pratikasr Mar 14, 2024
bf9b71b
tx fee burning
vishnukumavat Mar 19, 2024
50cb1ac
logs removed
vishnukumavat Mar 19, 2024
9834cee
gasles moduel and burner permissions added in v14 upgrade
vishnukumavat Mar 19, 2024
1ec0a36
feecollector module removed
cgsingh33 Mar 19, 2024
08f7fe9
module account burn permission issue fixed
cgsingh33 Mar 19, 2024
733a9a0
possible non-determinism sorce map replace with key value in gasless
vishnukumavat Mar 19, 2024
d74e93b
bug fix
vishnukumavat Mar 19, 2024
3753241
refactor
vishnukumavat Mar 19, 2024
648a287
collector refund and deposit code refactored
cgsingh33 Mar 20, 2024
0e8b609
pfm fix
cgsingh33 Mar 20, 2024
1df741d
withdraw stablemint control tx
cgsingh33 Mar 21, 2024
7d303c2
debt param change tx
cgsingh33 Mar 26, 2024
b41c346
revoke debt auctions function added
pratikasr Mar 27, 2024
1df0cb1
minor refactor
pratikasr Mar 27, 2024
41918ca
updating slots revoke logic
pratikasr Mar 29, 2024
6429c7a
minor refactor- for testcase
pratikasr Mar 29, 2024
7c3d9fe
bid query added
cgsingh33 Apr 4, 2024
349c2b8
bid proto correction
cgsingh33 Apr 9, 2024
1da77de
script improved
cgsingh33 Apr 9, 2024
871727b
ASA-2024-007 patch
cgsingh33 Apr 10, 2024
e96a76d
modules removed
cgsingh33 Jun 13, 2024
0d3fca2
go version fix
cgsingh33 Jun 14, 2024
d7223fd
skip-mev version bump
cgsingh33 Jun 14, 2024
ad7876c
testcase, linting fix
cgsingh33 Jun 14, 2024
8aab79e
unsed files removed
cgsingh33 Jun 14, 2024
4494b4c
wasmd,sdk version bumps
cgsingh33 Jun 14, 2024
824d8dc
sdk,math bump retract
cgsingh33 Jun 14, 2024
20452b7
redundant codec removed
cgsingh33 Jun 17, 2024
b13930a
upgrade testcase, back to 6sec BT for testnet
cgsingh33 Jun 17, 2024
f73471b
logger fix
cgsingh33 Jun 17, 2024
d968695
codec refactor
cgsingh33 Jun 17, 2024
5bcece1
TxSizeCostPerByte increased
cgsingh33 Jun 19, 2024
5eced3f
err handling
cgsingh33 Jun 19, 2024
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
Prev Previous commit
Next Next commit
modules removed
  • Loading branch information
cgsingh33 committed Jun 13, 2024
commit e96a76d2015fab955ad1d5cccc3a73546cde484c
7 changes: 1 addition & 6 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@ import (
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/comdex-official/comdex/app/decorators"
"github.com/comdex-official/comdex/x/gasless"
gaslesskeeper "github.com/comdex-official/comdex/x/gasless/keeper"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -32,9 +30,6 @@ type HandlerOptions struct {
TxDecoder sdk.TxDecoder
TxEncoder sdk.TxEncoder
auctionkeeperskip auctionkeeperskip.Keeper

GaslessKeeper gaslesskeeper.Keeper
BankKeeper gasless.BankKeeper
}

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
@@ -63,7 +58,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
gasless.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker, options.GaslessKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
// SetPubKeyDecorator must be called before all signature verification decorators
ante.NewSetPubKeyDecorator(options.AccountKeeper),
ante.NewValidateSigCountDecorator(options.AccountKeeper),
95 changes: 7 additions & 88 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -140,10 +140,6 @@ import (
collectorkeeper "github.com/comdex-official/comdex/x/collector/keeper"
collectortypes "github.com/comdex-official/comdex/x/collector/types"

"github.com/comdex-official/comdex/x/common"
commonkeeper "github.com/comdex-official/comdex/x/common/keeper"
commontypes "github.com/comdex-official/comdex/x/common/types"

"github.com/comdex-official/comdex/x/esm"
esmkeeper "github.com/comdex-official/comdex/x/esm/keeper"
esmtypes "github.com/comdex-official/comdex/x/esm/types"
@@ -194,11 +190,6 @@ import (
liquidationsV2keeper "github.com/comdex-official/comdex/x/liquidationsV2/keeper"
liquidationsV2types "github.com/comdex-official/comdex/x/liquidationsV2/types"

"github.com/comdex-official/comdex/x/gasless"
gaslessclient "github.com/comdex-official/comdex/x/gasless/client"
gaslesskeeper "github.com/comdex-official/comdex/x/gasless/keeper"
gaslesstypes "github.com/comdex-official/comdex/x/gasless/types"

"github.com/comdex-official/comdex/x/auctionsV2"
auctionsV2client "github.com/comdex-official/comdex/x/auctionsV2/client"
auctionsV2keeper "github.com/comdex-official/comdex/x/auctionsV2/keeper"
@@ -215,10 +206,6 @@ import (
auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper"
auctionmoduleskiptypes "github.com/skip-mev/block-sdk/x/auction/types"

"github.com/comdex-official/comdex/x/tokenfactory"
tokenfactorykeeper "github.com/comdex-official/comdex/x/tokenfactory/keeper"
tokenfactorytypes "github.com/comdex-official/comdex/x/tokenfactory/types"

cwasm "github.com/comdex-official/comdex/app/wasm"

mv13 "github.com/comdex-official/comdex/app/upgrades/mainnet/v13"
@@ -271,7 +258,6 @@ func GetGovProposalHandlers() []govclient.ProposalHandler {
proposalHandlers = append(proposalHandlers, liquidityclient.LiquidityProposalHandler...)
proposalHandlers = append(proposalHandlers, liquidationsV2client.LiquidationsV2Handler...)
proposalHandlers = append(proposalHandlers, auctionsV2client.AuctionsV2Handler...)
proposalHandlers = append(proposalHandlers, gaslessclient.GaslessProposalHandler...)

return proposalHandlers
}
@@ -330,9 +316,6 @@ var (
ibcfee.AppModuleBasic{},
liquidationsV2.AppModuleBasic{},
auctionsV2.AppModuleBasic{},
common.AppModuleBasic{},
tokenfactory.AppModuleBasic{},
gasless.AppModuleBasic{},
icq.AppModuleBasic{},
ibchooks.AppModuleBasic{},
packetforward.AppModuleBasic{},
@@ -417,11 +400,8 @@ type App struct {
Rewardskeeper rewardskeeper.Keeper
NewliqKeeper liquidationsV2keeper.Keeper
NewaucKeeper auctionsV2keeper.Keeper
CommonKeeper commonkeeper.Keeper
// auctionKeeper is the keeper that handles processing auction transactions
AuctionKeeperSkip auctionkeeperskip.Keeper
TokenFactoryKeeper tokenfactorykeeper.Keeper
GaslessKeeper gaslesskeeper.Keeper
AuctionKeeperSkip auctionkeeperskip.Keeper

// IBC modules
// transfer module
@@ -470,7 +450,7 @@ func New(
markettypes.StoreKey, bandoraclemoduletypes.StoreKey, lockertypes.StoreKey,
wasm.StoreKey, authzkeeper.StoreKey, auctiontypes.StoreKey, tokenminttypes.StoreKey,
rewardstypes.StoreKey, feegrant.StoreKey, liquiditytypes.StoreKey, esmtypes.ModuleName, lendtypes.StoreKey,
liquidationsV2types.StoreKey, auctionsV2types.StoreKey, commontypes.StoreKey, tokenfactorytypes.StoreKey, gaslesstypes.StoreKey,
liquidationsV2types.StoreKey, auctionsV2types.StoreKey,
ibchookstypes.StoreKey, packetforwardtypes.StoreKey, icqtypes.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, auctionmoduleskiptypes.StoreKey,
)
)
@@ -527,10 +507,7 @@ func New(
app.ParamsKeeper.Subspace(liquiditytypes.ModuleName)
app.ParamsKeeper.Subspace(rewardstypes.ModuleName)
app.ParamsKeeper.Subspace(liquidationsV2types.ModuleName)
app.ParamsKeeper.Subspace(tokenfactorytypes.ModuleName)
app.ParamsKeeper.Subspace(auctionsV2types.ModuleName)
app.ParamsKeeper.Subspace(commontypes.ModuleName)
app.ParamsKeeper.Subspace(gaslesstypes.ModuleName)
app.ParamsKeeper.Subspace(icqtypes.ModuleName)
app.ParamsKeeper.Subspace(packetforwardtypes.ModuleName).WithKeyTable(packetforwardtypes.ParamKeyTable())

@@ -551,12 +528,6 @@ func New(
app.mkeys[capabilitytypes.MemStoreKey],
)

var tokenFactoryCapabilities = []string{
tokenfactorytypes.EnableBurnFrom,
tokenfactorytypes.EnableForceTransfer,
tokenfactorytypes.EnableSetMetadata,
}

// grant capabilities for the ibc and ibc-transfer modules
var (
scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
@@ -934,26 +905,6 @@ func New(
&app.TokenmintKeeper,
)

app.CommonKeeper = commonkeeper.NewKeeper(
app.cdc,
app.keys[commontypes.StoreKey],
app.keys[commontypes.MemStoreKey],
app.GetSubspace(commontypes.ModuleName),
&app.WasmKeeper,
govModAddress,
)

// Create the TokenFactory Keeper
app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
appCodec,
app.keys[tokenfactorytypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.DistrKeeper,
tokenFactoryCapabilities,
govModAddress,
)

app.AuctionKeeperSkip = auctionkeeperskip.NewKeeper(
appCodec,
keys[auctionmoduleskiptypes.StoreKey],
@@ -964,17 +915,6 @@ func New(
govModAddress,
)

app.GaslessKeeper = gaslesskeeper.NewKeeper(
app.cdc,
app.keys[gaslesstypes.StoreKey],
app.GetSubspace(gaslesstypes.ModuleName),
app.interfaceRegistry,
app.AccountKeeper,
app.BankKeeper,
&app.WasmKeeper,
govModAddress,
)

// ICQ Keeper
icqKeeper := icqkeeper.NewKeeper(
appCodec,
@@ -999,9 +939,9 @@ func New(
if err != nil {
panic(fmt.Sprintf("error while reading wasm config: %s", err))
}
supportedFeatures := "iterator,staking,stargate,comdex,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,token_factory"
supportedFeatures := "iterator,staking,stargate,comdex,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3"

wasmOpts = append(cwasm.RegisterCustomPlugins(&app.LockerKeeper, &app.TokenmintKeeper, &app.AssetKeeper, &app.Rewardskeeper, &app.CollectorKeeper, &app.LiquidationKeeper, &app.AuctionKeeper, &app.EsmKeeper, &app.VaultKeeper, &app.LendKeeper, &app.LiquidityKeeper, &app.MarketKeeper, app.BankKeeper, &app.TokenFactoryKeeper, &app.GaslessKeeper), wasmOpts...)
wasmOpts = append(cwasm.RegisterCustomPlugins(&app.LockerKeeper, &app.TokenmintKeeper, &app.AssetKeeper, &app.Rewardskeeper, &app.CollectorKeeper, &app.LiquidationKeeper, &app.AuctionKeeper, &app.EsmKeeper, &app.VaultKeeper, &app.LendKeeper, &app.LiquidityKeeper, &app.MarketKeeper), wasmOpts...)

app.WasmKeeper = wasmkeeper.NewKeeper(
app.cdc,
@@ -1040,8 +980,7 @@ func New(
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IbcKeeper.ClientKeeper)).
AddRoute(liquiditytypes.RouterKey, liquidity.NewLiquidityProposalHandler(app.LiquidityKeeper)).
AddRoute(liquidationsV2types.RouterKey, liquidationsV2.NewLiquidationsV2Handler(app.NewliqKeeper)).
AddRoute(auctionsV2types.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper)).
AddRoute(gaslesstypes.RouterKey, gasless.NewGaslessProposalHandler(app.GaslessKeeper))
AddRoute(auctionsV2types.RouterKey, auctionsV2.NewAuctionsV2Handler(app.NewaucKeeper))

if len(wasmEnabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasmEnabledProposals))
@@ -1147,10 +1086,7 @@ func New(
liquidity.NewAppModule(app.cdc, app.LiquidityKeeper, app.AccountKeeper, app.BankKeeper, app.AssetKeeper),
rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper),
liquidationsV2.NewAppModule(app.cdc, app.NewliqKeeper, app.AccountKeeper, app.BankKeeper),
common.NewAppModule(app.cdc, app.CommonKeeper, app.AccountKeeper, app.BankKeeper, app.WasmKeeper),
auctionsV2.NewAppModule(app.cdc, app.NewaucKeeper, app.BankKeeper),
tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(tokenfactorytypes.ModuleName)),
gasless.NewAppModule(app.cdc, app.GaslessKeeper, app.AccountKeeper, app.BankKeeper),
ibchooks.NewAppModule(app.AccountKeeper),
icq.NewAppModule(*app.ICQKeeper),
packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
@@ -1197,9 +1133,6 @@ func New(
esmtypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
commontypes.ModuleName,
tokenfactorytypes.ModuleName,
gaslesstypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
@@ -1244,9 +1177,6 @@ func New(
esmtypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
commontypes.ModuleName,
tokenfactorytypes.ModuleName,
gaslesstypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
@@ -1295,9 +1225,6 @@ func New(
crisistypes.ModuleName,
liquidationsV2types.ModuleName,
auctionsV2types.ModuleName,
commontypes.ModuleName,
tokenfactorytypes.ModuleName,
gaslesstypes.ModuleName,
ibchookstypes.ModuleName,
icqtypes.ModuleName,
packetforwardtypes.ModuleName,
@@ -1360,8 +1287,6 @@ func New(
TxDecoder: encoding.TxConfig.TxDecoder(),
TxEncoder: encoding.TxConfig.TxEncoder(),
auctionkeeperskip: app.AuctionKeeperSkip,
GaslessKeeper: app.GaslessKeeper,
BankKeeper: app.BankKeeper,
},
)
if err != nil {
@@ -1607,7 +1532,7 @@ func (a *App) RegisterNodeService(clientCtx client.Context) {

func (a *App) ModuleAccountsPermissions() map[string][]string {
return map[string][]string{
authtypes.FeeCollectorName: {authtypes.Burner},
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
@@ -1638,9 +1563,6 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {
rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner},
liquidationsV2types.ModuleName: {authtypes.Minter, authtypes.Burner},
auctionsV2types.ModuleName: {authtypes.Minter, authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
commontypes.ModuleName: nil,
gaslesstypes.ModuleName: nil,
icatypes.ModuleName: nil,
ibcfeetypes.ModuleName: nil,
assettypes.ModuleName: nil,
@@ -1652,7 +1574,7 @@ func (a *App) ModuleAccountsPermissions() map[string][]string {
func (a *App) registerUpgradeHandlers() {
a.UpgradeKeeper.SetUpgradeHandler(
tv14.UpgradeName,
tv14.CreateUpgradeHandlerV14(a.mm, a.configurator, a.CommonKeeper, a.AuctionKeeperSkip, a.LendKeeper, a.TokenFactoryKeeper, a.AccountKeeper),
tv14.CreateUpgradeHandlerV14(a.mm, a.configurator, a.AuctionKeeperSkip, a.LendKeeper),
)
// When a planned update height is reached, the old binary will panic
// writing on disk the height and name of the update that triggered it
@@ -1689,10 +1611,7 @@ func upgradeHandlers(upgradeInfo upgradetypes.Plan, a *App, storeUpgrades *store
case upgradeInfo.Name == tv14.UpgradeName && !a.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height):
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{
commontypes.StoreKey,
auctionmoduleskiptypes.StoreKey,
tokenfactorytypes.ModuleName,
gaslesstypes.ModuleName,
},
}
}
5 changes: 2 additions & 3 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
@@ -14,14 +14,13 @@ import (
"github.com/cosmos/cosmos-sdk/std"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"
"testing"
"time"
// simappparams "cosmossdk.io/simapp/params"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
)

// DefaultConsensusParams defines the default Tendermint consensus params used in
@@ -52,7 +51,7 @@ func MakeTestEncodingConfig() moduletestutil.TestEncodingConfig {
return encodingConfig
}

func setup(t *testing.T, withGenesis bool) (*App, GenesisState) {
func setup(_ *testing.T, withGenesis bool) (*App, GenesisState) {
db := dbm.NewMemDB()
//encCdc := MakeTestEncodingConfig()
app := New(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig(), simtestutil.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts)
33 changes: 0 additions & 33 deletions app/upgrades/testnet/v14/upgrades.go
Original file line number Diff line number Diff line change
@@ -1,69 +1,36 @@
package v14

import (
"fmt"
commonkeeper "github.com/comdex-official/comdex/x/common/keeper"
commontypes "github.com/comdex-official/comdex/x/common/types"
lendkeeper "github.com/comdex-official/comdex/x/lend/keeper"
tokenfactorykeeper "github.com/comdex-official/comdex/x/tokenfactory/keeper"
tokenfactorytypes "github.com/comdex-official/comdex/x/tokenfactory/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
auctionkeeperskip "github.com/skip-mev/block-sdk/x/auction/keeper"
auctionmoduleskiptypes "github.com/skip-mev/block-sdk/x/auction/types"
"strings"
)

// We now charge 2 million gas * gas price to create a denom.
const NewDenomCreationGasConsume uint64 = 2_000_000

func CreateUpgradeHandlerV14(
mm *module.Manager,
configurator module.Configurator,
commonkeeper commonkeeper.Keeper,
auctionkeeperskip auctionkeeperskip.Keeper,
lendKeeper lendkeeper.Keeper,
tokenfactorykeeper tokenfactorykeeper.Keeper,
accountKeeper authkeeper.AccountKeeper,

) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {

ctx.Logger().Info("Applying test net upgrade - v14.0.0")

vm, err := mm.RunMigrations(ctx, configurator, fromVM)
if err != nil {
return vm, err
}
moduleAccI := accountKeeper.GetModuleAccount(ctx, authtypes.FeeCollectorName)
moduleAcc := moduleAccI.(*authtypes.ModuleAccount)
moduleAcc.Permissions = []string{authtypes.Burner}
accountKeeper.SetModuleAccount(ctx, moduleAcc)

ctx.Logger().Info("set common module params")
commonkeeper.SetParams(ctx, commontypes.DefaultParams())

ctx.Logger().Info("setting default params for MEV module (x/auction)")
if err = setDefaultMEVParams(ctx, auctionkeeperskip); err != nil {
return nil, err
}

// x/TokenFactory
// Use denom creation gas consumption instead of fee for contract developers
ctx.Logger().Info("setting params for Tokenfactory module (x/tokenfactory)")
updatedTf := tokenfactorytypes.Params{
DenomCreationFee: nil,
DenomCreationGasConsume: NewDenomCreationGasConsume,
}

if err := tokenfactorykeeper.SetParams(ctx, updatedTf); err != nil {
return vm, err
}
ctx.Logger().Info(fmt.Sprintf("updated tokenfactory params to %v", updatedTf))

//TODO: uncomment this before mainnet upgrade
//UpdateLendParams(ctx, lendKeeper)
return vm, err
Loading