Commit Graph

105 Commits

Author SHA1 Message Date
Ruaridh
5b3162c563
Cosmos v0.46 upgrade follow ups (#1522)
* ensure RewardIndexes.Mul method is called in test

* remove deprecated line breaks,
add new v0.46 keys cmd

* register kava msg types on authz ModuleCdc
2023-04-06 12:59:02 +01:00
drklee3
3375484f79
Update deprecated Cosmos methods (#1530)
* Use cosmossdk.io/errors for deprecated error methods

* Update error registration with cosmossdk.io/errors

* Use cosmossdk.io/math for deprecated sdk.Int alias

* Fix modified proto file

* Update sdk.Int usage in swap hooks

* Update e2e test deprecated method usage
2023-04-05 16:21:59 -07:00
drklee3
f757d7ab15
feat: upgrade to Cosmos v0.46 (#1477)
* Update cosmos-sdk to v0.45.10-kava

* Add RegisterNodeService to app

* Update cosmos proto files

* Update cosmos proto files

* Use tagged v0.45.10-kava-v0.19-0.21 cosmos version

* update x/auth/legacy to x/auth/migrations

* Delete rest packages and registration

* Remove rest from proposal handlers

* Remove legacy types referencing removed sdk types

* Remove legacy tx broadcast handler

* Update incentive staking hooks to return error

* Remove grpc replace directive, use new grpc version

* Fix storetypes import

* Update tally_handler with updated gov types

* Delete legacy types

* Use new gov default config

* Update RegisterTendermintService params

Signed-off-by: drklee3 <derrick@dlee.dev>

* Replace sdk.StoreKey with storetypes.StoreKey

* Replace sdk.Int#ToDec with sdk.NewDecFromInt

* Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update most intances of govtypes to govv1beta1

* Unpack coin slice for Coins#Sub and Coins#SafeSub

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update committee gov codec registration

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update migrate utils period_vesting Coins#Sub

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Coin#Sub in community proposal handler

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update community, earn, kavadist proposal gov registration

* Update evm cli client EthSecp256k1Type check

* AccAddressFromHex to AccAddressFromHexUnsafe

* Add mint DefaultInflationCalculationFn to earn test

* Update use of removed staking.NewHandler

* Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode

* cmd: Update new snapshot app option

Signed-off-by: drklee3 <derrick@dlee.dev>

* cmd: Add tendermint default config, use cosmos rpc status command

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ethermint import path

github.com/tharsis/ethermint -> github.com/evmos/ethermint

* Upgrade ibc-go to v6

* Update proto dependencies

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update Tally handler test with new gov types

* Update helpers.GenTx -> helpers.GenSignedMockTx

* Update evmkeeper.NewKeeper params

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ante authz, tests

* Add feemarket transient key, pass subspaces to evm/feemarket keepers

* Update new ante decorators

* Add new addModuleInitFlags to server commands

* Pass codec to keyring.New in genaccounts

* Pass codec to client keys add

* Add SendCoins to evmutil bank_keeper

* Use github.com/cosmos/iavl@v0.19.5

* Add ante HandlerOptions

* Add unimplemented SendCoins to evmutil bank keeper

Ethermint x/evm does not use this method

* Update init-new-chain script to disable post-london blocks

* Modify test genesis states to append 1 validator

* Update tally handler test to use string values

* Prevent querying balance for empty sdk.AccAddress in auction bidding test

* Set default bond denom to ukava

* Remove overwritten bank genesis total supply in committee proposal test

Signed-off-by: drklee3 <derrick@dlee.dev>

* Use ukava for testing staked balance

* Disable minting in community proposal handler test

Previously stake denom is used, which resulted in 0 minted coins

* Update hard APYToSPY test expected value

Increased iterations in sdk.ApproxRoot, updated closer to real value

* Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards

* Allow bkava earn incentive test values to match within small margin for rounding

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update invalid denom in issuance message coin validation

Colons are now valid in denoms

Signed-off-by: drklee3 <derrick@dlee.dev>

* Remove genesis validator in incentive delegation tests

* Update pricefeed market test for invalid denom

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update incentive delegator rewards test without genesis validator

Signed-off-by: drklee3 <derrick@dlee.dev>

* Add validator to export test

* Clear bank state in minting tests

Signed-off-by: drklee3 <derrick@dlee.dev>

* Remove validator for no stake tally test

Signed-off-by: drklee3 <derrick@dlee.dev>

* Clear incentive state before InitGenesis in incentive genesis export test

* Update swagger

Signed-off-by: drklee3 <derrick@dlee.dev>

* Update ethermint version to match replaced version

* Remove legacy swagger

* Add NewEthEmitEventDecorator

* Remove redundant func for AddModuleInitFlags

* Remove unused addBankBalanceForAddress func

* Add SetIAVLLazyLoading option to app cmd

* Use legacy.RegisterAminoMsg for committee msg concrete registration

* Remove unnecessary Amino field

* Add evm_util bankkeeper SendCoins comment

* Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear

* Validate incentive params.RewardsPerSecond to be non-zero

* Validate swap pools to disallow colons in token denoms

* Register all legacy amino types on gov modulecdc

* Remove redundant Comittee interface registration

* Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7

Causes failed to load state at height errors

* Update ethermint to new pinned version with minGasPrices parse error fix

* Update cosmos fork dependcy commit to include reverted account constructor patch

* Update Cosmos v0.46.11 and cometbft v0.34.27

* Bump minimum go version to 1.19

* Update tendermint proto

* Update internal testnet genesis

* Move NewCanTransferDecorator before NewEthGasConsumeDecorator

* Add hard borrow store tests (#1514)

* add store tests for Borrow type

* refactor Deposit tests to match

* Fix old bep3 tests (#1515)

* Update Ethermint to 1b17445 to fix duplicate proto registration

* Add custom status command to use snake_case and stdout

* Add SetInflation helper

* Reduce ambiguity with evm CanSignEthTx error

* Remove init genesis validator claim in test

* Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note

* chore: use tagged versions for Cosmos and Ethermint forks

* update kvtool & increase wait for ibc transfer test

---------

Signed-off-by: drklee3 <derrick@dlee.dev>
Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-03 20:08:45 -04:00
Robert Pirtle
016eecfcc0
remove x/mint (#1416)
* use kavamint in incentive to calculate staking apy

* use kavamint minting: rewards_earn_staking_integration_test

* update incentive tests to mint only with kavamint

* remove x/mint from incentive tests

* remove x/mint from kava app

* fix minting in x/auction tests

* replace simapp fund calls with test helper

* remove mint state from genesis.json
2022-12-09 14:31:31 -08:00
Nick DeLuca
d5dcfe73b2
Refactor Buf Usage (#1399)
* start makefile refactor to smaller units; break out proto-dep updating;
add check-proto-deps target for use in CI in order to determine if
depdencies have diverged

* add proto check workflow

* download go modules before checking proto deps

* clean up -- hide output and add error message for check target

* add error message for check-rsync

* update any type, and ibc-go protos for v3.4.0

* add buf generate files for gogo, docs, and swagger

* update swagger dirs and run with latest swagger gen

* ignore new build directories

* refactor proto makefile logic -- use buf instead of scripts

* remove old protobuf scripts

* run all proto checks on push

* remove moved file

* set default value for protoc machine

* install build deps seperately

* fetch master for buf check breaking

* checkout from https url in CI for buf breaking

* fix rsync file permissions on darwin

* ignore build dirs

* fix issue with apple provided make; clean up build deps; switch to buf
format

* remove clang format file -- using buf format now

* run make proto-format (buf format changes)

* update generated files for proto format changes
2022-11-22 16:22:07 -07:00
Nick DeLuca
5110fea008
Update Protos (#1362)
* Update third party protos for tendermint, cosmos updates

* fix proto gen scripts for go 1.18

* update ibc go swagger for v3.3.0

* update generated files

* update swagger

* update grpc and protobuf deps
2022-10-24 11:06:39 -07:00
Jacob Gadikian
09ddb3e367
gofumpt - apply format changes for readability and consistency (#1248) 2022-05-09 11:37:36 -07:00
Nick DeLuca
bbb2235ba0
Add auction migration (#1220)
* add initial auction migration from Levi's work

* reserve bid_duration field name as well

* refactor auction specifc migration code to legacy v0_17 pkg

* Add auction migration specific test. Delete v016 migration files. Add makefile target for running migration tests.

Co-authored-by: galxy25 <levismschoen@gmail.com>
2022-04-22 11:36:05 -07:00
Kevin Davis
c76b5f98b7
fix: use new bid duration params for same-bidder tests (#1163) 2022-02-08 09:33:42 -08:00
Derrick Lee
e526fd1639
Split existing auction bid_duration parameter into forward_bid_duration and reverse_bid_duration (#1158)
* Split bid_duration field into forward/reverse durations

* Update params.go

* Update params_test for forward/reverse bid durations

* Remove duplicated import

* Replace bid duration on place bids

* Fix reversed bid errors

* Update auctions test

* Update bidding test

* Update testutil suite to use default forward/reverse bid durations

* Fix missing ReverseBidDuration param field

* Check if auction is reversed on forward bid

* Add test for conversion to reverse auction that reaches maxbid

* Make proto fields backwards compatible

* Use ForwardBidDuration for debt bid

* Make copy of v16 auction types

this doesn't actually work but keeping it in history

* Disable migrations

* Update debt tests to use forward bid duration
2022-02-08 09:03:47 -08:00
Ruaridh
c0f71921d9
Test repeat auction bidding (#1159)
* improve error messages

* add tests for re-bidding with small balance
2022-02-08 08:42:00 -08:00
Ruaridh
ffef832d45
Upgrade to sdk v0.44.5 and add IBC (#1106)
- Upgrade cosmos-sdk to v0.44.5 from v0.39.2
- Add Legacy Tx Endpoint for backwards compatibility
- Add IBC v1.2.3 Support

Co-authored-by: DracoLi <draco@dracoli.com>
Co-authored-by: drklee3 <derrick@dlee.dev>
Co-authored-by: denalimarsh <denalimarsh@gmail.com>
Co-authored-by: Draco Li <draco@kava.io>
Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: Denali Marsh <denali@kava.io>
2022-01-07 17:39:27 -07:00
Kevin Davis
dd3470260d
add v0.13 legacy types for kava-5 (#784) 2021-02-02 15:10:57 -07:00
Kevin Davis
37be34b4d6
fix: replace is zero time check (#787) 2021-02-02 14:42:51 -07:00
Kevin Davis
c63ecf908a
Cdp accumulators (#751)
* Add 'InterestFactor' to CDP type (#734)

* update cdp type to include interest factor

* fix build

* Add cdp accumulator methods (#735)

* remame fees to interest

* add accumulate interest method

* add basic test

* add note

* address review comments

* update tests

* Add sync cdp interest method (#737)

* remame fees to interest

* add accumulate interest method

* add basic test

* add note

* address review comments

* update tests

* remove old fee functions

* add method to synchronize cdp interest

* add multi-cdp tests

* add test with many blocks

* add test for interest getter

* address review comments

* calculate time difference then convert to seconds

* fix: update collateral index when syncing interest

* fix: differentiate between case when apy is zero and all fees are being rounded to zero

* fix: round time difference properly

* update cdp genesis state and migrations (#738)

* remame fees to interest

* add accumulate interest method

* add basic test

* add note

* address review comments

* update tests

* remove old fee functions

* add method to synchronize cdp interest

* add multi-cdp tests

* add test with many blocks

* add test for interest getter

* update cdp genesis state and migrations

* address review comments

* calculate time difference then convert to seconds

* fix: update collateral index when syncing interest

* fix: differentiate between case when apy is zero and all fees are being rounded to zero

* fix: simplify add/remove/update collateral index

* update genesis state to include total principal amounts

* update migration

* Delete kava-4-cdp-state-block-500000.json

* Add cdp liquidations by external keeper (#750)

* feat: split liquidations between external keepers and automated begin blocker

* address review comments

* USDX incentive accumulators (#752)

* feat: split liquidations between external keepers and automated begin blocker

* wip: refactor usdx minting incentives to use accumulators/hooks

* wip: refactor usdx minting claim object

* feat: use accumulators/hooks for usdx minting rewards

* fix: get tests passing

* fix: don't create claim objects unless that cdp type is eligable for rewards

* add begin blocker

* update client

* cleanup comments/tests

* update querier

* address review comments

* fix: check for division by zero

* address review comments

* run hook before interest is synced

* Remove savings rate (#764)

* remove savings rate

* remove savings rate from debt param

* update migrations

* address review comments

* Add usdx incentives calculation test (#765)

* add usdx incentive calculation test

* update reward calculation

* add allowable error to test criteria

* Update x/incentive/keeper/rewards_test.go

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>

* fix: remove old fields from test genesis state

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>

Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com>
2021-01-18 12:12:37 -07:00
Kevin Davis
d15e3a43dd
[R4R] fix: don't panic on expired auctions in init genesis (#668)
* fix: close expired auctions in init genesis

* fix: initialize variable

* remove expired auction invarient
2020-10-02 12:50:56 -04:00
Denali Marsh
e2f515ba9e
Querier improvements: CDP and Auction priority 1 queries (#644)
* query auction by lot owner

* add SavingsRateDistributed to store

* v2cdps: filtered cdps query

* update v2cdps cli examples

* add savings rate dist counter to begin blocker

* implement savings rate dist cli query

* implement cdp REST queries

* minor auction CLI/REST updates

* fix auction querier bug

* update REST endpoint to 'cdps'

* update to savings-rate-dist

* update SavingsRateDistributed get/set

* update tests

* fix savings rate dist rounding errors

* 'collateralDenom' -> 'collateralType'

* refactor 'v2cdps' -> 'cdps', add ratio param

* fix augmented CDP type, msg string() method

* fix cdp querier test

* filter query results efficiently

* querier tests

* limit type iteration if owner defined

* improve savings rate dist genesis validation

* default sdk.Dec{} to sdk.ZeroDec in queries

* update condition logic for finding intersection

* fix cdp querier filtering

* Update kava-4 swagger (#653)

* add collateral_type, update cdp params

* savings rate, auctions, get cdps

* drop owner from AuctionResponse

* remove duplicate collateral denom

* update query paths with {collateral-type}
2020-09-16 20:45:10 -04:00
Kevin Davis
15a7dc610e
[R4R] feat: Fetch auctions from historical state (#649)
* feat: query old blocks for auctions

* fix: add next auction id to querier

* fix: set boolean when found

* fix: use correct query route and params

* apply suggestions from review comments
2020-09-16 14:58:11 -04:00
Ruaridh
2ffb1edd1f
Simulation fixes (#527)
* fix go version in dockerfile

* mix frequently occuring errors

* add missed import

* fix minor validator vesting sim bug

* fix auction sim bug

* fix docker build

* add todo from sim failure

* tidy up dockerfile

* update docs, add dockerignore to speed up builds

* Update simulations/README.md

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>

* add stack traces to logs for easier debugging

* replace root func with sdk version

Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: karzak <kjydavis3@gmail.com>
2020-09-01 11:33:12 -04:00
Federico Kunze
bfb9f7e20a
cleanup begin/end block (#553)
* cleanup begin/end block

* update cdp BeginBlocker

* update dist mint

* fix tests

* typo

* add comment on CloseExpiredAuctions

* fix tests
2020-06-17 05:09:44 -04:00
Nick DeLuca
890411b685
fix exhibit 48 - error message should match if statement (#580) 2020-06-11 14:33:36 -05:00
Nick DeLuca
7ae76b8440
Auctions Clean Up - Fixes redenancy and legibility (#576)
* resolve exhibit 41 - move redundant assignment into if block and only
assign if value is false.  No need to assign true to already true value.

* fix exhibit 43 - use existing auctionID variable instead of GetID

* use improved name for auction type in case statemnt

* rename a to auction in PlaceBidSurplus for legibility (part of exhibit 44)

* rename a to auctions in PlaceForwardBidCollateral (part of exhibit 44)

* rename a to auction in PlaceReverseBigCollateral for legibility (part of exhibit 44)

* rename a to auction in PlaceBidDebt for legibility (part of exhibit 44)

* renmae rest of a to auction variables for legibility and resolve exhibit
44

* one missed rename and a typo fix
2020-06-11 14:23:58 -05:00
Nick DeLuca
2a446fe530
fix misleading logging (#572) 2020-06-10 12:10:55 -04:00
Denali Marsh
2d7f5c4080
[R4R] Better docs (#541)
* update sidebar order

* update event backticks

* fix broken links

* fix spelling
2020-06-03 14:54:31 -04:00
Denali Marsh
b2edeb8549
[R4R] Add flags to auction queries (#522)
* cli auction query flags

* update bep3 filter method name

* rest auction query flags

* add constants for auction type, phase

* fix test

* revisions
2020-05-24 19:27:11 -07:00
Federico Kunze
5069aebda7
minor fix 2020-05-15 12:49:54 -04:00
Federico Kunze
6a07def455
remove test case 2020-05-15 12:43:52 -04:00
Federico Kunze
9932169a67
sim fixes 2020-05-13 12:05:55 -04:00
Federico Kunze
907e93b7a8
fix conflicts 2020-05-13 09:38:38 -04:00
Federico Kunze
1a46b3fa2b
fix tests 2020-05-13 09:24:17 -04:00
Federico Kunze
2327b01ed4
message test 2020-05-12 16:37:08 -04:00
Federico Kunze
71742d2eef
auction tests 2020-05-12 16:32:18 -04:00
rhuairahrighairigh
bc1a6a68e0 bugfix 2020-05-12 01:06:32 +01:00
Federico Kunze
32213ed56c
x/auction: types validation 2020-05-11 18:56:28 -04:00
Ruaridh
d489bacfac
tidy payout function
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-05-11 21:07:39 +01:00
rhuairahrighairigh
5987d966ef increase auction maths safety 2020-05-11 20:45:00 +01:00
rhuairahrighairigh
8899a7ff04 replace some errors with panics 2020-05-11 14:55:32 +01:00
rhuairahrighairigh
976f8f632d remove todo - leave to caller to deal with panic 2020-05-08 16:10:59 +01:00
rhuairahrighairigh
4039086e8d tidy up events 2020-05-08 16:07:11 +01:00
Jack Zampolin
f86d0f3c3b Add changes from code review 2020-05-04 10:52:36 -07:00
Federico Kunze
511e1e07ac
fix conflicts from development 2020-04-30 17:12:22 -04:00
Kevin Davis
22bba81944
Check spendable balance in cdp sims (#480)
* fix: check spendable balance

* don't log noisy result.Log

* remove dead comment
2020-04-30 17:02:42 -04:00
Federico Kunze
fe72a24aa0
update format 2020-04-30 10:23:41 -04:00
Federico Kunze
8853e8d3d1
linters and format 2020-04-30 10:13:31 -04:00
Kevin Davis
23e23fdaaa
fix: restore auction sims operations (#465) 2020-04-23 14:51:37 -07:00
Denali Marsh
a4c5a13822
[R4R] BEP3 module spec and clean up (#450)
* bump SDK version to v0.38.2

* fix module.go and remove codespaces

* fix coins Add()

* fixes to handlers

* migrate errors

* more fixes

* fixes fixes fixes

* build

* check for paramstore keytable

* empty param validation function (TODO)

* param validations

* fix some tests

* fix all tests

* simulation fixes (WIP)

* auction and bep3 sim refactor

* fixes

* bep3 sims fixes

* auction and pricefeed fix

* cdp sims fixes

* fix tests

* Update x/auction/keeper/auctions.go

Co-Authored-By: Denali Marsh <denali@kava.io>

* Update x/bep3/types/params.go

Co-Authored-By: Denali Marsh <denali@kava.io>

* Apply suggestions from code review

Co-Authored-By: Denali Marsh <denali@kava.io>

* Update x/bep3/keeper/swap.go

Co-Authored-By: Denali Marsh <denali@kava.io>

* address comments from review

* address comments from review

* fix: run sims

* fix: implement marshal/unmarshal JSON for validator vesting account

* fix: don't call set on sealed config

* remove swap interface

* add concepts spec

* add state spec

* add messages spec

* update event names

* implement swap expired event

* add events spec

* add params spec

* add begin block spec

* add module readme

* update alias

* revisions

* aggregate expired swap ids for event emisison

* markdown-link-check-disable for circleci

* exclude api-endpoint links in Makefile

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
Co-authored-by: Kevin Davis <kjydavis3@gmail.com>
2020-04-23 13:57:25 -07:00
Federico Kunze
a573625df8
[R4R] bump SDK version to v0.38.3 (#421)
* bump SDK version to v0.38.3

Co-authored-by: Denali Marsh <denali@kava.io>
Co-authored-by: Kevin Davis <kjydavis3@gmail.com>
Co-authored-by: Kevin Davis <karzak@users.noreply.github.com>
Co-authored-by: denalimarsh <denalimarsh@gmail.com>
Co-authored-by: rhuairahrighairigh <ruaridh.odonnell@gmail.com>
2020-04-23 12:35:58 -04:00
Kevin Davis
acc96952a7
fix: non-determinism in auction sims (#432) 2020-04-14 13:49:31 -04:00
Ruaridh
5bdffd5c1c
Add Auction Simulations (#419)
* first pass

* fix bid amount calculation

* untested refactor of sim ops and genesis

* refactor operations and fix auction bug

* add param changes and genesis

* address minor TODO

* add first draft of invariants

* improve param generation

* complete invariants

* fix genesis tests

* log no-op better

* small fixes

* add missed comma

Co-authored-by: John Maheswaran <john@kava.io>
2020-04-13 17:01:54 +01:00
Federico Kunze
3f4aba1c7f
decoder tests 2020-04-04 19:42:35 -03:00