From a821daa0b389c14a3ea45914335c1ac8641876f4 Mon Sep 17 00:00:00 2001 From: Greg Morrison Date: Fri, 29 Oct 2021 22:46:21 +0100 Subject: [PATCH] refactor(epochs): use single field to track epoch block height --- proto/osmosis/epochs/genesis.proto | 3 +- x/epochs/abci.go | 4 +- x/epochs/abci_test.go | 28 +++------ x/epochs/genesis.go | 2 +- x/epochs/genesis_test.go | 6 -- x/epochs/simulation/genesis.go | 2 - x/epochs/spec/02_state.md | 8 +-- x/epochs/types/genesis.go | 26 ++++---- x/epochs/types/genesis.pb.go | 98 ++++++++++-------------------- 9 files changed, 61 insertions(+), 116 deletions(-) diff --git a/proto/osmosis/epochs/genesis.proto b/proto/osmosis/epochs/genesis.proto index 122d9782bd0..b444801d35b 100644 --- a/proto/osmosis/epochs/genesis.proto +++ b/proto/osmosis/epochs/genesis.proto @@ -28,8 +28,7 @@ message EpochInfo { ]; bool epoch_counting_started = 6; reserved 7; - int64 start_height = 8; - int64 current_epoch_start_height = 9; + int64 current_epoch_start_height = 8; } // GenesisState defines the epochs module's genesis state. diff --git a/x/epochs/abci.go b/x/epochs/abci.go index 76efd32f8c2..c75457fe7d0 100644 --- a/x/epochs/abci.go +++ b/x/epochs/abci.go @@ -23,16 +23,16 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { shouldEpochStart := ctx.BlockTime().After(epochEndTime) && !shouldInitialEpochStart && !epochInfo.StartTime.After(ctx.BlockTime()) if shouldInitialEpochStart || shouldEpochStart { + epochInfo.CurrentEpochStartHeight = ctx.BlockHeight() + if shouldInitialEpochStart { epochInfo.EpochCountingStarted = true epochInfo.CurrentEpoch = 1 epochInfo.CurrentEpochStartTime = epochInfo.StartTime - epochInfo.CurrentEpochStartHeight = epochInfo.StartHeight logger.Info(fmt.Sprintf("Starting new epoch with identifier %s", epochInfo.Identifier)) } else { epochInfo.CurrentEpoch += 1 epochInfo.CurrentEpochStartTime = epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) - epochInfo.CurrentEpochStartHeight = ctx.BlockHeight() logger.Info(fmt.Sprintf("Starting epoch with identifier %s", epochInfo.Identifier)) ctx.EventManager().EmitEvent( sdk.NewEvent( diff --git a/x/epochs/abci_test.go b/x/epochs/abci_test.go index 65e30dd543d..08f929ebb38 100644 --- a/x/epochs/abci_test.go +++ b/x/epochs/abci_test.go @@ -18,22 +18,19 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { var epochInfo types.EpochInfo now := time.Now() - initialBlockHeight := int64(1) tests := []struct { expCurrentEpochStartTime time.Time expCurrentEpochStartHeight int64 expCurrentEpoch int64 - expInitialEpochStartHeight int64 expInitialEpochStartTime time.Time fn func() }{ { // Only advance 2 seconds, do not increment epoch - expCurrentEpochStartHeight: 1, + expCurrentEpochStartHeight: 2, expCurrentEpochStartTime: now, expCurrentEpoch: 1, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -42,10 +39,9 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { }, }, { - expCurrentEpochStartHeight: 1, + expCurrentEpochStartHeight: 2, expCurrentEpochStartTime: now, expCurrentEpoch: 1, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -54,10 +50,9 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { }, }, { - expCurrentEpochStartHeight: 1, + expCurrentEpochStartHeight: 2, expCurrentEpochStartTime: now, expCurrentEpoch: 1, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -72,7 +67,6 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expCurrentEpochStartHeight: 3, expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), expCurrentEpoch: 2, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -86,7 +80,6 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expCurrentEpochStartHeight: 3, expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), expCurrentEpoch: 2, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -102,7 +95,6 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { expCurrentEpochStartHeight: 3, expCurrentEpochStartTime: now.Add(time.Hour * 24 * 31), expCurrentEpoch: 2, - expInitialEpochStartHeight: initialBlockHeight, expInitialEpochStartTime: now, fn: func() { ctx = ctx.WithBlockHeight(2).WithBlockTime(now.Add(time.Second)) @@ -127,14 +119,13 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { app.EpochsKeeper.DeleteEpochInfo(ctx, epochInfo.Identifier) } - ctx = ctx.WithBlockHeight(initialBlockHeight).WithBlockTime(now) + ctx = ctx.WithBlockHeight(1).WithBlockTime(now) // check init genesis epochs.InitGenesis(ctx, app.EpochsKeeper, types.GenesisState{ Epochs: []types.EpochInfo{ { Identifier: "monthly", - StartHeight: ctx.BlockHeight(), StartTime: time.Time{}, Duration: time.Hour * 24 * 31, CurrentEpoch: 0, @@ -148,7 +139,6 @@ func TestEpochInfoChangesBeginBlockerAndInitGenesis(t *testing.T) { test.fn() require.Equal(t, epochInfo.Identifier, "monthly") - require.Equal(t, epochInfo.StartHeight, test.expInitialEpochStartHeight) require.Equal(t, epochInfo.StartTime.UTC().String(), test.expInitialEpochStartTime.UTC().String()) require.Equal(t, epochInfo.Duration, time.Hour*24*31) require.Equal(t, epochInfo.CurrentEpoch, test.expCurrentEpoch) @@ -172,13 +162,13 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { now := time.Now() week := time.Hour * 24 * 7 month := time.Hour * 24 * 30 - ctx = ctx.WithBlockHeight(1).WithBlockTime(now) + initialBlockHeight := int64(1) + ctx = ctx.WithBlockHeight(initialBlockHeight).WithBlockTime(now) epochs.InitGenesis(ctx, app.EpochsKeeper, types.GenesisState{ Epochs: []types.EpochInfo{ { Identifier: "monthly", - StartHeight: ctx.BlockHeight(), StartTime: now.Add(month), Duration: time.Hour * 24 * 30, CurrentEpoch: 0, @@ -192,7 +182,7 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { // epoch not started yet epochInfo := app.EpochsKeeper.GetEpochInfo(ctx, "monthly") require.Equal(t, epochInfo.CurrentEpoch, int64(0)) - require.Equal(t, epochInfo.CurrentEpochStartHeight, epochInfo.StartHeight) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) require.Equal(t, epochInfo.EpochCountingStarted, false) @@ -203,7 +193,7 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { // epoch not started yet epochInfo = app.EpochsKeeper.GetEpochInfo(ctx, "monthly") require.Equal(t, epochInfo.CurrentEpoch, int64(0)) - require.Equal(t, epochInfo.CurrentEpochStartHeight, epochInfo.StartHeight) + require.Equal(t, epochInfo.CurrentEpochStartHeight, initialBlockHeight) require.Equal(t, epochInfo.CurrentEpochStartTime, time.Time{}) require.Equal(t, epochInfo.EpochCountingStarted, false) @@ -214,7 +204,7 @@ func TestEpochStartingOneMonthAfterInitGenesis(t *testing.T) { // epoch started epochInfo = app.EpochsKeeper.GetEpochInfo(ctx, "monthly") require.Equal(t, epochInfo.CurrentEpoch, int64(1)) - require.Equal(t, epochInfo.CurrentEpochStartHeight, epochInfo.StartHeight) + require.Equal(t, epochInfo.CurrentEpochStartHeight, ctx.BlockHeight()) require.Equal(t, epochInfo.CurrentEpochStartTime.UTC().String(), now.Add(month).UTC().String()) require.Equal(t, epochInfo.EpochCountingStarted, true) } diff --git a/x/epochs/genesis.go b/x/epochs/genesis.go index 7397aba5dc4..b6cbaed020d 100644 --- a/x/epochs/genesis.go +++ b/x/epochs/genesis.go @@ -18,7 +18,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) epoch.StartTime = ctx.BlockTime() } - epoch.StartHeight = ctx.BlockHeight() + epoch.CurrentEpochStartHeight = ctx.BlockHeight() k.SetEpochInfo(ctx, epoch) } diff --git a/x/epochs/genesis_test.go b/x/epochs/genesis_test.go index 576a957b325..8eca4e95984 100644 --- a/x/epochs/genesis_test.go +++ b/x/epochs/genesis_test.go @@ -23,7 +23,6 @@ func TestEpochsExportGenesis(t *testing.T) { require.Equal(t, genesis.Epochs[0].Identifier, "day") require.Equal(t, genesis.Epochs[0].StartTime, chainStartTime) - require.Equal(t, genesis.Epochs[0].StartHeight, chainStartHeight) require.Equal(t, genesis.Epochs[0].Duration, time.Hour*24) require.Equal(t, genesis.Epochs[0].CurrentEpoch, int64(0)) require.Equal(t, genesis.Epochs[0].CurrentEpochStartHeight, chainStartHeight) @@ -31,7 +30,6 @@ func TestEpochsExportGenesis(t *testing.T) { require.Equal(t, genesis.Epochs[0].EpochCountingStarted, false) require.Equal(t, genesis.Epochs[1].Identifier, "week") require.Equal(t, genesis.Epochs[1].StartTime, chainStartTime) - require.Equal(t, genesis.Epochs[1].StartHeight, chainStartHeight) require.Equal(t, genesis.Epochs[1].Duration, time.Hour*24*7) require.Equal(t, genesis.Epochs[1].CurrentEpoch, int64(0)) require.Equal(t, genesis.Epochs[1].CurrentEpochStartHeight, chainStartHeight) @@ -59,7 +57,6 @@ func TestEpochsInitGenesis(t *testing.T) { Epochs: []types.EpochInfo{ { Identifier: "monthly", - StartHeight: ctx.BlockHeight(), StartTime: time.Time{}, Duration: time.Hour * 24, CurrentEpoch: 0, @@ -69,7 +66,6 @@ func TestEpochsInitGenesis(t *testing.T) { }, { Identifier: "monthly", - StartHeight: ctx.BlockHeight(), StartTime: time.Time{}, Duration: time.Hour * 24, CurrentEpoch: 0, @@ -85,7 +81,6 @@ func TestEpochsInitGenesis(t *testing.T) { Epochs: []types.EpochInfo{ { Identifier: "monthly", - StartHeight: ctx.BlockHeight(), StartTime: time.Time{}, Duration: time.Hour * 24, CurrentEpoch: 0, @@ -99,7 +94,6 @@ func TestEpochsInitGenesis(t *testing.T) { epochs.InitGenesis(ctx, app.EpochsKeeper, genesisState) epochInfo := app.EpochsKeeper.GetEpochInfo(ctx, "monthly") require.Equal(t, epochInfo.Identifier, "monthly") - require.Equal(t, epochInfo.StartHeight, ctx.BlockHeight()) require.Equal(t, epochInfo.StartTime.UTC().String(), now.UTC().String()) require.Equal(t, epochInfo.Duration, time.Hour*24) require.Equal(t, epochInfo.CurrentEpoch, int64(0)) diff --git a/x/epochs/simulation/genesis.go b/x/epochs/simulation/genesis.go index b00b1bbfa59..b495a64b7d1 100644 --- a/x/epochs/simulation/genesis.go +++ b/x/epochs/simulation/genesis.go @@ -16,7 +16,6 @@ func RandomizedGenState(simState *module.SimulationState) { epochs := []types.EpochInfo{ { Identifier: "day", - StartHeight: 0, StartTime: time.Time{}, Duration: time.Hour * 24, CurrentEpoch: 0, @@ -26,7 +25,6 @@ func RandomizedGenState(simState *module.SimulationState) { }, { Identifier: "hour", - StartHeight: 0, StartTime: time.Time{}, Duration: time.Hour, CurrentEpoch: 0, diff --git a/x/epochs/spec/02_state.md b/x/epochs/spec/02_state.md index 82772eed09d..24d77aaaa20 100644 --- a/x/epochs/spec/02_state.md +++ b/x/epochs/spec/02_state.md @@ -31,12 +31,11 @@ message EpochInfo { ]; bool epoch_counting_started = 6; reserved 7; - int64 start_height = 8; - int64 current_epoch_start_height = 9; + int64 current_epoch_start_height = 8; } ``` -EpochInfo keeps `identifier`, `start_time`,`duration`, `current_epoch`, `current_epoch_start_time`, `epoch_counting_started`, `start_height`, `current_epoch_start_height`. +EpochInfo keeps `identifier`, `start_time`,`duration`, `current_epoch`, `current_epoch_start_time`, `epoch_counting_started`, `current_epoch_start_height`. 1. `identifier` keeps epoch identification string. 2. `start_time` keeps epoch counting start time, if block time passes `start_time`, `epoch_counting_started` is set. @@ -44,5 +43,4 @@ EpochInfo keeps `identifier`, `start_time`,`duration`, `current_epoch`, `current 4. `current_epoch` keeps current active epoch number. 5. `current_epoch_start_time` keeps the start time of current epoch. 6. `epoch_number` is counted only when `epoch_counting_started` flag is set. -7. `start_height` keeps epoch start block height. -8. `current_epoch_start_height` keeps the start block height of current epoch. +7. `current_epoch_start_height` keeps the start block height of current epoch. diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go index d146d925220..68895b75f38 100644 --- a/x/epochs/types/genesis.go +++ b/x/epochs/types/genesis.go @@ -16,20 +16,22 @@ func NewGenesisState(epochs []EpochInfo) *GenesisState { func DefaultGenesis() *GenesisState { epochs := []EpochInfo{ { - Identifier: "week", - StartTime: time.Time{}, - Duration: time.Hour * 24 * 7, - CurrentEpoch: 0, - CurrentEpochStartTime: time.Time{}, - EpochCountingStarted: false, + Identifier: "week", + StartTime: time.Time{}, + Duration: time.Hour * 24 * 7, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, }, { - Identifier: "day", - StartTime: time.Time{}, - Duration: time.Hour * 24, - CurrentEpoch: 0, - CurrentEpochStartTime: time.Time{}, - EpochCountingStarted: false, + Identifier: "day", + StartTime: time.Time{}, + Duration: time.Hour * 24, + CurrentEpoch: 0, + CurrentEpochStartHeight: 0, + CurrentEpochStartTime: time.Time{}, + EpochCountingStarted: false, }, } return NewGenesisState(epochs) diff --git a/x/epochs/types/genesis.pb.go b/x/epochs/types/genesis.pb.go index 2157979ac4c..5e52251d4cb 100644 --- a/x/epochs/types/genesis.pb.go +++ b/x/epochs/types/genesis.pb.go @@ -35,8 +35,7 @@ type EpochInfo struct { CurrentEpoch int64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` CurrentEpochStartTime time.Time `protobuf:"bytes,5,opt,name=current_epoch_start_time,json=currentEpochStartTime,proto3,stdtime" json:"current_epoch_start_time" yaml:"current_epoch_start_time"` EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` - StartHeight int64 `protobuf:"varint,8,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` - CurrentEpochStartHeight int64 `protobuf:"varint,9,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` + CurrentEpochStartHeight int64 `protobuf:"varint,8,opt,name=current_epoch_start_height,json=currentEpochStartHeight,proto3" json:"current_epoch_start_height,omitempty"` } func (m *EpochInfo) Reset() { *m = EpochInfo{} } @@ -114,13 +113,6 @@ func (m *EpochInfo) GetEpochCountingStarted() bool { return false } -func (m *EpochInfo) GetStartHeight() int64 { - if m != nil { - return m.StartHeight - } - return 0 -} - func (m *EpochInfo) GetCurrentEpochStartHeight() int64 { if m != nil { return m.CurrentEpochStartHeight @@ -181,38 +173,37 @@ func init() { func init() { proto.RegisterFile("osmosis/epochs/genesis.proto", fileDescriptor_7ecf3e4d59074cbd) } var fileDescriptor_7ecf3e4d59074cbd = []byte{ - // 489 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x3f, 0x8f, 0xd3, 0x30, - 0x14, 0xaf, 0x69, 0x29, 0xa9, 0x5b, 0x04, 0x58, 0xc7, 0x11, 0x2a, 0x48, 0x72, 0x61, 0x89, 0x04, + // 474 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0x31, 0x8f, 0xd3, 0x30, + 0x18, 0xad, 0x69, 0x29, 0xa9, 0xef, 0x10, 0x60, 0x1d, 0x47, 0xa8, 0x20, 0x09,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0xb7, 0x70, 0x73, 0xd7, + 0x79, 0xb4, 0x6d, 0xe4, 0x09, 0x3e, 0xd4, 0xfc, 0x89, 0x28, 0x33, 0xe0, 0x59, 0xac, 0x07, 0xd9, + 0xd4, 0xec, 0x3a, 0xc8, 0x33, 0x82, 0x03, 0x85, 0xbe, 0xa8, 0xc1, 0x91, 0xc6, 0xc8, 0x33, 0xdc, + 0xbf, 0xc8, 0x2d, 0x61, 0x3c, 0x4e, 0xc0, 0x34, 0x54, 0xd4, 0x5b, 0xe7, 0x0c, 0x8f, 0x15, 0xfc, + 0xb6, 0x63, 0x5c, 0xb9, 0x6e, 0xb8, 0xef, 0xf0, 0xfe, 0x6b, 0xbd, 0x92, 0x23, 0x08, 0x81, 0x91, + 0xe7, 0xb8, 0xab, 0x77, 0xd1, 0x44, 0x4e, 0xdb, 0xdb, 0x3b, 0xba, 0x47, 0x2f, 0x5e, 0x51, 0xba, + 0xdd, 0xa3, 0x61, 0xa7, 0xca, 0x1f, 0xd4, 0x63, 0xc3, 0xe3, 0x93, 0xb5, 0x85, 0x4e, 0xd7, 0x16, + 0xfa, 0xb1, 0xb6, 0xd0, 0x72, 0x63, 0xb5, 0x4e, 0x37, 0x56, 0xeb, 0xdb, 0xc6, 0x6a, 0x7d, 0xa4, + 0x31, 0x87, 0xa4, 0x8c, 0xe8, 0x44, 0xa4, 0x7e, 0x2d, 0xfa, 0x68, 0x1e, 0x46, 0xb2, 0x39, 0xf8, + 0x9f, 0x9b, 0x9f, 0x04, 0x16, 0x39, 0x93, 0x51, 0x57, 0x75, 0xfd, 0xf8, 0x57, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x92, 0x53, 0x58, 0x15, 0x43, 0x03, 0x00, 0x00, } func (m *EpochInfo) Marshal() (dAtA []byte, err error) { @@ -238,11 +229,6 @@ func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.CurrentEpochStartHeight != 0 { i = encodeVarintGenesis(dAtA, i, uint64(m.CurrentEpochStartHeight)) i-- - dAtA[i] = 0x48 - } - if m.StartHeight != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.StartHeight)) - i-- dAtA[i] = 0x40 } if m.EpochCountingStarted { @@ -364,9 +350,6 @@ func (m *EpochInfo) Size() (n int) { if m.EpochCountingStarted { n += 2 } - if m.StartHeight != 0 { - n += 1 + sovGenesis(uint64(m.StartHeight)) - } if m.CurrentEpochStartHeight != 0 { n += 1 + sovGenesis(uint64(m.CurrentEpochStartHeight)) } @@ -594,25 +577,6 @@ func (m *EpochInfo) Unmarshal(dAtA []byte) error { } m.EpochCountingStarted = bool(v != 0) case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) - } - m.StartHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpochStartHeight", wireType) }