From ece388c980ebec855333e551fa45306657715f4b Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Tue, 18 Jul 2023 16:20:11 +0530 Subject: [PATCH 1/4] track acknowledgements via a fiels --- docs/swagger.yml | 31 +- .../v1/interchainstaking.proto | 1 + .../keeper/ibc_packet_handlers.go | 5 +- .../types/interchainstaking.pb.go | 276 ++++++++++-------- 4 files changed, 187 insertions(+), 126 deletions(-) diff --git a/docs/swagger.yml b/docs/swagger.yml index 6cfbc7158..dc258a313 100644 --- a/docs/swagger.yml +++ b/docs/swagger.yml @@ -764,6 +764,7 @@ paths: - ClaimTypeOsmosisPool - ClaimTypeCrescentPool - ClaimTypeSifchainPool + - ClaimTypeUmeeToken default: ClaimTypeUndefined title: >- - ClaimTypeUndefined: Undefined action (per protobuf @@ -923,6 +924,7 @@ paths: - ClaimTypeOsmosisPool - ClaimTypeCrescentPool - ClaimTypeSifchainPool + - ClaimTypeUmeeToken default: ClaimTypeUndefined title: >- - ClaimTypeUndefined: Undefined action (per protobuf @@ -1084,6 +1086,7 @@ paths: - ClaimTypeOsmosisPool - ClaimTypeCrescentPool - ClaimTypeSifchainPool + - ClaimTypeUmeeToken default: ClaimTypeUndefined title: >- - ClaimTypeUndefined: Undefined action (per protobuf @@ -1245,6 +1248,7 @@ paths: - ClaimTypeOsmosisPool - ClaimTypeCrescentPool - ClaimTypeSifchainPool + - ClaimTypeUmeeToken default: ClaimTypeUndefined title: >- - ClaimTypeUndefined: Undefined action (per protobuf @@ -1688,8 +1692,12 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1699,7 +1707,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -1727,10 +1735,8 @@ paths: name "y.z". - JSON - ==== The JSON representation of an `Any` value uses the regular @@ -1999,8 +2005,12 @@ paths: if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2010,7 +2020,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -2038,10 +2048,8 @@ paths: name "y.z". - JSON - ==== The JSON representation of an `Any` value uses the regular @@ -2641,6 +2649,8 @@ paths: format: date-time requeued: type: boolean + acknowledged: + type: boolean pagination: type: object properties: @@ -4415,6 +4425,8 @@ paths: format: date-time requeued: type: boolean + acknowledged: + type: boolean pagination: type: object properties: @@ -4606,6 +4618,8 @@ paths: format: date-time requeued: type: boolean + acknowledged: + type: boolean pagination: type: object properties: @@ -4914,6 +4928,7 @@ paths: - ClaimTypeOsmosisPool - ClaimTypeCrescentPool - ClaimTypeSifchainPool + - ClaimTypeUmeeToken default: ClaimTypeUndefined title: '- ClaimTypeUndefined: Undefined action (per protobuf spec)' proofs: diff --git a/proto/quicksilver/interchainstaking/v1/interchainstaking.proto b/proto/quicksilver/interchainstaking/v1/interchainstaking.proto index 6ba86aaa7..24b9b8673 100644 --- a/proto/quicksilver/interchainstaking/v1/interchainstaking.proto +++ b/proto/quicksilver/interchainstaking/v1/interchainstaking.proto @@ -95,6 +95,7 @@ message WithdrawalRecord { (gogoproto.stdtime) = true ]; bool requeued = 10; + bool acknowledged = 11; } message UnbondingRecord { diff --git a/x/interchainstaking/keeper/ibc_packet_handlers.go b/x/interchainstaking/keeper/ibc_packet_handlers.go index d89f6477f..ed58805bd 100644 --- a/x/interchainstaking/keeper/ibc_packet_handlers.go +++ b/x/interchainstaking/keeper/ibc_packet_handlers.go @@ -499,7 +499,7 @@ func (k *Keeper) GCCompletedRedelegations(ctx sdk.Context) error { func (k *Keeper) HandleMaturedUnbondings(ctx sdk.Context, zone *types.Zone) error { k.IterateZoneStatusWithdrawalRecords(ctx, zone.ChainId, types.WithdrawStatusUnbond, func(idx int64, withdrawal types.WithdrawalRecord) bool { - if ctx.BlockTime().After(withdrawal.CompletionTime) && !withdrawal.CompletionTime.Equal(time.Time{}) { // completion date has passed. + if ctx.BlockTime().After(withdrawal.CompletionTime) && withdrawal.Acknowledged { // completion date has passed. k.Logger(ctx).Info("found completed unbonding") sendMsg := &banktypes.MsgSend{FromAddress: zone.DelegationAddress.GetAddress(), ToAddress: withdrawal.Recipient, Amount: sdk.Coins{withdrawal.Amount[0]}} err := k.SubmitTx(ctx, []sdk.Msg{sendMsg}, zone.DelegationAddress, types.TxUnbondSendMemo(withdrawal.Txhash), zone.MessagesPerTx) @@ -712,6 +712,9 @@ func (k *Keeper) HandleUndelegate(ctx sdk.Context, msg sdk.Msg, completion time. if !found { return fmt.Errorf("unable to lookup withdrawal record; chain: %s, hash: %s", zone.ChainId, hash) } + + record.Acknowledged = true + if completion.After(record.CompletionTime) { record.CompletionTime = completion } diff --git a/x/interchainstaking/types/interchainstaking.pb.go b/x/interchainstaking/types/interchainstaking.pb.go index 7aa92170f..967cb9f5b 100644 --- a/x/interchainstaking/types/interchainstaking.pb.go +++ b/x/interchainstaking/types/interchainstaking.pb.go @@ -469,6 +469,7 @@ type WithdrawalRecord struct { Status int32 `protobuf:"varint,8,opt,name=status,proto3" json:"status,omitempty"` CompletionTime time.Time `protobuf:"bytes,9,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` Requeued bool `protobuf:"varint,10,opt,name=requeued,proto3" json:"requeued,omitempty"` + Acknowledged bool `protobuf:"varint,11,opt,name=acknowledged,proto3" json:"acknowledged,omitempty"` } func (m *WithdrawalRecord) Reset() { *m = WithdrawalRecord{} } @@ -567,6 +568,13 @@ func (m *WithdrawalRecord) GetRequeued() bool { return false } +func (m *WithdrawalRecord) GetAcknowledged() bool { + if m != nil { + return m.Acknowledged + } + return false +} + type UnbondingRecord struct { ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` EpochNumber int64 `protobuf:"varint,2,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` @@ -1176,123 +1184,124 @@ func init() { } var fileDescriptor_0d755cfd37ef9fee = []byte{ - // 1848 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x5f, 0x6f, 0x1b, 0xc7, - 0x11, 0xf7, 0x49, 0x14, 0x25, 0x0e, 0x25, 0x51, 0x5a, 0xc9, 0xce, 0x59, 0x71, 0x24, 0x86, 0x45, - 0x53, 0xb6, 0xae, 0xc8, 0xd0, 0x05, 0x5a, 0x23, 0x28, 0x8a, 0xe8, 0x8f, 0x91, 0x08, 0x85, 0x55, - 0xe1, 0xa4, 0x34, 0x80, 0x8b, 0xe2, 0xb0, 0xbc, 0x5b, 0x91, 0x5b, 0x1f, 0x77, 0xe9, 0xdd, 0x3d, - 0xfd, 0xc9, 0xa7, 0xc8, 0x47, 0xe8, 0x5b, 0x81, 0xa0, 0xe8, 0x93, 0x81, 0xbe, 0xf4, 0x03, 0xe4, - 0x31, 0xf0, 0x53, 0x51, 0x14, 0x76, 0x61, 0xbf, 0x36, 0x2f, 0xfd, 0x04, 0xc5, 0xfe, 0xb9, 0xe3, - 0x49, 0x51, 0x4d, 0xc9, 0x91, 0xfb, 0x44, 0xee, 0x6f, 0x66, 0x7e, 0x3b, 0xbb, 0x3b, 0x3b, 0x33, - 0xb7, 0x70, 0xff, 0x49, 0x4a, 0xa3, 0xc7, 0x92, 0x26, 0x47, 0x44, 0xb4, 0x29, 0x53, 0x44, 0x44, - 0x7d, 0x4c, 0x99, 0x54, 0xf8, 0x31, 0x65, 0xbd,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0xb4, 0x3b, 0x8e, 0xdc, 0x6c, 0xf3, - 0xd1, 0xd7, 0x2f, 0x57, 0xbd, 0x6f, 0x5e, 0xae, 0x7a, 0xff, 0x7a, 0xb9, 0xea, 0x7d, 0xf9, 0x6a, - 0xf5, 0xc6, 0x37, 0xaf, 0x56, 0x6f, 0xfc, 0xfd, 0xd5, 0xea, 0x8d, 0x47, 0x1f, 0x17, 0x16, 0x45, - 0x59, 0x8f, 0xb0, 0x94, 0xaa, 0xd3, 0xf5, 0x6e, 0x4a, 0x93, 0xb8, 0x5d, 0x7c, 0x92, 0x3d, 0xb9, - 0xe0, 0x51, 0xd6, 0x2c, 0xb9, 0x5b, 0x36, 0x4e, 0xfc, 0xec, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xf6, 0x12, 0xf4, 0x99, 0xc2, 0x15, 0x00, 0x00, + // 1867 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0xdd, 0x6e, 0x1b, 0xc7, + 0x15, 0xf6, 0xea, 0x87, 0x12, 0x0f, 0x29, 0x51, 0x1a, 0xc9, 0xce, 0x5a, 0x71, 0x24, 0x86, 0x45, + 0x53, 0xb6, 0xae, 0xc8, 0xd0, 0x05, 0x5a, 0x23, 0x28, 0x8a, 0xe8, 0xc7, 0x48, 0x84, 0xc2, 0xaa, + 0xb0, 0x52, 0x1a, 0xc0, 0x45, 0xb1, 0x18, 0xee, 0x8e, 0xc8, 0xa9, 0x97, 0x33, 0xf4, 0xcc, 0xac, + 0x7e, 0xf2, 0x14, 0xe9, 0x1b, 0xf4, 0xae, 0x40, 0x50, 0xf4, 0xca, 0x40, 0x6f, 0xfa, 0x00, 0xb9, + 0x0c, 0x7c, 0x55, 0x14, 0x85, 0x5d, 0xd8, 0xb7, 0xed, 0x4d, 0x9f, 0xa0, 0x98, 0x9f, 0x5d, 0xae, + 0x14, 0xd5, 0x94, 0x1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e5, 0x51, 0x29, 0x9a, 0xb8, 0x64, 0x29, + 0x1a, 0x75, 0x5a, 0x93, 0x67, 0x3a, 0xad, 0x51, 0x8b, 0x39, 0xf5, 0xf6, 0x5a, 0xcc, 0x2d, 0x80, + 0x43, 0x2a, 0xa4, 0x0a, 0x25, 0x21, 0xcc, 0x3d, 0x92, 0x8d, 0x4b, 0x1a, 0x9e, 0x49, 0x1a, 0x65, + 0x63, 0xb7, 0x4f, 0x08, 0x43, 0x9b, 0x50, 0x76, 0x35, 0x9a, 0xc4, 0x97, 0x2c, 0xed, 0x8e, 0x23, + 0x37, 0xdb, 0x7c, 0xf4, 0xf5, 0xcb, 0x55, 0xef, 0x9b, 0x97, 0xab, 0xde, 0x3f, 0x5f, 0xae, 0x7a, + 0x5f, 0xbe, 0x5a, 0xbd, 0xf1, 0xcd, 0xab, 0xd5, 0x1b, 0x7f, 0x7b, 0xb5, 0x7a, 0xe3, 0xd1, 0xc7, + 0x85, 0x45, 0x51, 0xd6, 0x23, 0x2c, 0xa5, 0xea, 0x74, 0xbd, 0x9b, 0xd2, 0x24, 0x6e, 0x17, 0x9f, + 0x6d, 0x4f, 0x2e, 0x78, 0xb8, 0x35, 0x4b, 0xee, 0x96, 0x8c, 0x13, 0x3f, 0xf9, 0x6f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xe3, 0xb8, 0x8d, 0xe4, 0xe6, 0x15, 0x00, 0x00, } func (m *Zone) Marshal() (dAtA []byte, err error) { @@ -1756,6 +1765,16 @@ func (m *WithdrawalRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Acknowledged { + i-- + if m.Acknowledged { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + } if m.Requeued { i-- if m.Requeued { @@ -2597,6 +2616,9 @@ func (m *WithdrawalRecord) Size() (n int) { if m.Requeued { n += 2 } + if m.Acknowledged { + n += 2 + } return n } @@ -4415,6 +4437,26 @@ func (m *WithdrawalRecord) Unmarshal(dAtA []byte) error { } } m.Requeued = bool(v != 0) + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Acknowledged", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInterchainstaking + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Acknowledged = bool(v != 0) default: iNdEx = preIndex skippy, err := skipInterchainstaking(dAtA[iNdEx:]) From b6861bcd96733fbf479681d57c1eace82681a326 Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Wed, 19 Jul 2023 03:36:34 +0530 Subject: [PATCH 2/4] added test cases for ack fix --- .../keeper/ibc_packet_handlers_test.go | 367 ++++++++++++++++++ 1 file changed, 367 insertions(+) diff --git a/x/interchainstaking/keeper/ibc_packet_handlers_test.go b/x/interchainstaking/keeper/ibc_packet_handlers_test.go index ef191e608..b038ffb5d 100644 --- a/x/interchainstaking/keeper/ibc_packet_handlers_test.go +++ b/x/interchainstaking/keeper/ibc_packet_handlers_test.go @@ -1194,6 +1194,7 @@ func (suite *KeeperTestSuite) TestReceiveAckErrForBeginUndelegate() { suite.Require().Equal(ewdr.Delegator, wdr.Delegator) suite.Require().Equal(ewdr.Distribution, wdr.Distribution, idx) suite.Require().Equal(ewdr.Status, wdr.Status) + suite.Require().False(wdr.Acknowledged) } }) } @@ -2187,6 +2188,7 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginUndelegate() { suite.Require().Equal(ewdr.Distribution, wdr.Distribution, idx) suite.Require().Equal(ewdr.Status, wdr.Status) suite.Require().Equal(ewdr.CompletionTime, wdr.CompletionTime) + suite.Require().True(wdr.Acknowledged) } }) } @@ -2368,3 +2370,368 @@ func (suite *KeeperTestSuite) TestReceiveAckForBeginRedelegateNilCompletion() { suite.Require().Equal(complete.Unix(), afterTarget.RedelegationEnd) suite.Require().Equal(beforeTarget.Amount.Add(redelegate.Amount), afterTarget.Amount) } + +func (suite *KeeperTestSuite) TestHandleMaturedUbondings() { + hash1 := randomutils.GenerateRandomHashAsHex(32) + hash2 := randomutils.GenerateRandomHashAsHex(32) + delegator1 := addressutils.GenerateAddressForTestWithPrefix("quick") + delegator2 := addressutils.GenerateAddressForTestWithPrefix("quick") + + tests := []struct { + name string + epoch int64 + withdrawalRecords func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord + completionTime time.Time + expectedWithdrawalRecords func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord + }{ + { + name: "1 wdr, valid completion time, acknowledged ", + epoch: 1, + withdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: true, + }, + } + }, + expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusSend, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: true, + }, + } + }, + }, + { + name: "1 wdr, invalid completion time, acknowledged ", + epoch: 1, + withdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(1 * time.Hour), + Acknowledged: true, + }, + } + }, + expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(1 * time.Hour), + Acknowledged: true, + }, + } + }, + }, + { + name: "1 wdr, invalid completion time, unacknowledged ", + epoch: 1, + withdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(1 * time.Hour), + Acknowledged: false, + }, + } + }, + expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(2000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1800)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(1 * time.Hour), + Acknowledged: false, + }, + } + }, + }, + + { + name: "valid completion time, Unacknowledged ", + epoch: 1, + withdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(1000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(900)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: false, + }, + } + }, + expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(1000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(900)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: false, + }, + } + }, + }, + { + name: "valid completion time, 1 acknowledged and 1 unacknowledged ", + epoch: 2, + withdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 500, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(1500))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1350)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: false, + }, + { + ChainId: suite.chainB.ChainID, + Delegator: delegator2, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 2000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(3000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(2700)), + Txhash: hash2, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: true, + }, + } + }, + expectedWithdrawalRecords: func(ctx sdk.Context, qs *app.Quicksilver, zone icstypes.Zone) []icstypes.WithdrawalRecord { + vals := qs.InterchainstakingKeeper.GetValidatorAddresses(ctx, zone.ChainId) + return []icstypes.WithdrawalRecord{ + { + ChainId: suite.chainB.ChainID, + Delegator: delegator1, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 500, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(1500))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(1350)), + Txhash: hash1, + Status: icstypes.WithdrawStatusUnbond, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: false, + }, + { + ChainId: suite.chainB.ChainID, + Delegator: delegator2, + Distribution: []*icstypes.Distribution{ + { + Valoper: vals[0], + Amount: 1000, + }, + { + Valoper: vals[1], + Amount: 2000, + }, + }, + Recipient: addressutils.GenerateAddressForTestWithPrefix(zone.GetAccountPrefix()), + Amount: sdk.NewCoins(sdk.NewCoin(zone.BaseDenom, sdk.NewInt(3000))), + BurnAmount: sdk.NewCoin(zone.LocalDenom, sdk.NewInt(2700)), + Txhash: hash2, + Status: icstypes.WithdrawStatusSend, + CompletionTime: ctx.BlockTime().Add(-1 * time.Hour), + Acknowledged: true, + }, + } + }, + }, + } + + for _, test := range tests { + suite.Run(test.name, func() { + suite.SetupTest() + suite.setupTestZones() + + quicksilver := suite.GetQuicksilverApp(suite.chainA) + ctx := suite.chainA.GetContext() + + zone, found := quicksilver.InterchainstakingKeeper.GetZone(ctx, suite.chainB.ChainID) + if !found { + suite.Fail("unable to retrieve zone for test") + } + + for _, wdr := range test.withdrawalRecords(ctx, quicksilver, zone) { + quicksilver.InterchainstakingKeeper.SetWithdrawalRecord(ctx, wdr) + } + + err := quicksilver.InterchainstakingKeeper.HandleMaturedUnbondings(ctx, &zone) + suite.Require().NoError(err) + + for idx, ewdr := range test.expectedWithdrawalRecords(ctx, quicksilver, zone) { + wdr, found := quicksilver.InterchainstakingKeeper.GetWithdrawalRecord(ctx, zone.ChainId, ewdr.Txhash, ewdr.Status) + suite.Require().True(found) + suite.Require().Equal(ewdr.Amount, wdr.Amount) + suite.Require().Equal(ewdr.BurnAmount, wdr.BurnAmount) + suite.Require().Equal(ewdr.Delegator, wdr.Delegator) + suite.Require().Equal(ewdr.Distribution, wdr.Distribution, idx) + suite.Require().Equal(ewdr.Status, wdr.Status) + suite.Require().Equal(ewdr.CompletionTime, wdr.CompletionTime) + suite.Require().Equal(ewdr.Acknowledged, wdr.Acknowledged) + } + }) + } +} From cc01d3d4a681725e0846d1f8ad6e316f8ade2a18 Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Wed, 19 Jul 2023 03:58:58 +0530 Subject: [PATCH 3/4] upgrade handler to migrate state --- app/upgrades/types.go | 1 + app/upgrades/upgrades.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/app/upgrades/types.go b/app/upgrades/types.go index e8f32b6e1..b3aabbaa3 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -30,6 +30,7 @@ const ( V010404beta5UpgradeName = "v1.4.4-beta.5" V010404beta7UpgradeName = "v1.4.4-beta.7" V010404rc0UpgradeName = "v1.4.4-rc.0" + V010404beta8UpgradeName = "v1.4.4-beta.8" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index 80d4d286c..dffc97d7c 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -33,6 +33,7 @@ func Upgrades() []Upgrade { {UpgradeName: V010404beta5UpgradeName, CreateUpgradeHandler: V010404beta5UpgradeHandler}, {UpgradeName: V010404beta7UpgradeName, CreateUpgradeHandler: V010404beta7UpgradeHandler}, {UpgradeName: V010404rc0UpgradeName, CreateUpgradeHandler: V010404rc0UpgradeHandler}, + {UpgradeName: V010404beta8UpgradeName, CreateUpgradeHandler: V010404beta8UpgradeHandler}, } } @@ -442,6 +443,25 @@ func V010404rc0UpgradeHandler( } } +func V010404beta8UpgradeHandler( + mm *module.Manager, + configurator module.Configurator, + appKeepers *keepers.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if isTestnet(ctx) || isTest(ctx) || isDevnet(ctx) { + appKeepers.InterchainstakingKeeper.IterateWithdrawalRecords(ctx, func(index int64, record icstypes.WithdrawalRecord) (stop bool) { + if (record.Status == icstypes.WithdrawStatusSend) || record.Requeued || ((record.CompletionTime != time.Time{}) && (record.CompletionTime.Before(ctx.BlockTime()))) { + record.Acknowledged = true + } + appKeepers.InterchainstakingKeeper.SetWithdrawalRecord(ctx, record) + return false + }) + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + // func V010400UpgradeHandler( // mm *module.Manager, // configurator module.Configurator, From cee856c37eeafd6ea8478743a530cae695cde937 Mon Sep 17 00:00:00 2001 From: Ajaz Ahmed Ansari Date: Wed, 19 Jul 2023 04:17:36 +0530 Subject: [PATCH 4/4] nil completion time for elgafar-1 are ack'd --- app/upgrades/upgrades.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/upgrades/upgrades.go b/app/upgrades/upgrades.go index dffc97d7c..37432df0f 100644 --- a/app/upgrades/upgrades.go +++ b/app/upgrades/upgrades.go @@ -454,6 +454,11 @@ func V010404beta8UpgradeHandler( if (record.Status == icstypes.WithdrawStatusSend) || record.Requeued || ((record.CompletionTime != time.Time{}) && (record.CompletionTime.Before(ctx.BlockTime()))) { record.Acknowledged = true } + + if (record.ChainId == "elgafar-1") && (record.CompletionTime == time.Time{}) { + record.Acknowledged = true + } + appKeepers.InterchainstakingKeeper.SetWithdrawalRecord(ctx, record) return false })