(feat) update x/cdp to run every X blocks based off params (#1814)

* add new cdp module param to protonet genesis

* update cdp / cdp related tests for new module param

* update telemetry docs and setup for collecting against local node

* update kvool commit for new cdp param
This commit is contained in:
Levi Schoen 2024-01-24 12:10:07 -10:00 committed by GitHub
parent 3767030005
commit 4d62f47773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
23 changed files with 466 additions and 306 deletions

View File

@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features ### Features
- (cli) [#1785] Add `shard` CLI command to support creating partitions of data for standalone nodes - (cli) [#1785] Add `shard` CLI command to support creating partitions of data for standalone nodes
- (cdp) [#1814] Add module param and logic for running x/cdp begin blocker every `n` blocks
- (cli) [#1804] Add `rocksdb compact` command for manual DB compaction of state or blockstore. - (cli) [#1804] Add `rocksdb compact` command for manual DB compaction of state or blockstore.
## [v0.25.0] ## [v0.25.0]
@ -69,6 +70,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
## [v0.24.3] ## [v0.24.3]
### Bug Fixes ### Bug Fixes
- (deps) [#1770] Bump ledger-cosmos-go to v0.13.1 to resolve signing error with - (deps) [#1770] Bump ledger-cosmos-go to v0.13.1 to resolve signing error with
- (rocksdb) [#1767] Fix resolution of rocksdb database path introduced in v0.24.2 - (rocksdb) [#1767] Fix resolution of rocksdb database path introduced in v0.24.2
@ -324,7 +326,6 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md).
[#1804]: https://github.com/Kava-Labs/kava/pull/1804 [#1804]: https://github.com/Kava-Labs/kava/pull/1804
[#1785]: https://github.com/Kava-Labs/kava/pull/1785 [#1785]: https://github.com/Kava-Labs/kava/pull/1785
[#1784]: https://github.com/Kava-Labs/kava/pull/1784 [#1784]: https://github.com/Kava-Labs/kava/pull/1784
[#1776]: https://github.com/Kava-Labs/kava/pull/1776
[#1770]: https://github.com/Kava-Labs/kava/pull/1770 [#1770]: https://github.com/Kava-Labs/kava/pull/1770
[#1755]: https://github.com/Kava-Labs/kava/pull/1755 [#1755]: https://github.com/Kava-Labs/kava/pull/1755
[#1761]: https://github.com/Kava-Labs/kava/pull/1761 [#1761]: https://github.com/Kava-Labs/kava/pull/1761
@ -384,7 +385,6 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md).
[v0.24.1]: https://github.com/Kava-Labs/kava/compare/v0.24.1...v0.24.0 [v0.24.1]: https://github.com/Kava-Labs/kava/compare/v0.24.1...v0.24.0
[v0.24.0]: https://github.com/Kava-Labs/kava/compare/v0.24.0...v0.23.2 [v0.24.0]: https://github.com/Kava-Labs/kava/compare/v0.24.0...v0.23.2
[v0.23.2]: https://github.com/Kava-Labs/kava/compare/v0.23.1...v0.23.2 [v0.23.2]: https://github.com/Kava-Labs/kava/compare/v0.23.1...v0.23.2
[v0.23.1]: https://github.com/Kava-Labs/kava/compare/v0.23.0...v0.23.1
[v0.23.0]: https://github.com/Kava-Labs/kava/compare/v0.21.1...v0.23.0 [v0.23.0]: https://github.com/Kava-Labs/kava/compare/v0.21.1...v0.23.0
[v0.16.1]: https://github.com/Kava-Labs/kava/compare/v0.16.0...v0.16.1 [v0.16.1]: https://github.com/Kava-Labs/kava/compare/v0.16.0...v0.16.1
[v0.16.0]: https://github.com/Kava-Labs/kava/compare/v0.15.2...v0.16.0 [v0.16.0]: https://github.com/Kava-Labs/kava/compare/v0.15.2...v0.16.0

View File

@ -330,6 +330,7 @@ start-remote-sims:
-—container-override environment=[{SIM_NAME=master-$(VERSION)}] -—container-override environment=[{SIM_NAME=master-$(VERSION)}]
update-kvtool: update-kvtool:
git submodule init || true
git submodule update git submodule update
cd tests/e2e/kvtool && make install cd tests/e2e/kvtool && make install

View File

@ -837,6 +837,7 @@
"gov_denom": "ukava", "gov_denom": "ukava",
"params": { "params": {
"circuit_breaker": false, "circuit_breaker": false,
"begin_blocker_execution_block_interval": 500,
"collateral_params": [ "collateral_params": [
{ {
"auction_size": "50000000000", "auction_size": "50000000000",

View File

@ -3505,6 +3505,9 @@ paths:
type: string type: string
circuit_breaker: circuit_breaker:
type: boolean type: boolean
begin_blocker_execution_block_interval:
type: string
format: int64
description: Params defines the parameters for the cdp module. description: Params defines the parameters for the cdp module.
description: >- description: >-
QueryParamsResponse defines the response type for the Query/Params QueryParamsResponse defines the response type for the Query/Params
@ -51628,6 +51631,9 @@ definitions:
type: string type: string
circuit_breaker: circuit_breaker:
type: boolean type: boolean
begin_blocker_execution_block_interval:
type: string
format: int64
description: Params defines the parameters for the cdp module. description: Params defines the parameters for the cdp module.
kava.cdp.v1beta1.QueryAccountsResponse: kava.cdp.v1beta1.QueryAccountsResponse:
type: object type: object
@ -52161,6 +52167,9 @@ definitions:
type: string type: string
circuit_breaker: circuit_breaker:
type: boolean type: boolean
begin_blocker_execution_block_interval:
type: string
format: int64
description: Params defines the parameters for the cdp module. description: Params defines the parameters for the cdp module.
description: >- description: >-
QueryParamsResponse defines the response type for the Query/Params RPC QueryParamsResponse defines the response type for the Query/Params RPC

View File

@ -38,10 +38,10 @@ Then restart the service with the updated settings
## Running local prometheus collector and grafana services ## Running local prometheus collector and grafana services
To collect app metrics and visualize them locally, you can run the prometheus collector and grafana services with docker compose from the repo root directory To collect app metrics and visualize them locally, you can run the prometheus collector and grafana services with docker compose from the repo root directory (after updating `config.toml` and `app.toml` as detailed above)
```bash ```bash
docker compose -f prometheus.docker-compose.yml docker compose -f prometheus.docker-compose.yml up
``` ```
Navigate to localhost:3000 to view the grafana unix Navigate to localhost:3000 to view the grafana unix
@ -54,13 +54,13 @@ See [grafana docs](https://grafana.com/docs/grafana/latest/dashboards/) for info
### Collecting from local host ### Collecting from local host
Update [prometheus config](../prometheus.yml) to collect metrics from your local source Update [prometheus config](../prometheus.yml) to collect metrics from your local source, where the port matches the value set for `config.toml/instrumentation.prometheus_listen_addr`
```yaml ```yaml
metrics_path: / metrics_path: /
static_configs: static_configs:
- targets: - targets:
- localhost:8888 - docker-host:8888
``` ```
### Collecting from remote host ### Collecting from remote host

View File

@ -1681,6 +1681,7 @@ Params defines the parameters for the cdp module.
| `debt_auction_threshold` | [string](#string) | | | | `debt_auction_threshold` | [string](#string) | | |
| `debt_auction_lot` | [string](#string) | | | | `debt_auction_lot` | [string](#string) | | |
| `circuit_breaker` | [bool](#bool) | | | | `circuit_breaker` | [bool](#bool) | | |
| `begin_blocker_execution_block_interval` | [int64](#int64) | | |

View File

@ -34,3 +34,10 @@ services:
- 9090 - 9090
networks: networks:
- monitoring - monitoring
docker-host:
image: qoomon/docker-host
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
mem_limit: 8M
restart: on-failure
networks:
- monitoring

View File

@ -3,8 +3,7 @@ global:
evaluation_interval: 15s evaluation_interval: 15s
scrape_configs: scrape_configs:
- job_name: proxy - job_name: proxy
scheme: https
metrics_path: / metrics_path: /
static_configs: static_configs:
- targets: - targets:
- 4efb-18-207-102-158.ngrok-free.app - docker-host:8888

View File

@ -66,6 +66,8 @@ message Params {
(gogoproto.nullable) = false (gogoproto.nullable) = false
]; ];
bool circuit_breaker = 8; bool circuit_breaker = 8;
int64 begin_blocker_execution_block_interval = 9;
} }
// DebtParam defines governance params for debt assets // DebtParam defines governance params for debt assets

@ -1 +1 @@
Subproject commit e1085562d203fd81c5dd8576170b29715b2de9ef Subproject commit b9669f6a5d16658ffe8ea667b688fb174e656f43

View File

@ -20,6 +20,16 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper)
params := k.GetParams(ctx) params := k.GetParams(ctx)
// only run CDP Begin Blocker every `BeginBlockerExecutionBlockInterval` blocks
blockHeight := ctx.BlockHeight()
if blockHeight%params.BeginBlockerExecutionBlockInterval != 0 {
ctx.Logger().Info("skipping x/cdp begin blocker")
return
}
ctx.Logger().Debug("running x/cdp begin blocker")
for _, cp := range params.CollateralParams { for _, cp := range params.CollateralParams {
ok := k.UpdatePricefeedStatus(ctx, cp.SpotMarketID) ok := k.UpdatePricefeedStatus(ctx, cp.SpotMarketID)
if !ok { if !ok {

View File

@ -205,11 +205,12 @@ func (suite *GenesisTestSuite) Test_InitExportGenesis() {
cdpGenesis := types.GenesisState{ cdpGenesis := types.GenesisState{
Params: types.Params{ Params: types.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000),
SurplusAuctionThreshold: types.DefaultSurplusThreshold, SurplusAuctionThreshold: types.DefaultSurplusThreshold,
SurplusAuctionLot: types.DefaultSurplusLot, SurplusAuctionLot: types.DefaultSurplusLot,
DebtAuctionThreshold: types.DefaultDebtThreshold, DebtAuctionThreshold: types.DefaultDebtThreshold,
DebtAuctionLot: types.DefaultDebtLot, DebtAuctionLot: types.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: types.CollateralParams{ CollateralParams: types.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",

View File

@ -113,11 +113,12 @@ func NewPricefeedGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState { func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
cdpGenesis := types.GenesisState{ cdpGenesis := types.GenesisState{
Params: types.Params{ Params: types.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000),
SurplusAuctionThreshold: types.DefaultSurplusThreshold, SurplusAuctionThreshold: types.DefaultSurplusThreshold,
SurplusAuctionLot: types.DefaultSurplusLot, SurplusAuctionLot: types.DefaultSurplusLot,
DebtAuctionThreshold: types.DefaultDebtThreshold, DebtAuctionThreshold: types.DefaultDebtThreshold,
DebtAuctionLot: types.DefaultDebtLot, DebtAuctionLot: types.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: types.CollateralParams{ CollateralParams: types.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",

View File

@ -47,6 +47,7 @@ func NewCDPGenState(cdc codec.JSONCodec, asset string, liquidationRatio sdk.Dec)
SurplusAuctionLot: types.DefaultSurplusLot, SurplusAuctionLot: types.DefaultSurplusLot,
DebtAuctionThreshold: types.DefaultDebtThreshold, DebtAuctionThreshold: types.DefaultDebtThreshold,
DebtAuctionLot: types.DefaultDebtLot, DebtAuctionLot: types.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: types.CollateralParams{ CollateralParams: types.CollateralParams{
{ {
Denom: asset, Denom: asset,
@ -155,11 +156,12 @@ func NewPricefeedGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState { func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
cdpGenesis := types.GenesisState{ cdpGenesis := types.GenesisState{
Params: types.Params{ Params: types.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000),
SurplusAuctionThreshold: types.DefaultSurplusThreshold, SurplusAuctionThreshold: types.DefaultSurplusThreshold,
SurplusAuctionLot: types.DefaultSurplusLot, SurplusAuctionLot: types.DefaultSurplusLot,
DebtAuctionThreshold: types.DefaultDebtThreshold, DebtAuctionThreshold: types.DefaultDebtThreshold,
DebtAuctionLot: types.DefaultDebtLot, DebtAuctionLot: types.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: types.CollateralParams{ CollateralParams: types.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",
@ -253,6 +255,7 @@ func NewCDPGenStateHighDebtLimit(cdc codec.JSONCodec) app.GenesisState {
SurplusAuctionLot: types.DefaultSurplusLot, SurplusAuctionLot: types.DefaultSurplusLot,
DebtAuctionThreshold: types.DefaultDebtThreshold, DebtAuctionThreshold: types.DefaultDebtThreshold,
DebtAuctionLot: types.DefaultDebtLot, DebtAuctionLot: types.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: types.CollateralParams{ CollateralParams: types.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",

View File

@ -33,12 +33,13 @@ func migrateParams(params v015cdp.Params) v016cdp.Params {
ConversionFactor: params.DebtParam.ConversionFactor, ConversionFactor: params.DebtParam.ConversionFactor,
DebtFloor: params.DebtParam.DebtFloor, DebtFloor: params.DebtParam.DebtFloor,
}, },
GlobalDebtLimit: params.GlobalDebtLimit, GlobalDebtLimit: params.GlobalDebtLimit,
SurplusAuctionThreshold: params.SurplusAuctionThreshold, SurplusAuctionThreshold: params.SurplusAuctionThreshold,
SurplusAuctionLot: params.SurplusAuctionLot, SurplusAuctionLot: params.SurplusAuctionLot,
DebtAuctionThreshold: params.DebtAuctionThreshold, DebtAuctionThreshold: params.DebtAuctionThreshold,
DebtAuctionLot: params.DebtAuctionLot, DebtAuctionLot: params.DebtAuctionLot,
CircuitBreaker: params.CircuitBreaker, CircuitBreaker: params.CircuitBreaker,
BeginBlockerExecutionBlockInterval: v016cdp.DefaultBeginBlockerExecutionBlockInterval,
} }
} }

View File

@ -163,11 +163,12 @@ func (s *migrateTestSuite) TestMigrate_GenState() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(100), DebtFloor: sdkmath.NewInt(100),
}, },
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000),
SurplusAuctionThreshold: sdkmath.NewInt(6), SurplusAuctionThreshold: sdkmath.NewInt(6),
SurplusAuctionLot: sdkmath.NewInt(7), SurplusAuctionLot: sdkmath.NewInt(7),
DebtAuctionThreshold: sdkmath.NewInt(8), DebtAuctionThreshold: sdkmath.NewInt(8),
DebtAuctionLot: sdkmath.NewInt(9), DebtAuctionLot: sdkmath.NewInt(9),
BeginBlockerExecutionBlockInterval: v016cdp.DefaultBeginBlockerExecutionBlockInterval,
}, },
CDPs: v016cdp.CDPs{ CDPs: v016cdp.CDPs{
{ {

View File

@ -5,7 +5,10 @@
"denom": "bnb", "denom": "bnb",
"type": "bnb-a", "type": "bnb-a",
"liquidation_ratio": "1.500000000000000000", "liquidation_ratio": "1.500000000000000000",
"debt_limit": { "denom": "usdx", "amount": "20000000000000" }, "debt_limit": {
"denom": "usdx",
"amount": "20000000000000"
},
"stability_fee": "1.000000000782997700", "stability_fee": "1.000000000782997700",
"auction_size": "50000000000", "auction_size": "50000000000",
"liquidation_penalty": "0.050000000000000000", "liquidation_penalty": "0.050000000000000000",
@ -19,7 +22,10 @@
"denom": "hbtc", "denom": "hbtc",
"type": "hbtc-a", "type": "hbtc-a",
"liquidation_ratio": "1.500000000000000000", "liquidation_ratio": "1.500000000000000000",
"debt_limit": { "denom": "usdx", "amount": "10000000000000" }, "debt_limit": {
"denom": "usdx",
"amount": "10000000000000"
},
"stability_fee": "1.000000001547125958", "stability_fee": "1.000000001547125958",
"auction_size": "1000000000000", "auction_size": "1000000000000",
"liquidation_penalty": "0.075000000000000000", "liquidation_penalty": "0.075000000000000000",
@ -36,21 +42,34 @@
"conversion_factor": "6", "conversion_factor": "6",
"debt_floor": "10000000" "debt_floor": "10000000"
}, },
"global_debt_limit": { "denom": "usdx", "amount": "43000000000000" }, "global_debt_limit": {
"denom": "usdx",
"amount": "43000000000000"
},
"surplus_auction_threshold": "500000000000", "surplus_auction_threshold": "500000000000",
"surplus_auction_lot": "10000000000", "surplus_auction_lot": "10000000000",
"debt_auction_threshold": "100000000000", "debt_auction_threshold": "100000000000",
"debt_auction_lot": "10000000000", "debt_auction_lot": "10000000000",
"circuit_breaker": false "circuit_breaker": false,
"begin_blocker_execution_block_interval": "1"
}, },
"cdps": [ "cdps": [
{ {
"id": "19", "id": "19",
"owner": "kava1u4p6a2yse66ewfndw4j7ppsa777vdcex3m4n9s", "owner": "kava1u4p6a2yse66ewfndw4j7ppsa777vdcex3m4n9s",
"type": "bnb-a", "type": "bnb-a",
"collateral": { "denom": "bnb", "amount": "40911876" }, "collateral": {
"principal": { "denom": "usdx", "amount": "10016831" }, "denom": "bnb",
"accumulated_fees": { "denom": "usdx", "amount": "36088" }, "amount": "40911876"
},
"principal": {
"denom": "usdx",
"amount": "10016831"
},
"accumulated_fees": {
"denom": "usdx",
"amount": "36088"
},
"fees_updated": "2021-11-05T21:13:12.856088470Z", "fees_updated": "2021-11-05T21:13:12.856088470Z",
"interest_factor": "1.002881426571765716" "interest_factor": "1.002881426571765716"
}, },
@ -58,9 +77,18 @@
"id": "22", "id": "22",
"owner": "kava1e8xjfylam4nvugcmkxwvuxh22uvvad5vknu4yh", "owner": "kava1e8xjfylam4nvugcmkxwvuxh22uvvad5vknu4yh",
"type": "bnb-a", "type": "bnb-a",
"collateral": { "denom": "bnb", "amount": "88268546" }, "collateral": {
"principal": { "denom": "usdx", "amount": "10000000" }, "denom": "bnb",
"accumulated_fees": { "denom": "usdx", "amount": "156662" }, "amount": "88268546"
},
"principal": {
"denom": "usdx",
"amount": "10000000"
},
"accumulated_fees": {
"denom": "usdx",
"amount": "156662"
},
"fees_updated": "2021-11-05T21:13:12.856088470Z", "fees_updated": "2021-11-05T21:13:12.856088470Z",
"interest_factor": "1.002881426571765716" "interest_factor": "1.002881426571765716"
} }
@ -69,12 +97,18 @@
{ {
"cdp_id": "19", "cdp_id": "19",
"depositor": "kava1u4p6a2yse66ewfndw4j7ppsa777vdcex3m4n9s", "depositor": "kava1u4p6a2yse66ewfndw4j7ppsa777vdcex3m4n9s",
"amount": { "denom": "bnb", "amount": "40911876" } "amount": {
"denom": "bnb",
"amount": "40911876"
}
}, },
{ {
"cdp_id": "22", "cdp_id": "22",
"depositor": "kava1e8xjfylam4nvugcmkxwvuxh22uvvad5vknu4yh", "depositor": "kava1e8xjfylam4nvugcmkxwvuxh22uvvad5vknu4yh",
"amount": { "denom": "bnb", "amount": "88268546" } "amount": {
"denom": "bnb",
"amount": "88268546"
}
} }
], ],
"starting_cdp_id": "1", "starting_cdp_id": "1",
@ -88,6 +122,9 @@
} }
], ],
"total_principals": [ "total_principals": [
{ "collateral_type": "bnb-a", "total_principal": "9285009581820" } {
"collateral_type": "bnb-a",
"total_principal": "9285009581820"
}
] ]
} }

View File

@ -134,14 +134,15 @@ func (m *GenesisState) GetTotalPrincipals() GenesisTotalPrincipals {
// Params defines the parameters for the cdp module. // Params defines the parameters for the cdp module.
type Params struct { type Params struct {
CollateralParams CollateralParams `protobuf:"bytes,1,rep,name=collateral_params,json=collateralParams,proto3,castrepeated=CollateralParams" json:"collateral_params"` CollateralParams CollateralParams `protobuf:"bytes,1,rep,name=collateral_params,json=collateralParams,proto3,castrepeated=CollateralParams" json:"collateral_params"`
DebtParam DebtParam `protobuf:"bytes,2,opt,name=debt_param,json=debtParam,proto3" json:"debt_param"` DebtParam DebtParam `protobuf:"bytes,2,opt,name=debt_param,json=debtParam,proto3" json:"debt_param"`
GlobalDebtLimit types.Coin `protobuf:"bytes,3,opt,name=global_debt_limit,json=globalDebtLimit,proto3" json:"global_debt_limit"` GlobalDebtLimit types.Coin `protobuf:"bytes,3,opt,name=global_debt_limit,json=globalDebtLimit,proto3" json:"global_debt_limit"`
SurplusAuctionThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=surplus_auction_threshold,json=surplusAuctionThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"surplus_auction_threshold"` SurplusAuctionThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=surplus_auction_threshold,json=surplusAuctionThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"surplus_auction_threshold"`
SurplusAuctionLot github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=surplus_auction_lot,json=surplusAuctionLot,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"surplus_auction_lot"` SurplusAuctionLot github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=surplus_auction_lot,json=surplusAuctionLot,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"surplus_auction_lot"`
DebtAuctionThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=debt_auction_threshold,json=debtAuctionThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_auction_threshold"` DebtAuctionThreshold github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=debt_auction_threshold,json=debtAuctionThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_auction_threshold"`
DebtAuctionLot github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=debt_auction_lot,json=debtAuctionLot,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_auction_lot"` DebtAuctionLot github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,7,opt,name=debt_auction_lot,json=debtAuctionLot,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"debt_auction_lot"`
CircuitBreaker bool `protobuf:"varint,8,opt,name=circuit_breaker,json=circuitBreaker,proto3" json:"circuit_breaker,omitempty"` CircuitBreaker bool `protobuf:"varint,8,opt,name=circuit_breaker,json=circuitBreaker,proto3" json:"circuit_breaker,omitempty"`
BeginBlockerExecutionBlockInterval int64 `protobuf:"varint,9,opt,name=begin_blocker_execution_block_interval,json=beginBlockerExecutionBlockInterval,proto3" json:"begin_blocker_execution_block_interval,omitempty"`
} }
func (m *Params) Reset() { *m = Params{} } func (m *Params) Reset() { *m = Params{} }
@ -205,6 +206,13 @@ func (m *Params) GetCircuitBreaker() bool {
return false return false
} }
func (m *Params) GetBeginBlockerExecutionBlockInterval() int64 {
if m != nil {
return m.BeginBlockerExecutionBlockInterval
}
return 0
}
// DebtParam defines governance params for debt assets // DebtParam defines governance params for debt assets
type DebtParam struct { type DebtParam struct {
Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
@ -456,81 +464,84 @@ func init() {
func init() { proto.RegisterFile("kava/cdp/v1beta1/genesis.proto", fileDescriptor_e4494a90aaab0034) } func init() { proto.RegisterFile("kava/cdp/v1beta1/genesis.proto", fileDescriptor_e4494a90aaab0034) }
var fileDescriptor_e4494a90aaab0034 = []byte{ var fileDescriptor_e4494a90aaab0034 = []byte{
// 1179 bytes of a gzipped FileDescriptorProto // 1223 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcd, 0x6e, 0x1b, 0x37, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0x45,
0x10, 0xf6, 0x3a, 0x8a, 0x23, 0xd1, 0x8a, 0x24, 0x33, 0x4e, 0xb2, 0x76, 0x50, 0x49, 0x75, 0xd1, 0x14, 0xcf, 0x26, 0x6e, 0x6a, 0x4f, 0xd2, 0xd8, 0x99, 0xa6, 0xed, 0x26, 0x15, 0xb6, 0x09, 0xa2,
0xc6, 0x3d, 0x58, 0x42, 0x52, 0x20, 0x40, 0x81, 0xa2, 0xa9, 0x65, 0xc1, 0x81, 0x11, 0x17, 0x10, 0x0d, 0x87, 0xda, 0x6a, 0x91, 0x2a, 0x21, 0x21, 0x4a, 0x1d, 0xd3, 0x2a, 0x6a, 0x91, 0xa2, 0x4d,
0xd6, 0x3e, 0xb5, 0x87, 0x05, 0x97, 0x4b, 0xc9, 0x84, 0x56, 0xcb, 0x2d, 0x49, 0xa9, 0xb6, 0x5f, 0x4e, 0x70, 0x58, 0xcd, 0xce, 0xbe, 0x6c, 0x46, 0x5e, 0xef, 0x2c, 0x33, 0x63, 0x93, 0xf6, 0x2b,
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x4e, 0x27, 0x0d, 0x00, 0x00, 0xbd, 0x7f, 0x07, 0x55, 0xef, 0xd5, 0xfb, 0xea, 0xdc, 0xdb, 0xf7, 0xd5, 0xb9, 0xbf, 0xdf, 0x57,
0xe7, 0xbe, 0xfb, 0x74, 0x02, 0x5f, 0x2f, 0x70, 0xf7, 0x52, 0x12, 0x49, 0xf3, 0xd5, 0x3c, 0x32,
0xff, 0xbe, 0x18, 0x13, 0xd1, 0xa2, 0xb9, 0x89, 0xcf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x25,
0x77, 0x77, 0x4d, 0x7b, 0x0d, 0x00, 0x00,
} }
func (m *GenesisState) Marshal() (dAtA []byte, err error) { func (m *GenesisState) Marshal() (dAtA []byte, err error) {
@ -661,6 +672,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if m.BeginBlockerExecutionBlockInterval != 0 {
i = encodeVarintGenesis(dAtA, i, uint64(m.BeginBlockerExecutionBlockInterval))
i--
dAtA[i] = 0x48
}
if m.CircuitBreaker { if m.CircuitBreaker {
i-- i--
if m.CircuitBreaker { if m.CircuitBreaker {
@ -1108,6 +1124,9 @@ func (m *Params) Size() (n int) {
if m.CircuitBreaker { if m.CircuitBreaker {
n += 2 n += 2
} }
if m.BeginBlockerExecutionBlockInterval != 0 {
n += 1 + sovGenesis(uint64(m.BeginBlockerExecutionBlockInterval))
}
return n return n
} }
@ -1798,6 +1817,25 @@ func (m *Params) Unmarshal(dAtA []byte) error {
} }
} }
m.CircuitBreaker = bool(v != 0) m.CircuitBreaker = bool(v != 0)
case 9:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BeginBlockerExecutionBlockInterval", wireType)
}
m.BeginBlockerExecutionBlockInterval = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenesis
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.BeginBlockerExecutionBlockInterval |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipGenesis(dAtA[iNdEx:]) skippy, err := skipGenesis(dAtA[iNdEx:])

View File

@ -13,18 +13,19 @@ import (
// Parameter keys // Parameter keys
var ( var (
KeyGlobalDebtLimit = []byte("GlobalDebtLimit") KeyGlobalDebtLimit = []byte("GlobalDebtLimit")
KeyCollateralParams = []byte("CollateralParams") KeyCollateralParams = []byte("CollateralParams")
KeyDebtParam = []byte("DebtParam") KeyDebtParam = []byte("DebtParam")
KeyCircuitBreaker = []byte("CircuitBreaker") KeyCircuitBreaker = []byte("CircuitBreaker")
KeyDebtThreshold = []byte("DebtThreshold") KeyDebtThreshold = []byte("DebtThreshold")
KeyDebtLot = []byte("DebtLot") KeyDebtLot = []byte("DebtLot")
KeySurplusThreshold = []byte("SurplusThreshold") KeySurplusThreshold = []byte("SurplusThreshold")
KeySurplusLot = []byte("SurplusLot") KeySurplusLot = []byte("SurplusLot")
DefaultGlobalDebt = sdk.NewCoin(DefaultStableDenom, sdk.ZeroInt()) KeyBeginBlockerExecutionBlockInterval = []byte("BeginBlockerExecutionBlockInterval")
DefaultCircuitBreaker = false DefaultGlobalDebt = sdk.NewCoin(DefaultStableDenom, sdk.ZeroInt())
DefaultCollateralParams = CollateralParams{} DefaultCircuitBreaker = false
DefaultDebtParam = DebtParam{ DefaultCollateralParams = CollateralParams{}
DefaultDebtParam = DebtParam{
Denom: "usdx", Denom: "usdx",
ReferenceAsset: "usd", ReferenceAsset: "usd",
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
@ -39,22 +40,25 @@ var (
DefaultSurplusLot = sdkmath.NewInt(10000000000) DefaultSurplusLot = sdkmath.NewInt(10000000000)
DefaultDebtLot = sdkmath.NewInt(10000000000) DefaultDebtLot = sdkmath.NewInt(10000000000)
stabilityFeeMax = sdk.MustNewDecFromStr("1.000000051034942716") // 500% APR stabilityFeeMax = sdk.MustNewDecFromStr("1.000000051034942716") // 500% APR
// Run every block
DefaultBeginBlockerExecutionBlockInterval = int64(1)
) )
// NewParams returns a new params object // NewParams returns a new params object
func NewParams( func NewParams(
debtLimit sdk.Coin, collateralParams CollateralParams, debtParam DebtParam, surplusThreshold, debtLimit sdk.Coin, collateralParams CollateralParams, debtParam DebtParam, surplusThreshold,
surplusLot, debtThreshold, debtLot sdkmath.Int, breaker bool, surplusLot, debtThreshold, debtLot sdkmath.Int, breaker bool, beginBlockerExecutionBlockInterval int64,
) Params { ) Params {
return Params{ return Params{
GlobalDebtLimit: debtLimit, GlobalDebtLimit: debtLimit,
CollateralParams: collateralParams, CollateralParams: collateralParams,
DebtParam: debtParam, DebtParam: debtParam,
SurplusAuctionThreshold: surplusThreshold, SurplusAuctionThreshold: surplusThreshold,
SurplusAuctionLot: surplusLot, SurplusAuctionLot: surplusLot,
DebtAuctionThreshold: debtThreshold, DebtAuctionThreshold: debtThreshold,
DebtAuctionLot: debtLot, DebtAuctionLot: debtLot,
CircuitBreaker: breaker, CircuitBreaker: breaker,
BeginBlockerExecutionBlockInterval: beginBlockerExecutionBlockInterval,
} }
} }
@ -63,7 +67,7 @@ func DefaultParams() Params {
return NewParams( return NewParams(
DefaultGlobalDebt, DefaultCollateralParams, DefaultDebtParam, DefaultSurplusThreshold, DefaultGlobalDebt, DefaultCollateralParams, DefaultDebtParam, DefaultSurplusThreshold,
DefaultSurplusLot, DefaultDebtThreshold, DefaultDebtLot, DefaultSurplusLot, DefaultDebtThreshold, DefaultDebtLot,
DefaultCircuitBreaker, DefaultCircuitBreaker, DefaultBeginBlockerExecutionBlockInterval,
) )
} }
@ -122,6 +126,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
paramtypes.NewParamSetPair(KeySurplusLot, &p.SurplusAuctionLot, validateSurplusAuctionLotParam), paramtypes.NewParamSetPair(KeySurplusLot, &p.SurplusAuctionLot, validateSurplusAuctionLotParam),
paramtypes.NewParamSetPair(KeyDebtThreshold, &p.DebtAuctionThreshold, validateDebtAuctionThresholdParam), paramtypes.NewParamSetPair(KeyDebtThreshold, &p.DebtAuctionThreshold, validateDebtAuctionThresholdParam),
paramtypes.NewParamSetPair(KeyDebtLot, &p.DebtAuctionLot, validateDebtAuctionLotParam), paramtypes.NewParamSetPair(KeyDebtLot, &p.DebtAuctionLot, validateDebtAuctionLotParam),
paramtypes.NewParamSetPair(KeyBeginBlockerExecutionBlockInterval, &p.BeginBlockerExecutionBlockInterval, validateBeginBlockerExecutionBlockIntervalParam),
} }
} }
@ -200,6 +205,10 @@ func (p Params) Validate() error {
collateralParamsDebtLimit, p.GlobalDebtLimit) collateralParamsDebtLimit, p.GlobalDebtLimit)
} }
if err := validateBeginBlockerExecutionBlockIntervalParam(p.BeginBlockerExecutionBlockInterval); err != nil {
return err
}
return nil return nil
} }
@ -346,3 +355,16 @@ func validateDebtAuctionLotParam(i interface{}) error {
return nil return nil
} }
func validateBeginBlockerExecutionBlockIntervalParam(i interface{}) error {
bbebi, ok := i.(int64)
if !ok {
return fmt.Errorf("invalid parameter type: %T", i)
}
if bbebi <= 0 {
return fmt.Errorf("begin blocker execution block interval param should be positive: %d", bbebi)
}
return nil
}

View File

@ -20,14 +20,15 @@ func (suite *ParamsTestSuite) SetupTest() {
func (suite *ParamsTestSuite) TestParamValidation() { func (suite *ParamsTestSuite) TestParamValidation() {
type args struct { type args struct {
globalDebtLimit sdk.Coin globalDebtLimit sdk.Coin
collateralParams types.CollateralParams collateralParams types.CollateralParams
debtParam types.DebtParam debtParam types.DebtParam
surplusThreshold sdkmath.Int surplusThreshold sdkmath.Int
surplusLot sdkmath.Int surplusLot sdkmath.Int
debtThreshold sdkmath.Int debtThreshold sdkmath.Int
debtLot sdkmath.Int debtLot sdkmath.Int
breaker bool breaker bool
beginBlockerExecutionBlockInterval int64
} }
type errArgs struct { type errArgs struct {
expectPass bool expectPass bool
@ -42,14 +43,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "default", name: "default",
args: args{ args: args{
globalDebtLimit: types.DefaultGlobalDebt, globalDebtLimit: types.DefaultGlobalDebt,
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: true, expectPass: true,
@ -82,11 +84,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: true, expectPass: true,
@ -119,11 +122,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -156,11 +160,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -207,11 +212,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: true, expectPass: true,
@ -258,11 +264,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -309,11 +316,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -345,11 +353,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -382,11 +391,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -433,11 +443,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -484,11 +495,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: true, expectPass: true,
@ -521,11 +533,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -558,11 +571,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -595,11 +609,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -632,11 +647,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -663,12 +679,13 @@ func (suite *ParamsTestSuite) TestParamValidation() {
CheckCollateralizationIndexCount: sdkmath.NewInt(10), CheckCollateralizationIndexCount: sdkmath.NewInt(10),
}, },
}, },
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -701,11 +718,12 @@ func (suite *ParamsTestSuite) TestParamValidation() {
ConversionFactor: sdkmath.NewInt(6), ConversionFactor: sdkmath.NewInt(6),
DebtFloor: sdkmath.NewInt(10000000), DebtFloor: sdkmath.NewInt(10000000),
}, },
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -715,14 +733,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "nil debt limit", name: "nil debt limit",
args: args{ args: args{
globalDebtLimit: sdk.Coin{}, globalDebtLimit: sdk.Coin{},
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -732,14 +751,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "zero surplus auction threshold", name: "zero surplus auction threshold",
args: args{ args: args{
globalDebtLimit: types.DefaultGlobalDebt, globalDebtLimit: types.DefaultGlobalDebt,
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: sdk.ZeroInt(), surplusThreshold: sdk.ZeroInt(),
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -749,14 +769,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "zero debt auction threshold", name: "zero debt auction threshold",
args: args{ args: args{
globalDebtLimit: types.DefaultGlobalDebt, globalDebtLimit: types.DefaultGlobalDebt,
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: sdk.ZeroInt(), debtThreshold: sdk.ZeroInt(),
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -766,14 +787,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "zero surplus auction lot", name: "zero surplus auction lot",
args: args{ args: args{
globalDebtLimit: types.DefaultGlobalDebt, globalDebtLimit: types.DefaultGlobalDebt,
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: sdk.ZeroInt(), surplusLot: sdk.ZeroInt(),
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: types.DefaultDebtLot, debtLot: types.DefaultDebtLot,
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -783,14 +805,15 @@ func (suite *ParamsTestSuite) TestParamValidation() {
{ {
name: "zero debt auction lot", name: "zero debt auction lot",
args: args{ args: args{
globalDebtLimit: types.DefaultGlobalDebt, globalDebtLimit: types.DefaultGlobalDebt,
collateralParams: types.DefaultCollateralParams, collateralParams: types.DefaultCollateralParams,
debtParam: types.DefaultDebtParam, debtParam: types.DefaultDebtParam,
surplusThreshold: types.DefaultSurplusThreshold, surplusThreshold: types.DefaultSurplusThreshold,
surplusLot: types.DefaultSurplusLot, surplusLot: types.DefaultSurplusLot,
debtThreshold: types.DefaultDebtThreshold, debtThreshold: types.DefaultDebtThreshold,
debtLot: sdk.ZeroInt(), debtLot: sdk.ZeroInt(),
breaker: types.DefaultCircuitBreaker, breaker: types.DefaultCircuitBreaker,
beginBlockerExecutionBlockInterval: types.DefaultBeginBlockerExecutionBlockInterval,
}, },
errArgs: errArgs{ errArgs: errArgs{
expectPass: false, expectPass: false,
@ -800,7 +823,7 @@ func (suite *ParamsTestSuite) TestParamValidation() {
} }
for _, tc := range testCases { for _, tc := range testCases {
suite.Run(tc.name, func() { suite.Run(tc.name, func() {
params := types.NewParams(tc.args.globalDebtLimit, tc.args.collateralParams, tc.args.debtParam, tc.args.surplusThreshold, tc.args.surplusLot, tc.args.debtThreshold, tc.args.debtLot, tc.args.breaker) params := types.NewParams(tc.args.globalDebtLimit, tc.args.collateralParams, tc.args.debtParam, tc.args.surplusThreshold, tc.args.surplusLot, tc.args.debtThreshold, tc.args.debtLot, tc.args.breaker, tc.args.beginBlockerExecutionBlockInterval)
err := params.Validate() err := params.Validate()
if tc.errArgs.expectPass { if tc.errArgs.expectPass {
suite.Require().NoError(err) suite.Require().NoError(err)

View File

@ -13,11 +13,12 @@ import (
func NewCDPGenState(cdc codec.JSONCodec, denom, asset string, liquidationRatio sdk.Dec) app.GenesisState { func NewCDPGenState(cdc codec.JSONCodec, denom, asset string, liquidationRatio sdk.Dec) app.GenesisState {
cdpGenesis := cdptypes.GenesisState{ cdpGenesis := cdptypes.GenesisState{
Params: cdptypes.Params{ Params: cdptypes.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 1000000000000),
SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold, SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold,
SurplusAuctionLot: cdptypes.DefaultSurplusLot, SurplusAuctionLot: cdptypes.DefaultSurplusLot,
DebtAuctionThreshold: cdptypes.DefaultDebtThreshold, DebtAuctionThreshold: cdptypes.DefaultDebtThreshold,
DebtAuctionLot: cdptypes.DefaultDebtLot, DebtAuctionLot: cdptypes.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: cdptypes.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: cdptypes.CollateralParams{ CollateralParams: cdptypes.CollateralParams{
{ {
Denom: denom, Denom: denom,

View File

@ -23,11 +23,12 @@ func c(denom string, amount int64) sdk.Coin { return sdk.NewInt64Coin(denom, amo
func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState { func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
cdpGenesis := cdptypes.GenesisState{ cdpGenesis := cdptypes.GenesisState{
Params: cdptypes.Params{ Params: cdptypes.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000),
SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold, SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold,
SurplusAuctionLot: cdptypes.DefaultSurplusLot, SurplusAuctionLot: cdptypes.DefaultSurplusLot,
DebtAuctionThreshold: cdptypes.DefaultDebtThreshold, DebtAuctionThreshold: cdptypes.DefaultDebtThreshold,
DebtAuctionLot: cdptypes.DefaultDebtLot, DebtAuctionLot: cdptypes.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: cdptypes.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: cdptypes.CollateralParams{ CollateralParams: cdptypes.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",

View File

@ -29,11 +29,12 @@ func dcs(coins ...sdk.DecCoin) sdk.DecCoins { return sdk.NewDecCoins(coins...) }
func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState { func NewCDPGenStateMulti(cdc codec.JSONCodec) app.GenesisState {
cdpGenesis := cdptypes.GenesisState{ cdpGenesis := cdptypes.GenesisState{
Params: cdptypes.Params{ Params: cdptypes.Params{
GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000), GlobalDebtLimit: sdk.NewInt64Coin("usdx", 2000000000000),
SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold, SurplusAuctionThreshold: cdptypes.DefaultSurplusThreshold,
SurplusAuctionLot: cdptypes.DefaultSurplusLot, SurplusAuctionLot: cdptypes.DefaultSurplusLot,
DebtAuctionThreshold: cdptypes.DefaultDebtThreshold, DebtAuctionThreshold: cdptypes.DefaultDebtThreshold,
DebtAuctionLot: cdptypes.DefaultDebtLot, DebtAuctionLot: cdptypes.DefaultDebtLot,
BeginBlockerExecutionBlockInterval: cdptypes.DefaultBeginBlockerExecutionBlockInterval,
CollateralParams: cdptypes.CollateralParams{ CollateralParams: cdptypes.CollateralParams{
{ {
Denom: "xrp", Denom: "xrp",