Compare commits

...

15 Commits

Author SHA1 Message Date
Michael
ac4257d792 Update README.md 2022-09-26 20:49:00 -07:00
adf86b84d1 ignite version 2022-09-24 01:22:13 +00:00
b852ce1a18 add versions & clean up readme fmt 2022-09-24 01:05:44 +00:00
98ceab502b formatting updates 2022-09-24 00:56:36 +00:00
2ea722c81c fixes + test hw edge cases 2022-09-23 00:16:42 +00:00
fba158d4d1 CLI tests, updates, fixes (reflect hw options) 2022-09-22 23:59:03 +00:00
e57473e2d2 add hardware args to cli lease creation
[UNTESTED]
2022-09-22 23:43:15 +00:00
f25f798443 new auction tx & event emission includes hw specs
[UNTESTED]
2022-09-22 23:18:08 +00:00
98c082693d hardware specs mandatory in auction creation msg 2022-09-22 23:01:31 +00:00
0b040b4334 cpu cores field 2022-09-22 22:40:51 +00:00
2fbd031988 temp fix for params init, finish later 2022-09-22 21:48:07 +00:00
8b201e32de populate dev config params genesis state 2022-09-22 00:49:52 +00:00
5ebc67bfd6 fully migrate to colinearcore params
- No more auctionconfig
- Now includes GPU model list support
- CPU vendors are still hardcoded
2022-09-22 00:16:09 +00:00
bfa30082f1 emit subscribable events for core module auctions 2022-09-21 20:31:20 +00:00
d51de8f3bc makefile help command 2022-09-21 20:31:01 +00:00
26 changed files with 1626 additions and 199 deletions

View File

@@ -1,7 +1,15 @@
SHELL = /bin/bash
.DEFAULT_GOAL := serve
.DEFAULT_GOAL := test
.PHONY: test
help:
@echo '--------------'
@echo '* Help *'
@echo '--------------'
@echo
@echo "test: run all integration tests on served chain"
@echo "utest: run all inline Go unit tests"
test:
./tests/test_locking_funds.sh
./tests/test_auction_flow.sh

View File

@@ -1,13 +1,13 @@
# Colinear Chain
# GPU Compute Chain
![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)
![Shell Script](https://img.shields.io/badge/shell_script-%23121011.svg?style=for-the-badge&logo=gnu-bash&logoColor=white)
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
![Rocky Linux](https://img.shields.io/badge/-Rocky%20Linux-%2310B981?style=for-the-badge&logo=rockylinux&logoColor=white)
![Go](https://img.shields.io/badge/1.18-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white&label=go)
![Cosmos-SDK](https://img.shields.io/badge/0.45.0-%23161931?style=for-the-badge&logoColor=white&label=Cosmos-SDK)
![Ignite CLI](https://img.shields.io/badge/0.23.0-rgb(85%2C%20123%2C%20244)?style=for-the-badge&logoColor=white&label=Ignite-CLI)
![Rocky Linux](https://img.shields.io/badge/9-%2310B981?style=for-the-badge&logo=rockylinux&logoColor=white&label=rocky%20linux)
![](https://shields.io/badge/license-business%20source%20license-orange?style=for-the-badge)
This repository contains the base chain implementation that Colinear's compute marketplace uses as a settlement layer.
This repository contains the base chain implementation used as a compute marketplace settlement layer.
## Technical Documentation

View File

@@ -25,7 +25,22 @@ genesis:
staking:
params:
bond_denom: "uclr"
colinearcore:
params:
gpuModels:
gtx-1050-ti: 0
gtx-1650-ti: 0
auctionTime: 10
minLeasePeriod: 3600
maxLeasePeriod: 2678400
allowedAuctionDenoms:
- uclr
- uusdc
maxVerifiedProviders: 1000
providerMinLockedUClr: 500000000
providerLockedSlashUClr: 100000000
providerAuditFrequency: 400
providerAuditLength: 11
accounts:
- name: alice
coins: ["20000000000uusdc", "200000000000uclr"]

View File

@@ -171,6 +171,27 @@ paths:
format: uint64
remaining:
type: string
gpus:
type: array
items:
type: string
title: hardware specs
cpuCores:
type: string
format: uint64
cpuArch:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
memMb:
type: string
format: uint64
storageGb:
type: string
format: uint64
pagination:
type: object
properties:
@@ -318,6 +339,27 @@ paths:
format: uint64
remaining:
type: string
gpus:
type: array
items:
type: string
title: hardware specs
cpuCores:
type: string
format: uint64
cpuArch:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
memMb:
type: string
format: uint64
storageGb:
type: string
format: uint64
default:
description: An unexpected error response.
schema:
@@ -436,6 +478,64 @@ paths:
params:
description: params holds all the parameters of this module.
type: object
properties:
gpuModels:
type: object
additionalProperties:
type: integer
format: int64
title: hardware options
auctionGas:
type: integer
format: int64
title: gas config
auctionTime:
type: integer
format: int64
title: auction config
minLeasePeriod:
type: integer
format: int64
maxLeasePeriod:
type: integer
format: int64
allowedAuctionDenoms:
type: array
items:
type: string
maxVerifiedProviders:
type: integer
format: int64
title: >-
Maximum number of verified providers; this is to prevent
buffer overflow
attacks since provider list is not committed to chain
state and costs 0 gas
providerMinLockedUClr:
type: integer
format: int64
title: |-
Minimum required staked CLR to be a provider (i.e. to bid)
500 CLR
providerLockedSlashUClr:
type: integer
format: int64
title: |-
Amount slashed when a provider is offline during an audit
100 CLR
providerAuditFrequency:
type: integer
format: int64
title: |-
Blocks between provider audits
400 blocks ~400-1200min
providerAuditLength:
type: integer
format: int64
title: |-
Blocks before an audit ping must be returned
3 blocks ~4-12sec
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
@@ -30861,6 +30961,27 @@ definitions:
format: uint64
remaining:
type: string
gpus:
type: array
items:
type: string
title: hardware specs
cpuCores:
type: string
format: uint64
cpuArch:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
memMb:
type: string
format: uint64
storageGb:
type: string
format: uint64
colinear.colinearcore.Bid:
type: object
properties:
@@ -30868,6 +30989,13 @@ definitions:
type: string
amount:
type: string
colinear.colinearcore.CpuArchitecture:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
colinear.colinearcore.LockedUsers:
type: object
properties:
@@ -30898,6 +31026,64 @@ definitions:
format: uint64
colinear.colinearcore.Params:
type: object
properties:
gpuModels:
type: object
additionalProperties:
type: integer
format: int64
title: hardware options
auctionGas:
type: integer
format: int64
title: gas config
auctionTime:
type: integer
format: int64
title: auction config
minLeasePeriod:
type: integer
format: int64
maxLeasePeriod:
type: integer
format: int64
allowedAuctionDenoms:
type: array
items:
type: string
maxVerifiedProviders:
type: integer
format: int64
title: >-
Maximum number of verified providers; this is to prevent buffer
overflow
attacks since provider list is not committed to chain state and costs
0 gas
providerMinLockedUClr:
type: integer
format: int64
title: |-
Minimum required staked CLR to be a provider (i.e. to bid)
500 CLR
providerLockedSlashUClr:
type: integer
format: int64
title: |-
Amount slashed when a provider is offline during an audit
100 CLR
providerAuditFrequency:
type: integer
format: int64
title: |-
Blocks between provider audits
400 blocks ~400-1200min
providerAuditLength:
type: integer
format: int64
title: |-
Blocks before an audit ping must be returned
3 blocks ~4-12sec
description: Params defines the parameters for the module.
colinear.colinearcore.QueryAllAuctionResponse:
type: object
@@ -30937,6 +31123,27 @@ definitions:
format: uint64
remaining:
type: string
gpus:
type: array
items:
type: string
title: hardware specs
cpuCores:
type: string
format: uint64
cpuArch:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
memMb:
type: string
format: uint64
storageGb:
type: string
format: uint64
pagination:
type: object
properties:
@@ -31026,6 +31233,27 @@ definitions:
format: uint64
remaining:
type: string
gpus:
type: array
items:
type: string
title: hardware specs
cpuCores:
type: string
format: uint64
cpuArch:
type: string
enum:
- ANY
- INTEL
- AMD
default: ANY
memMb:
type: string
format: uint64
storageGb:
type: string
format: uint64
colinear.colinearcore.QueryGetLockedUsersResponse:
type: object
properties:
@@ -31056,6 +31284,64 @@ definitions:
params:
description: params holds all the parameters of this module.
type: object
properties:
gpuModels:
type: object
additionalProperties:
type: integer
format: int64
title: hardware options
auctionGas:
type: integer
format: int64
title: gas config
auctionTime:
type: integer
format: int64
title: auction config
minLeasePeriod:
type: integer
format: int64
maxLeasePeriod:
type: integer
format: int64
allowedAuctionDenoms:
type: array
items:
type: string
maxVerifiedProviders:
type: integer
format: int64
title: >-
Maximum number of verified providers; this is to prevent buffer
overflow
attacks since provider list is not committed to chain state and
costs 0 gas
providerMinLockedUClr:
type: integer
format: int64
title: |-
Minimum required staked CLR to be a provider (i.e. to bid)
500 CLR
providerLockedSlashUClr:
type: integer
format: int64
title: |-
Amount slashed when a provider is offline during an audit
100 CLR
providerAuditFrequency:
type: integer
format: int64
title: |-
Blocks between provider audits
400 blocks ~400-1200min
providerAuditLength:
type: integer
format: int64
title: |-
Blocks before an audit ping must be returned
3 blocks ~4-12sec
description: QueryParamsResponse is response type for the Query/Params RPC method.
cosmos.base.query.v1beta1.PageRequest:
type: object

1
go.mod
View File

@@ -88,7 +88,6 @@ require (
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/gtank/ristretto255 v0.1.2 // indirect

2
go.sum
View File

@@ -734,8 +734,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU=
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0=
github.com/gtank/merlin v0.1.1-0.20191105220539-8318aed1a79f/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s=

View File

@@ -4,6 +4,7 @@ package colinear.colinearcore;
option go_package = "colinear/x/colinearcore/types";
import "colinearcore/bid.proto";
import "colinearcore/hardware.proto";
message Auction {
string index = 1;
@@ -17,4 +18,10 @@ message Auction {
uint64 leaseStart = 9;
uint64 leaseEnd = 10;
string remaining = 11;
// hardware specs
repeated string gpus = 12;
uint64 cpuCores = 13;
CpuArchitecture cpuArch = 14;
uint64 memMb = 15;
uint64 storageGb = 16;
}

View File

@@ -3,15 +3,6 @@ package colinear.colinearcore;
option go_package = "colinear/x/colinearcore/types";
enum GpuModel {
RTX_2080 = 0;
RTX_2080_TI = 1;
RTX_3070 = 2;
RTX_3070_TI = 3;
RTX_3080 = 4;
RTX_3080_TI = 5;
}
enum CpuArchitecture {
ANY = 0;
INTEL = 1;

View File

@@ -8,5 +8,35 @@ option go_package = "colinear/x/colinearcore/types";
// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;
// hardware options
map<string, uint32> gpuModels = 1; // maps GPU model to puzzle difficulty
// gas config
uint32 auctionGas = 2;
// auction config
uint32 auctionTime = 3;
uint32 minLeasePeriod = 4;
uint32 maxLeasePeriod = 5;
repeated string allowedAuctionDenoms = 6;
// Maximum number of verified providers; this is to prevent buffer overflow
// attacks since provider list is not committed to chain state and costs 0 gas
uint32 maxVerifiedProviders = 7;
// Minimum required staked CLR to be a provider (i.e. to bid)
// 500 CLR
uint32 providerMinLockedUClr = 8;
// Amount slashed when a provider is offline during an audit
// 100 CLR
uint32 providerLockedSlashUClr = 9;
// Blocks between provider audits
// 400 blocks ~400-1200min
uint32 providerAuditFrequency = 10;
// Blocks before an audit ping must be returned
// 3 blocks ~4-12sec
uint32 providerAuditLength = 11;
}

View File

@@ -5,9 +5,11 @@ package colinear.colinearcore;
option go_package = "colinear/x/colinearcore/types";
import "colinearcore/hardware.proto";
// Msg defines the Msg service.
service Msg {
rpc NewAuction(MsgNewAuction) returns (MsgNewAuctionResponse);
rpc NewAuction(MsgNewAuction) returns (MsgNewAuctionResponse);
rpc NewBid(MsgNewBid) returns (MsgNewBidResponse);
rpc LockFunds(MsgLockFunds) returns (MsgLockFundsResponse);
rpc UnlockFunds(MsgUnlockFunds) returns (MsgUnlockFundsResponse);
@@ -26,6 +28,12 @@ message MsgNewAuction {
// verified providers just specifies who's allowed to bid on the lease auction.
// STORED IN MEMORY. DOES NOT GET WRITTEN TO CHAIN STATE.
repeated string verifiedProviders = 7;
// hardware specs (mandatory)
repeated string gpus = 8;
uint64 cpuCores = 9;
CpuArchitecture cpuArch = 10;
uint64 memMb = 11;
uint64 storageGb = 12;
}
message MsgNewAuctionResponse {

View File

@@ -10,16 +10,34 @@ colineard tx colinearcore unlock-all-funds -y --from alice \
| swallow "Unlock all funds before proceeding"
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 3500) \
'[]' '["gtx-1050-ti"]' 4 0 1000 50 \
-y --from bob \
| expect_fail "Can't create auction below min lease period"
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 8200000) \
'[]' '["gtx-1050-ti"]' 4 0 1000 50 \
-y --from bob \
| expect_fail "Can't create auction above max lease period"
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 3700) \
'[]' '[]' 4 0 1000 50 \
-y --from bob \
| expect_fail "Can't create an auction with 0 GPUs"
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 3700) \
'[]' '["gtx-1050-ti"]' 0 0 1000 50 \
-y --from bob \
| expect_fail "Can't create an auction with 0 cores"
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 3700) \
'[]' '["gtx-1050-ti"]' 0 0 1000 50 \
-y --from bob \
| expect_fail "Can't create an auction with sub-25GB storage"
before=$(get_balance $BOB uusdc)
colineard tx colinearcore new-auction asdf asdf 2000 uusdc $(now + 3700) \
'[]' '["gtx-1050-ti"]' 4 0 1000 50 \
-y --from bob \
| expect_success "New auction is created"

View File

@@ -17,7 +17,7 @@ colineard tx colinearcore lock-funds 550000000 -y --from bob \
| expect_success "Re-lock funds (Bob)"
colineard tx colinearcore new-auction asdf asdf 200 uusdc $(now + 3700) \
$ALICE \
'["'$ALICE'"]' '["gtx-1050-ti"]' 4 0 1000 50 \
-y --from bob \
| expect_success "New auction is created"

View File

@@ -1,35 +0,0 @@
package auctionconfig
// Allowed Denoms
// note: as a slice, values can't be immutable, but length can be
var AllowedAuctionDenoms = [...]string{"uusdc", "uclr"}
const (
// Times
AuctionTime = 10 // 10 blocks = ~10-30 seconds
// Lease Period Requirements (seconds)
MinLeasePeriod = 3_600 // 1 hour
MaxLeasePeriod = 8_035_200 // 3 months
// Maximum number of verified providers; this is to prevent buffer overflow
// attacks since provider list is not committed to chain state and costs 0 gas
MaxVerifiedProviders = 1000
// Minimum required staked CLR to be a provider (i.e. to bid)
// 500 CLR
ProviderMinLockedUClr = 500_000_000
// Amount slashed when a provider is offline during an audit
// 100 CLR
ProviderLockedSlashUClr = 100_000_000
// Blocks between provider audits
// 400 blocks ~400-1200min
ProviderAuditFrequency = 400
// Blocks before an audit ping must be returned
// 3 blocks ~4-12sec
ProviderAuditLength = 4
// Gas Fees
AuctionGas = 10
)

View File

@@ -1,9 +1,9 @@
package cli
import (
"encoding/json"
"strconv"
"colinear/x/colinearcore/auctionconfig"
"colinear/x/colinearcore/types"
"github.com/cosmos/cosmos-sdk/client"
@@ -16,10 +16,12 @@ var _ = strconv.Itoa(0)
func CmdNewAuction() *cobra.Command {
cmd := &cobra.Command{
Use: "new-auction [name] [description] [ceiling] [denom] [end date] [verified providers (separated by spaces)...]",
Use: "new-auction [name] [description] [ceiling] [denom] [end date] [verified providers (json string)] [gpus (json string)] [cpu cores] [cpu arch] [memory (MB)] [storage (GB)]",
Short: "Broadcast message newAuction",
// Args: cobra.ExactArgs(5),
Args: cobra.RangeArgs(5, auctionconfig.MaxVerifiedProviders+5),
Args: cobra.ExactArgs(11),
// below: we're hardcoding the max providers param since we
// can't check chain params locally
// Args: cobra.RangeArgs(10, 1010),
RunE: func(cmd *cobra.Command, args []string) (err error) {
argName := args[0]
argDescription := args[1]
@@ -27,23 +29,56 @@ func CmdNewAuction() *cobra.Command {
argDenom := args[3]
argLeaseEnd := args[4]
vProvString := args[5]
gpusString := args[6]
cpuCores := args[7]
cpuArch := args[8]
memMb := args[9]
storageGb := args[10]
verifiedProviders := []string{}
if len(args) >= 6 {
// set to remaining arguments
verifiedProviders = args[5:]
}
gpuModels := []string{}
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}
// try to marshal JSON lists
if err := json.Unmarshal([]byte(vProvString), &verifiedProviders); err != nil {
return err
}
if err := json.Unmarshal([]byte(gpusString), &gpuModels); err != nil {
return err
}
// try to parse int strings
var le int
le, err = strconv.Atoi(argLeaseEnd)
if err != nil {
return err
}
nCpuCores, err := strconv.Atoi(cpuCores)
if err != nil {
return err
}
nCpuArch, err := strconv.Atoi(cpuArch)
if err != nil {
return err
}
nMemMb, err := strconv.Atoi(memMb)
if err != nil {
return err
}
nStorageGb, err := strconv.Atoi(storageGb)
if err != nil {
return err
}
msg := types.NewMsgNewAuction(
clientCtx.GetFromAddress().String(),
argName,
@@ -52,6 +87,11 @@ func CmdNewAuction() *cobra.Command {
argDenom,
uint64(le),
verifiedProviders,
gpuModels,
uint64(nCpuCores),
types.CpuArchitecture(nCpuArch),
uint64(nMemMb),
uint64(nStorageGb),
)
if err := msg.ValidateBasic(); err != nil {
return err

View File

@@ -81,6 +81,14 @@ func (k Keeper) FinalizeExpiredAuctions(ctx sdk.Context) {
// end auction
k.SetAuction(ctx, auction)
// emit finalization event
ctx.EventManager().EmitEvent(
sdk.NewEvent(types.AuctionFinalizedEventType,
sdk.NewAttribute(types.AuctionFinalizedIndex, auction.Index),
),
)
}
return nil

View File

@@ -70,5 +70,13 @@ func (k msgServer) ClaimFunds(goCtx context.Context, msg *types.MsgClaimFunds) (
auction.Remaining = newRemaining.String()
k.Keeper.SetAuction(ctx, auction)
ctx.EventManager().EmitEvent(
sdk.NewEvent(types.LeaseFundsClaimedEventType,
sdk.NewAttribute(types.LeaseFundsClaimedEventCreator, msg.Creator),
sdk.NewAttribute(types.LeaseFundsClaimedAmountClaimed, subAmt.String()),
sdk.NewAttribute(types.LeaseFundsClaimedAmountRemaining, auction.Remaining),
),
)
return &types.MsgClaimFundsResponse{}, nil
}

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"math/big"
"colinear/x/colinearcore/auctionconfig"
"colinear/x/colinearcore/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -28,7 +27,7 @@ func (k msgServer) LockFunds(goCtx context.Context, msg *types.MsgLockFunds) (*t
// return nil, errors.New("unable to get locked users")
}
required := big.NewInt(auctionconfig.ProviderMinLockedUClr)
required := big.NewInt(int64(k.GetParams(ctx).ProviderMinLockedUClr))
paying := new(big.Int)
paying.SetString(msg.Amount, 10)

View File

@@ -2,12 +2,12 @@ package keeper
import (
"context"
"encoding/json"
"errors"
"fmt"
"math/big"
"strconv"
"colinear/x/colinearcore/auctionconfig"
"colinear/x/colinearcore/memdb"
"colinear/x/colinearcore/types"
@@ -26,27 +26,27 @@ func (k msgServer) NewAuction(goCtx context.Context, msg *types.MsgNewAuction) (
auctionLen := msg.LeaseEnd - uint64(ctx.BlockTime().Unix())
// check that submitted denom is allowed
for _, denom := range auctionconfig.AllowedAuctionDenoms {
for _, denom := range k.GetParams(ctx).AllowedAuctionDenoms {
if msg.Denom == denom {
goto found
}
}
return nil, fmt.Errorf("denom %s is not allowed; must be in %v", msg.Denom, auctionconfig.AllowedAuctionDenoms)
return nil, fmt.Errorf("denom %s is not allowed; must be in %v", msg.Denom, k.GetParams(ctx).AllowedAuctionDenoms)
found:
if auctionLen < auctionconfig.MinLeasePeriod {
if uint32(auctionLen) < k.GetParams(ctx).MinLeasePeriod {
return nil, fmt.Errorf(
"Auction length %d is below min lease period of %d",
auctionLen,
auctionconfig.MinLeasePeriod,
k.GetParams(ctx).MinLeasePeriod,
)
}
if auctionLen > auctionconfig.MaxLeasePeriod {
if uint32(auctionLen) > k.GetParams(ctx).MaxLeasePeriod {
return nil, fmt.Errorf(
"Auction length %d is above max lease period of %d",
auctionLen,
auctionconfig.MaxLeasePeriod,
k.GetParams(ctx).MaxLeasePeriod,
)
}
@@ -55,8 +55,8 @@ found:
return nil, fmt.Errorf("sender address `%s` format invalid (bech32 required)", msg.Creator)
}
if len(msg.VerifiedProviders) > auctionconfig.MaxVerifiedProviders {
return nil, fmt.Errorf("must submit no more than %d verified providers (got %d)", auctionconfig.MaxVerifiedProviders, len(msg.VerifiedProviders))
if uint32(len(msg.VerifiedProviders)) > k.GetParams(ctx).MaxVerifiedProviders {
return nil, fmt.Errorf("must submit no more than %d verified providers (got %d)", k.GetParams(ctx).MaxVerifiedProviders, len(msg.VerifiedProviders))
}
bech32Len := len("colinear") + 39
@@ -78,7 +78,7 @@ found:
Description: msg.Description,
// best bid -> null
// Best: new(types.Bid),
Deadline: uint64(ctx.BlockHeight()) + auctionconfig.AuctionTime,
Deadline: uint64(ctx.BlockHeight()) + uint64(k.GetParams(ctx).AuctionTime),
Denom: msg.Denom,
Owner: msg.Creator,
Ceiling: msg.Ceiling,
@@ -88,6 +88,16 @@ found:
LeaseEnd: msg.LeaseEnd,
// remaining payout -> null
// Remaining: "0",
Gpus: msg.Gpus,
CpuArch: msg.CpuArch,
CpuCores: msg.CpuCores,
MemMb: msg.MemMb,
StorageGb: msg.StorageGb,
}
// validate hardware
if err := k.ValidateAuctionHardware(ctx, auction); err != nil {
return nil, err
}
spendable := k.bank.SpendableCoins(ctx, senderAddr)
@@ -112,7 +122,56 @@ found:
k.Keeper.SetNextAuction(ctx, types.NextAuction{AuctionId: next.AuctionId})
gpuList, err := json.Marshal(msg.Gpus)
if err != nil {
return nil, fmt.Errorf("failed to marshal gpu list %v", msg.Gpus)
}
ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.AuctionCreatedEventType,
sdk.NewAttribute(types.AuctionCreatedIndex, auction.Index),
sdk.NewAttribute(types.AuctionCreatedEventCreator, msg.Creator),
sdk.NewAttribute(types.AuctionCreatedCeiling, msg.Ceiling),
sdk.NewAttribute(types.AuctionCreatedCpuCores, msg.CpuArch.String()),
sdk.NewAttribute(types.AuctionCreatedCpuArch, msg.CpuArch.String()),
sdk.NewAttribute(types.AuctionCreatedGpus, string(gpuList)),
sdk.NewAttribute(types.AuctionCreatedMemMb, fmt.Sprint(msg.MemMb)),
sdk.NewAttribute(types.AuctionCreatedStorage, fmt.Sprint(msg.StorageGb)),
),
)
return &types.MsgNewAuctionResponse{
AuctionId: strconv.FormatUint(next.AuctionId, 10),
}, nil
}
func (k *Keeper) ValidateAuctionHardware(ctx sdk.Context, a types.Auction) error {
if a.Gpus == nil {
return errors.New("GPU list not found")
}
// move these to module params later
if len(a.Gpus) == 0 || len(a.Gpus) > 20 {
return fmt.Errorf("must order between 1 and 20 GPUs (got %d)", len(a.Gpus))
}
for _, gpu := range a.Gpus {
if _, ok := k.GetParams(ctx).GpuModels[gpu]; !ok {
return fmt.Errorf("GPU model %s invalid", gpu)
}
}
// move these to module params later
if a.CpuCores < 1 || a.CpuCores > 12 {
return fmt.Errorf("CPU Cores must be between 1 and 12 (got %d)", a.CpuCores)
}
// move these to module params later
if a.StorageGb < 25 || a.StorageGb > 2000 {
return fmt.Errorf("storage must be between 25GB and 2TB (got %dGB)", a.StorageGb)
}
return nil
}

View File

@@ -7,7 +7,6 @@ import (
"math/big"
"reflect"
"colinear/x/colinearcore/auctionconfig"
"colinear/x/colinearcore/memdb"
"colinear/x/colinearcore/types"
@@ -22,13 +21,13 @@ func (k msgServer) NewBid(goCtx context.Context, msg *types.MsgNewBid) (*types.M
return nil, errors.New("unable to read locked providers (uninitialized)")
}
if lockedAmtStr, ok := lockedUsers.Users[msg.Creator]; !ok {
return nil, fmt.Errorf("provider has not locked CLR tokens (min: %d uCLR)", auctionconfig.ProviderMinLockedUClr)
return nil, fmt.Errorf("provider has not locked CLR tokens (min: %d uCLR)", k.GetParams(ctx).ProviderMinLockedUClr)
} else {
lockedAmt := new(big.Int)
lockedAmt.SetString(lockedAmtStr, 10)
required := big.NewInt(auctionconfig.ProviderMinLockedUClr)
required := big.NewInt(int64(k.GetParams(ctx).ProviderMinLockedUClr))
if lockedAmt.Cmp(required) == -1 {
return nil, fmt.Errorf("provider has not locked enough CLR tokens (min: %d uCLR, locked: %s)", auctionconfig.ProviderMinLockedUClr, lockedAmt.String())
return nil, fmt.Errorf("provider has not locked enough CLR tokens (min: %d uCLR, locked: %s)", k.GetParams(ctx).ProviderMinLockedUClr, lockedAmt.String())
}
}
@@ -104,5 +103,15 @@ bidderVerified:
return nil, fmt.Errorf("failed to add bid: %s", err)
}
// emit bid event
ctx.EventManager().EmitEvent(
sdk.NewEvent(types.BidCreatedEventType,
sdk.NewAttribute(types.BidCreatedEventCreator, msg.Creator),
sdk.NewAttribute(types.BidCreatedAuctionIndex, msg.AuctionIndex),
sdk.NewAttribute(types.BidCreatedAmount, msg.Amount),
),
)
return &types.MsgNewBidResponse{}, nil
}

View File

@@ -34,6 +34,12 @@ type Auction struct {
LeaseStart uint64 `protobuf:"varint,9,opt,name=leaseStart,proto3" json:"leaseStart,omitempty"`
LeaseEnd uint64 `protobuf:"varint,10,opt,name=leaseEnd,proto3" json:"leaseEnd,omitempty"`
Remaining string `protobuf:"bytes,11,opt,name=remaining,proto3" json:"remaining,omitempty"`
// hardware specs
Gpus []string `protobuf:"bytes,12,rep,name=gpus,proto3" json:"gpus,omitempty"`
CpuCores uint64 `protobuf:"varint,13,opt,name=cpuCores,proto3" json:"cpuCores,omitempty"`
CpuArch CpuArchitecture `protobuf:"varint,14,opt,name=cpuArch,proto3,enum=colinear.colinearcore.CpuArchitecture" json:"cpuArch,omitempty"`
MemMb uint64 `protobuf:"varint,15,opt,name=memMb,proto3" json:"memMb,omitempty"`
StorageGb uint64 `protobuf:"varint,16,opt,name=storageGb,proto3" json:"storageGb,omitempty"`
}
func (m *Auction) Reset() { *m = Auction{} }
@@ -146,6 +152,41 @@ func (m *Auction) GetRemaining() string {
return ""
}
func (m *Auction) GetGpus() []string {
if m != nil {
return m.Gpus
}
return nil
}
func (m *Auction) GetCpuCores() uint64 {
if m != nil {
return m.CpuCores
}
return 0
}
func (m *Auction) GetCpuArch() CpuArchitecture {
if m != nil {
return m.CpuArch
}
return CpuArchitecture_ANY
}
func (m *Auction) GetMemMb() uint64 {
if m != nil {
return m.MemMb
}
return 0
}
func (m *Auction) GetStorageGb() uint64 {
if m != nil {
return m.StorageGb
}
return 0
}
func init() {
proto.RegisterType((*Auction)(nil), "colinear.colinearcore.Auction")
}
@@ -153,26 +194,32 @@ func init() {
func init() { proto.RegisterFile("colinearcore/auction.proto", fileDescriptor_c2581508d43e9c55) }
var fileDescriptor_c2581508d43e9c55 = []byte{
// 298 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x3f, 0x4f, 0xf3, 0x30,
0x10, 0xc6, 0xeb, 0xbe, 0xe9, 0xbf, 0xeb, 0x66, 0xbd, 0x20, 0x2b, 0x02, 0x2b, 0x62, 0xea, 0x94,
0x4a, 0x30, 0x30, 0x53, 0x89, 0x2f, 0x50, 0x36, 0x36, 0x27, 0x3e, 0x21, 0x4b, 0x89, 0x1d, 0x39,
0x46, 0x94, 0x6f, 0xc1, 0x57, 0x62, 0x63, 0xec, 0xc8, 0x88, 0x92, 0x2f, 0x82, 0x6c, 0x2b, 0x90,
0x4a, 0x6c, 0xfe, 0x3d, 0xf7, 0xdc, 0xdd, 0x63, 0x1d, 0xa4, 0xa5, 0xa9, 0x94, 0x46, 0x61, 0x4b,
0x63, 0x71, 0x2b, 0x9e, 0x4b, 0xa7, 0x8c, 0xce, 0x1b, 0x6b, 0x9c, 0xa1, 0x67, 0x43, 0x2d, 0x1f,
0x9b, 0x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x37, 0xb8, 0xf9, 0x0e, 0x00, 0x00,
0xff, 0xff, 0x5b, 0x39, 0x9d, 0x8f, 0xd0, 0x01, 0x00, 0x00,
// 392 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xc1, 0x8e, 0xd3, 0x30,
0x10, 0xad, 0x69, 0x76, 0xb3, 0x75, 0x61, 0x41, 0x16, 0xa0, 0x51, 0x80, 0x28, 0xe2, 0x80, 0x72,
0x4a, 0xa5, 0xe5, 0xc0, 0x95, 0xdd, 0x15, 0xe2, 0xc4, 0x25, 0xdc, 0xb8, 0x39, 0xf6, 0xa8, 0xb5,
0xd4, 0xd8, 0x91, 0xe3, 0xa8, 0xe5, 0x2f, 0xf8, 0x2c, 0x8e, 0x3d, 0x72, 0x44, 0xed, 0x81, 0xdf,
0x40, 0xb6, 0x15, 0xda, 0x4a, 0xec, 0xcd, 0xef, 0xbd, 0x99, 0x37, 0xcf, 0xa3, 0xa1, 0x99, 0x30,
0x6b, 0xa5, 0x91, 0x5b, 0x61, 0x2c, 0x2e, 0xf8, 0x20, 0x9c, 0x32, 0xba, 0xea, 0xac, 0x71, 0x86,
0xbd, 0x18, 0xb5, 0xea, 0xb4, 0x28, 0x7b, 0x79, 0xd6, 0xd2, 0x28, 0x19, 0xcb, 0xb3, 0x57, 0x67,
0xfc, 0x8a, 0x5b, 0xb9, 0xe1, 0x16, 0xa3, 0xf8, 0xf6, 0xcf, 0x94, 0xa6, 0xb7, 0xd1, 0x9d, 0x3d,
0xa7, 0x17, 0x4a, 0x4b, 0xdc, 0x02, 0x29, 0x48, 0x39, 0xab, 0x23, 0x60, 0x8c, 0x26, 0x9a, 0xb7,
0x08, 0x8f, 0x02, 0x19, 0xde, 0xac, 0xa0, 0x73, 0x89, 0xbd, 0xb0, 0xaa, 0xf3, 0x8d, 0x30, 0x0d,
0xd2, 0x29, 0xc5, 0x2a, 0x9a, 0x34,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 0xe3, 0x90,
0x4f, 0x76, 0x87, 0x7c, 0xf2, 0xeb, 0x90, 0x4f, 0xbe, 0xbd, 0x19, 0x87, 0x2e, 0xb6, 0x8b, 0xb3,
0x5b, 0x71, 0xdf, 0x3b, 0xec, 0x9b, 0xcb, 0x70, 0x29, 0xef, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff,
0x68, 0xb2, 0x60, 0x4d, 0x93, 0x02, 0x00, 0x00,
}
func (m *Auction) Marshal() (dAtA []byte, err error) {
@@ -195,6 +242,37 @@ func (m *Auction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.StorageGb != 0 {
i = encodeVarintAuction(dAtA, i, uint64(m.StorageGb))
i--
dAtA[i] = 0x1
i--
dAtA[i] = 0x80
}
if m.MemMb != 0 {
i = encodeVarintAuction(dAtA, i, uint64(m.MemMb))
i--
dAtA[i] = 0x78
}
if m.CpuArch != 0 {
i = encodeVarintAuction(dAtA, i, uint64(m.CpuArch))
i--
dAtA[i] = 0x70
}
if m.CpuCores != 0 {
i = encodeVarintAuction(dAtA, i, uint64(m.CpuCores))
i--
dAtA[i] = 0x68
}
if len(m.Gpus) > 0 {
for iNdEx := len(m.Gpus) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Gpus[iNdEx])
copy(dAtA[i:], m.Gpus[iNdEx])
i = encodeVarintAuction(dAtA, i, uint64(len(m.Gpus[iNdEx])))
i--
dAtA[i] = 0x62
}
}
if len(m.Remaining) > 0 {
i -= len(m.Remaining)
copy(dAtA[i:], m.Remaining)
@@ -332,6 +410,24 @@ func (m *Auction) Size() (n int) {
if l > 0 {
n += 1 + l + sovAuction(uint64(l))
}
if len(m.Gpus) > 0 {
for _, s := range m.Gpus {
l = len(s)
n += 1 + l + sovAuction(uint64(l))
}
}
if m.CpuCores != 0 {
n += 1 + sovAuction(uint64(m.CpuCores))
}
if m.CpuArch != 0 {
n += 1 + sovAuction(uint64(m.CpuArch))
}
if m.MemMb != 0 {
n += 1 + sovAuction(uint64(m.MemMb))
}
if m.StorageGb != 0 {
n += 2 + sovAuction(uint64(m.StorageGb))
}
return n
}
@@ -687,6 +783,114 @@ func (m *Auction) Unmarshal(dAtA []byte) error {
}
m.Remaining = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 12:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Gpus", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuction
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthAuction
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthAuction
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Gpus = append(m.Gpus, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 13:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CpuCores", wireType)
}
m.CpuCores = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuction
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.CpuCores |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 14:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CpuArch", wireType)
}
m.CpuArch = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuction
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.CpuArch |= CpuArchitecture(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 15:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MemMb", wireType)
}
m.MemMb = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuction
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MemMb |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 16:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field StorageGb", wireType)
}
m.StorageGb = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowAuction
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.StorageGb |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipAuction(dAtA[iNdEx:])

View File

@@ -20,43 +20,6 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type GpuModel int32
const (
GpuModel_RTX_2080 GpuModel = 0
GpuModel_RTX_2080_TI GpuModel = 1
GpuModel_RTX_3070 GpuModel = 2
GpuModel_RTX_3070_TI GpuModel = 3
GpuModel_RTX_3080 GpuModel = 4
GpuModel_RTX_3080_TI GpuModel = 5
)
var GpuModel_name = map[int32]string{
0: "RTX_2080",
1: "RTX_2080_TI",
2: "RTX_3070",
3: "RTX_3070_TI",
4: "RTX_3080",
5: "RTX_3080_TI",
}
var GpuModel_value = map[string]int32{
"RTX_2080": 0,
"RTX_2080_TI": 1,
"RTX_3070": 2,
"RTX_3070_TI": 3,
"RTX_3080": 4,
"RTX_3080_TI": 5,
}
func (x GpuModel) String() string {
return proto.EnumName(GpuModel_name, int32(x))
}
func (GpuModel) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_b5d8e515bcf89b12, []int{0}
}
type CpuArchitecture int32
const (
@@ -82,30 +45,25 @@ func (x CpuArchitecture) String() string {
}
func (CpuArchitecture) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_b5d8e515bcf89b12, []int{1}
return fileDescriptor_b5d8e515bcf89b12, []int{0}
}
func init() {
proto.RegisterEnum("colinear.colinearcore.GpuModel", GpuModel_name, GpuModel_value)
proto.RegisterEnum("colinear.colinearcore.CpuArchitecture", CpuArchitecture_name, CpuArchitecture_value)
}
func init() { proto.RegisterFile("colinearcore/hardware.proto", fileDescriptor_b5d8e515bcf89b12) }
var fileDescriptor_b5d8e515bcf89b12 = []byte{
// 214 bytes of a gzipped FileDescriptorProto
// 152 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4e, 0xce, 0xcf, 0xc9,
0xcc, 0x4b, 0x4d, 0x2c, 0x4a, 0xce, 0x2f, 0x4a, 0xd5, 0xcf, 0x48, 0x2c, 0x4a, 0x29, 0x4f, 0x2c,
0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x49, 0xea, 0x21, 0xab, 0xd2, 0x4a,
0xe7, 0xe2, 0x70, 0x2f, 0x28, 0xf5, 0xcd, 0x4f, 0x49, 0xcd, 0x11, 0xe2, 0xe1, 0xe2, 0x08, 0x0a,
0x89, 0x88, 0x37, 0x32, 0xb0, 0x30, 0x10, 0x60, 0x10, 0xe2, 0xe7, 0xe2, 0x86, 0xf1, 0xe2, 0x43,
0x3c, 0x05, 0x18, 0x61, 0xd2, 0xc6, 0x06, 0xe6, 0x06, 0x02, 0x4c, 0x30, 0x69, 0x10, 0x0f, 0x24,
0xcd, 0x8c, 0x90, 0xb6, 0x30, 0x10, 0x60, 0x41, 0x48, 0x43, 0x74, 0xb3, 0x6a, 0xe9, 0x71, 0xf1,
0x3b, 0x17, 0x94, 0x3a, 0x16, 0x25, 0x67, 0x64, 0x96, 0xa4, 0x26, 0x97, 0x94, 0x16, 0xa5, 0x0a,
0xb1, 0x73, 0x31, 0x3b, 0xfa, 0x45, 0x0a, 0x30, 0x08, 0x71, 0x72, 0xb1, 0x7a, 0xfa, 0x85, 0xb8,
0xfa, 0x08, 0x30, 0x82, 0xc5, 0x7c, 0x5d, 0x04, 0x98, 0x9c, 0xcc, 0x4f, 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, 0x16, 0xe6, 0x01, 0xfd, 0x0a, 0x7d, 0x14, 0x1f, 0x97, 0x54,
0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0xfd, 0x6b, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x59,
0x42, 0x58, 0x0e, 0x01, 0x00, 0x00,
0x4a, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x49, 0xea, 0x21, 0xab, 0xd2, 0xd2,
0xe3, 0xe2, 0x77, 0x2e, 0x28, 0x75, 0x2c, 0x4a, 0xce, 0xc8, 0x2c, 0x49, 0x4d, 0x2e, 0x29, 0x2d,
0x4a, 0x15, 0x62, 0xe7, 0x62, 0x76, 0xf4, 0x8b, 0x14, 0x60, 0x10, 0xe2, 0xe4, 0x62, 0xf5, 0xf4,
0x0b, 0x71, 0xf5, 0x11, 0x60, 0x04, 0x8b, 0xf9, 0xba, 0x08, 0x30, 0x39, 0x99, 0x9f, 0x78, 0x24,
0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78,
0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x2c, 0xcc, 0x5c, 0xfd, 0x0a, 0x7d, 0x14, 0x87,
0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff,
0x17, 0xf0, 0x7c, 0xa7, 0xa5, 0x00, 0x00, 0x00,
}

View File

@@ -28,3 +28,37 @@ const (
const (
LockedUsersKey = "LockedUsers-value-"
)
// Module Events
const (
AuctionCreatedEventType = "auction-created"
AuctionCreatedEventCreator = "creator"
AuctionCreatedIndex = "auction-id"
AuctionCreatedCeiling = "ceiling"
// hardware
AuctionCreatedGpus = "gpus"
AuctionCreatedCpuArch = "cpu-arch"
AuctionCreatedCpuCores = "cpu-cores"
AuctionCreatedMemMb = "mem-mb"
AuctionCreatedStorage = "storage-gb"
)
const (
BidCreatedEventType = "bid-created"
BidCreatedEventCreator = "creator"
BidCreatedAuctionIndex = "auction-id"
BidCreatedAmount = "amount"
)
const (
AuctionFinalizedEventType = "auction-finalized"
AuctionFinalizedIndex = "auction-id"
)
const (
LeaseFundsClaimedEventType = "lease-claimed"
LeaseFundsClaimedEventCreator = "claimer"
LeaseFundsClaimedAmountClaimed = "amount-claimed"
LeaseFundsClaimedAmountRemaining = "amount-remaining"
)

View File

@@ -9,15 +9,29 @@ const TypeMsgNewAuction = "new_auction"
var _ sdk.Msg = &MsgNewAuction{}
func NewMsgNewAuction(creator string, name string, description string, ceiling string, denom string, leaseEnd uint64, vProviders []string) *MsgNewAuction {
func NewMsgNewAuction(
// auction params
creator string, name string, description string, ceiling string, denom string, leaseEnd uint64, vProviders []string,
// hardware specs
gpus []string, cpuCores uint64, cpuArch CpuArchitecture, memMb uint64, storageGb uint64,
) *MsgNewAuction {
return &MsgNewAuction{
Creator: creator,
Creator: creator,
// creation params
Name: name,
Description: description,
Ceiling: ceiling,
Denom: denom,
LeaseEnd: leaseEnd,
VerifiedProviders: vProviders,
// hardware
Gpus: gpus,
CpuCores: cpuCores,
CpuArch: cpuArch,
MemMb: memMb,
StorageGb: storageGb,
}
}

View File

@@ -14,7 +14,26 @@ func ParamKeyTable() paramtypes.KeyTable {
// NewParams creates a new Params instance
func NewParams() Params {
return Params{}
// return Params{}
// temp fix
return Params{
GpuModels: map[string]uint32{
"gtx-1050-ti": 0,
"gtx-1650-ti": 0,
},
AuctionTime: 10,
ProviderMinLockedUClr: 500_000_000,
ProviderLockedSlashUClr: 100_000_000,
AuctionGas: 10,
MinLeasePeriod: 3_600, // 1 hour
MaxLeasePeriod: 8_035_200, // 3 months
MaxVerifiedProviders: 1000,
ProviderAuditFrequency: 400,
ProviderAuditLength: 4,
AllowedAuctionDenoms: []string{"uclr", "uusdc"},
}
}
// DefaultParams returns a default set of parameters

View File

@@ -25,6 +25,30 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Params defines the parameters for the module.
type Params struct {
// hardware options
GpuModels map[string]uint32 `protobuf:"bytes,1,rep,name=gpuModels,proto3" json:"gpuModels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
// gas config
AuctionGas uint32 `protobuf:"varint,2,opt,name=auctionGas,proto3" json:"auctionGas,omitempty"`
// auction config
AuctionTime uint32 `protobuf:"varint,3,opt,name=auctionTime,proto3" json:"auctionTime,omitempty"`
MinLeasePeriod uint32 `protobuf:"varint,4,opt,name=minLeasePeriod,proto3" json:"minLeasePeriod,omitempty"`
MaxLeasePeriod uint32 `protobuf:"varint,5,opt,name=maxLeasePeriod,proto3" json:"maxLeasePeriod,omitempty"`
AllowedAuctionDenoms []string `protobuf:"bytes,6,rep,name=allowedAuctionDenoms,proto3" json:"allowedAuctionDenoms,omitempty"`
// Maximum number of verified providers; this is to prevent buffer overflow
// attacks since provider list is not committed to chain state and costs 0 gas
MaxVerifiedProviders uint32 `protobuf:"varint,7,opt,name=maxVerifiedProviders,proto3" json:"maxVerifiedProviders,omitempty"`
// Minimum required staked CLR to be a provider (i.e. to bid)
// 500 CLR
ProviderMinLockedUClr uint32 `protobuf:"varint,8,opt,name=providerMinLockedUClr,proto3" json:"providerMinLockedUClr,omitempty"`
// Amount slashed when a provider is offline during an audit
// 100 CLR
ProviderLockedSlashUClr uint32 `protobuf:"varint,9,opt,name=providerLockedSlashUClr,proto3" json:"providerLockedSlashUClr,omitempty"`
// Blocks between provider audits
// 400 blocks ~400-1200min
ProviderAuditFrequency uint32 `protobuf:"varint,10,opt,name=providerAuditFrequency,proto3" json:"providerAuditFrequency,omitempty"`
// Blocks before an audit ping must be returned
// 3 blocks ~4-12sec
ProviderAuditLength uint32 `protobuf:"varint,11,opt,name=providerAuditLength,proto3" json:"providerAuditLength,omitempty"`
}
func (m *Params) Reset() { *m = Params{} }
@@ -59,23 +83,119 @@ func (m *Params) XXX_DiscardUnknown() {
var xxx_messageInfo_Params proto.InternalMessageInfo
func (m *Params) GetGpuModels() map[string]uint32 {
if m != nil {
return m.GpuModels
}
return nil
}
func (m *Params) GetAuctionGas() uint32 {
if m != nil {
return m.AuctionGas
}
return 0
}
func (m *Params) GetAuctionTime() uint32 {
if m != nil {
return m.AuctionTime
}
return 0
}
func (m *Params) GetMinLeasePeriod() uint32 {
if m != nil {
return m.MinLeasePeriod
}
return 0
}
func (m *Params) GetMaxLeasePeriod() uint32 {
if m != nil {
return m.MaxLeasePeriod
}
return 0
}
func (m *Params) GetAllowedAuctionDenoms() []string {
if m != nil {
return m.AllowedAuctionDenoms
}
return nil
}
func (m *Params) GetMaxVerifiedProviders() uint32 {
if m != nil {
return m.MaxVerifiedProviders
}
return 0
}
func (m *Params) GetProviderMinLockedUClr() uint32 {
if m != nil {
return m.ProviderMinLockedUClr
}
return 0
}
func (m *Params) GetProviderLockedSlashUClr() uint32 {
if m != nil {
return m.ProviderLockedSlashUClr
}
return 0
}
func (m *Params) GetProviderAuditFrequency() uint32 {
if m != nil {
return m.ProviderAuditFrequency
}
return 0
}
func (m *Params) GetProviderAuditLength() uint32 {
if m != nil {
return m.ProviderAuditLength
}
return 0
}
func init() {
proto.RegisterType((*Params)(nil), "colinear.colinearcore.Params")
proto.RegisterMapType((map[string]uint32)(nil), "colinear.colinearcore.Params.GpuModelsEntry")
}
func init() { proto.RegisterFile("colinearcore/params.proto", fileDescriptor_54a22962c5c35285) }
var fileDescriptor_54a22962c5c35285 = []byte{
// 131 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0xcf, 0xc9,
0xcc, 0x4b, 0x4d, 0x2c, 0x4a, 0xce, 0x2f, 0x4a, 0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x85, 0x49, 0xe9, 0x21, 0xab, 0x91, 0x12, 0x49, 0xcf,
0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a,
0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0x32, 0x3f, 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, 0x59, 0x98, 0x69, 0xfa, 0x15, 0xfa, 0x28, 0x96, 0x97, 0x54, 0x16, 0xa4, 0x16,
0x27, 0xb1, 0x81, 0xcd, 0x33, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x70, 0x9f, 0x63, 0x4b, 0x99,
0x00, 0x00, 0x00,
// 419 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x4d, 0x6f, 0xd3, 0x30,
0x18, 0xc7, 0xeb, 0xb5, 0x2b, 0xf4, 0xa9, 0x98, 0x90, 0xe9, 0xc0, 0x4c, 0x22, 0x44, 0x1c, 0x50,
0x0f, 0x28, 0x45, 0x03, 0xc1, 0x34, 0x71, 0x19, 0x6f, 0x93, 0x50, 0x27, 0x55, 0xe1, 0xe5, 0xc0,
0xcd, 0x24, 0x0f, 0x99, 0xb5, 0xc4, 0x0e, 0x76, 0x32, 0x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
0x6a, 0xf1, 0x59, 0x60, 0xb8, 0xd0, 0xea, 0x5c, 0x84, 0xa8, 0x0d, 0xbb, 0x62, 0x5f, 0xe8, 0x64,
0xf4, 0x31, 0xec, 0xa6, 0xd5, 0x70, 0x22, 0xe4, 0x5c, 0x05, 0x67, 0x18, 0xbe, 0x7f, 0x11, 0x6b,
0x76, 0xd5, 0x4a, 0xdd, 0x90, 0x1e, 0xc0, 0xad, 0x1a, 0x94, 0xe9, 0xdb, 0x98, 0x9b, 0x53, 0xeb,
0x8d, 0xac, 0x77, 0x19, 0xa6, 0x4f, 0xe0, 0x66, 0x8d, 0x8e, 0xf2, 0x50, 0x64, 0xaf, 0x35, 0x7e,
0xc9, 0x51, 0x06, 0x05, 0x03, 0x2b, 0x5e, 0x42, 0xe9, 0x43, 0xb8, 0xd1, 0x22, 0x73, 0x94, 0x51,
0x76, 0xca, 0xc6, 0x56, 0xea, 0x42, 0x7b, 0xcf, 0x60, 0xa7, 0xfd, 0xe1, 0xf4, 0x3a, 0xf4, 0xcf,
0xb0, 0x60, 0xc4, 0x25, 0xd3, 0x91, 0xbf, 0x39, 0xd2, 0x09, 0x6c, 0x9f, 0xf3, 0x38, 0xc7, 0xea,
0xcb, 0xcb, 0xe1, 0x70, 0xeb, 0x80, 0x1c, 0x0e, 0xbe, 0xff, 0xb8, 0xdb, 0x7b, 0xfe, 0xf4, 0xe7,
0xca, 0x21, 0x17, 0x2b, 0x87, 0xfc, 0x5e, 0x39, 0xe4, 0xdb, 0xda, 0xe9, 0x5d, 0xac, 0x9d, 0xde,
0xaf, 0xb5, 0xd3, 0xfb, 0x78, 0xa7, 0x5e, 0xb0, 0xd9, 0x72, 0xd6, 0xda, 0xed, 0xac, 0x48, 0xd1,
0x7c, 0x1a, 0xda, 0x75, 0x7d, 0xf4, 0x37, 0x00, 0x00, 0xff, 0xff, 0x05, 0x9c, 0x24, 0xe5, 0xf8,
0x02, 0x00, 0x00,
}
func (m *Params) Marshal() (dAtA []byte, err error) {
@@ -98,6 +218,77 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.ProviderAuditLength != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.ProviderAuditLength))
i--
dAtA[i] = 0x58
}
if m.ProviderAuditFrequency != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.ProviderAuditFrequency))
i--
dAtA[i] = 0x50
}
if m.ProviderLockedSlashUClr != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.ProviderLockedSlashUClr))
i--
dAtA[i] = 0x48
}
if m.ProviderMinLockedUClr != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.ProviderMinLockedUClr))
i--
dAtA[i] = 0x40
}
if m.MaxVerifiedProviders != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.MaxVerifiedProviders))
i--
dAtA[i] = 0x38
}
if len(m.AllowedAuctionDenoms) > 0 {
for iNdEx := len(m.AllowedAuctionDenoms) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.AllowedAuctionDenoms[iNdEx])
copy(dAtA[i:], m.AllowedAuctionDenoms[iNdEx])
i = encodeVarintParams(dAtA, i, uint64(len(m.AllowedAuctionDenoms[iNdEx])))
i--
dAtA[i] = 0x32
}
}
if m.MaxLeasePeriod != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.MaxLeasePeriod))
i--
dAtA[i] = 0x28
}
if m.MinLeasePeriod != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.MinLeasePeriod))
i--
dAtA[i] = 0x20
}
if m.AuctionTime != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.AuctionTime))
i--
dAtA[i] = 0x18
}
if m.AuctionGas != 0 {
i = encodeVarintParams(dAtA, i, uint64(m.AuctionGas))
i--
dAtA[i] = 0x10
}
if len(m.GpuModels) > 0 {
for k := range m.GpuModels {
v := m.GpuModels[k]
baseI := i
i = encodeVarintParams(dAtA, i, uint64(v))
i--
dAtA[i] = 0x10
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintParams(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintParams(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0xa
}
}
return len(dAtA) - i, nil
}
@@ -118,6 +309,47 @@ func (m *Params) Size() (n int) {
}
var l int
_ = l
if len(m.GpuModels) > 0 {
for k, v := range m.GpuModels {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovParams(uint64(len(k))) + 1 + sovParams(uint64(v))
n += mapEntrySize + 1 + sovParams(uint64(mapEntrySize))
}
}
if m.AuctionGas != 0 {
n += 1 + sovParams(uint64(m.AuctionGas))
}
if m.AuctionTime != 0 {
n += 1 + sovParams(uint64(m.AuctionTime))
}
if m.MinLeasePeriod != 0 {
n += 1 + sovParams(uint64(m.MinLeasePeriod))
}
if m.MaxLeasePeriod != 0 {
n += 1 + sovParams(uint64(m.MaxLeasePeriod))
}
if len(m.AllowedAuctionDenoms) > 0 {
for _, s := range m.AllowedAuctionDenoms {
l = len(s)
n += 1 + l + sovParams(uint64(l))
}
}
if m.MaxVerifiedProviders != 0 {
n += 1 + sovParams(uint64(m.MaxVerifiedProviders))
}
if m.ProviderMinLockedUClr != 0 {
n += 1 + sovParams(uint64(m.ProviderMinLockedUClr))
}
if m.ProviderLockedSlashUClr != 0 {
n += 1 + sovParams(uint64(m.ProviderLockedSlashUClr))
}
if m.ProviderAuditFrequency != 0 {
n += 1 + sovParams(uint64(m.ProviderAuditFrequency))
}
if m.ProviderAuditLength != 0 {
n += 1 + sovParams(uint64(m.ProviderAuditLength))
}
return n
}
@@ -156,6 +388,322 @@ func (m *Params) Unmarshal(dAtA []byte) error {
return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field GpuModels", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthParams
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthParams
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.GpuModels == nil {
m.GpuModels = make(map[string]uint32)
}
var mapkey string
var mapvalue uint32
for iNdEx < postIndex {
entryPreIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
if fieldNum == 1 {
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthParams
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey < 0 {
return ErrInvalidLengthParams
}
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
} else if fieldNum == 2 {
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
mapvalue |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
} else {
iNdEx = entryPreIndex
skippy, err := skipParams(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthParams
}
if (iNdEx + skippy) > postIndex {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
m.GpuModels[mapkey] = mapvalue
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AuctionGas", wireType)
}
m.AuctionGas = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AuctionGas |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field AuctionTime", wireType)
}
m.AuctionTime = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.AuctionTime |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MinLeasePeriod", wireType)
}
m.MinLeasePeriod = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MinLeasePeriod |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MaxLeasePeriod", wireType)
}
m.MaxLeasePeriod = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MaxLeasePeriod |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field AllowedAuctionDenoms", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthParams
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthParams
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.AllowedAuctionDenoms = append(m.AllowedAuctionDenoms, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 7:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MaxVerifiedProviders", wireType)
}
m.MaxVerifiedProviders = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MaxVerifiedProviders |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 8:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ProviderMinLockedUClr", wireType)
}
m.ProviderMinLockedUClr = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ProviderMinLockedUClr |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ProviderLockedSlashUClr", wireType)
}
m.ProviderLockedSlashUClr = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ProviderLockedSlashUClr |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 10:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ProviderAuditFrequency", wireType)
}
m.ProviderAuditFrequency = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ProviderAuditFrequency |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 11:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ProviderAuditLength", wireType)
}
m.ProviderAuditLength = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowParams
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ProviderAuditLength |= uint32(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipParams(dAtA[iNdEx:])

View File

@@ -37,6 +37,12 @@ type MsgNewAuction struct {
// verified providers just specifies who's allowed to bid on the lease auction.
// STORED IN MEMORY. DOES NOT GET WRITTEN TO CHAIN STATE.
VerifiedProviders []string `protobuf:"bytes,7,rep,name=verifiedProviders,proto3" json:"verifiedProviders,omitempty"`
// hardware specs (mandatory)
Gpus []string `protobuf:"bytes,8,rep,name=gpus,proto3" json:"gpus,omitempty"`
CpuCores uint64 `protobuf:"varint,9,opt,name=cpuCores,proto3" json:"cpuCores,omitempty"`
CpuArch CpuArchitecture `protobuf:"varint,10,opt,name=cpuArch,proto3,enum=colinear.colinearcore.CpuArchitecture" json:"cpuArch,omitempty"`
MemMb uint64 `protobuf:"varint,11,opt,name=memMb,proto3" json:"memMb,omitempty"`
StorageGb uint64 `protobuf:"varint,12,opt,name=storageGb,proto3" json:"storageGb,omitempty"`
}
func (m *MsgNewAuction) Reset() { *m = MsgNewAuction{} }
@@ -121,6 +127,41 @@ func (m *MsgNewAuction) GetVerifiedProviders() []string {
return nil
}
func (m *MsgNewAuction) GetGpus() []string {
if m != nil {
return m.Gpus
}
return nil
}
func (m *MsgNewAuction) GetCpuCores() uint64 {
if m != nil {
return m.CpuCores
}
return 0
}
func (m *MsgNewAuction) GetCpuArch() CpuArchitecture {
if m != nil {
return m.CpuArch
}
return CpuArchitecture_ANY
}
func (m *MsgNewAuction) GetMemMb() uint64 {
if m != nil {
return m.MemMb
}
return 0
}
func (m *MsgNewAuction) GetStorageGb() uint64 {
if m != nil {
return m.StorageGb
}
return 0
}
type MsgNewAuctionResponse struct {
AuctionId string `protobuf:"bytes,1,opt,name=auctionId,proto3" json:"auctionId,omitempty"`
}
@@ -623,39 +664,45 @@ func init() {
func init() { proto.RegisterFile("colinearcore/tx.proto", fileDescriptor_0c3854a2a9bba3b4) }
var fileDescriptor_0c3854a2a9bba3b4 = []byte{
// 512 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x51, 0x8b, 0xd3, 0x40,
0x10, 0xc7, 0x9b, 0xb6, 0xd7, 0x33, 0x73, 0xe7, 0xc1, 0xad, 0x77, 0x35, 0x46, 0x0d, 0x21, 0x2a,
0x04, 0xbc, 0x6b, 0x45, 0x11, 0x5f, 0xbd, 0x8a, 0x8a, 0x60, 0x45, 0x8a, 0xbe, 0x08, 0xc2, 0xc5,
0xec, 0x1a, 0x16, 0xd3, 0xdd, 0xb2, 0x9b, 0x9e, 0xf5, 0x5b, 0xf8, 0xb1, 0x7c, 0x3c, 0xdf, 0xf4,
0x4d, 0xda, 0x2f, 0x22, 0x6e, 0x92, 0x4d, 0x72, 0xb5, 0x69, 0xe1, 0xde, 0x3a, 0x33, 0xff, 0xf9,
0x4d, 0x76, 0xe7, 0xdf, 0x85, 0xc3, 0x90, 0xc7, 0x94, 0x91, 0x40, 0x84, 0x5c, 0x90, 0x7e, 0x32,
0xeb, 0x4d, 0x04, 0x4f, 0x38, 0xd2, 0xe9, 0x5e, 0xb9, 0xee, 0xfd, 0x36, 0xe0, 0xea, 0x50, 0x46,
0x6f, 0xc8, 0xd7, 0x93, 0x69, 0x98, 0x50, 0xce, 0x90, 0x05, 0xdb, 0xa1, 0x20, 0x41, 0xc2, 0x85,
0x65, 0xb8, 0x86, 0x6f, 0x8e, 0xf2, 0x10, 0x21, 0x68, 0xb3, 0x60,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, 0x13, 0xb4, 0x05, 0x00, 0x00,
// 601 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x5f, 0x4f, 0xd4, 0x4e,
0x14, 0xa5, 0xcb, 0xb2, 0xd0, 0x0b, 0x3f, 0x12, 0xe6, 0x07, 0x38, 0x16, 0x6d, 0x9a, 0xfa, 0x27,
0x4d, 0x84, 0xc5, 0x60, 0x8c, 0xaf, 0xb0, 0x44, 0x89, 0x89, 0x6b, 0xcc, 0x46, 0x5f, 0x4c, 0x4c,
0x28, 0xed, 0x58, 0x26, 0xb6, 0x9d, 0x66, 0xa6, 0x05, 0xfc, 0x16, 0x7e, 0x2c, 0x1f, 0xf1, 0xcd,
0x47, 0xc3, 0x7e, 0x10, 0xcd, 0x4e, 0xdb, 0x69, 0xcb, 0xba, 0x7f, 0x12, 0xdf, 0x7a, 0xef, 0x3d,
0xe7, 0xdc, 0x69, 0xcf, 0x69, 0x06, 0xb6, 0x3c, 0x16, 0xd2, 0x98, 0xb8, 0xdc, 0x63, 0x9c, 0xec,
0xa7, 0x57, 0xdd, 0x84, 0xb3, 0x94, 0x21, 0xd5, 0xee, 0xd6, 0xe7, 0xc6, 0x4e, 0x03, 0x7d, 0xee,
0x72, 0xff, 0xd2, 0xe5, 0x24, 0xe7, 0xd8, 0xbf, 0x5b, 0xf0, 0x5f, 0x5f, 0x04, 0x6f, 0xc9, 0xe5,
0x51, 0xe6, 0xa5, 0x94, 0xc5, 0x08, 0xc3, 0xb2, 0xc7, 0x89, 0x9b, 0x32, 0x8e, 0x35, 0x4b, 0x73,
0xf4, 0x41, 0x59, 0x22, 0x04, 0xed, 0xd8, 0x8d, 0x08, 0x6e, 0xc9, 0xb6, 0x7c, 0x46, 0x16, 0xac,
0xfa, 0x44, 0x78, 0x9c, 0x26, 0x23, 0x32, 0x5e, 0x94, 0xa3, 0x7a, 0x4b, 0xea, 0x11, 0x1a,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0x7a, 0x2f, 0xbe, 0xdf, 0x98, 0xda, 0xf5, 0x8d, 0xa9, 0xfd, 0xba, 0x31, 0xb5, 0x6f, 0x43,
0x73, 0xe1, 0x7a, 0x68, 0x2e, 0xfc, 0x1c, 0x9a, 0x0b, 0x1f, 0xef, 0x97, 0xec, 0xfd, 0xab, 0xfd,
0xe6, 0xd5, 0xf2, 0x35, 0x21, 0xe2, 0xac, 0x23, 0xaf, 0x8a, 0x67, 0x7f, 0x02, 0x00, 0x00, 0xff,
0xff, 0x44, 0xed, 0x86, 0xa7, 0x77, 0x06, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -938,6 +985,35 @@ func (m *MsgNewAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i
var l int
_ = l
if m.StorageGb != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.StorageGb))
i--
dAtA[i] = 0x60
}
if m.MemMb != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.MemMb))
i--
dAtA[i] = 0x58
}
if m.CpuArch != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.CpuArch))
i--
dAtA[i] = 0x50
}
if m.CpuCores != 0 {
i = encodeVarintTx(dAtA, i, uint64(m.CpuCores))
i--
dAtA[i] = 0x48
}
if len(m.Gpus) > 0 {
for iNdEx := len(m.Gpus) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.Gpus[iNdEx])
copy(dAtA[i:], m.Gpus[iNdEx])
i = encodeVarintTx(dAtA, i, uint64(len(m.Gpus[iNdEx])))
i--
dAtA[i] = 0x42
}
}
if len(m.VerifiedProviders) > 0 {
for iNdEx := len(m.VerifiedProviders) - 1; iNdEx >= 0; iNdEx-- {
i -= len(m.VerifiedProviders[iNdEx])
@@ -1366,6 +1442,24 @@ func (m *MsgNewAuction) Size() (n int) {
n += 1 + l + sovTx(uint64(l))
}
}
if len(m.Gpus) > 0 {
for _, s := range m.Gpus {
l = len(s)
n += 1 + l + sovTx(uint64(l))
}
}
if m.CpuCores != 0 {
n += 1 + sovTx(uint64(m.CpuCores))
}
if m.CpuArch != 0 {
n += 1 + sovTx(uint64(m.CpuArch))
}
if m.MemMb != 0 {
n += 1 + sovTx(uint64(m.MemMb))
}
if m.StorageGb != 0 {
n += 1 + sovTx(uint64(m.StorageGb))
}
return n
}
@@ -1758,6 +1852,114 @@ func (m *MsgNewAuction) Unmarshal(dAtA []byte) error {
}
m.VerifiedProviders = append(m.VerifiedProviders, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 8:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Gpus", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthTx
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthTx
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Gpus = append(m.Gpus, string(dAtA[iNdEx:postIndex]))
iNdEx = postIndex
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CpuCores", wireType)
}
m.CpuCores = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.CpuCores |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 10:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field CpuArch", wireType)
}
m.CpuArch = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.CpuArch |= CpuArchitecture(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 11:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field MemMb", wireType)
}
m.MemMb = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.MemMb |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 12:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field StorageGb", wireType)
}
m.StorageGb = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTx
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.StorageGb |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := skipTx(dAtA[iNdEx:])