diff --git a/CHANGELOG.md b/CHANGELOG.md index 37a61f0a3..992107293 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Features +### Features + +* [#1670](https://github.com/NibiruChain/nibiru/pull/1670) - feat(inflation): Make inflation polynomial + +### State Machine Breaking + +* [#1682](https://github.com/NibiruChain/nibiru/pull/1682) - feat: add upgrade handler for v1.1.0 + +## [v1.0.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.0.0) + +### Features * [#1596](https://github.com/NibiruChain/nibiru/pull/1596) - epic(tokenfactory): State transitions, collections, genesis import and export, and app wiring * [#1607](https://github.com/NibiruChain/nibiru/pull/1607) - Token factory transaction messages for CreateDenom, ChangeAdmin, and UpdateModuleParams @@ -50,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1656](https://github.com/NibiruChain/nibiru/pull/1656) - feat(perp): Make the collateral denom a stateful collections.Item * [#1663](https://github.com/NibiruChain/nibiru/pull/1663) - feat(perp): Add volume based rebates * [#1670](https://github.com/NibiruChain/nibiru/pull/1670) - feat(inflation): Make inflation polynomial +* [#1683](https://github.com/NibiruChain/nibiru/pull/1683) - feat(perp): Add `StartDnREpoch` to `AfterEpochEnd` hook ### State Machine Breaking diff --git a/app/app.go b/app/app.go index f6322ee0a..3e28de638 100644 --- a/app/app.go +++ b/app/app.go @@ -171,6 +171,8 @@ func NewNibiruApp( app.initModuleManager(encodingConfig, skipGenesisInvariants) + app.setupUpgrades() + // NOTE: Any module instantiated in the module manager that is later modified // must be passed by reference here. diff --git a/app/keepers.go b/app/keepers.go index 84619298c..6452aa3b0 100644 --- a/app/keepers.go +++ b/app/keepers.go @@ -626,6 +626,9 @@ func orderedModuleNames() []string { // -------------------------------------------------------------------- // Cosmos-SDK modules // + // NOTE: (BeginBlocker requirement): upgrade module must occur first + upgradetypes.ModuleName, + // NOTE (InitGenesis requirement): Capability module must occur // first so that it can initialize any capabilities, allowing other // modules that want to create or claim capabilities afterwards in @@ -654,7 +657,6 @@ func orderedModuleNames() []string { authz.ModuleName, feegrant.ModuleName, paramstypes.ModuleName, - upgradetypes.ModuleName, vestingtypes.ModuleName, // -------------------------------------------------------------------- @@ -707,7 +709,6 @@ func (app *NibiruApp) initModuleManager( app.initAppModules(encodingConfig, skipGenesisInvariants)..., ) - // Init module orders for hooks and genesis orderedModules := orderedModuleNames() app.mm.SetOrderBeginBlockers(orderedModules...) app.mm.SetOrderEndBlockers(orderedModules...) @@ -743,7 +744,7 @@ func (app *NibiruApp) initModuleManager( } } -// ModuleBasicManager: The app's collection of module.AppModuleBasic +// ModuleBasicManager The app's collection of module.AppModuleBasic // implementations. These set up non-dependant module elements, such as codec // registration and genesis verification. func ModuleBasicManager() module.BasicManager { diff --git a/app/upgrades.go b/app/upgrades.go new file mode 100644 index 000000000..4a863d0aa --- /dev/null +++ b/app/upgrades.go @@ -0,0 +1,42 @@ +package app + +import ( + "fmt" + + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/NibiruChain/nibiru/app/upgrades" + "github.com/NibiruChain/nibiru/app/upgrades/v1_1_0" +) + +var Upgrades = []upgrades.Upgrade{ + v1_1_0.Upgrade, +} + +func (app *NibiruApp) setupUpgrades() { + app.setUpgradeHandlers() + app.setUpgradeStoreLoaders() +} + +func (app *NibiruApp) setUpgradeHandlers() { + for _, u := range Upgrades { + app.upgradeKeeper.SetUpgradeHandler(u.UpgradeName, u.CreateUpgradeHandler()) + } +} + +func (app *NibiruApp) setUpgradeStoreLoaders() { + upgradeInfo, err := app.upgradeKeeper.ReadUpgradeInfoFromDisk() + if err != nil { + panic(fmt.Sprintf("failed to read upgrade info from disk: %s", err.Error())) + } + + if app.upgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + return + } + + for _, u := range Upgrades { + if upgradeInfo.Name == u.UpgradeName { + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &u.StoreUpgrades)) + } + } +} diff --git a/app/upgrades/types.go b/app/upgrades/types.go new file mode 100644 index 000000000..caa328bb8 --- /dev/null +++ b/app/upgrades/types.go @@ -0,0 +1,14 @@ +package upgrades + +import ( + store "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/x/upgrade/types" +) + +type Upgrade struct { + UpgradeName string + + CreateUpgradeHandler func() types.UpgradeHandler + + StoreUpgrades store.StoreUpgrades +} diff --git a/app/upgrades/v1_1_0/constants.go b/app/upgrades/v1_1_0/constants.go new file mode 100644 index 000000000..9a384e5b5 --- /dev/null +++ b/app/upgrades/v1_1_0/constants.go @@ -0,0 +1,21 @@ +package v1_1_0 + +import ( + "github.com/cosmos/cosmos-sdk/store/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + + "github.com/NibiruChain/nibiru/app/upgrades" + inflationtypes "github.com/NibiruChain/nibiru/x/inflation/types" +) + +const UpgradeName = "v1.1.0" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: func() upgradetypes.UpgradeHandler { + return nil + }, + StoreUpgrades: types.StoreUpgrades{ + Added: []string{inflationtypes.ModuleName}, + }, +} diff --git a/proto/nibiru/perp/v2/genesis.proto b/proto/nibiru/perp/v2/genesis.proto index 8d5300acb..6e66a77e8 100644 --- a/proto/nibiru/perp/v2/genesis.proto +++ b/proto/nibiru/perp/v2/genesis.proto @@ -65,6 +65,8 @@ message GenesisState { repeated DNRAllocation rebates_allocations = 12 [ (gogoproto.nullable) = false ]; + string dnr_epoch_name = 14; + message GlobalVolume { uint64 epoch = 1; string volume = 2 [ diff --git a/x/perp/v2/keeper/dnr.go b/x/perp/v2/keeper/dnr.go index 909f79462..dfffda830 100644 --- a/x/perp/v2/keeper/dnr.go +++ b/x/perp/v2/keeper/dnr.go @@ -68,6 +68,26 @@ func (intKeyEncoder) Decode(b []byte) (int, math.Int) { func (intKeyEncoder) Stringify(key math.Int) string { return key.String() } +// maybeUpdateDnREpoch checks if the current epoch hook call matches the +// epoch name that targets discounts and rebates, if it does then we simply +// invoke the StartNewEpoch function to kickstart a new epoch. +// This method is invoked by the AfterEpochEnd hook. +func (k Keeper) maybeUpdateDnREpoch(ctx sdk.Context, epochIdentifier string, number uint64) { + // if epoch name is empty, we just assume DnR is not enabled. + referenceEpochName := k.DnREpochName.GetOr(ctx, "") + if referenceEpochName != epochIdentifier { + return + } + // kickstart new epoch + k.Logger(ctx).Info("updating dnr epoch", "epochIdentifier", epochIdentifier, "number", number) + err := k.StartNewEpoch(ctx, number) + if err != nil { + // in case of error we panic in this case, because state may have been updated + // in a corrupted way. + panic(err) + } +} + // StartNewEpoch is called by the epochs hooks when a new 30day epoch starts. func (k Keeper) StartNewEpoch(ctx sdk.Context, identifier uint64) error { // set the current epoch diff --git a/x/perp/v2/keeper/dnr_test.go b/x/perp/v2/keeper/dnr_test.go index e79852e23..89f38c07c 100644 --- a/x/perp/v2/keeper/dnr_test.go +++ b/x/perp/v2/keeper/dnr_test.go @@ -6,6 +6,9 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + + "github.com/NibiruChain/nibiru/app" "github.com/NibiruChain/nibiru/x/common/asset" "github.com/NibiruChain/nibiru/x/common/denoms" @@ -251,3 +254,50 @@ func TestRebates(t *testing.T) { } NewTestSuite(t).WithTestCases(tests...).Run() } + +type actionFn func(app *app.NibiruApp, ctx sdk.Context) (outCtx sdk.Context, err error, isMandatory bool) + +func (f actionFn) Do(app *app.NibiruApp, ctx sdk.Context) (outCtx sdk.Context, err error, isMandatory bool) { + return f(app, ctx) +} + +func TestDnREpoch(t *testing.T) { + dnrEpochIdentifierIs := func(identifier string) actionFn { + return func(app *app.NibiruApp, ctx sdk.Context) (outCtx sdk.Context, err error, isMandatory bool) { + app.PerpKeeperV2.DnREpochName.Set(ctx, identifier) + return ctx, nil, false + } + } + + triggerEpoch := func(identifier string, epoch uint64) actionFn { + return func(app *app.NibiruApp, ctx sdk.Context) (outCtx sdk.Context, err error, isMandatory bool) { + app.PerpKeeperV2.AfterEpochEnd(ctx, identifier, epoch) + return ctx, nil, false + } + } + + expectDnREpoch := func(epoch uint64) actionFn { + return func(app *app.NibiruApp, ctx sdk.Context) (outCtx sdk.Context, err error, isMandatory bool) { + require.Equal(t, epoch, app.PerpKeeperV2.DnREpoch.GetOr(ctx, 0)) + return ctx, nil, false + } + } + + tests := TestCases{ + TC("DnR epoch with valid identifier"). + When( + dnrEpochIdentifierIs("monthly"), + triggerEpoch("monthly", 1)). + Then( + expectDnREpoch(1), + ), + TC("DnR epoch with invalid identifier"). + When( + dnrEpochIdentifierIs("monthly"), + triggerEpoch("weekly", 1)). + Then( + expectDnREpoch(0), + ), + } + NewTestSuite(t).WithTestCases(tests...).Run() +} diff --git a/x/perp/v2/keeper/hooks.go b/x/perp/v2/keeper/hooks.go index 51beabff8..6dbc4a74b 100644 --- a/x/perp/v2/keeper/hooks.go +++ b/x/perp/v2/keeper/hooks.go @@ -16,7 +16,8 @@ import ( func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ uint64) { } -func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ uint64) { +func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, number uint64) { + k.maybeUpdateDnREpoch(ctx, epochIdentifier, number) for _, market := range k.Markets.Iterate(ctx, collections.Range[collections.Pair[asset.Pair, uint64]]{}).Values() { if !market.Enabled || epochIdentifier != market.FundingRateEpochId { return diff --git a/x/perp/v2/keeper/keeper.go b/x/perp/v2/keeper/keeper.go index f8851a38d..7f60ccd36 100644 --- a/x/perp/v2/keeper/keeper.go +++ b/x/perp/v2/keeper/keeper.go @@ -38,7 +38,8 @@ type Keeper struct { Positions collections.Map[collections.Pair[collections.Pair[asset.Pair, uint64], sdk.AccAddress], types.Position] ReserveSnapshots collections.Map[collections.Pair[asset.Pair, time.Time], types.ReserveSnapshot] - DnREpoch collections.Item[uint64] + DnREpoch collections.Item[uint64] // Keeps track of the current DnR epoch. + DnREpochName collections.Item[string] // Keeps track of the current DnR epoch identifier, provided by x/epoch. GlobalVolumes collections.Map[uint64, math.Int] // Keeps track of global volumes for each epoch. TraderVolumes collections.Map[collections.Pair[sdk.AccAddress, uint64], math.Int] // Keeps track of user volumes for each epoch. GlobalDiscounts collections.Map[math.Int, math.LegacyDec] // maps a volume level to a discount @@ -128,6 +129,10 @@ func NewKeeper( storeKey, NamespaceCollateral, common.StringValueEncoder, ), + DnREpochName: collections.NewItem( + storeKey, NamespaceDnrEpochName, + common.StringValueEncoder, + ), } k.Admin = admin{&k} return k @@ -146,6 +151,7 @@ const ( NamespaceRebatesAllocations NamespaceMarketLastVersion NamespaceCollateral + NamespaceDnrEpochName ) func (k Keeper) Logger(ctx sdk.Context) log.Logger { diff --git a/x/perp/v2/module/genesis.go b/x/perp/v2/module/genesis.go index 36fb20100..623ae04c5 100644 --- a/x/perp/v2/module/genesis.go +++ b/x/perp/v2/module/genesis.go @@ -22,6 +22,8 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.DnREpoch.Set(ctx, genState.DnrEpoch) + k.DnREpochName.Set(ctx, genState.DnrEpochName) + for _, m := range genState.Markets { k.SaveMarket(ctx, m) } @@ -123,6 +125,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { } genesis.ReserveSnapshots = k.ReserveSnapshots.Iterate(ctx, collections.PairRange[asset.Pair, time.Time]{}).Values() genesis.DnrEpoch = k.DnREpoch.GetOr(ctx, 0) + genesis.DnrEpochName = k.DnREpochName.GetOr(ctx, "") // export volumes volumes := k.TraderVolumes.Iterate(ctx, collections.PairRange[sdk.AccAddress, uint64]{}) diff --git a/x/perp/v2/module/genesis_test.go b/x/perp/v2/module/genesis_test.go index 48097d770..8998d1f2d 100644 --- a/x/perp/v2/module/genesis_test.go +++ b/x/perp/v2/module/genesis_test.go @@ -104,6 +104,8 @@ func RunTestGenesis(t *testing.T, tc TestCase) { Epoch: 0, Amount: sdk.NewCoins(sdk.NewCoin(denoms.NUSD, sdk.NewInt(1_000_000))), }) + app.PerpKeeperV2.DnREpochName.Set(ctx, "weekly") + app.PerpKeeperV2.DnREpoch.Set(ctx, 1) // create some positions for _, position := range tc.positions { @@ -151,6 +153,8 @@ func RunTestGenesis(t *testing.T, tc TestCase) { require.Equal(t, genState.CollateralDenom, genStateAfterInit.CollateralDenom) require.Equal(t, genState.GlobalVolumes, genStateAfterInit.GlobalVolumes) require.Equal(t, genState.RebatesAllocations, genStateAfterInit.RebatesAllocations) + require.Equal(t, genState.DnrEpochName, genStateAfterInit.DnrEpochName) + require.Equal(t, genState.DnrEpoch, genStateAfterInit.DnrEpoch) } func TestNewAppModuleBasic(t *testing.T) { diff --git a/x/perp/v2/types/genesis.pb.go b/x/perp/v2/types/genesis.pb.go index a97d842db..d56739798 100644 --- a/x/perp/v2/types/genesis.pb.go +++ b/x/perp/v2/types/genesis.pb.go @@ -44,6 +44,7 @@ type GenesisState struct { MarketLastVersions []GenesisMarketLastVersion `protobuf:"bytes,10,rep,name=market_last_versions,json=marketLastVersions,proto3" json:"market_last_versions"` GlobalVolumes []GenesisState_GlobalVolume `protobuf:"bytes,13,rep,name=global_volumes,json=globalVolumes,proto3" json:"global_volumes"` RebatesAllocations []DNRAllocation `protobuf:"bytes,12,rep,name=rebates_allocations,json=rebatesAllocations,proto3" json:"rebates_allocations"` + DnrEpochName string `protobuf:"bytes,14,opt,name=dnr_epoch_name,json=dnrEpochName,proto3" json:"dnr_epoch_name,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -163,6 +164,13 @@ func (m *GenesisState) GetRebatesAllocations() []DNRAllocation { return nil } +func (m *GenesisState) GetDnrEpochName() string { + if m != nil { + return m.DnrEpochName + } + return "" +} + type GenesisState_TraderVolume struct { Trader string `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty"` Epoch uint64 `protobuf:"varint,2,opt,name=epoch,proto3" json:"epoch,omitempty"` @@ -464,56 +472,57 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/genesis.proto", fileDescriptor_c2c7acfef3993fde) } var fileDescriptor_c2c7acfef3993fde = []byte{ - // 772 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4f, 0x4f, 0xdb, 0x48, - 0x14, 0x8f, 0x49, 0x08, 0xc9, 0x10, 0x12, 0x76, 0x40, 0xc8, 0xca, 0xb2, 0x01, 0x21, 0xed, 0x2a, - 0x68, 0x85, 0x2d, 0xb2, 0xd2, 0x4a, 0xbb, 0xa7, 0x25, 0x64, 0x8b, 0x2a, 0x35, 0x08, 0x19, 0xc4, - 0xa1, 0xaa, 0x94, 0x4e, 0x9c, 0xa9, 0x63, 0x61, 0x7b, 0xac, 0x79, 0x93, 0xa8, 0x3d, 0xb7, 0x1f, - 0xa0, 0x87, 0x7e, 0x96, 0x7e, 0x06, 0x8e, 0x1c, 0xab, 0x1e, 0x50, 0x05, 0xc7, 0x7e, 0x89, 0xca, - 0x33, 0x93, 0x7f, 0x16, 0xa1, 0x54, 0x48, 0x3d, 0x25, 0xf3, 0xde, 0xfb, 0xfd, 0xde, 0x6f, 0xde, - 0xfc, 0x66, 0x8c, 0x36, 0x23, 0xbf, 0xeb, 0xf3, 0x81, 0x1d, 0x53, 0x1e, 0xdb, 0xc3, 0x86, 0xed, - 0xd1, 0x88, 0x82, 0x0f, 0x56, 0xcc, 0x99, 0x60, 0xb8, 0xac, 0xb2, 0x56, 0x92, 0xb5, 0x86, 0x8d, - 0x6a, 0xcd, 0x65, 0x10, 0x32, 0xb0, 0xbb, 0x04, 0xa8, 0x3d, 0xdc, 0xef, 0x52, 0x41, 0xf6, 0x6d, - 0x97, 0xf9, 0x91, 0xaa, 0xaf, 0x6e, 0x7a, 0x8c, 0x79, 0x01, 0xb5, 0x49, 0x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 0xa3, 0x07, 0x5c, 0xda, 0x77, 0xb9, 0x61, 0xa6, 0xcf, 0x2c, 0xf5, 0xe0, 0x8f, 0xeb, 0x9b, - 0x47, 0x97, 0x37, 0x35, 0xe3, 0xea, 0xa6, 0x66, 0x7c, 0xb9, 0xa9, 0x19, 0xef, 0x6f, 0x6b, 0x99, - 0xab, 0xdb, 0x5a, 0xe6, 0xd3, 0x6d, 0x2d, 0xf3, 0x7c, 0xef, 0x7b, 0x42, 0x47, 0xdf, 0x3e, 0x79, - 0x26, 0xdd, 0xbc, 0xfc, 0xf8, 0xfd, 0xf5, 0x2d, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x78, 0x24, 0x04, - 0x9c, 0x07, 0x00, 0x00, + // 788 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xdf, 0x6a, 0x13, 0x4f, + 0x14, 0xce, 0x36, 0x69, 0x9a, 0x4c, 0xd2, 0xa4, 0xbf, 0x69, 0x29, 0x43, 0x7e, 0x35, 0x2d, 0x45, + 0x25, 0x45, 0xba, 0x4b, 0x23, 0x08, 0x7a, 0x65, 0xd3, 0x68, 0x11, 0x4c, 0x29, 0xdb, 0xd2, 0x0b, + 0x11, 0xd6, 0xc9, 0x66, 0xdc, 0x2c, 0xdd, 0xdd, 0x59, 0x76, 0x26, 0x41, 0xaf, 0xf5, 0x01, 0x14, + 0x7c, 0x16, 0x9f, 0xa1, 0x97, 0xbd, 0x14, 0x2f, 0x8a, 0xb4, 0x2f, 0x22, 0x3b, 0x33, 0x9b, 0x3f, + 0x4b, 0x53, 0x2b, 0x05, 0xaf, 0x92, 0x39, 0xe7, 0x7c, 0xdf, 0xf9, 0xe6, 0xec, 0x37, 0x33, 0x60, + 0x2d, 0x70, 0xbb, 0x6e, 0x34, 0x30, 0x42, 0x12, 0x85, 0xc6, 0xb0, 0x69, 0x38, 0x24, 0x20, 0xcc, + 0x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0x48, 0x48, 0xed, 0x3e, 0xca, 0x6f, 0x68, 0x8d, + 0x9c, 0x59, 0xe8, 0x05, 0xd1, 0x8b, 0x78, 0x0d, 0xb7, 0xc0, 0x92, 0x4d, 0x3d, 0x0f, 0x73, 0x12, + 0x61, 0xcf, 0xea, 0x91, 0x80, 0xfa, 0xa8, 0xb4, 0xa1, 0x35, 0x8a, 0x66, 0x75, 0x1c, 0x6f, 0xc7, + 0x61, 0x78, 0x02, 0x2a, 0x3c, 0xc2, 0x3d, 0x12, 0x59, 0x43, 0xea, 0x0d, 0x7c, 0xc2, 0xd0, 0x82, + 0x10, 0xb6, 0x35, 0x63, 0x97, 0x62, 0xfa, 0xfa, 0xb1, 0x80, 0x9c, 0x08, 0x84, 0x92, 0xb8, 0xc8, + 0x27, 0x62, 0x0c, 0x1e, 0x83, 0xaa, 0xe3, 0xd1, 0x6e, 0xdc, 0xde, 0x65, 0x36, 0x1d, 0x04, 0x1c, + 0x15, 0x04, 0xf1, 0x83, 0x1b, 0x89, 0xdb, 0xaa, 0x58, 0x91, 0x56, 0x24, 0x47, 0x12, 0x85, 0x6f, + 0xc1, 0x92, 0x3d, 0x60, 0x9c, 0xfa, 0x23, 0x56, 0x86, 0x8a, 0x82, 0xf6, 0xd1, 0x8d, 0xb4, 0x7b, + 0x02, 0x94, 0x22, 0xaf, 0xda, 0x53, 0x51, 0x06, 0xdf, 0x81, 0x15, 0x69, 0x13, 0xcb, 0xc3, 0x8c, + 0x5b, 0x43, 0x12, 0x31, 0xf1, 0xdd, 0x81, 0xe8, 0xd0, 0x98, 0xd1, 0x41, 0xfa, 0xec, 0x35, 0x66, + 0xfc, 0x44, 0x02, 0x14, 0x3d, 0xf4, 0xd3, 0x09, 0x16, 0x4f, 0x5b, 0x4d, 0x25, 0x99, 0xf6, 0xe2, + 0x2d, 0xa6, 0xbd, 0x2f, 0x20, 0xd3, 0xd3, 0x76, 0x26, 0x62, 0xf1, 0xb4, 0x97, 0x23, 0xd2, 0xc5, + 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 0xb9, 0x10, 0xbb, 0x6a, 0x8f, 0xad, 0xa7, 0xaa, 0xc5, 0xce, 0x44, + 0x8b, 0x03, 0xb1, 0xb7, 0xbd, 0x3e, 0x76, 0x03, 0x43, 0xdd, 0xfc, 0x1f, 0x0c, 0x9b, 0xfa, 0x3e, + 0x0d, 0x0c, 0xcc, 0x18, 0xe1, 0xfa, 0x21, 0x76, 0x23, 0x53, 0xd0, 0x40, 0x04, 0x16, 0xd4, 0x71, + 0x54, 0xee, 0x49, 0x96, 0x9b, 0xdf, 0x35, 0x50, 0x4d, 0xdd, 0xc0, 0xff, 0xac, 0x39, 0x7c, 0x06, + 0x0a, 0xc9, 0x35, 0x2f, 0xec, 0x5b, 0x6a, 0xa2, 0xf4, 0x37, 0x4b, 0x3d, 0x0b, 0xa3, 0xfa, 0xd6, + 0xfe, 0xd9, 0x65, 0x5d, 0x3b, 0xbf, 0xac, 0x6b, 0xbf, 0x2e, 0xeb, 0xda, 0x97, 0xab, 0x7a, 0xe6, + 0xfc, 0xaa, 0x9e, 0xf9, 0x71, 0x55, 0xcf, 0xbc, 0xd9, 0xfe, 0x93, 0xd0, 0xe4, 0x85, 0x14, 0xdf, + 0xa4, 0x9b, 0x17, 0x4f, 0xe4, 0xe3, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x5d, 0xaf, 0x6c, + 0xc2, 0x07, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -536,6 +545,13 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.DnrEpochName) > 0 { + i -= len(m.DnrEpochName) + copy(dAtA[i:], m.DnrEpochName) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.DnrEpochName))) + i-- + dAtA[i] = 0x72 + } if len(m.GlobalVolumes) > 0 { for iNdEx := len(m.GlobalVolumes) - 1; iNdEx >= 0; iNdEx-- { { @@ -1029,6 +1045,10 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + l = len(m.DnrEpochName) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -1550,6 +1570,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DnrEpochName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DnrEpochName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])