From 613fd46bf97b2e7990f00d0ffcb5634af1dd73d3 Mon Sep 17 00:00:00 2001 From: Sishir Giri Date: Fri, 2 Jun 2023 19:57:16 -0700 Subject: [PATCH] [CL][Internal Review][CollectIncentives] fix uptime Accumulator init genesis [part2] (#5411) * updated * removed * cleanup * fixing * fixed test --- .../concentrated-liquidity/genesis.proto | 2 + x/concentrated-liquidity/genesis.go | 28 +++ x/concentrated-liquidity/genesis_test.go | 81 +++++++++ .../types/genesis/genesis.pb.go | 168 ++++++++++++------ 4 files changed, 227 insertions(+), 52 deletions(-) diff --git a/proto/osmosis/concentrated-liquidity/genesis.proto b/proto/osmosis/concentrated-liquidity/genesis.proto index 20107ec5499..d47c19ed401 100644 --- a/proto/osmosis/concentrated-liquidity/genesis.proto +++ b/proto/osmosis/concentrated-liquidity/genesis.proto @@ -53,6 +53,8 @@ message PositionData { uint64 lock_id = 2 [ (gogoproto.moretags) = "yaml:\"lock_id\"" ]; osmosis.accum.v1beta1.Record spread_reward_accum_record = 3 [ (gogoproto.nullable) = false ]; + repeated osmosis.accum.v1beta1.Record uptime_accum_records = 4 + [ (gogoproto.nullable) = false ]; } // GenesisState defines the concentrated liquidity module's genesis state. diff --git a/x/concentrated-liquidity/genesis.go b/x/concentrated-liquidity/genesis.go index a454184f687..97065c67602 100644 --- a/x/concentrated-liquidity/genesis.go +++ b/x/concentrated-liquidity/genesis.go @@ -79,6 +79,16 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState genesis.GenesisState) { spreadRewardPositionKey := types.KeySpreadRewardPositionAccumulator(positionWrapper.Position.PositionId) k.initOrUpdateAccumPosition(ctx, spreadRewardAccumObject, positionWrapper.SpreadRewardAccumRecord.AccumValuePerShare, spreadRewardPositionKey, positionWrapper.SpreadRewardAccumRecord.NumShares, positionWrapper.SpreadRewardAccumRecord.UnclaimedRewardsTotal, positionWrapper.SpreadRewardAccumRecord.Options) + + positionName := string(types.KeyPositionId(positionWrapper.Position.PositionId)) + uptimeAccumulators, err := k.GetUptimeAccumulators(ctx, positionWrapper.Position.PoolId) + if err != nil { + panic(err) + } + + for uptimeIndex, uptimeRecord := range positionWrapper.UptimeAccumRecords { + k.initOrUpdateAccumPosition(ctx, uptimeAccumulators[uptimeIndex], uptimeRecord.AccumValuePerShare, positionName, uptimeRecord.NumShares, uptimeRecord.UnclaimedRewardsTotal, uptimeRecord.Options) + } } } @@ -189,10 +199,28 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *genesis.GenesisState { panic(err) } + // Retrieve uptime incentive accumulator state for position + positionName := string(types.KeyPositionId(position.PositionId)) + uptimeAccumulators, err := k.GetUptimeAccumulators(ctx, position.PoolId) + if err != nil { + panic(err) + } + + uptimeAccumObject := make([]accum.Record, len(uptimeAccumulators)) + for uptimeIndex := range types.SupportedUptimes { + accumRecord, err := uptimeAccumulators[uptimeIndex].GetPosition(positionName) + if err != nil { + panic(err) + } + + uptimeAccumObject[uptimeIndex] = accumRecord + } + positionData = append(positionData, genesis.PositionData{ LockId: lockId, Position: &position, SpreadRewardAccumRecord: spreadRewardAccumPositionRecord, + UptimeAccumRecords: uptimeAccumObject, }) } diff --git a/x/concentrated-liquidity/genesis_test.go b/x/concentrated-liquidity/genesis_test.go index d25148ac110..4441d771444 100644 --- a/x/concentrated-liquidity/genesis_test.go +++ b/x/concentrated-liquidity/genesis_test.go @@ -72,8 +72,32 @@ var ( UnclaimedRewardsTotal: sdk.NewDecCoins(sdk.NewDecCoin("foo", sdk.NewInt(5))), Options: nil, } + + accumRecord = accum.Record{ + NumShares: sdk.OneDec(), + AccumValuePerShare: sdk.NewDecCoins(sdk.NewDecCoin("foo", sdk.NewInt(50))), + UnclaimedRewardsTotal: sdk.NewDecCoins(sdk.NewDecCoin("foo", sdk.NewInt(25))), + Options: nil, + } + + // five records because we have 5 supported uptimes + testUptimeAccumRecord = []accum.Record{ + accumRecord, + accumRecord, + accumRecord, + accumRecord, + accumRecord, + accumRecord, + } ) +func accumRecordWithDefinedValues(accumRecord accum.Record, numShares sdk.Dec, initAccumValue, unclaimedRewards sdk.Int) accum.Record { + accumRecord.NumShares = numShares + accumRecord.AccumValuePerShare = sdk.NewDecCoins(sdk.NewDecCoin("uion", initAccumValue)) + accumRecord.UnclaimedRewardsTotal = sdk.NewDecCoins(sdk.NewDecCoin("uosmo", unclaimedRewards)) + return accumRecord +} + func positionWithPoolId(position model.Position, poolId uint64) *model.Position { position.PoolId = poolId return &position @@ -200,11 +224,20 @@ func (s *KeeperTestSuite) TestInitGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, { LockId: 0, Position: withPositionId(testPositionModel, 2), SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: []accum.Record{ + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(10000), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1000), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(100), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(10), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1), sdk.NewInt(100), sdk.NewInt(50)), + }, }, }, spreadFactorAccumValues: genesis.AccumObject{ @@ -255,11 +288,20 @@ func (s *KeeperTestSuite) TestInitGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, { LockId: 0, Position: withPositionId(testPositionModel, 2), SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: []accum.Record{ + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(10000), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1000), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(100), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(10), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(1), sdk.NewInt(100), sdk.NewInt(50)), + }, }, }, expectedspreadFactorAccumValues: []genesis.AccumObject{ @@ -309,6 +351,7 @@ func (s *KeeperTestSuite) TestInitGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, }, spreadFactorAccumValues: genesis.AccumObject{ @@ -343,6 +386,14 @@ func (s *KeeperTestSuite) TestInitGenesis() { { LockId: 2, Position: withPositionId(*positionWithPoolId(testPositionModel, 2), DefaultPositionId+1), + UptimeAccumRecords: []accum.Record{ + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(999), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + }, }, }, @@ -427,11 +478,20 @@ func (s *KeeperTestSuite) TestInitGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, { LockId: 2, Position: withPositionId(*positionWithPoolId(testPositionModel, 2), DefaultPositionId+1), SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: []accum.Record{ + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(999), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + }, }, }, }, @@ -519,6 +579,7 @@ func (s *KeeperTestSuite) TestInitGenesis() { LockId: actualLockId, Position: &getPosition, SpreadRewardAccumRecord: positionDataEntry.SpreadRewardAccumRecord, + UptimeAccumRecords: positionDataEntry.UptimeAccumRecords, }) } @@ -586,6 +647,7 @@ func (s *KeeperTestSuite) TestExportGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, }, spreadFactorAccumValues: genesis.AccumObject{ @@ -636,11 +698,13 @@ func (s *KeeperTestSuite) TestExportGenesis() { LockId: 1, Position: &testPositionModel, SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, { LockId: 0, Position: withPositionId(testPositionModel, DefaultPositionId+1), SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: testUptimeAccumRecord, }, }, spreadFactorAccumValues: genesis.AccumObject{ @@ -697,6 +761,14 @@ func (s *KeeperTestSuite) TestExportGenesis() { LockId: 2, Position: withPositionId(*positionWithPoolId(testPositionModel, 2), DefaultPositionId+2), SpreadRewardAccumRecord: testSpreadRewardAccumRecord, + UptimeAccumRecords: []accum.Record{ + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9999), sdk.NewInt(10), sdk.NewInt(5)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(999), sdk.NewInt(100), sdk.NewInt(50)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(99), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + accumRecordWithDefinedValues(accumRecord, sdk.NewDec(9), sdk.NewInt(50), sdk.NewInt(25)), + }, }, }, }, @@ -752,6 +824,15 @@ func (s *KeeperTestSuite) TestExportGenesis() { } } + // Validate uptime accumulators + for i, actualPositionData := range actualExported.PositionData { + expectedPositionData := expectedGenesis.PositionData[i] + // validate incentive accumulator + for i, uptimeAccum := range actualPositionData.UptimeAccumRecords { + s.Require().Equal(expectedPositionData.UptimeAccumRecords[i], uptimeAccum) + } + } + // Validate positions. s.Require().Equal(tc.genesis.PositionData, actualExported.PositionData) diff --git a/x/concentrated-liquidity/types/genesis/genesis.pb.go b/x/concentrated-liquidity/types/genesis/genesis.pb.go index ed981cff683..ed2d000790c 100644 --- a/x/concentrated-liquidity/types/genesis/genesis.pb.go +++ b/x/concentrated-liquidity/types/genesis/genesis.pb.go @@ -179,6 +179,7 @@ type PositionData struct { Position *model.Position `protobuf:"bytes,1,opt,name=position,proto3" json:"position,omitempty"` LockId uint64 `protobuf:"varint,2,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty" yaml:"lock_id"` SpreadRewardAccumRecord accum.Record `protobuf:"bytes,3,opt,name=spread_reward_accum_record,json=spreadRewardAccumRecord,proto3" json:"spread_reward_accum_record"` + UptimeAccumRecords []accum.Record `protobuf:"bytes,4,rep,name=uptime_accum_records,json=uptimeAccumRecords,proto3" json:"uptime_accum_records"` } func (m *PositionData) Reset() { *m = PositionData{} } @@ -235,6 +236,13 @@ func (m *PositionData) GetSpreadRewardAccumRecord() accum.Record { return accum.Record{} } +func (m *PositionData) GetUptimeAccumRecords() []accum.Record { + if m != nil { + return m.UptimeAccumRecords + } + return nil +} + // GenesisState defines the concentrated liquidity module's genesis state. type GenesisState struct { // params are all the parameters of the module @@ -372,58 +380,60 @@ func init() { } var fileDescriptor_5c140d686ee6724a = []byte{ - // 814 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcb, 0x6e, 0xf3, 0x44, - 0x14, 0x8e, 0x1b, 0x37, 0x24, 0x93, 0xb4, 0xb4, 0x56, 0xa1, 0x6e, 0x51, 0x93, 0x60, 0x54, 0x29, - 0xa8, 0xc4, 0x56, 0x53, 0xe8, 0x82, 0x5d, 0x5d, 0x2e, 0x0a, 0x48, 0x50, 0x0d, 0x5d, 0x81, 0x20, - 0x4c, 0xec, 0x49, 0x18, 0xea, 0x78, 0x82, 0x67, 0x52, 0x92, 0x2d, 0x4f, 0x80, 0x58, 0xf1, 0x20, - 0x48, 0xbc, 0x42, 0x85, 0x10, 0xea, 0x92, 0x55, 0x84, 0xda, 0x1d, 0xcb, 0x3c, 0xc1, 0x2f, 0xcf, - 0x25, 0x97, 0xfe, 0xad, 0x92, 0xfe, 0x3b, 0xcf, 0x9c, 0xf3, 0x7d, 0xe7, 0x3b, 0xb7, 0x31, 0x78, - 0x8f, 0xb2, 0x1e, 0x65, 0x84, 0x79, 0x01, 0x8d, 0x03, 0x1c, 0xf3, 0x04, 0x71, 0x1c, 0xd6, 0x23, - 0xf2, 0xd3, 0x80, 0x84, 0x84, 0x8f, 0xbc, 0x2e, 0x8e, 0x31, 0x23, 0xcc, 0xed, 0x27, 0x94, 0x53, - 0xeb, 0x50, 0x79, 0xbb, 0xf3, 0xde, 0x53, 0x67, 0xf7, 0xfa, 0xb8, 0x8d, 0x39, 0x3a, 0xde, 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6c, 0x78, 0xee, 0x4a, 0x6d, 0x77, 0x2f, 0x55, 0xae, 0xbe, 0x7d, - 0x33, 0xae, 0x64, 0x26, 0xe3, 0xca, 0xd6, 0x42, 0x90, 0x0e, 0x75, 0xa0, 0xa0, 0x75, 0xfe, 0x34, - 0x41, 0xfe, 0x82, 0xd2, 0xe8, 0x23, 0xc4, 0x91, 0x75, 0x02, 0xcc, 0x54, 0xab, 0xc8, 0xa5, 0xd8, - 0xd8, 0x71, 0x65, 0xab, 0x5d, 0xdd, 0x6a, 0xf7, 0x2c, 0x1e, 0xf9, 0x85, 0xbf, 0xfe, 0xa8, 0xaf, - 0xa7, 0x88, 0x26, 0x14, 0xce, 0xd6, 0x37, 0x60, 0x3d, 0x65, 0x65, 0xf6, 0x5a, 0x35, 0xfb, 0x0c, - 0x85, 0xba, 0x86, 0xfe, 0x8e, 0x52, 0x58, 0x9a, 0x29, 0x64, 0x0e, 0x94, 0x9c, 0xd6, 0xef, 0x06, - 0xd8, 0x63, 0xfd, 0x04, 0xa3, 0xb0, 0x95, 0xe0, 0x9f, 0x51, 0x12, 0xb6, 0xc4, 0x34, 0x0d, 0x22, - 0xc4, 0x69, 0xa2, 0x6a, 0xd2, 0x58, 0x31, 0xe2, 0x59, 0x8a, 0xfc, 0xb2, 0xfd, 0x23, 0x0e, 0xb8, - 0x5f, 0x53, 0x41, 0xab, 0x32, 0xe8, 0x93, 0x21, 0x1c, 0xb8, 0x2b, 0x6d, 0x50, 0x98, 0xce, 0x66, - 0x16, 0xeb, 0x37, 0x03, 0xec, 0x4e, 0x67, 0x84, 0xcd, 0x83, 0x98, 0x6d, 0x8a, 0x52, 0xbc, 0x8a, - 0xb0, 0x43, 0x25, 0xec, 0x40, 0x0a, 0x7b, 0x3c, 0x80, 0x03, 0xdf, 0x9c, 0x19, 0xe6, 0x34, 0x31, - 0x8b, 0x80, 0xed, 0x87, 0x73, 0xcb, 0xec, 0x75, 0xa1, 0xe6, 0x74, 0x45, 0x35, 0x4d, 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x30, 0x63, 0xd4, 0xc3, 0xa2, 0x9a, 0x05, 0xff, 0xf5, 0xc9, 0xb8, 0x52, - 0x54, 0x54, 0xa8, 0x87, 0x1d, 0x28, 0x8c, 0xd6, 0x17, 0x60, 0x43, 0x76, 0x36, 0xa0, 0x31, 0xc7, - 0x31, 0x17, 0xa3, 0x51, 0x6c, 0xbc, 0xfb, 0x44, 0x6b, 0xe7, 0x36, 0xe3, 0x5c, 0x02, 0x60, 0x49, - 0x78, 0xa8, 0x93, 0x1f, 0xde, 0xdc, 0x95, 0x8d, 0xdb, 0xbb, 0xb2, 0xf1, 0xdf, 0x5d, 0xd9, 0xf8, - 0xf5, 0xbe, 0x9c, 0xb9, 0xbd, 0x2f, 0x67, 0xfe, 0xbd, 0x2f, 0x67, 0xbe, 0xfe, 0xac, 0x4b, 0xf8, - 0x0f, 0x83, 0xb6, 0x1b, 0xd0, 0x9e, 0xa7, 0xc8, 0xeb, 0x11, 0x6a, 0x33, 0x7d, 0xf0, 0xae, 0x8f, - 0x4f, 0xbd, 0xe1, 0x93, 0x7f, 0x9a, 0x51, 0x1f, 0x33, 0xfd, 0xbf, 0x6e, 0xe7, 0xc4, 0xfb, 0x79, - 0xf2, 0x22, 0x00, 0x00, 0xff, 0xff, 0x95, 0x00, 0xfc, 0x3c, 0xe0, 0x07, 0x00, 0x00, + // 838 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xe3, 0x44, + 0x18, 0xae, 0x5b, 0xb7, 0x34, 0x93, 0xec, 0xd2, 0x1d, 0x05, 0xea, 0x2d, 0xda, 0x24, 0x18, 0x55, + 0x0a, 0x5a, 0x62, 0xab, 0x29, 0xec, 0x81, 0x5b, 0xbd, 0x7c, 0x28, 0x20, 0x41, 0x35, 0x2c, 0x17, + 0x10, 0x84, 0x89, 0x3d, 0x09, 0xc3, 0xda, 0x1e, 0xe3, 0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 0x34, 0xa2, 0xe2, 0xdb, 0xf1, 0xc0, 0x0b, 0x59, 0xe2, 0x6b, 0xf2, 0x4e, + 0x8c, 0x07, 0xdc, 0x1c, 0xfc, 0x8b, 0x93, 0x47, 0xfe, 0xe4, 0xc6, 0x1f, 0xb0, 0x69, 0x46, 0xb8, + 0xf9, 0x1b, 0x30, 0xd8, 0x93, 0x6b, 0xf9, 0xf4, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x11, 0xbd, + 0x05, 0x2c, 0x37, 0x08, 0x00, 0x00, } func (m *FullTick) Marshal() (dAtA []byte, err error) { @@ -576,6 +586,20 @@ func (m *PositionData) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.UptimeAccumRecords) > 0 { + for iNdEx := len(m.UptimeAccumRecords) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.UptimeAccumRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } { size, err := m.SpreadRewardAccumRecord.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -790,6 +814,12 @@ func (m *PositionData) Size() (n int) { } l = m.SpreadRewardAccumRecord.Size() n += 1 + l + sovGenesis(uint64(l)) + if len(m.UptimeAccumRecords) > 0 { + for _, e := range m.UptimeAccumRecords { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -1301,6 +1331,40 @@ func (m *PositionData) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UptimeAccumRecords", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.UptimeAccumRecords = append(m.UptimeAccumRecords, accum.Record{}) + if err := m.UptimeAccumRecords[len(m.UptimeAccumRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])