From a3e3a8fa4aa1e9b95fbc2d9181afa747194b7e1b Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Fri, 22 Mar 2024 20:24:59 +0100 Subject: [PATCH] update params --- proto/umee/auction/v1/auction.proto | 9 ++- proto/umee/auction/v1/genesis.proto | 7 +- x/auction/auction.pb.go | 61 +++++++------- x/auction/genesis.pb.go | 121 +++++++++++++++++++++------- 4 files changed, 131 insertions(+), 67 deletions(-) diff --git a/proto/umee/auction/v1/auction.proto b/proto/umee/auction/v1/auction.proto index fd193320fe..95b1d858bc 100644 --- a/proto/umee/auction/v1/auction.proto +++ b/proto/umee/auction/v1/auction.proto @@ -8,8 +8,9 @@ option (gogoproto.goproto_getters_all) = false; // RewardsParams defines parameters for the rewards auction. message RewardsParams { - // auction_duration is duration in seconds. - int64 auction_duration = 1; - // min_bid_increment (nominal) in the base denom for each consequitive bid. - int64 min_bid_increment = 2; + // bid_duration is duration of the bid phase in seconds. + int64 bid_duration = 1; + // Duration (in seconds) at the end of each auction, when we start collecting revenues for + // the next auction. + int64 revenu_collection_shift = 2; } diff --git a/proto/umee/auction/v1/genesis.proto b/proto/umee/auction/v1/genesis.proto index 6a43d70c42..a164053694 100644 --- a/proto/umee/auction/v1/genesis.proto +++ b/proto/umee/auction/v1/genesis.proto @@ -13,9 +13,12 @@ option (gogoproto.goproto_getters_all) = false; // GenesisState defines the x/auction module's genesis state. message GenesisState { RewardsParams rewards_params = 1 [(gogoproto.nullable) = false]; - // latest reward - uint32 reward_id = 2; + // latest active (in bid phase) reward auction. + uint32 reward_auction_id = 2; // latest highest bid string highest_bidder = 3; repeated cosmos.base.v1beta1.Coin reward_tokens = 4 [(gogoproto.nullable) = false]; + // tokens collected for the next auction, while the current reward auction is still in the + // bid phase. + repeated cosmos.base.v1beta1.Coin next_reward_tokens = 5 [(gogoproto.nullable) = false]; } diff --git a/x/auction/auction.pb.go b/x/auction/auction.pb.go index e1a635970a..fd51a40ee5 100644 --- a/x/auction/auction.pb.go +++ b/x/auction/auction.pb.go @@ -25,10 +25,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // RewardsParams defines parameters for the rewards auction. type RewardsParams struct { - // auction_duration is duration in seconds. - AuctionDuration int64 `protobuf:"varint,1,opt,name=auction_duration,json=auctionDuration,proto3" json:"auction_duration,omitempty"` - // min_bid_increment (nominal) in the base denom for each consequitive bid. - MinBidIncrement int64 `protobuf:"varint,2,opt,name=min_bid_increment,json=minBidIncrement,proto3" json:"min_bid_increment,omitempty"` + // bid_duration is duration of the bid phase in seconds. + BidDuration int64 `protobuf:"varint,1,opt,name=bid_duration,json=bidDuration,proto3" json:"bid_duration,omitempty"` + // Duration (in seconds) at the end of each auction, when we start collecting revenues for + // the next auction. + RevenuCollectionShift int64 `protobuf:"varint,2,opt,name=revenu_collection_shift,json=revenuCollectionShift,proto3" json:"revenu_collection_shift,omitempty"` } func (m *RewardsParams) Reset() { *m = RewardsParams{} } @@ -71,21 +72,21 @@ func init() { func init() { proto.RegisterFile("umee/auction/v1/auction.proto", fileDescriptor_7a7eec280427e7e3) } var fileDescriptor_7a7eec280427e7e3 = []byte{ - // 216 bytes of a gzipped FileDescriptorProto + // 221 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0xcd, 0x4d, 0x4d, 0xd5, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0x84, 0x31, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xf8, 0x41, 0xd2, 0x7a, 0x30, 0xb1, 0x32, 0x43, 0x29, 0x91, 0xf4, 0xfc, - 0xf4, 0x7c, 0xb0, 0x9c, 0x3e, 0x88, 0x05, 0x51, 0xa6, 0x94, 0xc6, 0xc5, 0x1b, 0x94, 0x5a, 0x9e, - 0x58, 0x94, 0x52, 0x1c, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xa4, 0xc9, 0x25, 0x00, 0xd5, 0x14, - 0x9f, 0x52, 0x5a, 0x94, 0x08, 0x62, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0xf1, 0x43, 0xc5, - 0x5d, 0xa0, 0xc2, 0x42, 0x5a, 0x5c, 0x82, 0xb9, 0x99, 0x79, 0xf1, 0x49, 0x99, 0x29, 0xf1, 0x99, - 0x79, 0xc9, 0x45, 0xa9, 0xb9, 0xa9, 0x79, 0x25, 0x12, 0x4c, 0x10, 0xb5, 0xb9, 0x99, 0x79, 0x4e, - 0x99, 0x29, 0x9e, 0x30, 0x61, 0x27, 0xf7, 0x13, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc, - 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, - 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x33, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, - 0x57, 0x1f, 0xe4, 0x6e, 0xdd, 0xbc, 0xd4, 0x92, 0xf2, 0xfc, 0xa2, 0x6c, 0x30, 0x47, 0xbf, 0xcc, - 0x4c, 0xbf, 0x02, 0xe6, 0xbb, 0x24, 0x36, 0xb0, 0xbb, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x26, 0xc1, 0xf4, 0x0e, 0xff, 0x00, 0x00, 0x00, + 0xf4, 0x7c, 0xb0, 0x9c, 0x3e, 0x88, 0x05, 0x51, 0xa6, 0x94, 0xc5, 0xc5, 0x1b, 0x94, 0x5a, 0x9e, + 0x58, 0x94, 0x52, 0x1c, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xa4, 0xc8, 0xc5, 0x93, 0x94, 0x99, + 0x12, 0x9f, 0x52, 0x5a, 0x94, 0x08, 0xd2, 0x29, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x1c, 0xc4, 0x9d, + 0x94, 0x99, 0xe2, 0x02, 0x15, 0x12, 0x32, 0xe3, 0x12, 0x2f, 0x4a, 0x2d, 0x4b, 0xcd, 0x2b, 0x8d, + 0x4f, 0xce, 0xcf, 0xc9, 0x49, 0x05, 0xdb, 0x10, 0x5f, 0x9c, 0x91, 0x99, 0x56, 0x22, 0xc1, 0x04, + 0x56, 0x2d, 0x0a, 0x91, 0x76, 0x86, 0xcb, 0x06, 0x83, 0x24, 0x9d, 0xdc, 0x4f, 0x3c, 0x94, 0x63, + 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, + 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xcd, 0xf4, 0xcc, 0x92, 0x8c, + 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0xdb, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, + 0xb2, 0xc1, 0x1c, 0xfd, 0x32, 0x33, 0xfd, 0x0a, 0x98, 0x0f, 0x93, 0xd8, 0xc0, 0x6e, 0x37, 0x06, + 0x04, 0x00, 0x00, 0xff, 0xff, 0x54, 0x46, 0x9a, 0x8f, 0x03, 0x01, 0x00, 0x00, } func (m *RewardsParams) Marshal() (dAtA []byte, err error) { @@ -108,13 +109,13 @@ func (m *RewardsParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.MinBidIncrement != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.MinBidIncrement)) + if m.RevenuCollectionShift != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.RevenuCollectionShift)) i-- dAtA[i] = 0x10 } - if m.AuctionDuration != 0 { - i = encodeVarintAuction(dAtA, i, uint64(m.AuctionDuration)) + if m.BidDuration != 0 { + i = encodeVarintAuction(dAtA, i, uint64(m.BidDuration)) i-- dAtA[i] = 0x8 } @@ -138,11 +139,11 @@ func (m *RewardsParams) Size() (n int) { } var l int _ = l - if m.AuctionDuration != 0 { - n += 1 + sovAuction(uint64(m.AuctionDuration)) + if m.BidDuration != 0 { + n += 1 + sovAuction(uint64(m.BidDuration)) } - if m.MinBidIncrement != 0 { - n += 1 + sovAuction(uint64(m.MinBidIncrement)) + if m.RevenuCollectionShift != 0 { + n += 1 + sovAuction(uint64(m.RevenuCollectionShift)) } return n } @@ -184,9 +185,9 @@ func (m *RewardsParams) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AuctionDuration", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BidDuration", wireType) } - m.AuctionDuration = 0 + m.BidDuration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuction @@ -196,16 +197,16 @@ func (m *RewardsParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.AuctionDuration |= int64(b&0x7F) << shift + m.BidDuration |= int64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MinBidIncrement", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RevenuCollectionShift", wireType) } - m.MinBidIncrement = 0 + m.RevenuCollectionShift = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAuction @@ -215,7 +216,7 @@ func (m *RewardsParams) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MinBidIncrement |= int64(b&0x7F) << shift + m.RevenuCollectionShift |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/auction/genesis.pb.go b/x/auction/genesis.pb.go index 7c02ae231c..82857a4e25 100644 --- a/x/auction/genesis.pb.go +++ b/x/auction/genesis.pb.go @@ -27,11 +27,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the x/auction module's genesis state. type GenesisState struct { RewardsParams RewardsParams `protobuf:"bytes,1,opt,name=rewards_params,json=rewardsParams,proto3" json:"rewards_params"` - // latest reward - RewardId uint32 `protobuf:"varint,2,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"` + // latest active (in bid phase) reward auction. + RewardAuctionId uint32 `protobuf:"varint,2,opt,name=reward_auction_id,json=rewardAuctionId,proto3" json:"reward_auction_id,omitempty"` // latest highest bid HighestBidder string `protobuf:"bytes,3,opt,name=highest_bidder,json=highestBidder,proto3" json:"highest_bidder,omitempty"` RewardTokens []types.Coin `protobuf:"bytes,4,rep,name=reward_tokens,json=rewardTokens,proto3" json:"reward_tokens"` + // tokens collected for the next auction, while the current reward auction is still in the + // bid phase. + NextRewardTokens []types.Coin `protobuf:"bytes,5,rep,name=next_reward_tokens,json=nextRewardTokens,proto3" json:"next_reward_tokens"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -74,28 +77,30 @@ func init() { func init() { proto.RegisterFile("umee/auction/v1/genesis.proto", fileDescriptor_15e83c50dcf6ac7b) } var fileDescriptor_15e83c50dcf6ac7b = []byte{ - // 327 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x4f, 0x4b, 0xc3, 0x30, - 0x18, 0xc6, 0x1b, 0x37, 0xc4, 0x75, 0x7f, 0x84, 0xe2, 0xa1, 0x4e, 0x8c, 0x45, 0x10, 0xea, 0xc1, - 0x84, 0x4e, 0xf0, 0x03, 0x4c, 0x61, 0x88, 0x17, 0xa9, 0x9e, 0xbc, 0x94, 0xb4, 0x0d, 0x5d, 0x18, - 0x6d, 0x46, 0x92, 0x75, 0x7e, 0x0c, 0x3f, 0xd6, 0x8e, 0x3b, 0x7a, 0x12, 0xdd, 0xf0, 0x7b, 0x48, - 0x93, 0x0c, 0x44,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e, 0x39, 0xab, 0xec, 0x29, 0x3d, 0xe3, - 0x7a, 0xd6, 0xa6, 0xf1, 0x64, 0xf5, 0x05, 0x9d, 0xd5, 0x06, 0x82, 0xf5, 0x06, 0x82, 0xcf, 0x0d, - 0x04, 0x6f, 0x5b, 0xe8, 0xac, 0xb7, 0xd0, 0x79, 0xdf, 0x42, 0xe7, 0xe5, 0xb2, 0x60, 0x6a, 0xba, - 0x48, 0x51, 0xc6, 0x4b, 0xdc, 0x7c, 0xf3, 0xaa, 0xa2, 0x6a, 0xc9, 0xc5, 0x4c, 0x3f, 0x70, 0x7d, - 0x83, 0x5f, 0x77, 0xb1, 0xa5, 0xfb, 0x3a, 0xb7, 0xeb, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe3, - 0x21, 0xb9, 0x4c, 0xbe, 0x01, 0x00, 0x00, + // 353 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x51, 0x4d, 0x4b, 0xf3, 0x40, + 0x18, 0x4c, 0xda, 0xbe, 0x2f, 0x98, 0x7e, 0x69, 0xf0, 0x10, 0x0b, 0xae, 0x41, 0x10, 0xa2, 0xe0, + 0x2e, 0xa9, 0xe0, 0xdd, 0x2a, 0x14, 0x11, 0x41, 0xa2, 0x27, 0x2f, 0x21, 0x1f, 0x4b, 0xba, 0x94, + 0x64, 0xcb, 0xee, 0x36, 0xed, 0xcf, 0xf0, 0x3f, 0x79, 0xe9, 0xb1, 0x47, 0x4f, 0xa2, 0xed, 0x1f, + 0x91, 0xec, 0x6e, 0xa1, 0xea, 0xc5, 0xdb, 0xee, 0xcc, 0x33, 0x33, 0x0f, 0xf3, 0x58, 0x87, 0xd3, + 0x1c, 0x63, 0x14, 0x4d, 0x13, 0x41, 0x68, 0x81, 0x4a, 0x1f, 0x65, 0xb8, 0xc0, 0x9c, 0x70, 0x38, + 0x61, 0x54, 0x50, 0xbb, 0x5b, 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 0xbb, 0xc1, 0x70, 0xf1, + 0x09, 0x8c, 0xc5, 0x0a, 0x98, 0xcb, 0x15, 0x30, 0x3f, 0x56, 0xc0, 0x7c, 0x59, 0x03, 0x63, 0xb9, + 0x06, 0xc6, 0xdb, 0x1a, 0x18, 0xcf, 0xa7, 0x19, 0x11, 0xa3, 0x69, 0x0c, 0x13, 0x9a, 0xa3, 0xaa, + 0xc4, 0xf3, 0x02, 0x8b, 0x19, 0x65, 0x63, 0xf9, 0x41, 0xe5, 0x25, 0x9a, 0x6f, 0x8e, 0x12, 0xff, + 0x97, 0x57, 0xb9, 0xf8, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x5d, 0x86, 0x77, 0xd1, 0x1c, 0x02, 0x00, + 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -118,6 +123,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.NextRewardTokens) > 0 { + for iNdEx := len(m.NextRewardTokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NextRewardTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if len(m.RewardTokens) > 0 { for iNdEx := len(m.RewardTokens) - 1; iNdEx >= 0; iNdEx-- { { @@ -139,8 +158,8 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a } - if m.RewardId != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.RewardId)) + if m.RewardAuctionId != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.RewardAuctionId)) i-- dAtA[i] = 0x10 } @@ -176,8 +195,8 @@ func (m *GenesisState) Size() (n int) { _ = l l = m.RewardsParams.Size() n += 1 + l + sovGenesis(uint64(l)) - if m.RewardId != 0 { - n += 1 + sovGenesis(uint64(m.RewardId)) + if m.RewardAuctionId != 0 { + n += 1 + sovGenesis(uint64(m.RewardAuctionId)) } l = len(m.HighestBidder) if l > 0 { @@ -189,6 +208,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.NextRewardTokens) > 0 { + for _, e := range m.NextRewardTokens { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -262,9 +287,9 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardAuctionId", wireType) } - m.RewardId = 0 + m.RewardAuctionId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenesis @@ -274,7 +299,7 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RewardId |= uint32(b&0x7F) << shift + m.RewardAuctionId |= uint32(b&0x7F) << shift if b < 0x80 { break } @@ -345,6 +370,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextRewardTokens", 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.NextRewardTokens = append(m.NextRewardTokens, types.Coin{}) + if err := m.NextRewardTokens[len(m.NextRewardTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])