Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions .github/workflows/integration-test-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@
]
},
{
"_comment": "Suites: SeiDB State Store, Mint & Staking & Bank, Distribution. SeiDB State Store runs first because it asserts absolute wasm code counts (genesis + its own fixtures). TestMintModule asserts an absolute usei total supply, so nothing upstream of it in this row may mint or burn usei (SeiDB SS is safe today: fees are not burned and tokenfactory creation does not burn usei).",
"_comment": "Suites: SeiDB State Store, Mint & Staking & Bank, Distribution. SeiDB State Store runs first because it asserts absolute wasm code counts (genesis + its own fixtures). TestMintModule asserts an absolute usei total supply, so nothing upstream of it in this row may mint or burn usei (SeiDB SS is safe today: fees are not burned).",
"name": "Cosmos Modules (SeiDB SS, Mint & Staking & Bank, Distribution)",
"scripts": [
"docker exec sei-node-0 integration_test/contracts/deploy_wasm_contracts.sh",
"docker exec sei-node-0 integration_test/contracts/create_tokenfactory_denoms.sh",
"go test -tags yaml_integration -v -timeout $JOB_TIMEOUT ./integration_test/runner/... -run TestSeiDBStateStore",
"go test -tags yaml_integration -v -timeout $JOB_TIMEOUT ./integration_test/runner/... -run \"TestMintModule|TestStakingModule|TestBankModule\"",
"go test -tags yaml_integration -v -timeout $JOB_TIMEOUT ./integration_test/runner/... -run TestDistributionModule"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

## Unreleased
sei-chain
* [#4536](https://github.com/sei-protocol/sei-chain/pull/4536) Remove the tokenfactory module behind the v6.8 upgrade: module, store, params, protobuf schema, CLI, wasm bindings, the bank `factory/` denom transfer allowlist and tooling are gone; only the tokenfactory Msg types remain decodable so historical blocks still trace. Existing `factory/` balances stay in bank but can no longer be minted or burned, and denoms that had a transfer allowlist become freely transferable. The upgrade deletes at most 1,000 allowlists from the bank store and leaves any beyond that in place, unenforced. App-hash breaking at the upgrade height.
* [#4319](https://github.com/sei-protocol/sei-chain/pull/4319) Remove the oracle module behind the v6.8 upgrade: module, store, protobuf schema, wasm query route and tooling are gone; only the oracle Msg types remain decodable so historical blocks still trace. App-hash breaking at the upgrade height.
* [#4332](https://github.com/sei-protocol/sei-chain/pull/4332) Bump sei-protocol/go-ethereum to v1.15.7-sei-21
* [#4329](https://github.com/sei-protocol/sei-chain/pull/4329) Add Giga fetch/serve and BlockDB prune metrics
Expand Down
26 changes: 3 additions & 23 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import (
"github.com/sei-protocol/sei-chain/app/migration"
appparams "github.com/sei-protocol/sei-chain/app/params"
"github.com/sei-protocol/sei-chain/app/retiredoracle"
"github.com/sei-protocol/sei-chain/app/retiredtokenfactory"
"github.com/sei-protocol/sei-chain/app/upgrades"
"github.com/sei-protocol/sei-chain/app/upgrades/kvrepair"
v0upgrade "github.com/sei-protocol/sei-chain/app/upgrades/v0"
Expand Down Expand Up @@ -139,9 +140,6 @@ import (
mintclient "github.com/sei-protocol/sei-chain/x/mint/client/cli"
mintkeeper "github.com/sei-protocol/sei-chain/x/mint/keeper"
minttypes "github.com/sei-protocol/sei-chain/x/mint/types"
tokenfactorymodule "github.com/sei-protocol/sei-chain/x/tokenfactory"
tokenfactorykeeper "github.com/sei-protocol/sei-chain/x/tokenfactory/keeper"
tokenfactorytypes "github.com/sei-protocol/sei-chain/x/tokenfactory/types"
dbm "github.com/tendermint/tm-db"
"go.opentelemetry.io/otel/attribute"
otelmetric "go.opentelemetry.io/otel/metric"
Expand Down Expand Up @@ -206,7 +204,6 @@ var (
evm.AppModuleBasic{},
wasm.AppModuleBasic{},
epochmodule.AppModuleBasic{},
tokenfactorymodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
)

Expand All @@ -220,7 +217,6 @@ var (
govtypes.ModuleName: {authtypes.Burner},
wasm.ModuleName: {authtypes.Burner},
evmtypes.ModuleName: {authtypes.Minter, authtypes.Burner},
tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
// this line is used by starport scaffolding # stargate/app/maccPerms
}

Expand All @@ -229,7 +225,7 @@ var (
// retiredModuleAccounts are module accounts whose modules no longer exist
// but whose deterministic addresses stay blocked so funds cannot be sent
// to an account nothing can sign for.
retiredModuleAccounts = []string{"transfer"}
retiredModuleAccounts = []string{"transfer", retiredtokenfactory.ModuleName}

// kvStoreKeyNames is the canonical, in-order list of module KV store
// names mounted on the SeiDB / memiavl backend. It is the single source
Expand All @@ -244,7 +240,6 @@ var (
evidencetypes.StoreKey,
evmtypes.StoreKey, wasm.StoreKey,
epochmoduletypes.StoreKey,
tokenfactorytypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
}

Expand Down Expand Up @@ -381,8 +376,6 @@ type App struct {

EpochKeeper epochmodulekeeper.Keeper

TokenFactoryKeeper tokenfactorykeeper.Keeper

BeginBlockKeepers legacyabci.BeginBlockKeepers
EndBlockKeepers legacyabci.EndBlockKeepers
CheckTxKeepers legacyabci.CheckTxKeepers
Expand Down Expand Up @@ -583,22 +576,12 @@ func New(
).SetHooks(epochmoduletypes.NewMultiEpochHooks(
app.MintKeeper.Hooks()))

app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
appCodec,
app.keys[tokenfactorytypes.StoreKey],
app.GetSubspace(tokenfactorytypes.ModuleName),
app.AccountKeeper,
app.BankKeeper.(bankkeeper.BaseKeeper).WithMintCoinsRestriction(tokenfactorytypes.NewTokenFactoryDenomMintCoinsRestriction()),
app.DistrKeeper,
)

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
supportedFeatures := "iterator,staking,stargate,sei"
wasmOpts = append(
wasmbinding.RegisterCustomPlugins(
&app.EpochKeeper,
&app.TokenFactoryKeeper,
&app.AccountKeeper,
app.MsgServiceRouter(),
app.BankKeeper,
Expand Down Expand Up @@ -812,7 +795,6 @@ func New(
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
evm.NewAppModule(appCodec, &app.EvmKeeper),
epochModule,
tokenfactorymodule.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
// this line is used by starport scaffolding # stargate/app/appModule
)
Expand Down Expand Up @@ -862,7 +844,6 @@ func New(
genutiltypes.ModuleName,
evidencetypes.ModuleName,
authz.ModuleName,
tokenfactorytypes.ModuleName,
epochmoduletypes.ModuleName,
wasm.ModuleName,
evmtypes.ModuleName,
Expand Down Expand Up @@ -1047,7 +1028,7 @@ func (app *App) SetStoreUpgradeHandlers() {

if upgradeInfo.Name == "1.1.1beta" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Added: []string{tokenfactorytypes.StoreKey},
Added: []string{retiredtokenfactory.ModuleName},
}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
Expand Down Expand Up @@ -2701,7 +2682,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(wasm.ModuleName)
paramsKeeper.Subspace(evmtypes.ModuleName)
paramsKeeper.Subspace(epochmoduletypes.ModuleName)
paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
paramsKeeper.Subspace(migration.SubspaceName).WithKeyTable(migration.ParamKeyTable())
// this line is used by starport scaffolding # stargate/app/paramSubspace

Expand Down
5 changes: 0 additions & 5 deletions app/apptesting/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sd
return valAddr
}

// SetupTokenFactory sets up a token module account for the TokenFactoryKeeper.
func (s *KeeperTestHelper) SetupTokenFactory() {
s.App.TokenFactoryKeeper.CreateModuleAccount(s.Ctx)
}

// EndBlock ends the block.
func (s *KeeperTestHelper) EndBlock() {
legacyabci.EndBlock(s.Ctx, s.Ctx.BlockHeight(), 0, s.App.EndBlockKeepers)
Expand Down
5 changes: 5 additions & 0 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"github.com/sei-protocol/sei-chain/app/params"
"github.com/sei-protocol/sei-chain/app/retiredoracle"
"github.com/sei-protocol/sei-chain/app/retiredtokenfactory"
"github.com/sei-protocol/sei-chain/app/retiredvesting"
"github.com/sei-protocol/sei-chain/sei-cosmos/std"
)
Expand All @@ -16,6 +17,8 @@ func MakeEncodingConfig() params.EncodingConfig {
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredoracle.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredoracle.RegisterLegacyAminoCodec(encodingConfig.Amino)
retiredtokenfactory.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredtokenfactory.RegisterLegacyAminoCodec(encodingConfig.Amino)
retiredvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}
Expand All @@ -29,6 +32,8 @@ func MakeLegacyEncodingConfig() params.EncodingConfig {
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredoracle.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredoracle.RegisterLegacyAminoCodec(encodingConfig.Amino)
retiredtokenfactory.RegisterInterfaces(encodingConfig.InterfaceRegistry)
retiredtokenfactory.RegisterLegacyAminoCodec(encodingConfig.Amino)
retiredvesting.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}
40 changes: 12 additions & 28 deletions x/tokenfactory/types/codec.go → app/retiredtokenfactory/codec.go
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
package types
package retiredtokenfactory

import (
"github.com/sei-protocol/sei-chain/sei-cosmos/codec"
cdctypes "github.com/sei-protocol/sei-chain/sei-cosmos/codec/types"
codectypes "github.com/sei-protocol/sei-chain/sei-cosmos/codec/types"
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"

// this line is used by starport scaffolding # 1
"github.com/sei-protocol/sei-chain/sei-cosmos/types/msgservice"
)

func RegisterCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgCreateDenom{}, "tokenfactory/MsgCreateDenom", nil)
cdc.RegisterConcrete(&MsgUpdateDenom{}, "tokenfactory/MsgUpdateDenom", nil)
cdc.RegisterConcrete(&MsgMint{}, "tokenfactory/MsgMint", nil)
cdc.RegisterConcrete(&MsgBurn{}, "tokenfactory/MsgBurn", nil)
cdc.RegisterConcrete(&MsgChangeAdmin{}, "tokenfactory/MsgChangeAdmin", nil)
cdc.RegisterConcrete(&MsgSetDenomMetadata{}, "tokenfactory/MsgSetDenomMetadata", nil)
}

func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgCreateDenom{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgUpdateDenom{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgMint{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgBurn{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgChangeAdmin{},
)
registry.RegisterImplementations((*sdk.Msg)(nil),
&MsgSetDenomMetadata{},
)
}

msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgCreateDenom{}, "tokenfactory/MsgCreateDenom", nil)
cdc.RegisterConcrete(&MsgUpdateDenom{}, "tokenfactory/MsgUpdateDenom", nil)
cdc.RegisterConcrete(&MsgMint{}, "tokenfactory/MsgMint", nil)
cdc.RegisterConcrete(&MsgBurn{}, "tokenfactory/MsgBurn", nil)
cdc.RegisterConcrete(&MsgChangeAdmin{}, "tokenfactory/MsgChangeAdmin", nil)
cdc.RegisterConcrete(&MsgSetDenomMetadata{}, "tokenfactory/MsgSetDenomMetadata", nil)
}

var (
Expand All @@ -47,8 +32,7 @@ var (
)

func init() {
RegisterCodec(amino)
RegisterLegacyAminoCodec(amino)
sdk.RegisterLegacyAminoCodec(amino)

amino.Seal()
}
6 changes: 6 additions & 0 deletions app/retiredtokenfactory/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package retiredtokenfactory

import "github.com/sei-protocol/sei-chain/sei-cosmos/types/errors"

// ErrDeprecated is the error every retired tokenfactory message fails validation with.
var ErrDeprecated = errors.Register(ModuleName, 26, "tokenfactory module is deprecated") // codes 2-25 keep their historical meanings
107 changes: 107 additions & 0 deletions app/retiredtokenfactory/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Package retiredtokenfactory provides decode-only compatibility for retired tokenfactory transactions.
package retiredtokenfactory

import (
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
)

const (
// ModuleName is the name of the retired tokenfactory module, which also names
// its deleted store and its error codespace.
ModuleName = "tokenfactory"

TypeMsgCreateDenom = "create_denom"
TypeMsgUpdateDenom = "update_denom"
TypeMsgMint = "mint"
TypeMsgBurn = "burn"
TypeMsgChangeAdmin = "change_admin"
TypeMsgSetDenomMetadata = "set_denom_metadata"
)

var (
_ sdk.Msg = (*MsgCreateDenom)(nil)
_ sdk.Msg = (*MsgUpdateDenom)(nil)
_ sdk.Msg = (*MsgMint)(nil)
_ sdk.Msg = (*MsgBurn)(nil)
_ sdk.Msg = (*MsgChangeAdmin)(nil)
_ sdk.Msg = (*MsgSetDenomMetadata)(nil)
)

func (m MsgCreateDenom) Route() string { return ModuleName }

func (m MsgCreateDenom) Type() string { return TypeMsgCreateDenom }

func (m MsgCreateDenom) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgCreateDenom) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgCreateDenom) ValidateBasic() error { return ErrDeprecated }

func (m MsgUpdateDenom) Route() string { return ModuleName }

func (m MsgUpdateDenom) Type() string { return TypeMsgUpdateDenom }

func (m MsgUpdateDenom) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgUpdateDenom) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgUpdateDenom) ValidateBasic() error { return ErrDeprecated }

func (m MsgMint) Route() string { return ModuleName }

func (m MsgMint) Type() string { return TypeMsgMint }

func (m MsgMint) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgMint) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgMint) ValidateBasic() error { return ErrDeprecated }

func (m MsgBurn) Route() string { return ModuleName }

func (m MsgBurn) Type() string { return TypeMsgBurn }

func (m MsgBurn) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgBurn) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgBurn) ValidateBasic() error { return ErrDeprecated }

func (m MsgChangeAdmin) Route() string { return ModuleName }

func (m MsgChangeAdmin) Type() string { return TypeMsgChangeAdmin }

func (m MsgChangeAdmin) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgChangeAdmin) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgChangeAdmin) ValidateBasic() error { return ErrDeprecated }

func (m MsgSetDenomMetadata) Route() string { return ModuleName }

func (m MsgSetDenomMetadata) Type() string { return TypeMsgSetDenomMetadata }

func (m MsgSetDenomMetadata) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
}

func (m MsgSetDenomMetadata) GetSigners() []sdk.AccAddress { return senderSigners(m.Sender) }

func (m MsgSetDenomMetadata) ValidateBasic() error { return ErrDeprecated }

// senderSigners returns the sender as the only signer, or an empty address when
// the sender does not parse.
func senderSigners(sender string) []sdk.AccAddress {
addr, _ := sdk.AccAddressFromBech32(sender)
return []sdk.AccAddress{addr}
}
Loading
Loading