From 17a8fd021a98e0205f0dc7ea9c508cf4b5cfb195 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 18 Apr 2024 23:17:46 +0200 Subject: [PATCH] feat(x/auction): implement auction finalization (#2498) * feat(x/auction): implement auction finalization * convert rewards.Bidder from string to bytes * use module account * fix * burn coins * fix * review * lint * disable x/auction endblocker --- app/app.go | 2 +- proto/umee/auction/v1/auction.proto | 2 +- x/auction/auction.pb.go | 70 +++++++++++++++-------------- x/auction/expected_keepers.go | 8 ++-- x/auction/keeper/grpc_query.go | 4 +- x/auction/keeper/keeper.go | 18 ++++++-- x/auction/keeper/rewards.go | 62 +++++++++++++++++++------ x/auction/module/module.go | 13 ++++-- 8 files changed, 115 insertions(+), 64 deletions(-) diff --git a/app/app.go b/app/app.go index ce63f3c150..a831cb20a2 100644 --- a/app/app.go +++ b/app/app.go @@ -229,7 +229,7 @@ func init() { leveragetypes.ModuleName: {authtypes.Minter, authtypes.Burner}, wasmtypes.ModuleName: {authtypes.Burner}, - auction.ModuleName: nil, + auction.ModuleName: {authtypes.Burner}, incentive.ModuleName: nil, metoken.ModuleName: {authtypes.Minter, authtypes.Burner}, oracletypes.ModuleName: nil, diff --git a/proto/umee/auction/v1/auction.proto b/proto/umee/auction/v1/auction.proto index 46871e2907..a20a98cbbb 100644 --- a/proto/umee/auction/v1/auction.proto +++ b/proto/umee/auction/v1/auction.proto @@ -17,7 +17,7 @@ message RewardsParams { // Bid records a user bid message Bid { - string bidder = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + bytes bidder = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string amount = 2 [(cosmos_proto.scalar) = "cosmos.Int", (gogoproto.customtype) = "cosmossdk.io/math.Int", (gogoproto.nullable) = false]; } diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index a20ee31dfa..fde9cfb152 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -71,7 +71,7 @@ var xxx_messageInfo_RewardsParams proto.InternalMessageInfo // Bid records a user bid type Bid struct { - Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + Bidder []byte `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` Amount cosmossdk_io_math.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=cosmossdk.io/math.Int" json:"amount"` } @@ -156,33 +156,33 @@ func init() { func init() { proto.RegisterFile("umee/auction/v1/auction.proto", fileDescriptor_7a7eec280427e7e3) } var fileDescriptor_7a7eec280427e7e3 = []byte{ - // 407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x92, 0xc1, 0x6e, 0x13, 0x31, - 0x10, 0x86, 0xd7, 0x04, 0x25, 0xe0, 0x80, 0x90, 0x56, 0x45, 0x4a, 0x23, 0xe1, 0x94, 0x9c, 0x8a, - 0x50, 0x6c, 0x12, 0x24, 0x24, 0x0e, 0x1c, 0xba, 0x45, 0x42, 0xbd, 0xa1, 0x85, 0x13, 0x97, 0xc8, - 0x5e, 0x9b, 0xad, 0x55, 0x6c, 0x57, 0xb6, 0x77, 0xcb, 0x81, 0x1b, 0x2f, 0xd0, 0x87, 0xe9, 0x43, - 0xe4, 0x58, 0xf5, 0x84, 0x38, 0x04, 0x48, 0x5e, 0x04, 0x79, 0xed, 0xbd, 0xcd, 0xcc, 0x3f, 0xdf, - 0xce, 0x3f, 0xb3, 0x86, 0xcf, 0x1a, 0x25, 0x04, 0xa1, 0x4d, 0xe5, 0xa5, 0xd1, 0xa4, 0x5d, 0xf6, - 0x21, 0xbe, 0xb4, 0xc6, 0x9b, 0xfc, 0x49, 0x90, 0x71, 0x5f, 0x6b, 0x97, 0xd3, 0x59, 0x6d, 0x4c, - 0xfd, 0x4d, 0x90, 0x4e, 0x66, 0xcd, 0x57, 0xe2, 0xa5, 0x12, 0xce, 0x53, 0x75, 0x19, 0x89, 0xe9, - 0x41,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b, 0xd3, 0x68, 0x66, 0xbc, 0x9a, 0xe2, 0x78, 0x7c, - 0xdc, 0x1f, 0x1f, 0x7f, 0xee, 0x8f, 0x5f, 0x3c, 0x08, 0xec, 0xf5, 0x9f, 0x19, 0x28, 0x87, 0x01, - 0x3a, 0xf1, 0xc5, 0x87, 0xcd, 0x3f, 0x94, 0x6d, 0x76, 0x08, 0xdc, 0xee, 0x10, 0xf8, 0xbb, 0x43, - 0xe0, 0x7a, 0x8f, 0xb2, 0xdb, 0x3d, 0xca, 0x7e, 0xed, 0x51, 0xf6, 0xe5, 0x45, 0x2d, 0xfd, 0x79, - 0xc3, 0x70, 0x65, 0x14, 0x09, 0xff, 0x78, 0xa1, 0x85, 0xbf, 0x32, 0xf6, 0xa2, 0x4b, 0x48, 0xfb, - 0x86, 0x7c, 0xef, 0x5f, 0x02, 0x1b, 0x76, 0xe3, 0x5e, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xc9, - 0x8c, 0x9f, 0x2d, 0x2b, 0x02, 0x00, 0x00, + // 409 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x34, 0x52, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0x5d, 0x13, 0x94, 0x80, 0x53, 0x84, 0xb4, 0x2a, 0x52, 0x1a, 0x09, 0x27, 0xe4, 0x14, 0x84, + 0x62, 0x93, 0x20, 0x21, 0x71, 0xe0, 0xd0, 0x2d, 0x12, 0xea, 0x0d, 0x2d, 0x9c, 0xb8, 0x44, 0x76, + 0x6c, 0xb6, 0x56, 0xb1, 0x5d, 0xd9, 0xde, 0x2d, 0x07, 0x6e, 0xfc, 0x40, 0x3f, 0xa6, 0x1f, 0x91, + 0x63, 0xd5, 0x13, 0xe2, 0x50, 0x20, 0xf9, 0x91, 0xca, 0x6b, 0xef, 0xed, 0xcd, 0xbc, 0x79, 0x3b, + 0x6f, 0xde, 0x1a, 0x3e, 0x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x60, 0xfa, 0xdc, 0xa9, 0xf6, 0x65, + 0x92, 0xce, 0x7e, 0x01, 0x38, 0x48, 0x96, 0xf3, 0x77, 0x70, 0x60, 0x23, 0x1c, 0x81, 0x69, 0x6f, + 0x3e, 0x5c, 0x1d, 0xe1, 0xa4, 0x08, 0xf7, 0xe2, 0x74, 0x2f, 0x3e, 0x31, 0x52, 0x17, 0x0f, 0xc3, + 0xb2, 0xb2, 0x9b, 0xcf, 0xdf, 0xc3, 0x81, 0xd0, 0xdc, 0xad, 0x69, 0x34, 0x33, 0x5c, 0x8d, 0x71, + 0x0c, 0x1f, 0x77, 0xe1, 0xe3, 0x2f, 0x5d, 0xf8, 0xc5, 0xa3, 0xa0, 0xbd, 0xfa, 0x3b, 0x01, 0x65, + 0x3f, 0x88, 0x8e, 0x7d, 0xf1, 0x71, 0xfb, 0x1f, 0x65, 0xdb, 0x1d, 0x02, 0x37, 0x3b, 0x04, 0xfe, + 0xed, 0x10, 0xb8, 0xda, 0xa3, 0xec, 0x66, 0x8f, 0xb2, 0xdf, 0x7b, 0x94, 0x7d, 0x7d, 0x59, 0x49, + 0x7f, 0x56, 0x33, 0xbc, 0x31, 0x8a, 0x84, 0x7f, 0xbc, 0xd0, 0xc2, 0x5f, 0x1a, 0x7b, 0xde, 0x16, + 0xa4, 0x79, 0x4b, 0x7e, 0x74, 0x2f, 0x81, 0xf5, 0xdb, 0x75, 0x6f, 0xee, 0x03, 0x00, 0x00, 0xff, + 0xff, 0xa0, 0x8c, 0xc4, 0xb7, 0x2b, 0x02, 0x00, 0x00, } func (m *RewardsParams) Marshal() (dAtA []byte, err error) { @@ -461,7 +461,7 @@ func (m *Bid) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) } - var stringLen uint64 + var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuction @@ -471,23 +471,25 @@ func (m *Bid) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if byteLen < 0 { return ErrInvalidLengthAuction } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthAuction } if postIndex > l { return io.ErrUnexpectedEOF } - m.Bidder = string(dAtA[iNdEx:postIndex]) + m.Bidder = append(m.Bidder[:0], dAtA[iNdEx:postIndex]...) + if m.Bidder == nil { + m.Bidder = []byte{} + } iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/auction/expected_keepers.go b/x/auction/expected_keepers.go index 7c1c22a404..d737da8239 100644 --- a/x/auction/expected_keepers.go +++ b/x/auction/expected_keepers.go @@ -6,9 +6,9 @@ import ( // BankKeeper defines the expected x/bank keeper interface. type BankKeeper interface { - // SendCoinsFromModuleToAccount(ctx sdk.Context, fromModule string, toAddr sdk.AccAddress, coins sdk.Coins) error - // SendCoinsFromAccountToModule(ctx sdk.Context, fromAddr sdk.AccAddress, toModule string, coins sdk.Coins) error - // SendCoinsFromModuleToModule(ctx sdk.Context, fromModule string, toModule string, coins sdk.Coins) error - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error } diff --git a/x/auction/keeper/grpc_query.go b/x/auction/keeper/grpc_query.go index 2d77244381..49c568ec7c 100644 --- a/x/auction/keeper/grpc_query.go +++ b/x/auction/keeper/grpc_query.go @@ -36,10 +36,10 @@ func (q Querier) RewardsAuction(goCtx context.Context, msg *auction.QueryRewards bid, id := q.Keeper(&ctx).getRewardsBid(msg.Id) r := &auction.QueryRewardsAuctionResponse{Id: id} if bid != nil { - r.Bidder = bid.Bidder + r.Bidder = sdk.AccAddress(bid.Bidder).String() r.Bid = coin.UmeeInt(bid.Amount) } - rewards, _ := q.Keeper(&ctx).getRewards(msg.Id) + rewards, _ := q.Keeper(&ctx).getRewardsAuction(msg.Id) if rewards != nil { r.Rewards = rewards.Rewards r.EndsAt = rewards.EndsAt diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 8bfbf56ed9..4d128fa92e 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -10,8 +10,8 @@ import ( ) type SubAccounts struct { - Rewards []byte - RewardsBid []byte + // Account used to collect rewards + RewardsCollect []byte } type Builder struct { @@ -54,6 +54,16 @@ type Keeper struct { ctx *sdk.Context } -func (k Keeper) sendCoins(from, to sdk.AccAddress, amount sdk.Coins) error { - return k.bank.SendCoins(*k.ctx, from, to, amount) +// +// helper functions +// + +func (k Keeper) sendCoins(from, to sdk.AccAddress, amounts sdk.Coins) error { + return k.bank.SendCoins(*k.ctx, from, to, amounts) +} +func (k Keeper) sendFromModule(to sdk.AccAddress, amounts ...sdk.Coin) error { + return k.bank.SendCoinsFromModuleToAccount(*k.ctx, auction.ModuleName, to, amounts) +} +func (k Keeper) sendToModule(from sdk.AccAddress, amounts ...sdk.Coin) error { + return k.bank.SendCoinsFromAccountToModule(*k.ctx, from, auction.ModuleName, amounts) } diff --git a/x/auction/keeper/rewards.go b/x/auction/keeper/rewards.go index 7a899b9ed7..eeed12242b 100644 --- a/x/auction/keeper/rewards.go +++ b/x/auction/keeper/rewards.go @@ -1,10 +1,12 @@ package keeper import ( + "bytes" "errors" + "fmt" "strconv" + "time" - sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/umee-network/umee/v6/util" @@ -13,8 +15,35 @@ import ( "github.com/umee-network/umee/v6/x/auction" ) -func umeeCoins(amount sdkmath.Int) sdk.Coins { - return sdk.Coins{coin.UmeeInt(amount)} +func (k Keeper) FinalizeRewardsAuction() error { + now := k.ctx.BlockTime() + a, id := k.getRewardsAuction(0) + if !a.EndsAt.After(now) { + return nil + } + + newCoins := k.bank.GetAllBalances(*k.ctx, k.accs.RewardsCollect) + bid, _ := k.getRewardsBid(id) + if len(bid.Bidder) == 0 { + err := k.sendCoins(k.accs.RewardsCollect, bid.Bidder, a.Rewards) + if err != nil { + return fmt.Errorf("can't send coins to finalize the auction [%w]", err) + } + err = k.bank.BurnCoins(*k.ctx, auction.ModuleName, sdk.Coins{coin.UmeeInt(bid.Amount)}) + if err != nil { + return fmt.Errorf("can't burn rewards auction bid [%w]", err) + } + + } else if len(a.Rewards) != 0 { + // rollover the past rewards if there was no bidder + newCoins = newCoins.Add(a.Rewards...) + } + + id++ + store.SetInteger(k.store, keyRewardsCurrentID, id) + params := k.GetRewardsParams() + endsAt := now.Add(time.Duration(params.BidDuration) * time.Second) + return k.storeNewRewardsAuction(id, endsAt, newCoins) } func (k Keeper) currentRewardsAuction() uint32 { @@ -41,25 +70,23 @@ func (k Keeper) rewardsBid(msg *auction.MsgRewardsBid) error { sender, err := sdk.AccAddressFromBech32(msg.Sender) util.Panic(err) - prevBidder, err := sdk.AccAddressFromBech32(lastBid.Bidder) - util.Panic(err) - vault := k.accs.RewardsBid - if lastBid.Bidder != msg.Sender { - if err = k.sendCoins(vault, prevBidder, umeeCoins(lastBid.Amount)); err != nil { + if !bytes.Equal(sender, lastBid.Bidder) { + returned := coin.UmeeInt(lastBid.Amount) + if err = k.sendFromModule(lastBid.Bidder, returned); err != nil { return err } - if err = k.sendCoins(sender, vault, sdk.Coins{msg.Amount}); err != nil { + if err = k.sendToModule(sender, msg.Amount); err != nil { return err } } else { - diff := msg.Amount.SubAmount(minBid) - if err = k.sendCoins(sender, vault, sdk.Coins{diff}); err != nil { + diff := msg.Amount.SubAmount(lastBid.Amount) + if err = k.sendToModule(sender, diff); err != nil { return err } } - bid := auction.Bid{Bidder: msg.Sender, Amount: msg.Amount.Amount} + bid := auction.Bid{Bidder: sender, Amount: msg.Amount.Amount} return store.SetValue(k.store, key, &bid, keyMsg) } @@ -73,11 +100,18 @@ func (k Keeper) getRewardsBid(id uint32) (*auction.Bid, uint32) { } // returns nil if id is not found -func (k Keeper) getRewards(id uint32) (*auction.Rewards, uint32) { +func (k Keeper) getRewardsAuction(id uint32) (*auction.Rewards, uint32) { if id == 0 { id = k.currentRewardsAuction() } - keyMsg := "auction.rewards.coins" + const keyMsg = "auction.rewards.coins" key := k.keyRewardsCoins(id) return store.GetValue[*auction.Rewards](k.store, key, keyMsg), id } + +func (k Keeper) storeNewRewardsAuction(id uint32, endsAt time.Time, coins sdk.Coins) error { + newRewards := auction.Rewards{EndsAt: endsAt, Rewards: coins} + const keyMsg = "auction.rewards.coins" + key := k.keyRewardsCoins(id) + return store.SetValue(k.store, key, &newRewards, keyMsg) +} diff --git a/x/auction/module/module.go b/x/auction/module/module.go index e339254425..24cfeaa26e 100644 --- a/x/auction/module/module.go +++ b/x/auction/module/module.go @@ -150,20 +150,25 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} // EndBlock executes all ABCI EndBlock logic respective to the x/auction module. // It returns no validator updates. func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + // TODO: enable end blocker + // k := am.kb.Keeper(&ctx) + // if err := k.FinalizeRewardsAuction(); err != nil { + // ctx.Logger().With("module", "x/auction"). + // Error("can't finalize rewards auction", "error", err) + // } + return []abci.ValidatorUpdate{} } // sub-module accounts var ( - subaccRewards = []byte{0x01} - subaccRewardsBid = []byte{0x02} + subAccRewards = []byte{0x01} ) // SubAccounts for auction Keeper func SubAccounts() keeper.SubAccounts { n := AppModuleBasic{}.Name() return keeper.SubAccounts{ - Rewards: address.Module(n, subaccRewards), - RewardsBid: address.Module(n, subaccRewardsBid), + RewardsCollect: address.Module(n, subAccRewards), } }